#tonymx-update-paymentmethod

1 messages · Page 1 of 1 (latest)

tribal kettle
#

Hi there! A Checkout Session would only be to collect a paymentmethod from your customer. Are you trying to update the PaymentMethod for use on their Subscription after their Subscription has already been started? Can you tell me a bit more about exactly what you are trying to do?

wet abyss
#

I'm trying to update the paiement method on a subscription that is already started.

tribal kettle
#

Got it. And you are sending your Customer through a new Checkout Session to collect a new PaymentMethod?

wet abyss
#

Yes I'm sending the customer_id and subscription_id.

#

=>

#

payment_intent_data: {
metadata: {
customer_id: findedRpaUserService.stripe_customer_id,
subscription_id: findedRpaUserService.stripe_subscription
}
}

tribal kettle
#

Okay, and do you want to use the new PaymentMethod for all Subscriptions on the customer (do any of your Customers have multiple Subscriptions) or just for the individual Subscription?

wet abyss
#

Just for the individual.

tribal kettle
wet abyss
#

Yes but I need to create a session bedore.

#

If I try with your code, the user is not redirected to the page to update the details.

#

The function "stripe.subscriptions.update" don't have a success_url and cancel_url.

tribal kettle
#

You would do the above after they have completed the Checkout Session

#

The Checkout Session is to collect the new PaymentMethod

wet abyss
#

Ok but when I try to execute "checkout.sessions.create" with mode "setup" I got the error.

#

And this is my main issue.

#

I'm not able to create a session with mode to "setup".

tribal kettle
#

You would not pass this as metadata

wet abyss
#

Ok thank you it works !!!