#dacoin
1 messages · Page 1 of 1 (latest)
Hello! Can you paste your other message in this thread please?
My flow is not the basic one.
Backend side, I create the invoice with items and return the PI that contains:
"id": "pi_3NEb6wDLjBWvJBYP1OGaDzzh",
"object": "payment_intent",
...
"payment_method_types": [
"card",
"paypal",
"sepa_debit"
],
(See the paypal entry that new I suppose)
Frontend side (CardElement & latest @stripe/react-stripe-js), I do:
// PaymentIntent?
const { error } = await stripe.confirmCardPayment(client_secret, {
payment_method: {
card: stripeElements.getElement(CardElement),
billing_details: {
name: checkoutFormValues.cardName,
},
},
...(checkoutFormValues.cardSave &&
{ setup_future_usage: 'on_session' }),
})
The confirmPayment know that I use/want the payment_method_type card and not paypal at final for pay this invoice (it has the expected_payment_method_type: 'card' right filled in the exception) so I don't understand why it throw the exception :/
Any suggestion? Thanks
Sure 🙂 done.
Hmm... give me a few minutes to look into this
https://dashboard.stripe.com/test/payments/pi_3NEb6wDLjBWvJBYP1OGaDzzh If you have the access
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Did some digging - did you enabled recurring payments for paypal in the dashboard? https://stripe.com/docs/payments/paypal/set-up-future-payments
No, I just tried to enable paypal on the test mode only earlier to see if it's fix the issue.
Yeah I believe you need to enable that setting for paypal to work with setup_future_usage
The fact that the invoice list paypal as payment type why not, even if I didn't enabled it earlier, but it's weird that if I want pay with a card, it should ignore the paypal payment type, and allow the setup_future_usage. Sound like a bug
I'd just disabled paypal integration https://dashboard.stripe.com/test/settings/payment_methods?platform_id=pmc_1KEbUXDLjBWvJBYPij3dfYLL and still has the issue.
I kind expect that the paypal payment type should not be listed in the invoice payment types when I disable it
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I can avoid the use of setup_future_usage: 'on_session' during a time.
But from my point of view, maybe create 2 issues on your side to
1 - do no list paypal as payment type in invoice if paypal integration is not enabled.
2- do not throw error about setup_future_usage if a confirmCardPayment is used with it, even if paypal integration is enabled (Because paypal is not concerned. it as its own confirmPayPalPayment from what I see)
wdyt?
Sorry been a bit busy in the channel -
no problem
1 - do no list paypal as payment type in invoice if paypal integration is not enabled.
paypal is still a valid payment method for the invoice - it's just not a valid payment method for a payment if you're ALSO using it with setup_future_usage. Is setup_future_usage something you're passing in yourself during confirmation? That would explain the mismatch
2- do not throw error about setup_future_usage if a confirmCardPayment is used with it, even if paypal integration is enabled (Because paypal is not concerned. it as its own confirmPayPalPayment from what I see)
The way to get around that today would be to set payment_method_options.card.setup_future_usage (https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-setup_future_usage) instead of the top level setup_future_usage
What that does is it ONLY does setup_future_usage for the card payment method