#Ubaidul
1 messages · Page 1 of 1 (latest)
Hi Rubeus
Hello! You can use that Payment Method for future payments as long as it's been set up for future use and it's attached to a Customer. To set it up for future use you need to use it with either a Setup Intent or a Payment Intent with setup_future_usage set.
ok thanks
do i have to attach to a customer?
can i use a guest customer on stripe?
No, to reuse it it must be attached to an actual Customer, not a guest customer.
ok got it thank you
i know how to create a customer using POST /v1/customers
is it possible to automatically create the customer when creating a Payment Intent?
No, you would need to make both API requests separately.
I recommend you take a look at this guide: https://stripe.com/docs/payments/save-during-payment
ok thank you
last question if thats ok
much appreciate the support btw
can i take the payment, then create a customer ID and attach the payment ID i've received from the payment?
so process would be:
- create payment intent
- make payment using confirmPayment(). capture payment id
- create a customer ID and attach the above payment id to the customer
- make recurring payments in future date using payment ID
Yes, you can do that. Make sure setup_future_usage is set on the Payment Intent, then after the payment is successful you can attach the Payment Method to the Customer: https://stripe.com/docs/api/payment_methods/attach
thats amazing