#abrams-webhook
1 messages · Page 1 of 1 (latest)
Hi there! Yes, if you are supporting asynch payment methods (like bank debits) then it is possible that a PaymentIntent is successful but the charge fails later on.
Other than chargebacks. Even on a chargeback, the funds appear in my account, right?
All card payments are synchronous.
So the dispute would happen later
But the inital charge would succeed when the PaymentIntent succeeds
When you say, "bank debits," do you mean debit cards?
Nope, bank debits like ACH Debit. See: https://stripe.com/docs/payments/bank-debits
Ok. Is there a way to turn off asynchronous payments? Or is there another event that I can listen to where the payment is settled, and takes into account asynchronous payments?
What integration flow are you using?
I only want to take action in my webhook when the funds are in my account. So if payment_intent.succeeded is fired but the ACH debit has not been completed, I don't want to take action.
I am doing CURL calls to create the Session object. Then I have a webhook that is currently listening to payment_intent.succeeded because I thought payment_intent.succeeded means the funds are in my account.
Ah okay so you are using Stripe Checkout
Yes. I am forwarding the customer to the Stripe website for checkout/payment via the stripe.redirectToCheckout javascript call
Gotcha, so you want to follow this guide: https://stripe.com/docs/payments/checkout/fulfill-orders
That will discuss how to handle synchronous and asynchronous payment methods
Can I just turn off asynchronous payments? I thought there was a simple event I can listen to when the funds are in my account. I didn't know that payment_intent.succeeded also fires for asynchronous payments where the funds are not in my account yet. It appears there is no such event and payment_intent.succeeded is not this event as it does not cover asynchronous payments.
If there is no such event, and I have to do a lot of coding just to cover the asynchronous payment possibilities, I would rather just turn it off
Sure, you can control which payment methods are shown by setting which payment methods are ON in your Dashboard or by passing payment_method_types on the session creation: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_types
Hi, I just went to this page you suggested. Then there is another link to https://stripe.com/docs/payments/payment-methods/overview. On the https://stripe.com/docs/payments/payment-methods/overview, it doesn't specify which payment types are synchronous and which payment types are asynchronous (ie. which payment methods where listening to payment_intent.succeeded will work because the funds are in my account).
https://stripe.com/payments/payment-methods-guide give you more details
There is a chart that shows which are "delayed"
Which means asynch
Hi. I have 2 more questions then.
-
Alipay and Wechat pay are both synchronous, right? (ie. I can listen to payment_intent.succeeded for Alipay and Wechat pay)
-
I assume Apple Pay, Google Pay, and Microsoft Pay are also synchronous? But how do I enable Apple Pay, Google Pay, and Microsoft Pay because I don't see the option to enable them at https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_types
Hello! For Alipay you can read details about timing and logistics at the top of this guide: https://stripe.com/docs/payments/alipay/accept-a-payment
Same for WeChat pay here: https://stripe.com/docs/payments/wechat-pay/accept-a-payment
For Apple Pay, Google Pay, and Microsoft Pay, those are all card transactions and work in a very similar way to regular cards.
I see. I took a look at both of these links and it seems like for both Alipay and Wechat pay, they are not supported on the Stripe checkout page, right? For both Alipay and Wechat pay, it looks like I have to redirect the customer to the Alipay or Wechat pay, rather than redirecting them to the Stripe checkout page (I would like to just redirect the customer to the Stripe checkout page at Stripe's website via the javscript call stripe.redirectToCheckout).
Both Alipay (https://stripe.com/docs/payments/alipay/accept-a-payment?platform=checkout) and WeChat (https://stripe.com/docs/payments/wechat-pay/accept-a-payment?platform=checkout) support Stripe Checkout. You redirect to Stripe Checkout and then we handle the other redirects from there.
Hi. I just tried Alipay and WeChat pay out. For Alipay, in my CURL call, I added &payment_method_types[]=alipay. For WeChat pay, in my CURL call, I added &payment_method_types[]=wechat_pay&payment_method_options[wechat_pay][client]=web.
For Alipay, I got the log error: Invalid currency options usd. The payment method alipay only supports the following currencies: cny, hkd.
For Wechatpay, I got the log error: The currency provided (usd) is invalid. Sessions with wechat_pay support the following currencies: hkd, cny.
I have set line_items[][price_data][currency]=usd
Yep, have a look here for details about which methods of payment support what currencies and other things: https://stripe.com/docs/payments/payment-methods/integration-options
Both support USD though
Actually, hang on, that table may not be detailed enough for what you're seeing, one sec...
Have a look here for Alipay supported currencies by country: https://stripe.com/docs/payments/alipay#supported-currencies
Oh, that's too bad, I guess I can't use Alipay and Wechat pay then. I always present my prices in USD. For PayPal, they will convert the price in USD to the local currency of that country
Seems like Stripe does not convert USD to the local currency. Thus, if I use Alipay or Wechat pay, I have to quote the price in CNY
Stripe does do currency conversion, but not in the way you're describing, yeah: https://stripe.com/docs/currencies/conversions
Well, I want to present the price as USD. When the customer goes to Stripe checkout, if they select Alipay or Wechat pay (instead of selecting a credit card), I want Stripe to handle any currency conversions from USD to CNY. For example, a customer in China is paying for my product. They get redirected to the Stripe checkout page where they see the options to pay by credit card, Alipay, or Wechat pay. They select Alipay. Stripe will then convert the USD price amount to CNY amount for the customer to pay on Alipay. This does not seem possible with the Stripe checkout page.
For PayPal, I can present my price as USD. On the checkout page at PayPal, the customer may see the amount in their local currency. PayPal handles this automatically. I can't seem to do the same with Alipay and Wechat pay, it seems I am forced by Stripe to present the price as CNY, which I don't want to do because my website does not keep track of the exchange rates
That's correct, what you're describing will not work on Stripe.
What country is your Stripe account in?
It's in Hong Kong. But I accept USD as my payment. I have customers from around the world, so I have to present my prices in USD
Yeah, if you want to use Alipay with Stripe you need to present in HKD.
Same for WeChat.
Anyways, on to Apple Pay, Google Pay, and Microsoft Pay. How do I enable these options on the Stripe checkout page? I don't see an option to enable these for the payment_method_types parameter at https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Perhaps pple Pay, Google Pay, and Microsoft Pay are not supported on the Stripe checkout page?
Apple Pay (pple Pay is a typo)
Apple Pay and Google Pay are supported on Stripe Checkout, and should work by default unless you've explicitly disabled them or they're not supported for the transaction you're trying to make.
I don't believe Microsoft Pay is supported by Checkout though.
Do you see Apple Pay and Google Pay as options here? https://dashboard.stripe.com/settings/payment_methods
Yup, I see them there. There are turned on
I think I know what the problem is. Apple Pay and Google Pay won't show unless I am using an IPhone or Android phone. I am on my PC now
Yep, you need to be on a supported device with a valid payment card in the wallet.
I just used my IPhone 7, and using Safari on my IPhone 7, I am using my localhost test website, and I was redirected to the Stripe checkout page in Safari. But I still don't see the Apple Pay option?
Do you have a valid card in your Apple Pay wallet on that device?
Ahh, I don't. I guess that's why Apple Pay isn't presented
I guess it's the same with Google Pay, it won't show up even if I use my Android phone, so I don't need to bother to test that with my Android phone either.
Yeah, a valid card needs to be in there for it to show up.
Ok, I have one last question then. My original question was about payment_intent.succeeded. I am currently listening to payment_intent.succeeded in my webhook. I only want to take action if the funds are in my account. You can see my conversation with @undone nimbus, that if I am only listening to payment_intent.succeeded and I only want to take action if the funds are in my account, that I cannot have any asynchronous payment options turned on. I see by default, only cards, Apple Pay, and Google Pay are turned on. I am making a CURL call to create the Session object and I am not passing payment_method_types at all when I create the Session object.
So if I am not passing payment_method_types at all, it should be using the default payments, that is cards + Apple Pay + Google Pay, which are the default payment types turned on in my account. If I am just using the default payment types, is it safe for me to listen to the payment_intent.succeeded event? That is, when my webhook receives the payment_intent.succeeded event, the funds should be in my Stripe account, right?
The payment_intent.succeeded event is triggered when the payment is successfully complete: https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded
It doesn't matter if you're using async methods of payment or not, that event will fire once you get the money.
It's just that with async methods it may take longer to fire.
Oh, I see. I guess I am confused about what @undone nimbus said then. He/she seemed to imply an asyncrhonous payment may fire it, even if the funds are not in my account.
Ok, then I should be able to listen to payment_intent.succeeded because if that even fires, it means the funds are in my account (ie. any background check has passed, any e-cheque has settled, any bank transfer has also been settled, and the funds are in my account)
"if that event fires" (sorry, another typo)
To clarify, that event means the payment succeeded, not that the resulting funds have actually settled yet. There are various delays involved for pretty much every method of payment. Card payments, for example, land in your pending balance first and take a bit of time to move to your available balance.
But pending or not, the money is in your Stripe account.
See here for more info: https://stripe.com/docs/payouts#payout-speed
I see. So there is a Sepa Direct Debit option that I can turn on. Sepa Direct Debit falls under the category of Bank Debits and according to this page here https://stripe.com/en-hk/payments/payment-methods-guide, Bank Debits is "Delayed," meaning it is asynchronous. So will payment_intent.succeeded fire even if the funds are not settled? (ie. I don't want the situation where I take action because payment_intent.succeeded fires but the funds aren't even settled yet and a few days later, the Sepa Direct Debit transaction is rejected/reversed)
For SEPA the Payment Intent won't succeed until the payment actually succeeds: https://stripe.com/docs/payments/sepa-debit/accept-a-payment?platform=web#web-confirm-success
So the payment_intent.succeeded event won't fire immediately, only after the payment succeeds.
Ok, thanks. I think that's all the questions I have for now. I don't have Sepa Direct Debit turned on anyways, I may consider it in the future. I will probably roll out with the default options turned on, that is cards + Apple Pay + Google Pay. Since cards, Apple Pay, and Google Pay are immediate payments (ie. they are synchronous payments), the funds should be in my account if I receive a payment_intent.succeeded event