#vilesa - paymentintent
1 messages · Page 1 of 1 (latest)
Hi there!
What do you mean "this will create a new payment method each time on stripe"?
How did you create all these payment methods in your screenshot?
hello
As you can see on the screenshot, after each payment stripe will automatically attach a new payment method to the customer, all representing the same Apple Pay card
Can you share two of the PaymentMethod IDs? pm_xxx
pm_1LcFhQGTsLVnzqGECNmzdd8s
pm_1LbEaNGTsLVnzqGEXF3dXUon
(https://dashboard.stripe.com/acct_1JAB41GTsLVnzqGE/customers/cus_Er1Bd3x4orm5Oe)
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Each of these payment method was created with an API call you made to Stripe:
- pm_1LcFhQGTsLVnzqGECNmzdd8s -> https://dashboard.stripe.com/logs/req_FY1rBva5yzBqQh
- pm_1LbEaNGTsLVnzqGEXF3dXUon -> https://dashboard.stripe.com/logs/req_OtMrQo8fR2OgA0
If you want to reuse the PaymentMethod, then you don't need to create a brand new Payment Method for each payment.
yes, but at the time the user selects their card in apple pay, I have no way to know if that card was already added into stripe or not, so how do I know if I need to pass the param setup_future_usage=off_session ?
The way it works in general:
- The first time you create the PaymentIntent, you set
setup_future_usage=off_session - Then the next time the customer want to pay, you directly create a PaymentIntent while setting the
payment_methodandconfirm:true
However, we don't recommend that with Apple Pay, see this doc: https://stripe.com/docs/apple-pay?platform=web#recurring-payments
For repeat purchases that aren’t related to a subscription, Stripe recommends that you create single-use tokens. Your customer must authenticate with the Apple Pay payment sheet each time—attempting to reuse payment information for a non-subscription payment can result in it being declined.
yes, so what is recommended for apple pay?
I guess the main solution is to not save the card (so not use setup_future_usage=off_session), and every time go though the Apple Pay flow. Unless it's for recurring payments and in that case you could use a subscription.
yes but if I need to charge the card offline later for some reason, then I won't be able to do it?
yes but if I need to charge the card offline later for some reason, then I won't be able to do it?
True, but like the documentation said, this is not really supported with Apple pay: "attempting to reuse payment information for a non-subscription payment can result in it being declined"
I see! thank you!
same question for bancontact:
I use setup_future_usage=off_session, because I want the "generated_sepa_debit" payment method to be attached to the customer
but a new one is attach each time, how can we prevent this?
I think I already answered this:
The way it works in general:
- The first time you create the PaymentIntent, you set setup_future_usage=off_session, and it create a new Payment Method
- The next time the customer want to pay, you directly create a PaymentIntent while setting the
payment_methodto the existing Payment Method andconfirm:true
that's not really my question
I want to allow my user to pay by bancontact, and to save the payment method (the generated_sepa_debit from the bancontact) in case I need to do some offline payments after
however if I use setup_future_usage=off_session
then I will have many duplicated sepa_debit payment methods
however if I use setup_future_usage=off_session then I will have many duplicated sepa_debit payment methods
But why? I think there is a miss-understanding. You should create a PaymentMethod only once (with setup_future_usage=off_session). And then you can keep reusing the same PaymentMethod for the following payments.
what do you mean by "You should create a PaymentMethod only once"
I am not creating the PM, I am creating the PI
then stripes creates the PM
Let me try to re-explain this:
- The first time the customer pays, you create the PaymentIntent with
setup_future_usage=off_session. You collect the payment information, and Stripe creates a Payment Method (pm_123) attached to the customer. - Next time you create a PaymentIntent, you use
payment_method:pm_123andconfirm:truein your API call. This way Stripe won't create a new Payment Method, but reuse the one you provided.
yes makes sense, but it's not really what I want
because for bancontact : the PM is "real time", although the generated sepa debit is debit, so not real time (5 days)
let me know if not clear and I can clarify
Hi there 👋 I'm jumping in as my teammate needed to step away. Please bear with me a moment while I catch up on context.
I'm seeing that you're looking to work with Bancontact, but that you have a concern over having duplicated Sepa DD payment methods, could you elaborate on that?
hi, sure:
my customers pay with Bancontact
but I need to be able to charge them sometimes offline. So for that, I need to have a PM. So when creating the PI, I put setup_future_usage=off_session so that a sepa_debit PM is generated.
But now, my customers have dozens of sepa_debit PM on stripe because a different one is generated for each payment
Okay, and what is your desired outcome?
that stripes generates a sepa_debit once for a given bancontact PM
We don't do any automatic deduplication. There are a couple approaches that you can look into though. If the Customer already has an existing Sepa PM, then you could avoid using setup_future_usage. Alternatively, you could use webhooks to listen for the creation of new Payment Methods, review the fingerprint for the PMs for the Customer, and delete any duplicates that are created.
https://stripe.com/docs/api/payment_methods/object#payment_method_object-sepa_debit-fingerprint
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
understood, thank you!
Any time!