#torkise

1 messages · Page 1 of 1 (latest)

tender cometBOT
tropic vine
#

Hi there, how can I help

pseudo oracle
#

I am currently trying to implement payment with different currencies in our store.

When selling a product I see in our code we create a paymentIntent, allowing me to pass a currency and unit price to the paymentIntent.

const paymentIntent = await stripe.paymentIntents.create({
            customer: customerId,
            metadata: {
              ...metadata,
              priceId,
            },
            amount: price.currency_options[currency].unit_amount,
            currency: currency,
            payment_method_types: ['card'],
          });
```
So this works good for me.

But when we sell subscriptions, I am not able to pass currency and unit price,  only the priceID

const subscription = await stripe.subscriptions.create({
customer: customerId,
metadata: {
...metadata,
},
items: [
{
price: priceId,
},

        ],

I read somewhere that Stripe handles different currencies automaticly in some cases. The price has NOK, EUR and Dollars as available currencies. Will stripe handle that for me?
tropic vine
pseudo oracle
#

Do I need on unique Price object for each currency? The price object already has a list of available currencies

tropic vine
pseudo oracle
#

Yeah, currencie options. What is the different between checkout and subscription creation?

tropic vine
pseudo oracle
#

So If we're not using checkout session, what would be a good sollution? Creating a uniqe price for each currency? Seems a bit over the top

tropic vine
#

Yes you can do that

pseudo oracle
#

Is it possible to not use the default currencie when creating the subscription?

tropic vine
#

But I'd highly recommend you using checkout for subscriptions

#

Sure, you can use other currencies for subscriptions

pseudo oracle
#

okay, and then it will be handled automaticly based on the customers location?

tropic vine
pseudo oracle
#

Gucci gucci

#

Question, just trying to understand our code here.
When using stripe-subscriptions.create, will the payment be done in that line of code?

tropic vine
#

No that just create a subscription

pseudo oracle
#

yeah I see it now. They are using stripe.confirmCardPayment

const confirmPayment = await stripe.confirmCardPayment(
        subscription.data.clientSecret,
        {
          payment_method: paymentMethodReq.paymentMethod.id,
        }
      );
#

This is not the same as checkout session?

tropic vine
#

No

pseudo oracle
#

So I should switch this out with a checkout-session?

#

Or won't that work?

tropic vine