#LucidLaw
1 messages · Page 1 of 1 (latest)
Hi there!
So in your flow the customer already had an existing payment method when you created the subscription?
Got it. So a few things:
- When you create the subscription, you could use
expand: ["latest_invoice.payment_intent"]to directly retrieve the PaymentIntent with no extra API call - If you are directly using
next_action.use_stripe_sdk.stripe_js, I would strongly recommend to stop because this can break. Instead you should call https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-attached on your frontend to start the 3DS flow.
No, why are you saying this?
When you create a new subscription, add expand: ["latest_invoice.payment_intent"] to the API call. In the reponse you will directly get the client_sercet of the PaymentIntent, so you can confirm it on the frontend to do the 3DS flow.
Okay wait I'm checking the docs now, sorry we're pretty new to stripe
Here's the main doc explaing how to create a subscription. Note that this doc assumes that the customer doesn't have a PaymentMethod: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
Okay wait
I can't seems to find the option of adding latest_invoice.payment_intent in creating subscription
I'm using this https://api.stripe.com/v1/subscriptions
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Have you tried? Did you get an error message? If so can you share the request ID (req_xxx)?
can you please send me the docs on this part
We are currently developing all the APIs for the mobile app by the way, so we are using APIs only
"When you create a new subscription, add expand: ["latest_invoice.payment_intent"]"
where can I find this? what will I pass?
It's in the doc I shared earlier: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription
We are not using that
we are using this API
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Exactly, that's what the link I shared with you is using:
we are using the PHP curl
I sent the APIs we've use
- We subscribe to a Plan using a 3D card, we pass "payment_behavior=allow_incomplete" (https://api.stripe.com/v1/subscriptions)
we are using the PHP curl
Are you using PHP or CURL? These are two different things.
Sorry CURL
With curl it's probably something like this: -d "expand[]"="latest_invoice.payment_intent"
why isn't what in the docs exactly?
and to clarify, now that you have the PaymentIntent, what are you going to do with it? how do you intend to handle 3D Secure? With our frontend libraries or not?
the expand parameter
Good question and exactly what I want ask too, initially I was thinking my next steps are the following. (Pleas correct me)
If i have to answer 'why', it's because all endpoints take that so it's not mentioned on each one, it's instead extensively documented at https://stripe.com/docs/expand/ and https://stripe.com/docs/api/expanding_objects and each field has a expandable label linking to those.
- I will call the Payment Intent retrieve API (https://api.stripe.com/v1/payment_intents/pi_3MI9MgLlkdPoC87s0Yiq0dZs)
- Get the next_action.use_stripe_sdk.stripe_js value (which is the URL) and then use it on an iframe
incorrect
you can not parse the field yourself
well you should be using https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements which explains how you use the client_secret of the PaymentIntent with our frontend stripe.js library to call functions like confirmPayment that process the payment and present 3D Secure if needed
Okay wait checking
where can I get the CLIENT_SECRET?
sorry confuse with this part
it's in the PaymentIntent
subscription->latest_invoice->payment_intent->client_secret
ah see it thank you
okay wait
Okay, I need to do the testing and code it myself for me to fully understand the process
will this thread will be closed?
or I can message later on?
it'll be locked in an ~hour or so but you can always ask in the main channel
got it