Reputation: 840
I am testing Google pay for android. I got few test cards in my Google account for payment. They are working fine for any successful payments. But I am not getting any way to fail that payment. I want to check failed response whether it could be insufficient fund or anything else. I am using Stripe as payment gateway. How to achieve this?
Upvotes: 4
Views: 3410
Reputation: 6250
The Google Pay API now supports test cards from your PSPs. Add configuration for your payment gateway under the tokenizationSpecification
parameter, when you use Google Pay in TEST
mode and you'll be able to complete successful and filed payment flows.
Upvotes: 0
Reputation: 7780
Google Pay (the button and the payment sheet) won't actually process the payment1 so therefore you won't generally receive insufficient funds from Google Pay. It returns a payment credential that you could use to process the payment with Stripe where Stripe may return a response indicating that there are insufficient funds.
I mention generally because Google Pay does expose an API that will allow you to check for sufficient funds by performing an authorization with your PSP. This is the onPaymentAuthorized
callback method. The primary difference between checking in this method versus after you receive a response from Google Pay is that the payment sheet is still active and you can ask the user to choose a different payment method.
1 Google Pay may perform an authorization against the card to check to see if it is active when you add it to your account.
Upvotes: 1