#sskarim - subscriptions
1 messages · Page 1 of 1 (latest)
Hi there!
i'm doing this to allow customer to choose a payment method everytime
Can you clarify what is your payment flow?
i'm migrating a working subscription integration from card element to payment element , the recommended way from stripe docs is to create an incomplete subscription to get a payment intent, than update the subscription when payment confirmed, it's working fine with new subscription, but for updating subscription i can't figure it out, the logic i want is when customer upgrade to a more expansive plan, he pay the diffrence immedialtly
if i don't use payment_behavior='default_incomplete' param in the update call i'm gettinng this error "This customer has no attached payment source or default payment method. Please consider adding a default payment method"
the logic i want is when customer upgrade to a more expansive plan, he pay the diffrence immedialtly
For this you just need to useproration_behavior = 'always_invoice'. You can learn more about upgrading subscriptions here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
"This customer has no attached payment source or default payment method. Please consider adding a default payment method"
Well when creating subscription, it's important to set a default payment method so that the next invoices will be successful.
One option is to do that automatically when creating the subscription using this https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method
if i set a defeult payment method on subscription creation , how can i test scenarios where payment fail, transition form processing to require payment method .... on subscription upgrade
also what if i want to let my costomer to change their payment method on subscription upgrade , he uses a card for the first monthely subs , but he ant to pay with bank transfert for a more yearly subscription
there's some approaches documented on https://stripe.com/docs/billing/testing
you can certainly do that
how ?
you can use the https://stripe.com/docs/billing/subscriptions/integrating-customer-portal to let customers change their payment methods, or you can redirect them to the Checkout page to set up and save a new payment method : https://stripe.com/docs/payments/checkout/subscriptions/update-payment-details or you can build your own page to collect payment details and save them and update the subscription (https://stripe.com/docs/payments/save-and-reuse) , depends exactly what options work for you.
ok thanks, i have a last question