#Matt11

1 messages · Page 1 of 1 (latest)

fossil anvilBOT
torn bluff
#

hello! how can I help?

vagrant meteor
#

This is my flow:

  • inside the checkout page I create a setup intent
  • I confirm it
  • if the customer selected a plan with trial days I proceed to homepage; otherwise the customer need to pay so I create a payment intent server-side and I confirm it.

But using this card (4000002500003155), for example, I receive two 3DS requests: one for the SI and one for the PI so for the customer is not a good thing.

what I'd like to do is create a setup_intent in case I'm in the checkout with a plan with trial days or directly create a payment_intent in case I'm with a plan without trial days.
The only problem with this choice is that I don't know in advance how much the user will pay because, in the checkout, there is the option to enter a coupon code that lowers the price.

torn bluff
vagrant meteor
#

no, we don't use subscriptions. The customer want to use setup intents and payment intents, this is why I'm doing this.

#

can you help about this please?

torn bluff
#

ah i see, then for the PaymentIntent, you should create it with off_session=true

#

since you're creating and confirming the PaymentIntent server-side

vagrant meteor
#

I'm creating it with setup_future_usage = 'off_session' because in 1 year I need to do a sort of background job that created a renew that is off_session

#

or is it superfluous since before I'm creating a setup_intent with usage: 'off_session'?

torn bluff
#

to clarify, right now you're creating a SetupIntent to create the PaymentMethod, and then a PaymentIntent with the saved PaymentMethod?

vagrant meteor
#

exactly

#

like this { amount: pay_order.final_amount.to_i, customer: user.stripe_customer_id, currency: 'eur', payment_method: payment_method.id, confirm: true, setup_future_usage: 'off_session' }

torn bluff
vagrant meteor
#

so basically since I'm confirming server-side every PI need to have off_session: true, rght?

torn bluff
#

yes, that's correct

vagrant meteor
#

I was thinking that since I'm creating the PI after the checkout the user was in-session.
But I believe that in-session is only when I do the confirmPayment directly inside my html page right?

torn bluff
#

yep, that's correct

vagrant meteor
#

cool seems to work!