#Niladri-failing-payments
1 messages · Page 1 of 1 (latest)
This is happening with any card which needs authorization
I have tried using the test card 4000 0027 6000 3184 as well
This is happening when I setup using subscriptions during checkout
And I want to send invoices later with "charge_automatically"
Can you please send an example Payment Intent?
stripe.error.CardError: Request req_xKyIQbbFuCnT6l: This payment requires additional user action before it can be completed successfully. Payment can be completed using the PaymentIntent associated with the invoice. For more details see: https://stripe.com/docs/billing/subscriptions/overview#requires-action
Thanks
Well you shouldn't really call the /pay endpoint as it can't facilitate the auth/3DS checks requested by the bank! Hence the error.
Instead you'd use confirmCardPayment from Stripe.js with the Payment Intent from the Invoice object.
There needs to be a client-side element with Stripe.js so that the auth challenge can be presented to and completed by your user
Umm, I want to do this without the user
Hence, the "charge_automatically"
When user is in checkout, that's the only time I want the user to authorize.
After that I want to send invoices and charge users without any extra hassle
To be clearer, Stripe has this charge off session method during checkout for one time payments but it does not have this feature for subscriptions
I want something like charge off session to charge users later for extra usage
To be clear, what is 'checkout' in this instance? Our Checkout product or your own custom flow?
Stripe Cehckout session
You can set payment_intent_data.setup_future_usage to have Checkout automatically attach the payment method to the Customer you pass in for future reuse.
This is from docs but it does not work in subscription mode
Right, mode: 'subscription' will automatically setup the payment method for off-session usage
However that doesn't guarantee that the bank can't/won't request 3DS/auth for future off-session payments like this
Generally that /pay endpoint just isn't optimised for these 3DS flows
So how can I optimize this?
What do you recommend to charge for invoices?
I also saw that the payment method is not set to default automatically when a user subscribes
So I have to attach it separately and set it as default
It should be set as the default_payment_method on the subscription
Anyway, the invoice you shared doesn't seem to belong to a specific subscription
This was in test mode so
I can send you some other ones
"The bank returned the decline code do_not_honor, and did not provide any other information. We recommend that your customer contact their card issuer, The Toronto-Dominion Bank, for more information, or use another payment method."
id - pm_1KP6kJKxwZpYBG1DC6nj3jI0
Can this be set automatically when I create the checkout session?
Is there a specific Payment Intent I should be looking at?
It should be done by Checkout. Please share a Subscription ID if that's not the case
Not anything in particular, just that it had failed.
cus_L74ZjEp1ViyAHh
sub_1KQqQNKJDNSNdeFgkUOKKNSp
Without this I am unable to charge for invoices and it says no active card
stripe.Customer.modify(
event["data"]["object"]["customer"],
invoice_settings={
"default_payment_method":
event["data"]["object"]["charges"]["data"][0][
"payment_method"]
}
)
After adding this line I was able to charge invoices
Yep, as stated Checkout will set default_payment_method field on the resulting Subscription object, but not the Customer object
Any suggestions regarding this?
What is this exactly? The example you shared was a one-off Invoice unrelated to any Subscription
"However that doesn't guarantee that the bank can't/won't request 3DS/auth for future off-session payments like this
Generally that /pay endpoint just isn't optimised for these 3DS flows"
As stated, /pay won't work in most cases as it can't handle 3DS/auth. So you'd need to bring your user on-session to perform the required action which will require a client-side implementation
So is it better to send an invoice to the user in such cases?
Alternatively, send the invoice (collection_behaviour: 'send_invoice') and use the hosted invoice page which will handle all this: https://stripe.com/docs/invoicing/hosted-invoice-page
Alright