#Yevhenii
1 messages · Page 1 of 1 (latest)
Can you share more details about how you want to implement this? Do you currently use Stripe Checkout or Elements to integrate with Stripe?
I'm not sure what I use for integration, but. I use stripe-go library. Example code:
stripeCustomer, err := customer.Get("cus_Ov7ZkDhAz9pxmM", &stripe.CustomerParams{
Params: stripe.Params{Context: c.Request().Context()},
Expand: []*string{stripe.String("subscriptions.data.default_payment_method")},
})
Can I get a link to update the customer subscription payment method from the code?
Sure, this is how you'd update the PaymentMethod on the Subscription: https://stripe.com/docs/api/subscriptions/update#update_subscription-default_payment_method
However, this assumes you've already collected payment details and created a PaymentMethod object
You could use the SetupIntents API to collect payment method details with Elements: https://stripe.com/docs/payments/save-and-reuse?platform=web
I recommend looking into using the Billing Portal. You can programmatically create a billing portal session and deep link to the payment method update page
Will check, thanks!
Is there another way to get or create a link to update or change the bank card details in the subscription?