#morunas
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
if the latest_invoice.payment_intent.status is requires_action then yes
Hi Tarzan ๐ ok. I was just unsure if that was the correct way to "reuse" the payment method already stored
I'm unsure though with it's past_due and not directly paid
since there is a default pm
well I'm running the subscription update with the following parameters
'items' => [
[
'id' => $currentSubscription->items->first()->id,
'price' => $choicePrice->id
]
],
'billing_cycle_anchor' => $choicePrice->recurring->interval == $currentPrice->recurring->interval
? 'unchanged'
: 'now',
'payment_behavior' => 'allow_incomplete',
'payment_settings' => [
'save_default_payment_method' => 'on_subscription'
],
'proration_date' => time(),
'proration_behavior' => 'always_invoice',
'cancel_at_period_end' => false,
'expand' => [
'latest_invoice.payment_intent'
]
]
Are these correct, considering that this is an ongoing subscription with a payment method? or is some of it redundant? like payment.settings.save_default_payment_method
@primal reef this really needs time to investigate and with how busy discord is nowadays it's pretty much impossible to do so
would you mind sending all of these details here https://support.stripe.com/contact/email?topic=api_integration
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
oh ok sorry I did not mean at all to steal your time ๐ it was only if there was something obvious
no that's not it on the opposite, I want to help you but I need you to send all of the info code etc. through that link I gave you and mention that you were speaking to tarzan on discord, so someone from my team/myself could pick this up dig through and take the time needed to help you with this tricky Q
does that sound good to you?
Sounds fine ๐ but you did answer "if the latest_invoice.payment_intent.status is requires_action then yes" which does answer my question. What I did not really get was when you said "I'm unsure though with it's past_due and not directly paid", but it is stated here https://stripe.com/docs/billing/migration/strong-customer-authentication that "If the charge requires SCA, the subscription status changes to past_due". So I guess that is correct :- )
hmmmm, that I didn't know. It's really interesting how much we still need to learn at Stripe and how we can learn from each other (staff and community). The amount of knowledge is infinite. thanks for that @primal reef
indeed the amount of knowledge is insane xD and the documentation is pretty good... but there is just so much (and sometimes multiple ways of achieving the same(ish)) that I find myself often doubting my steps :/ and then come and nag you guys here xD
as long as we can help you achieve this then we're happy to
I just realized that I was meant to send another user to https://support.stripe.com/contact/email?topic=api_integration instead of you
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
now I get the confusion ๐คฆ
sorry about that
hehehe ๐ happens!
I do have one more question though, but should I create a separate thread on dev-help? or can I ask it here?
Alright so when a customer on-session choses to upgrade their subscription (with proration), I want to show them the changes for confirmation and in case there is need for SCA, they can authenticate, as we just previously talked.
Can you confirm the correct flow than is:
- Use upcoming invoice to show proration amount
- when the client hits confirm I then call the server to execute the subscription update
- if the latest_invoice.payment_intent is require_action, then I return to client side and run confirmCardPayment with the existing payment_method
So the key differences are:
-> for first subscription payment, I need to create a subscription with default_incomplete to get a payment intent so the user can provide a payment method (since there is none) and pay, and if applicable do the SCA in one go
-> for subsequent subscription changes that required payment (protating on upgrade), I can use the UpcomingInvoice feature first (and not immediately change the subscription before showing the proration preview), because there is already a payment method, so when the customer clicks confirm then I try to execute the update, which tries to charge, and may end up requiring the extra SCA step
Does this make sense? Do I have it clear?
Hey! Taking over for my colleague. Let me catch up.
Oki ๐ I think you only need to read my last comment (I just need to know that I understood things correctly)
Does this make sense? Do I have it clear?
Yes the flow seems correct to me.
Just to double check are you following the official guide for building Subscription Integration (for First Susbcrtipion payment)?
https://stripe.com/docs/billing/subscriptions/build-subscriptions
No, because our integration has already been running for many years now (like since 2016 I think). But I needed to add SCA support as we've had issues with some payments. What I've been following is the SCA migration guide here https://stripe.com/docs/billing/migration/strong-customer-authentication
And I had to adapt our flow because what we did before was:
- use setup intent to collect card info together with billing info (including info relevant for tax rates)
- then use upcomming invoice to preview charges for either a new subscription or a change to a subscription
- then the user would confirm and we'd execute the changes
3DS worked fine with setup intent, but now - as I understand - with 3DS2 and SCA, certain payments may require (re)auth regardless, so I had to change our flow to:
- start by creating first chosen subscription with default_incomplete and use the payment intent client secret to collect card info and pay the first invoice in one go
- then for subscription changes use (as before) the upcoming invoice to preview charges
- and now when the user confirms the changes, I must attempt to effect the changes but if SCA is needed I need to return to client side to call confirmCardPayment with the existing payment_method
I don't see any particular issue with this if you want to remain with the old integration. I invite you to test it and come back if you have any follow up questions.