#glovord-customerportal-pmupdates

1 messages ยท Page 1 of 1 (latest)

nimble nacelleBOT
coral glen
maiden steeple
coral glen
maiden steeple
#

Here is an image to make it more clear what I am talking about

coral glen
#

That is clear to me

#

If you are referring to the Customer Portal, then yes you can configure all of this with the API

#

You can retrict what the customer can do in the Configuration object

maiden steeple
#

@coral glen yes, I saw this documentation. I was able to generate a payment update link. The problem is that this payment method is updated not on the subscription level, but just as a default customer payment method. Here is what I was able to setup via API:

coral glen
#

Ah, you want to update the default PM on the subscription?

maiden steeple
#

Looks like I still need to see more details and try to find a way. I hope it's possible to generate a link to no just update a default payment method for customer but to update a payment method of a specific subscription. Thank you in any case, I'll check your links!

maiden steeple
#

For example, our business case is that the customer's card for the subscription is expired and we want to send an email with a link that allows a customer to update his payment method to a newer card.

coral glen
#

In that case we do not have a way to achieve this programmatically. I can raise this as a feature request for the Customer Portal.

Also you can allow the Customer to update their default PM, listen for the customer.updated webhook event, and set the default PM on the Subscription.

maiden steeple
#

Ok, so as an alternative we can do this 2-step flow as you described - 1) update the default payment method; 2) listen to the default PM updated event (customer.updated) and call Stripe API to update the PM of Subscription with new Payment method details. Looks like we can try it, thank you!

#

Just one small optional question. Can we pass some metadata when updating the default PM of a customer? To receive it in the customer.updated webhook event

coral glen
#

Unfortunately you aren't updating the Customer object. The Portal Session is. So you don't have the option to append any metadata to the Customer unless you do it just before you create their session.

maiden steeple
#

Got it, thank you!

coral glen
#

Sure thing! Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚