Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency hardcoded as AUD in StripeService.php #1

Closed
dnrdigital opened this issue Jan 17, 2024 · 1 comment
Closed

Currency hardcoded as AUD in StripeService.php #1

dnrdigital opened this issue Jan 17, 2024 · 1 comment

Comments

@dnrdigital
Copy link

I'm in the UK. My Statamic locale is set to UK as described in your docs, and the field has GBP set as the currency. My Stripe account is also a GBP account. I get the following error from Stripe when using the fieldtype with a product:

[13:57:47] LOG.error: StatamicStripeCheckout createCheckoutSession StripeService API Error: The price specified supports currencies of aud which doesn't include the expected currency of gbp.

This appears to be because 'AUD' is hardcoded at line 152 of StripeService.php:

'price_data' => [
    'currency' => 'AUD',
    ...

If I change this to

'price_data' => [
    'currency' => $config->get('currency_code'),
    ...

it works as expected. I can submit as a PR if that's useful. BTW Thanks for this great addon - just scoping things out but will likely purchase for a client's production site as it's a huge timesaver :)

martyf added a commit that referenced this issue Jan 17, 2024
@martyf
Copy link
Contributor

martyf commented Jan 17, 2024

Totally my bad, sorry. I've fixed this up and released 1.0.1 which should address it.

Time saving is why we created it too: had the need for a few clients but just had to keep reminding ourselves of the scope: it's not an online store, but a hook in to Stripe for forms. Glad you're finding it useful!

@martyf martyf closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants