#fdc8cd4cff2c19e0d1022e78481ddf36
1 messages · Page 1 of 1 (latest)
Hi
What you can is:
- First, you accept a one-time payment and save the payment method for future usage:
https://stripe.com/docs/payments/save-during-payment - Use that Payment Method in order to create a Subscription:
https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
Whats the difference between providing the payment method and expand=["latest_invoice.payment_intent"] ?
Isnt it basically the same?
Since I would get the payment method from the latest checkout session -> payment intent -> payment method?
payment method is the method used to pay the invoice (e.g. card, bank debit...) it is passed in the request creation (POST request). While expanding an API resource https://stripe.com/docs/api/expanding_objects is used when making GET requests
expand=["latest_invoice.payment_intent"] will fetch the related payment _intent of the Subscription's invoice.
so if I create a checkout session with payment_intent_data={
"setup_future_usage": "off_session",
}
wait till the user pays... after he pays I am creating a subscription for him with a trial. If I provide expand=["latest_invoice.payment_intent"] will it get his payment method from the checkout session?
or do I have to get the payment method from the latest checkout session -> payment intent -> payment method and supply it to the subscription while creation as a default payment method?
If I provide expand=["latest_invoice.payment_intent"] will it get his payment method from the checkout session?
I think you are mixing the payment method and the payment intent. These are two different object.
or do I have to get the payment method from the latest checkout session -> payment intent -> payment method and supply it to the subscription while creation as a default payment method?
Correct.