#darth-paymentelement-savedpm
1 messages ยท Page 1 of 1 (latest)
What do you mean? Updates are handled the same way they would be if there were no dynamic payment items on the Subscription
Hello
I mean usually when having a subscription.update to change the user subscription from sub_1 to sub_2
this can be applied also when dealing with subscription witch have a dynamic price created by the user?
also regarding this process how paying with a given payment method should be handled? Let's say the customer has 3 pm's and you wanna let him choose to not pay with the default payment method how you do this?
Let's focus on one question at a time
yes, sure.
Can you rephrase your question? I'm not sure what you're asking. Subscriptions with these dynamic prices are handled like any other subscription
So
the platform we are building has a pay-what-you-want pricing model witch users subscribe with what price they choose
our issue now is if the user wants to change the subscription to a higher price or lower how can we update his subscription
the remommended process is updating a subscription item using this (https://stripe.com/docs/api/subscription_items/update) or updating the subscription itself and chanigng the items (https://stripe.com/docs/api/subscription_items/update)
It sounds like you have the right direction. Do you have more specific questions?
Sorry, I'm just not sure what you're asking as it sounds like you already know what to do
Ok, i was not sure if what I'm thinking so that's why I've thought ask first :))
It sounds like you're on the right direction. Just have to test and see what happens.
My second question is how can we allow users choose the pm they wanna when they have multiple pm added?
I don't see while looking over the the 2 links above no parameters that I can pass with the desired pm I wanna buy
am I "blind" or this is not supported?
You can make an API call to get the Customer's payment methods and then display them in your UI: https://stripe.com/docs/api/payment_methods/customer_list
ok, yes, but how can then I confirm the payment method with a certain payment method, since I might not wanna use the default_payment_method
I don't understand the question. Can you rephrase?
One customer can have multiple payment methods, right?
in the custom checkout flow if we display the payment methods how can we specify witch payment method to be charged instead of by default having the default_payment_method
What are you using to charge them? Some API endpoints accept a Payment Method ID for charging, while others (namely Subscription-based payment flows) will relyo n the default
to charge the user I'm using the stripe.confirmPayment method exposed by the @stripe/react-stripe-js package
Are you passing in a Payment Intent client secret to the confirmPayment() call? Or are you passing in an elements instance?
using in a elements instance
Are you sure? If you're passing in an Elements instance, then your customer will have entered a new Payment Method and the confirmPayment method will automatically use the Payment Method that gets created as a result of the customer's action in the Payment Element.
yes
this is how now it's implemented
but for subscription updates would be easier to just let the customer choose the pm
not to type again the card
make sense?
I'm confused. You're accepting a new payment method from your customer (because why else would you use the Payment Element?), but you want them to be able to choose a different payment method other than the one they just entered?
Oh, so you're saying the PaymentElement is intended to be only used when you're making purchases and wanna also collected maybe the payment method but cannot support like pre-adding the card details or something
correct
darth-paymentelement-savedpm
Today you use PaymentElement to collect new payment method details. And you have your own UI to show previously saved PaymentMethods
We are working on combining the two but it's in beta right now so not publicly accessible
Ok,I see
Would make sense to make this with the same component yah, I though asking since would make sense
but if it's not ready it's fine
you can ask for beta access to our support team maybe: https://support.stripe.com/contact
But today most websites have like a list of saved PaymentMethods and a "add new" button, even Amazon really
yep that makes sense
my confusion was with updating the customer subscription but also providing a payment method to be used
Unfortunately that's really vague
Ok, so what we would like to have is:
- Show a UI where we display the payment methods the customer has
- Allow choosing a payment method to be used for completing the subscription update
sorry let's pause
Please focus purely on the API and ask the exact question about the API. Not the meta question about your UI. You seem to want to do something you can't figure out but you are too abstract
Does the API support subscription updates with a specific payment method?
that's still a really vague question :p
:))
User A wants to change his subscription A to subscription B and does not wanna use his customer default_payment_method
How can I specify witch pm to be charged
yeah sorry, I'm a bit pushy because all of this would take you seconds looking at the docs
Like you have explicitly set default_payment_method on the Customer I assume? And if you look at https://stripe.com/docs/api/subscriptions/update you would see default_payment_method right there as a parameter no?
Ok, i might missed this one because I could not see this on this endpoint:
https://stripe.com/docs/api/subscription_items/update
Why are you looking at the SubscriptionItem Update API?
Updates the plan or quantity of an item on a current subscription.
this is not supposed to work in this scenario?
That API method only updates one specific SubscriptionItem on a Subscription so no you can't also change things about the Subscription itself at the same time.
Sorry you are avoiding your real question which makes it really hard to help as a lot of it is me guessing
Ok, got it
Your real question is: When updating a SubscriptionItem directly, how can I set the default PaymentMethod id that I want the Subscription to use?
Is that correct? And if it is then the answer is you can't
Yap
so the answer is to use the subscription update endpoint
it I wanna achive this
yes
No stress, just trying to push you to take a step back and ask a clear question.
Yah, I was thinking many things and I wasn't clear with exactly what I wanted
my bad
I have another quick question if possible?
sure
I saw in the docs stripe recommends to create each time when the user is in your checkout flow a client secret, am I right? And not reuse the first one ever created for that customer over and over
That's not really true no
Ok, why? And how it's recommend
sorry, really vague again, you have a real concrete question you are not askign at all ๐ฆ
If you have a Customer, they come, try to pay, give up, come back an hour later, then you should use the original PaymentIntent's client_secret
Ok, so the first PaymentIntent client_secret ever created to a customer should be save somewhere (db probably) and used for any action witch require a PaymentIntent client_secret
I mean only if this is the same person trying to order the same thing. No point using a PaymentIntent from 2 years ago. Do what seem reasonable about their own payment attempt/order overall
yaya, if it's the same customer reuse the one you first created and saved somewhere
if it's somebody else create one for him yah
But in my scenario with the pay-what-you-want pricing model I have to create a new one when the price changes, right?
๐
Are you using Billing and Subscriptions? Because you don't say so in your questions and I'm lost. If you do, then you don't control the PaymentIntent itself, it's the result of the Subcription's Invoice so you have no way to modify it. Plus incomplete Subscriptions expire after 24 hours.
So I'm really struggling to help you with those disconnected questions unfortunately
Are you using Billing and Subscriptions? -> YES
So does my explanation already answer your question?