Search code examples
javascriptpayment-gatewaypaymentadyen

Adding google pay to Adyen Web SDK


I'm trying to add Google Pay as a payment method. I'm using Adyen Web SDK.

I'm doing a CURL to get the payment session:

curl -H "Content-Type: application/json" -H "X-API-Key: my_key" -X POST -d '{ 
       "merchantAccount": "my account",
       "sdkVersion": "1.9.2",
       "channel": "Web",
       "amount": { 
          "currency": "EUR", 
          "value": 2500
       }, 
       "reference": "Your order number",
       "countryCode": "IE",
       "shopperLocale": "en_IE",
       "origin": "http://192.168.43.16:3000",
       "returnUrl": "http://localhost:8080/payment/completed/the_guid_from_UI/"
    }' https://checkout-test.adyen.com/v41/paymentSession -i

Im copying the paymentSession into the UI. But on my page I just see:

enter image description here

All the documentation says to do is:

enter image description here

I've added the pay.js library. Is that it? What else do I need to do?

EDIT I was using an older version of the Adyen Web SDK (which didnt support Google Pay). I've added the latest version now:

`<script type="text/javascript" src="https://checkoutshopper-test.adyen.com/checkoutshopper/assets/js/sdk/checkoutSDK.1.9.2.min.js"></script>`

However Im still seeing the same result...


Solution

  • Yes, that's correct. You need to load the Google Pay library before loading the Web SDK.

    <script src="https://pay.google.com/gp/p/js/pay.js"></script>
    <script type="text/javascript" src="https://checkoutshopper-test.adyen.com/checkoutshopper/assets/js/sdk/checkoutSDK.1.9.2.min.js"></script>
    

    And just to be sure, have you done the step 2 on that screenshot?

    1. Before you can start accepting live Google Pay payments, we need to configure your Google Pay merchantID. Follow Google Pay's Deploy production environment guidelines then contact Support Team and provide your merchantID from your Google Pay Developer Profile.

    Google Pay won't appear in the payment methods list if it's not properly configured in your merchant account.