#Radhika
1 messages ยท Page 1 of 1 (latest)
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.
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
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.
request_id : req_rh0yGnlAULquzb
Subscription_id : sub_1MCNVnFk2q6OMRMH19pPDNrv
yes,..it will be pending_setup_intent
but it is also null
That's because there an initial invoice generated with an immediate payment due: https://dashboard.stripe.com/test/invoices/in_1MCNVnFk2q6OMRMHM2c7npiX
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You should look for the latest_invoice.payment_intent field when you create the Subscription
There's no specific guide for Android SDK and subscriptions. You should follow this: https://stripe.com/docs/payments/accept-a-payment?platform=android&ui=payment-sheet#android-collect-payment-details
i can't understand
Instead of creating a Payment Intent directly, create the Subscription and use the returned payment_intent field on the invoice
but i am not creating paymentIntent
when i am creting subscription
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
what i have to do is ,
as suggest in above document
- 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
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
how can i prevent this
because on client_side , it need setUPIntent_client_secret
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
but, why they suggest to use this flow for recurring payment than ?
https://stripe.com/docs/payments/save-and-reuse?platform=android&ui=payment-sheet
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 ?
Who is they?
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 ?
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
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 ?
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.
oky,...my end goal is
use set-up-intent and collect details from client side
- 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 :
- i am creating set-up-intent
- creating subscription with incomplete status
sending set-up-intent client-secret to client
- after that try to active subscription with payment_method
So to summarise, you only want to create a subscription if the customer has a payment method attached?
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
do you have an example customer I can take a look at?
Also request IDs would help too
https://support.stripe.com/questions/finding-the-id-for-an-api-request
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.
can you share the SetupIntent ID as well?
It looks like the customer does have an attached payment method
seti_1MBwTJFk2q6OMRMHpWTKTCGj
Its just not set as default
but when,..i try to retrieve from customer for subscription
i can't get
Once the SetupIntent is successful, you likely want to set the generated payment method as invoice_settings.default_payment_method by calling the Update customer API
https://stripe.com/docs/api/customers/update?lang=node#update_customer-invoice_settings-default_payment_method
That's the payment method that a Subscription will attempt to charge
but when,..i try to retrieve from customer for subscription
How exactly are you retrieving the customer?
In order to see the attached PaymentMethod you'd want to use this endpoint
https://stripe.com/docs/api/payment_methods/customer_list?lang=node
oky,..so when customer will have default_payment_method
subscription will be charged automatically
ur we have to do anything else ?
i am retire customer using
https://stripe.com/docs/api/customers/retrieve?lang=node
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
subscription will be charged automatically
ur we have to do anything else ?
Yes, as long as the payment method is setup correctly.
i am retire customer using
https://stripe.com/docs/api/customers/retrieve?lang=node
I would recommend using the other endpoint I suggested above
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oky,.
thank you so much for ur help
i will try this
NP! ๐ Good luck