#bhanu365-save-pm

1 messages · Page 1 of 1 (latest)

shut nexus
#

hello, how far are you integrated?

hidden moth
#

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?

shut nexus
#

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

hidden moth
#

"to render the card entry UI, yes you need this"

There are some confusion.

  1. Which payment API Method do I need to call after payment element form submit?
  2. Is there do I need to call any stripe function? Like stripe.confirmPayment.
  3. How can I get the PaymentMethod.
midnight jay
#

@hidden moth which doc are you currently following exactly?

hidden moth
#

No one because I don’t understand what should I do the next step

midnight jay
#

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?

hidden moth
#

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

midnight jay
#

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

hidden moth
#

Yes I’ve checked but I want to integrate on our website

midnight jay
#

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

hidden moth
#

Got it thanks

midnight jay
#

Do you already have a SetupIntent integration with PaymentElement?

#

If not that's where I would start

hidden moth
#

@midnight jay no worry I will get it done by myself

midnight jay
#

Sounds good, ping here if you're confused by the doc I shared