#bhanu365-save-pm
1 messages · Page 1 of 1 (latest)
This is upgradation form when customer want to upgrade their subscription. I just want to open a popup on click on the change card button then display a form where customers can enter their card details and will click on the update card detail button then they can upgrade.
I am confuse in the next step what I need to do
Do I need to render payment element using setupIndent client secret for this?
Do I need to render payment element using setupIndent client secret for this?
to render the card entry UI, yes you need this^
as for what to do after, once the above is done and a SetupIntent is created and confirmed, you get back a PaymentMethod
You use that PaymentMethod and update it as the Subscription's default_payment_method
and that PaymentMethod will be charged going forward
also just flagging, the Customer Portal does give you this functionality out of the box
"to render the card entry UI, yes you need this"
There are some confusion.
- Which payment API Method do I need to call after payment element form submit?
- Is there do I need to call any stripe function? Like stripe.confirmPayment.
- How can I get the PaymentMethod.
@hidden moth which doc are you currently following exactly?
No one because I don’t understand what should I do the next step
Okay that's likely part of all the confusion really
So what is your goal exactly? Just letting a customer update their card details for a given Subscription and nothing else?
Yes because if a customer know their card has expired or lost etc so they can update their new card details for future payments so when the subscription will renew, the payment will get done easily without any failure
Okay so let's take a step back for a sec: Have you considered using the Customer Portal? This does this for you end to end and you never even have to do anything
Yes I’ve checked but I want to integrate on our website
I would highly and strongly recommend you don't and just let us do this. It will be 10 lines of code and you are done
But otherwise you want to read https://stripe.com/docs/payments/save-and-reuse which has every step you need to make this work and collect the PaymentMethod.
And once that works you change the default_payment_method which is what my colleague already advised you
Got it thanks
Do you already have a SetupIntent integration with PaymentElement?
If not that's where I would start
@midnight jay no worry I will get it done by myself
Sounds good, ping here if you're confused by the doc I shared