#Radhika

1 messages ยท Page 1 of 1 (latest)

hollow riverBOT
gritty saddle
#

Is there a requirement from your integration to create a Setup Intent and a Subscription? Generally the Subscription is sufficient as it'll handle the same flow as the Setup Intent.

glass star
#

actually , i try to create subscription with customer_id first
but i can't find set_up_intent_id from subscription which i can provide to client side

gritty saddle
#

Can you share the sub_xxx ID?

#

Assuming there's no immediate payment, there'd be a pending_setup_intent field. Otherwise if there is a payment due, you'd want latest_invoice.payment_intent.

glass star
#

request_id : req_rh0yGnlAULquzb
Subscription_id : sub_1MCNVnFk2q6OMRMH19pPDNrv

glass star
gritty saddle
#

You should look for the latest_invoice.payment_intent field when you create the Subscription

glass star
#

i can't understand

gritty saddle
#

Instead of creating a Payment Intent directly, create the Subscription and use the returned payment_intent field on the invoice

glass star
#

but i am not creating paymentIntent
when i am creting subscription

gritty saddle
#

Exactly, as stated. You need to substitute the Payment Intent creation for a Subscription creation. Unfortunately we don't have any documentation specifically for Android subscriptions

glass star
#

what i have to do is ,

as suggest in above document

  1. send setUpIntent_client_secret to client side and some other value like
    EphemeralKey
    so,..they can open stripeUI and enter card_details and from server side i can complete a subscription with paymentMethodId
gritty saddle
#

Yes, except your subscription won't generate a Setup Intent idea (as there's a payment due immediately)

#

So instead of looking for pending_setup_intent returned on the subscription object, you'd want the latest_invoice.payment_intent field

glass star
#

how can i prevent this
because on client_side , it need setUPIntent_client_secret

gritty saddle
#

You can't. If the subscription parameters dictate that the initial invoice requires payment then a Payment Intent will be generated. You'd adjust your client/Android code to handle a Payment Intent client_secret instead

glass star
#

it should be some way

#

as per this when i can create subscription ?

#

when i receive payment_method_id from webhook
that time crete a subscription ?

glass star
#

sometime ago , i asked from stripe
regrading some documentation for subscription in stripe

#

in which scenario pending_setup_intent will be not null
in subscription ?

mint flower
#

Hello ๐Ÿ‘‹

#

Taking over as ynnoj needs to step away soon

#

If you have a trial period in your subscription then the first invoice of the subscription will be of 0 amount. In which case, pending_setup_intent will have an actual SetupIntent that you can use to save the payment method which then will be charged for subsequent invoices

glass star
#

but, i can do something like

when setupIntent is confirm from client side
i can receive info in webhook (which webhook i have to use?)

and after that create subscription, with payment-method directly and charge invoice ?

mint flower
#

Let's take a step back
What is your end goal here? We usually recommend relying on SetupIntent created by the subscription so that your end-user don't have to go through 3DS auth flow multiple times.

#

You can choose to handle it the way you suggested above but you would needs to also build a flow to bring your users back on-session in case 3DS auth is requested.

glass star
#

oky,...my end goal is
use set-up-intent and collect details from client side

  1. for now,..i am creating subscription with incomplete status,
    so,..i can active subscription when i got card_details from client side.

but,..i can't active subscription after getting payment_method because invoice is generated , and we have to use payment_intent instead of set_up_intent

#

i am doing below step :

  1. i am creating set-up-intent
  2. creating subscription with incomplete status

sending set-up-intent client-secret to client

  1. after that try to active subscription with payment_method
mint flower
#

So to summarise, you only want to create a subscription if the customer has a payment method attached?

glass star
#

yes,..
but in that also i am facing problem
i am createing a setupIntent with customerId
and after confirm, i try to get payment_method_id from customer but i can't get

mint flower
glass star
#

req_Zn3C61hWooWyrI

#

sorry check this

req_43ACuzSwToc5FU

mint flower
#

can you share the SetupIntent ID as well?

#

It looks like the customer does have an attached payment method

glass star
#

seti_1MBwTJFk2q6OMRMHpWTKTCGj

mint flower
#

Its just not set as default

glass star
#

but when,..i try to retrieve from customer for subscription
i can't get

mint flower
glass star
#

oky,..so when customer will have default_payment_method

subscription will be charged automatically
ur we have to do anything else ?

mint flower
glass star
#

oky,.
thank you so much for ur help
i will try this

mint flower
#

NP! ๐Ÿ™‚ Good luck