#Niladri-failing-payments

1 messages · Page 1 of 1 (latest)

sudden bone
#

Hey! Can you share the ID of a failed Payment Intent?

lapis sphinx
#

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"

sudden bone
#

Can you please send an example Payment Intent?

lapis sphinx
sudden bone
#

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.

lapis sphinx
#

Any way to do this using Python?

#

Our API is completely on Python

sudden bone
#

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

lapis sphinx
#

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

sudden bone
#

To be clear, what is 'checkout' in this instance? Our Checkout product or your own custom flow?

lapis sphinx
#

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

sudden bone
#

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

lapis sphinx
#

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

sudden bone
#

Anyway, the invoice you shared doesn't seem to belong to a specific subscription

lapis sphinx
#

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

lapis sphinx
sudden bone
sudden bone
lapis sphinx
#

Not anything in particular, just that it had failed.

lapis sphinx
#

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

sudden bone
#

Yep, as stated Checkout will set default_payment_method field on the resulting Subscription object, but not the Customer object

lapis sphinx
sudden bone
#

What is this exactly? The example you shared was a one-off Invoice unrelated to any Subscription

lapis sphinx
#

"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"

sudden bone
#

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

lapis sphinx
#

So is it better to send an invoice to the user in such cases?

sudden bone
lapis sphinx
#

Alright