laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.39k stars 679 forks source link

We have our payment plans in INR (instead of USD). The same currency is configured in Stripe, and the transaction works well. However, when we download and open the invoice, we see "?" symbol instead of '₹' (INR symbol). #973

Closed satishsharma-riseandinspire closed 4 years ago

satishsharma-riseandinspire commented 4 years ago

Description:

We have our payment plans in INR (instead of USD). The same currency is configured in Stripe, and the transaction works well. However, when we download and open the invoice, we see "?" symbol instead of '₹' (INR symbol). We have the following config in our env CASHIER_CURRENCY=inr CASHIER_CURRENCY_LOCALE=en CASHIER_MODEL=App\User We have also changed the default currency by calling the Cashier::useCurrency method from within the boot method of the service providers as - Cashier::useCurrency('inr', '₹'); However we received an error - 'Call to undefined method'.

Steps To Reproduce:

We have the following config in our env CASHIER_CURRENCY=inr CASHIER_CURRENCY_LOCALE=en

driesvints commented 4 years ago

Please share the entire stacktrace.

satishsharma-riseandinspire commented 4 years ago

Currently i am using laravel spark 10. We have the following config in our env CASHIER_CURRENCY=inr CASHIER_CURRENCY_LOCALE=en

but when we download and open the invoice, we see "?" symbol instead of '₹' (INR symbol). Same happen in invoice email.

driesvints commented 4 years ago

You're sharing 'Call to undefined method'.. Please share the stacktrace of the error.

satishsharma-riseandinspire commented 4 years ago

Just trying to follow below step : -

The default Cashier currency is United States Dollars (USD). You can change the default currency by calling the Cashier::useCurrency method from within the boot method of one of your service providers. The useCurrency method accepts two string parameters: the currency and the currency's symbol: use Laravel\Cashier\Cashier; Cashier::useCurrency('inr', '₹');

driesvints commented 4 years ago

I just saw you're using an older version. Cashier doesn't has a useCurrency anymore since v10. Please upgrade to the latest version and report the correct Cashier version that you're using next time please.

satishsharma-riseandinspire commented 4 years ago

No, i am using cashier latest version ^11.0

{ "name": "laravel/spark-aurelius", "description": "Laravel Spark provides scaffolding for Laravel SaaS applications.", "keywords": ["laravel", "stripe", "billing", "scaffolding", "saas"], "license": "MIT", "authors": [ { "name": "Taylor Otwell", "email": "taylor@laravel.com" } ], "require": { "php": "^7.2", "ext-json": "", "ext-zip": "", "erusev/parsedown": "~1.0", "firebase/php-jwt": "~4.0|~5.0", "guzzlehttp/guzzle": "~6.0", "ramsey/uuid": "^3.1", "intervention/image": "^2.3", "laravel/cashier": "^11.0" }, "require-dev": { "mockery/mockery": "^1.0", "phpunit/phpunit": "^7.0", "mpociot/vat-calculator": "^1.6" }, "autoload": { "psr-4": { "Laravel\Spark\": "src/" } }, "extra": { "branch-alias": { "dev-master": "9.0-dev" } }, "minimum-stability": "dev" }

driesvints commented 4 years ago

There is no useCurrency method in Cashier v11

driesvints commented 4 years ago

I'm suspecting you missed this part in the upgrade guide: https://github.com/laravel/cashier-stripe/blob/12.x/UPGRADE.md#invoices

The useCurrency method has been replaced by a configuration option in the new Cashier configuration file and the usesCurrency method has been removed.

satishsharma-riseandinspire commented 4 years ago

My main issue is Rupee symbol is not showing in invoice pdf. and i am trying below method but its not working.

Currently i am using laravel spark 10. We have the following config in our env CASHIER_CURRENCY=inr CASHIER_CURRENCY_LOCALE=en

but when we download and open the invoice, we see "?" symbol instead of '₹' (INR symbol). Same happen in invoice email.

driesvints commented 4 years ago
Screenshot 2020-07-17 at 18 29 53

I get it just find. This sounds like an encoding problem of your output. Please try a support channel:

satishsharma-riseandinspire commented 4 years ago

I totally agree with you but still my question is same. when we download and open the invoice, we see "?" symbol instead of '₹' (INR symbol). Same happen in invoice email. In Application it shows '₹' symbol but in pdf it shows ?. please find below in-pdf in-application

attachment.

driesvints commented 4 years ago

I've already said that this is probably an encoding issue. Please try a support channel from above.