#mhanzla80 - subscriptions

1 messages · Page 1 of 1 (latest)

worldly sapphire
#

Hi!
happy to help

fair folio
#

thanks for helping me

#

can you tell me if i am doing something wrong

worldly sapphire
#

Could you please share the customer id?

fair folio
#

sure

#

cus_M8Sx0uIlv6FV6K

worldly sapphire
#

Thanks for sharing it

fair folio
#

i do not have the payment method id. I am initializing the payment sheet which automatically generator the payment method on stripe and process the payment.
How do i get the payment method Id ?

#

invoice_settings.default_payment_method needs the payment method Id but i do not have it.
How can i get it ?

worldly sapphire
fair folio
#

how do we know that user select and user which payment method in the payment sheet ?

worldly sapphire
#

Do you have a screenshot on your paymentsheet please?

fair folio
#

yes

#

this is my payment sheet

mortal pine
#

ok makes sense

#

so no, you don't need to set a default_payment_mehtod

#

instead you should create the subscription and pass payment_behavior:default_incomplete like we mention in the docs

fair folio
#

yeah great fixed

#

thanks for you kindness and help

mortal pine
#

cool cool

#

but the idea is you create the subscription in the 'incomplete' status, then you pass the PaymentIntent from that Subscription to the frontend app; the app confirms the PaymentIntent using the PaymentSheet, and that saves the card the customer used and sets it as a default.

fair folio
#

okay so you mean we have to call the subscription api before open payment sheet ?

craggy skiff
#

Hi! I'm taking over this thread.

fair folio
#

k;

craggy skiff
#

Yes, you first create the subscription on the backend, and then use the subscription.latest_invoice.payment_intent for the PaymentSheet.

fair folio
#

where do i have to pass these parameters ?

craggy skiff
fair folio
#

subscription.latest_invoice.payment_intent
these parameters.
where do i have to pass them ?

craggy skiff
fair folio
#

yaa i got it now

#

let me implement it

bronze smelt
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

fair folio
#

i have implemented the flow that you have told me but it processing the incomplete subscription payment
how can i solve this ?

bronze smelt
#

what webhook events are you listening to?

fair folio
#

there is no any webhook

#

i am using it on phone

#

i am creating a subscription with incomplete payment and then passing the payment intent secret to the payment sheet but still payment status for subscription is incompete

mortal pine
#

what's the subscription ID sub_xxx?

fair folio
#

sub_1LQWpCR1SG2Iic1Y7o96LArd

mortal pine
#

doesn't look like you confirmed the PaymentIntent.

#

and then passing the payment intent secret to the payment sheet
yep, and then you should be entering a card in the payment sheet and submitting the payment. Are you not doing that?

fair folio
#

yes i am retrieving customer's saved card and select and pay for it

#

here you can see this

mortal pine
#

and what happens when you hit the Pay button in that UI?

fair folio
#

success

mortal pine
#

you're confirming the wrong PaymentIntent

#

if you check what you're doing, you create a PaymentIntent(which you don't need to do), and you create a Subscription. Then on the frontend you are confirming that PaymentIntent you created, instead of the latest_invoice.payment_intent, which is what you should be doing instead.

fair folio
#

you mean i do not have to create the payment intent

#

on subscription object i receive a payment intent secret id which i have to pass to the payment sheet
right ?

mortal pine
#

that's what we've been saying and the docs describe

mortal pine
fair folio
#

k; let me test

#

yes its fixed my issue

#

grateful to you
thanks for helping me

#

❤️