#ahjaydog-async-payment-failed

1 messages ยท Page 1 of 1 (latest)

ashen badge
#

Hello ๐Ÿ‘‹
Let me check

dense cargo
#

Hi again. Sure.

ashen badge
#

As far as I can tell, the PaymentIntent associated with the checkout session should have an error code

#

If not, you can check the charge itself as well

dense cargo
#

hmm so would i have to expand on checkout.session to get the payment intent?

ashen badge
#

yup

dense cargo
#

ok. I had a few other questions. If I get a failure, I think I will just cancel the unpaid subscription if one exists. How would I do that?

ashen badge
#

There isn't a built in way to cancel the subscription if the payment fails. I believe you'd need to call the API to do that separately

dense cargo
#

hmm ok.

#

And which email is the right one to use for print(checkout.session)? I see like 3 different customer emails in the JSON. And one of them is null

#

checkout_session.customer.email ?

dense cargo
#

I highlighted the 3

ashen badge
#

so it depends on your integration really.

if you already have a customer object, that's the one you'd want to use.
If you don't have an existing customer, you would want to use customer_details.email as that's the one that is the most recent valid email provided by the customer on the Checkout form

dense cargo
#

i already have it since i grey out the checkout email text box. However, on my donation form I leave the email text box enabled. So I guess I will use the customer details one then

#

I just worry that it will be null so I'll take your word for it

#

I don't remember how i disabled the email textbox in cheeckout? Was it from the dashboard?

#

If I decide not to cancel after an async failure, how do I allow my customer to pay from the customer portal the unpaid invoice and give them the subscription and change my database membership to activated?

#

By the way, the other day it was a bad idea to try to automatically redirect from the success page to the verification pin page. The pin page creation is delayed so it wouldn't have worked.

#

Or rather for the async failure I would need to cancel the subscription plus void the invoice

ashen badge
#

I don't remember how i disabled the email textbox in cheeckout? Was it from the dashboard?
I don't think you can disable email textbox unless you provide an existing customer while creating the checkout session

dense cargo
#

oh makes sense that is why then

ashen badge
#

If I decide not to cancel after an async failure, how do I allow my customer to pay from the customer portal the unpaid invoice and give them the subscription and change my database membership to activated?
Your integration would control that flow to be honest. You can bring them back to a page that collects their information again

#

By the way, the other day it was a bad idea to try to automatically redirect from the success page to the verification pin page. The pin page creation is delayed so it wouldn't have worked.
Yup. I remember flagging it to you as well that the micro-deposits may take 1-2 days to show up

dense cargo
#

Yea I realized later after you told me lol

#

hmm I probably want to cancel the sub and void the invoice on the failure. So I would need to expand the payment intent on the async_failure, then find the subscription id, delete it, and find the invoice from the payment intent, void it?

ashen badge
#

Yeah seems reasonable flow

#

would recommend testing it out though

dense cargo
#

Yea or does the dashboard billing settings page handle that for me? I forget.

ashen badge
#

It can, yes.

dense cargo
#

ok I will code it and test it both ways

#

thanks i will try it out. I will come back if I need more help figuring out how to get these IDs lol

ashen badge
#

NP! ๐Ÿ™‚ Good luck

dense cargo
#

Hmm well I have the 1 webhook to handle both 1 time donations / subscription donations and my other subscription only main product. How would I expand the checkout session to tell I have a one time payment versus a recurring payment?

ashen badge