#nick_51639
1 messages · Page 1 of 1 (latest)
hello! you'll need to use Subscription Schedules to achieve what you want
Thanks @remote grove, can I also confirm for the credit card and bank forms we're using the elements api where mode = payment.
Do we still need to create the payment method and attach it to the customer we created or is this already part of the elements api that when submission it will automatically create a payment method?
The issue is we find the payment method which is created by the component holds no link back to the Customer and therefor can't be found.
you would want to use setup_future_usage to automatically save the PaymentMethod to the Customer upon successful payment
Subsequently, you would need to set the default_payment_method for either the Subscription Schedule [0] or invoice_settings.default_payment_method [1] on the customer
[0] https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-default_settings-default_payment_method
[1] https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-setupFutureUsage
https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.