#jack11sparrow
1 messages ยท Page 1 of 1 (latest)
Hi ๐ if this is for a new integration that hasn't gone live yet, then I would recommend taking a look at the payment_settings.save_default_payment_method option:
https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method
It causes the default payment method on the Subscription to be set to the payment method used when a payment succeeds.
If you're trying to build a process to make this change to existing Subscriptions that are already in progress, then that will take a bit more effort but we can talk through that.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
we are not live yet, still developing
but we do need this functionality soon
right now we are using sdks and webhooks in Backend
would it be possible with this?
Gotcha, in that case I would use the parameter I referenced above when creating your Subscriptions. Setting it to on_subscription, that will cause the default_payment_method field on the Subscription to automatically be set to the Payment Method being used when the subscription's initial payment succeeds.
@wispy river
this you are telling for sdk?
@granite karma can you share the filed i need to use here
https://pkg.go.dev/github.com/stripe/stripe-go/v74@v74.30.0#SubscriptionParams
PaymentSettings
then
SaveDefaultPaymentMethod
You can also see it being used in a code snippet in the second block of sample code in this section:
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription