#cabeedelhertz
1 messages · Page 1 of 1 (latest)
Hello
Let's clarify on something first
If the payment method has already been set up for future usage, and I update the subscription with PaymentBehavior "default_incomplete", then the paymentIntent requires confirmation but attempting to confirm the payment fails because the payment method is already set up (already has mandate data).
This shouldn't be the behavior as far as I know if you pass the PaymentMethod ID to confirmPayment
Is that what you are doing?
We have not been passing that. Is that argument in a recent release because I don't see it in the libary code for my client?
It was added a bit ago, don't recall exactly when. You can see it supported in our JS reference: https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method
Yes I see it in the documentation, but that doesn't seem to exist in the stripe.js code https://github.com/stripe/stripe-js/blob/9331f746b66b0449fc26bb71be42a2074c73d016/types/stripe-js/stripe.d.ts#L79
They seem to have the payment_method ID param on the specific confirm functions like stripe.confirmUsBankPayment() but the general stripe.confirmPayment() does not
Hmm it is possible that it wasn't properly added to our types
Try disabling the type check and see if it works
I can flag that we missed it in our types
okay I'll test that out thanks. Regardless of that, do you know if there is a "correct" way to check if a payment method has been set up for future usage on the server side?
I can check if the paymentMethod was used on a past paymentIntent. But, as an example, if the paymentMethod was set up for future usage using stripe.confirmSetup(), that will update the subscription with the pending_setup_intent, and then once set up, stripe will remove the pending_setup_intent from the subscription object.
So if that data is not persisted on the subscription object, how can I check if the payment was set up?
You should be able to check on the payment method object here: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-generated_from-setup_attempt
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That looks like it only works for Cards. It looks like the other payment method types dont have that. And I specifically need to know it for CashApp
You could use this endpoint https://stripe.com/docs/api/setup_intents/list#list_setup_intents-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Also to Bismarck's earlier point:
"This shouldn't be the behavior as far as I know if you pass the PaymentMethod ID to confirmPayment
Is that what you are doing?"
I don't see why that would fix the issue I'm seeing. The paymentIntent would already have a paymentMethod (ID) attached to it, so calling confirmPayment() passing in that same payment method ID wouldn't change the behavior would it?
And I would think there would be some direct relationship/attribute for a payment method regarding if and how it is set up for future usage. The stripe dashboard seems to suggest this because it shows how each payment method is set up for future use
You can check the api spec. I don't think there is one
The endpoint I listed above would be the best way
Yeah the setupintent.List seems like it should work well