Search code examples
javascriptangularreactjsgoogle-pay

Unable to add test card in Google Pay TEST environment and order total


  1. In GooglePay, how to display the order total in googlepay payment sheet?(Is it possible to do?) Could not find any documentation for that.
  2. Im using TEST environment but still unable to add any test card which is mentioned in the below URL and also it is redirecting to https://pay.google.com instead of https://pay.sandbox.google.com (Is this expected behaviour?) new google.payments.api.PaymentsClient({ environment: ‘TEST’ })

Test Cards: https://docs.adyen.com/developers/test-cards/test-card-numbers


Solution

  • UPDATE: Google Pay now supports dynamically showing the total price on the payments sheet. This price can also be updated as the user changes their selection at checkout (eg.: shipping option). You can configure these pricing updates as shown in the docs.

    You can also check out the official announcement for more details.
    Hope it helps.


    1. That's right, it is not possible to add the total price to the payments sheet.
    2. The way the test environment works for Google Pay is slightly different to the sandboxes some payment providers offer. When you use Google Pay in the TEST environment, the APIs are, by default, still expecting valid card numbers. As such, if you use invalid information, the checks will still fail. Said so, your card is never charged nor the token that the systems responds with allows to perform any transaction.