Google Developer Documentation


Google Pay™

Learn how to accept Google Pay™ payments.

With Google Pay, shoppers can make purchases using credit or debit cards stored in their Google account. Shoppers get to experience a simpler checkout process whether they are buying from their Android devices, on the web, or in-store through POS terminals.

When a shopper pays with Google Pay™ in apps and on websites, Google Pay™ shows a payment sheet where they select their preferred card payment method and confirm their purchase.

Google Pay™ supports liability shift for Discover, Mastercard, and Visa cards issued in the EU or the UK. Google Pay™ does not support liability shift for American Express, JCB, or Visa cards issued outside of the EU or the UK. To get this liability shift when using Google Pay, you need to authenticate the transaction with 3D Secure.

Payment type Payment flow Countries Currencies Recurring Refunds Partial refunds Separate captures Partial captures Chargebacks
Wallet Direct International Multiple -white_check_mark- -white_check_mark- -white_check_mark- -white_check_mark- -white_check_mark- -white_check_mark-

Compatibility

For more information on Google Pay™ availability, refer to:

Supported networks

Our integration supports the following card networks:

  • American Express: Supported globally.
  • Mastercard: Supported globally.
  • Visa: Supported globally.

Google Pay™ Drop-in integration

Add Google Pay™ to an existing Drop-in integration.

On this page, you can find additional configuration for adding Google Pay™ to your Drop-in integration.

When shoppers select Google Pay, Drop-in presents the Google Pay™ payment sheet where shoppers choose a card they want to use. If shoppers select a card that requires 3D Secure authentication, Drop-in also handles redirecting shoppers to another website to complete the verification.

Before you begin

Before starting your Google Pay™ integration:

  1. Contact our Support Team to add Google Pay in your test Customer Area.

To accept live Google Pay™ payments, you must complete all of the steps in Before you go live.

API reference

You don't need to send additional fields for Google Pay. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:

Drop-in configuration

Load the Google Pay™ API JavaScript library

We recommend that you preload the the Google Pay™ API JavaScript library, by including the
following script in your checkout page:

                                    <script src="https://pay.google.com/gp/p/js/pay.js"></script>
                                    
                                

Required configuration

Select which endpoint you're integrating:

There's no additional configuration you need to include for Google Pay.

If you implemented an advanced use case

Parameter name Required Description
amount.value The value of the payment, in minor units.
amount.currency The currency code of the payment.
countryCode The two-letter country code of your merchant account.
environment Set to PRODUCTION when you're ready to accept live payments. The default value is TEST.

The following example shows how to configure Drop-in:

Optional Drop-in instance configuration
  1. const googlePayConfiguration = {
  2. amount: {
  3. value: 1000,
  4. currency: "EUR"
  5. },
  6. countryCode: "NL",
  7. //Set this to PRODUCTION when you're ready to accept live payments
  8. environment: "TEST"
  9. };

Include the googlePayConfiguration object when creating a configuration object:

NoqoodyCheckout configuration
  1. const configuration = {
  2. // ... other required configuration
  3. paymentMethodsConfiguration: {
  4. googlepay: googlePayConfiguration
  5. }
  6. },

Optional configuration

This optional configuration parameter is only accepted on the dropin instance.

Instant payment button configuration

Use the instantPaymentTypes object to display the Google Pay payment button at the top of the list of available payment methods. The sample below shows how to do this:

Optional Drop-in instance configuration
  1. const dropin = checkout.create('dropin', {
  2. //... other optional configuration
  3. instantPaymentTypes: ['googlepay']
  4. }).mount('#dropin-container');

Merchant info

Configure the merchant name rendered in the payment sheet. See MerchantInfo for more details.

Values you set in the configuration object will override any Google Pay™ configuration from your back end.

Property Description
configuration.merchantName The merchant name you want displayed in the payment sheet. If specified, you must also specify configuration.merchantId and configuration.gatewayMerchantId.
configuration.gatewayMerchantId The name of your Noqoody merchant or company account. Required if merchantName is specified.
configuration.merchantId Your Google Merchant ID . Required if merchantName is specified.
configuration.authJwt Your signed JSON Web Token (JWT). This allows you to use your Google merchant ID with multiple domains.

Button options

Configure the Google Pay™ button. See ButtonOptions for more details.

Property Description
buttonType The  type of button  you want displayed on your payments form. 
buttonColor The color of the button  you want displayed on the payment form.
buttonLocale The language on the button . Defaults to the locale set on the current NoqoodyCheckout instance.
Supported from Web Components v4.1.0.
buttonSizeMode Specifies whether the button changes to fill the size of its container (the default), or has a static width and height.
Supported from Web Components v4.1.0.

Payment data

Configure your payment requirements. See PaymentDataRequest for more details.

Property Description
emailRequired Set this to true if you want to collect the shopper's email address.
shippingAddressRequired Set to true to request the shopper's full shipping address.
shippingAddressParameters Set any  shipping restrictions .
shippingOptionRequired Set to true if you want to present shipping options in the payment sheet.
shippingOptionParameters Set shipping options and a default shipping option to be shown in the payment sheet.

Card parameters

Configure accepted card types. See Card Parameters for more details.

Property Description
allowedAuthMethods Specify supported authentication methods. Default value is ['PAN_ONLY', 'CRYPTOGRAM_3DS'].
allowedCardNetworks Specify allowed card networks. The allowed networks are automatically configured based on your account settings, but you can override this here.
allowCreditCards Default is true. Set this to false if you don't support credit cards.
allowPrepaidCards Default is true. Set this to false if you don't support prepaid cards.
billingAddressRequired Set this to true if you require a billing address.
billingAddressParameters The expected fields returned if billingAddressRequired is set to true. For more information on the available fields, see Google Pay API documentation on billingAddressParameters .

Payment method support

Specify which payment methods are supported. See IsReadyToPayRequest for more details.

Property Description
existingPaymentMethodRequired Default is true.

Events

The following event handlers are supported for Google Pay.

Event Description
onClick(resolve, reject) Called when the shopper clicks the Google Pay™ button. Call resolve() or reject() to continue or stop the payment flow.
onChange or onSubmit Called after the shopper approves the payment on the Google Pay™ form. The first parameter (state) of this function contains all the necessary data to make a payment using the /payments API.
onAuthorized Called after the shopper approves the payment on the Google Pay™ form. Contains the full response from Google Pay™ . Use this if you need additional data such as the shipping address or the shopper email.

Recurring payments

To make recurring Google Pay™ payments, you first need to create a shopper token and then make subsequent recurring transactionswith the token.

Refer to Tokenization for more information and detailed instructions.

Test and go live

To test Google Pay, log in to a Google account and create a Google Pay wallet with the details of a real card, not a test card. When you make a test payment, the card number is automatically mapped to our test card number starting with 4111, so the real card is not charged.

To test Google Pay™ with the 3D Secure flow, contact our Support Team.

You can check the status of a Google Pay™ test payment in your Customer Area  > Transactions > Payments.

For more information, see Google Pay's test environment setup for Web .

Before you go live

  1. Make sure your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.
  2. Contact our Support Team and submit a request to configure your Google Pay™ merchantID .
  3. Complete all of the steps in the Google Pay™ API deploy to production documentation for Web .

In the live environment, note that Google Pay™ will only be available if:

Google Pay™ Component

Add Google Pay™ to an existing Components integration.

On this page, you can find additional configuration for adding Google Pay™ to your Drop-in integration.

When shoppers select Google Pay, Drop-in presents the Google Pay™ payment sheet where shoppers choose a card they want to use. If shoppers select a card that requires 3D Secure authentication, Drop-in also handles redirecting shoppers to another website to complete the verification.

Before you begin

Before starting your Google Pay™ integration:

  1. Make sure you've integrated Drop-in v4.0.0 or later.
  2. Please check Google Pay™ Web Brand Guidelines & Web developer documentation.
  3. Contact our Support Team to add Google Pay in your test Customer Area.
  4. All merchants must adhere to the Google Pay™ APIs Acceptable Use Policy and accept the terms defined in the Google Pay™ API Terms of Service.
  5. Register with the Google Pay™ and Wallet Console and receiving a Google merchant ID

To accept live Google Pay™ payments, you must complete all of the steps in Before you go live.

API reference

You don't need to send additional fields for Google Pay. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:

Drop-in configuration

Load the Google Pay™ API JavaScript library

We recommend that you preload the the Google Pay™ API JavaScript library, by including the
following script in your checkout page:

                                    <script src="https://pay.google.com/gp/p/js/pay.js"></script>
                                    
                                

Required configuration

If you implemented an advanced use case

Parameter name Required Description
amount.value The value of the payment, in minor units.
amount.currency The currency code of the payment.
countryCode The two-letter country code of your merchant account.
environment Set to PRODUCTION when you're ready to accept live payments. The default value is TEST.

The following example shows how to configure Drop-in:

Optional Drop-in instance configuration
  1. const googlePayConfiguration = {
  2. amount: {
  3. value: 1000,
  4. currency: "EUR"
  5. },
  6. countryCode: "NL",
  7. //Set this to PRODUCTION when you're ready to accept live payments
  8. environment: "TEST"
  9. };

Include the googlePayConfiguration object when creating a configuration object:

NoqoodyCheckout configuration
  1. const configuration = {
  2. // ... other required configuration
  3. paymentMethodsConfiguration: {
  4. googlepay: googlePayConfiguration
  5. }
  6. },
Google Pay™ Button

Optional configuration

This optional configuration parameter is only accepted on the dropin instance.

Instant payment button configuration

Use the instantPaymentTypes object to display the Google Pay payment button at the top of the list of available payment methods. The sample below shows how to do this:

Optional Drop-in instance configuration
  1. const dropin = checkout.create('dropin', {
  2. //... other optional configuration
  3. instantPaymentTypes: ['googlepay']
  4. }).mount('#dropin-container');

Merchant info

Configure the merchant name rendered in the payment sheet. See MerchantInfo for more details.

Values you set in the configuration object will override any Google Pay™ configuration from your back end.

Property Description
configuration.merchantName The merchant name you want displayed in the payment sheet. If specified, you must also specify configuration.merchantId and configuration.gatewayMerchantId.
configuration.gatewayMerchantId The name of your Noqoody merchant or company account. Required if merchantName is specified.
configuration.merchantId Your Google Merchant ID . Required if merchantName is specified.
configuration.authJwt Your signed JSON Web Token (JWT). This allows you to use your Google merchant ID with multiple domains.

Button options

Configure the Google Pay™ button. See ButtonOptions for more details.

Property Description
buttonType The  type of button  you want displayed on your payments form. 
buttonColor The color of the button  you want displayed on the payment form.
buttonLocale The language on the button . Defaults to the locale set on the current NoqoodyCheckout instance.
Supported from Web Components v4.1.0.
buttonSizeMode Specifies whether the button changes to fill the size of its container (the default), or has a static width and height.
Supported from Web Components v4.1.0.

Payment data

Configure your payment requirements. See PaymentDataRequest for more details.

Property Description
emailRequired Set this to true if you want to collect the shopper's email address.
shippingAddressRequired Set to true to request the shopper's full shipping address.
shippingAddressParameters Set any  shipping restrictions .
shippingOptionRequired Set to true if you want to present shipping options in the payment sheet.
shippingOptionParameters Set shipping options and a default shipping option to be shown in the payment sheet.

Card parameters

Configure accepted card types. See Card Parameters for more details.

Property Description
allowedAuthMethods Specify supported authentication methods. Default value is ['PAN_ONLY', 'CRYPTOGRAM_3DS'].
allowedCardNetworks Specify allowed card networks. The allowed networks are automatically configured based on your account settings, but you can override this here.
allowCreditCards Default is true. Set this to false if you don't support credit cards.
allowPrepaidCards Default is true. Set this to false if you don't support prepaid cards.
billingAddressRequired Set this to true if you require a billing address.
billingAddressParameters The expected fields returned if billingAddressRequired is set to true. For more information on the available fields, see Google Pay API documentation on billingAddressParameters .

Payment method support

Specify which payment methods are supported. See IsReadyToPayRequest for more details.

Property Description
existingPaymentMethodRequired Default is true.

Events

The following event handlers are supported for Google Pay.

Event Description
onClick(resolve, reject) Called when the shopper clicks the Google Pay™ button. Call resolve() or reject() to continue or stop the payment flow.
onChange or onSubmit Called after the shopper approves the payment on the Google Pay™ form. The first parameter (state) of this function contains all the necessary data to make a payment using the /payments API.
onAuthorized Called after the shopper approves the payment on the Google Pay™ form. Contains the full response from Google Pay™ . Use this if you need additional data such as the shipping address or the shopper email.

Recurring payments

To make recurring Google Pay™ payments, you first need to create a shopper token and then make subsequent recurring transactionswith the token.

Refer to Tokenization for more information and detailed instructions.

Test and go live

To test Google Pay, log in to a Google account and create a Google Pay wallet with the details of a real card, not a test card. When you make a test payment, the card number is automatically mapped to our test card number starting with 4111, so the real card is not charged.

To test Google Pay™ with the 3D Secure flow, contact our Support Team.

You can check the status of a Google Pay™ test payment in your Customer Area  > Transactions > Payments.

For more information, see Google Pay's test environment setup for Web .

Before you go live

  1. Make sure your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.
  2. Contact our Support Team and submit a request to configure your Google Pay™ merchantID .
  3. Complete all of the steps in the Google Pay™ API deploy to production documentation for Web .

In the live environment, note that Google Pay™ will only be available if:

Google Pay™ Drop-in integration

Add Google Pay™ to an existing Drop-in integration.

Our Android Drop-in renders Google Pay™ in your payment form. When shoppers select Google Pay, Drop-in presents the Google Pay payment sheet where shoppers choose a card they want to use. If shoppers select a card that requires 3D Secure authentication, Drop-in also handles redirecting shoppers to another website to complete the verification.

Before you begin

Before starting your Google Pay™ integration:

  1. Make sure you've integrated Drop-in v4.0.0 or later.
  2. Contact our Support Team to add Google Pay in your test Customer Area.
  3. Register with the Google Pay™ and Wallet Console and receiving a Google merchant ID

To accept live Google Pay™ payments, you must complete all of the steps in Before you go live.

Show Google Pay™ in your payment form

Drop-in uses the countryCode and the amount.currency from your /paymentMethods request to show the available payment methods to your shopper. From your server, make a /paymentMethods request specifying:

Optional configuration

When creating an instance of Drop-in, you can optionally include a GooglePayConfiguration object to add custom configuration for Google Pay in your payment form.

  1. val googlePayConfig = GooglePayConfiguration.Builder(YourContext, "YOUR_CLIENT_KEY")
  2. .setAmount(amount)
  3. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
  4. .setEnvironment(Environment.TEST)
  5. .build()
  6. val dropInConfiguration =
  7. DropInConfiguration.Builder(YourContext, YourDropInService::class..java, class="text-warning">"YOUR_CLIENT_KEY")
  8. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
  9. .setEnvironment(Environment.TEST)
  10. // Required for versions earlier than v4.5.0. When you're ready to accept live payments, change the value to ENVIRONMENT_PRODUCTION.
  11. .setGooglePayEnvironment(WalletConstants.ENVIRONMENT_TEST)
  12. .addGooglePayConfiguration(googlePayConfig)
  13. .build()

Make a payment

When the shopper proceeds to pay, Drop-in returns the paymentComponentData.paymentMethod

  1. Pass the paymentComponentData.paymentMethod to your server.
  2. From your server, make a /payments request, specifying:
    • paymentMethod : The paymentComponentData.paymentMethod from your client app.
    • browserInfo : Required if you want to trigger 3D Secure authentication .
    • returnURL URL where the shopper will be redirected back to after completing a 3D Secure authentication. The returnUrl can have a maximum of 1024 characters. Get this URL from the Component in the RedirectComponent.getReturnUrl(context).
  1. curl https://checkout-test.Noqoody.com/v68/payments \
  2. -H "x-API-key: YOUR_X-API-KEY" \
  3. -H "content-type: application/json" \
  4. -d '{
  5. "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
  6. "reference":"YOUR_ORDER_NUMBER",
  7. "amount":{
  8. "currency":"EUR",
  9. "value":1000
  10. },
  11. "paymentMethod":{
  12. "type":"googlepay",
  13. "googlePayToken": "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}"
  14. },
  15. "browserInfo: {
  16. "userAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. },
  19. "returnUrl":"Noqoodycheckout://your.package.name"
  20. }'
  1. # Set your X-API-KEY with the API key from the Customer Area.
  2. Noqoody = Noqoody::Client.new
  3. Noqoody.api_key = "YOUR_X-API-KEY"
  4.  
  5. response = Noqoody.checkout.payments({
  6. :amount => {
  7. :currency => "EUR" ,
  8. :value => 1000
  9. }
  10. :reference => "YOUR_ORDER_NUMBER" ,
  11. :paymentMethod => {
  12. :type => "googlepay" ,
  13. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  14. }
  15. :browserInfo => {
  16. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. };
  19. :returnUrl => "Noqoodycheckout://your.package.name" ,
  20. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  21. })
  1. // Set YOUR_X-API-KEY with the API key from the Customer Area.
  2. // Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments.
  3. Client client = new Client( "YOUR_X-API-KEY" , Environment.TEST);
  4. Checkout checkout = new Checkout(client);
  5.  
  6. PaymentsRequest paymentsRequest = new PaymentsRequest();
  7.  
  8. String merchantAccount = "YOUR_MERCHANT_ACCOUNT"
  9. paymentsRequest.setMerchantAccount(merchantAccount);
  10.  
  11. GooglePayDetails googlePayDetails = new GooglePayDetails();
  12.  
  13. googlePayDetails.setGooglePayToken(state.data.paymentMethod.googlePayToken);
  14. paymentsRequest.setPaymentMethod(googlePayDetails);
  15.  
  16. BrowserInfo browserInfo = new BrowserInfo();
  17. browserInfo.setUserAgent( "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36" );
  18. browserInfo.setAcceptHeader( "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" );
  19.  
  20. paymentsRequest.setBrowserInfo(browserInfo);
  21.  
  22. paymentsRequest.setReference( "YOUR_ORDER_NUMBER" );
  23. paymentsRequest.setReturnUrl( "Noqoodycheckout://your.package.name" );
  24.  
  25. PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. $client = new \Noqoody\Client();
  3. $client->setXApiKey( "YOUR_X-API-KEY" );
  4. $service = new \Noqoody\Service\Checkout($client);
  5.  
  6. $params = array (
  7. "amount" => array (
  8. "amount" => array (
  9. "currency" => "EUR" ,
  10. "value" => 1000
  11. )
  12. "reference" => "YOUR_ORDER_NUMBER" ,
  13. :paymentMethod => {
  14. :type => "googlepay" ,
  15. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  16. }
  17. :browserInfo => {
  18. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  19. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  20. };
  21. :returnUrl => "Noqoodycheckout://your.package.name" ,
  22. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  23. )
  24. $result = $service->payments($params);
  1. # Set your X-API-KEY with the API key from the Customer Area.
  2. Noqoody = Noqoody.Noqoody()
  3. Noqoody.client.xapikey = 'YOUR_X-API-KEY'
  4.  
  5. response = Noqoody.checkout.payments({
  6. :amount => {
  7. :value => 1000
  8. :currency => "EUR" ,
  9. }
  10. :reference => "YOUR_ORDER_NUMBER" ,
  11. :paymentMethod => {
  12. :type => "googlepay" ,
  13. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  14. }
  15. :browserInfo => {
  16. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. };
  19. :returnUrl => "Noqoodycheckout://your.package.name" ,
  20. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  21. })
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. var client = new Client ( "YOUR_X-API-KEY" , Environment.Test);
  3.  
  4. var amount = new Model.Checkout.Amount( "EUR" , 1000 );
  5. var details = new Model.Checkout.DefaultPaymentMethodDetails{
  6. $service = new \Noqoody\Service\Checkout($client);
  7.  
  8. Type = "googlepay" ,
  9. GooglePayToken = "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}"
  10. };
  11. var browserInfo = new Model.Checkout.BrowserInfo{
  12. UserAgent = @"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36" ,
  13. AcceptHeader = @"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" ,
  14. };
  15. var paymentRequest = new Noqoody.Model.Checkout.PaymentRequest
  16. {
  17. Reference = "YOUR_ORDER_NUMBER" ,
  18. Amount = amount,
  19. ReturnUrl = @"Noqoodycheckout://your.package.name" ,
  20. MerchantAccount = "YOUR_MERCHANT_ACCOUNT" ,
  21. PaymentMethod = details,
  22. BrowserInfo = browserInfo
  23. };
  24.  
  25. var paymentResponse = checkout.Payments(paymentsRequest);
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. const {Client, Config, CheckoutAPI} = require ( '@Noqoody/api-library' );
  3. const config = new Config();
  4. // Set your X-API-KEY with the API key from the Customer Area.
  5. config.apiKey = '[API_KEY]' ;
  6. config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]' ;
  7. const client = new Client({ config });
  8. client.setEnvironment( "TEST" );
  9. const checkout = new CheckoutAPI(client);
  10. checkout.payments({
  11. amount: { currency: "EUR" , value: 1000 }
  12. paymentMethod: {
  13. type: 'googlepay' ,
  14. googlePayToken: '{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}'
  15. },
  16. browserInfo: {
  17. userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36', ,
  18. acceptHeader: 'text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8' }
  19. },
  20. reference: "YOUR_ORDER_NUMBER" ,
  21. merchantAccount: config.merchantAccount,
  22. returnUrl: "Noqoodycheckout://your.package.name"
  23. }).then(res => res);

The response contains the result of the payment.

/payments response
  1. {
  2. "pspReference": "JDD6LKT8MBLZNN84" ,
  3. "resultCode": "Authorised"
  4. }

If the shopper used a card that requires 3D Secure authentication before the payment can be completed, you receive an action.type redirect in the response.

/payments response for a card that requires 3D Secure authentication
  1. {
  2. "resultCode": "RedirectShopper" ,
  3. "action": {
  4. "url": "https://test.Noqoody.com/hpp/3d/validate.shtml" ,
  5. "paymentMethodType": "scheme" ,
  6. "data": {
  7. "MD": "OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09..." ,
  8. "PaReq": "eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe..." ,
  9. "TermUrl": "https://example.com/checkout?shopperOrder=12xy..." ,
  10. },
  11. "method": "POST" ,
  12. "type": "redirect" ,
  13. }
  14. }

3. If you received an action object, pass the action object to your client app and return it inside a DropInServiceResult.Action.

If you did not receive an action object, proceed to present the payment result to your shopper.

Cards with 3D Secure: Check the payment result

Drop-in redirects the shopper to complete the payment. When the shopper returns back to your app, Drop-in provides the actionComponentData object.

From your server, make a POST /payments/details request providing:

  • details: The actionComponentData.details object from Drop-in.
/payments/details request
  1. curl https://checkout-test.Noqoody.com/v68/payments \
  2. -H "x-API-key: YOUR_X-API-KEY" \
  3. -H "content-type: application/json" \
  4. -d ' {
  5. "details":{
  6. "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ=="
  7. },
  8. }'

You receive a response containing:

  • resultCode: Use this to present the payment result to your shopper.
  • pspReference : Our unique identifier for the transaction.
/payments/details response
  1. {
  2. "resultCode": "Authorised"
  3. "pspReference": "JDD6LKT8MBLZNN84" ,
  4. }

Present the payment result

Use the resultCode that you received in the /payments or //payments/details response to present the payment result to your shopper.

The resultCode values you can receive for Google Pay™ are:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
Error There was an error when the payment was being processed. Inform the shopper that there was an error processing their payment. The response contains a refusalReason, indicating the cause of the error.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

Recurring payments

To make recurring Google Pay™ payments, you first need to create a shopper token and then make subsequent recurring transactionswith the token.

Refer to Tokenization for more information and detailed instructions.

Test and go live

To test Google Pay, log in to a Google account and create a Google Pay wallet with the details of a real card, not a test card. When you make a test payment, the card number is automatically mapped to our test card number starting with 4111, so the real card is not charged.

To test Google Pay™ with the 3D Secure flow, contact our Support Team.

You can check the status of a Google Pay™ test payment in your Customer Area  > Transactions > Payments.

For more information, see Google Pay's test environment setup for Android .

Before you go live

  1. Make sure your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.
  2. Contact our Support Team and submit a request to configure your Google Pay™ merchantID .
  3. Complete all of the steps in the Google Pay™ API deploy to production documentation for Web .

In the live environment, note that Google Pay™ will only be available if:

Google Pay™ Component

Add Google Pay™ to an existing Components integration.

Our Google Pay™ Component renders Google Pay™ in your payment form. When the shopper selects Google Pay, Drop-in invokes the payment sheet, where shoppers select the card they want to use, and completes the payment.

When building your Google Pay™ integration, you also need to if the the shopper makes a payment with a card that requires 3D Secure authentication.

Before you begin

Before starting your Google Pay™ integration:

  1. Make sure you've integrated Drop-in v4.0.0 or later.
  2. Please check Google Pay™ Android brand guidelines & Android developer documentation.
  3. Contact our Support Team to add Google Pay in your test Customer Area.
  4. All merchants must adhere to the Google Pay™ APIs Acceptable Use Policy and accept the terms defined in the Google Pay™ API Terms of Service.
  5. Register with the Google Pay™ and Wallet Console and receiving a Google merchant ID

To accept live Google Pay™ payments, you must complete all of the steps in Before you go live.

Show Google Pay™ in your payment form

To show Google Pay™ Component in your payment form, you need to:

  1. Specify in your /paymentMethods request:
  2. Deserialize the response from the /paymentMethods call and get the object with type : googlepay.
  3. Add the Google Pay™ Component:

    a. Import the Google Pay™ Component to your build.gradle file.

                                                <script src="https://pay.google.com/gp/p/js/pay.js"></script>
                                                
                                            

    Check the latest version on GitHub .

    b. Create a GooglePayConfiguration object, passing your client key. You can also include optional configuration , for example to add the amount on the Pay button.

    1. val googlePayConfig = GooglePayConfiguration.Builder(YourContext, "YOUR_CLIENT_KEY")
    2. .setAmount(amount)
    3. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
    4. .setEnvironment(Environment.TEST)
    5. .build()
    6. val dropInConfiguration =
    7. DropInConfiguration.Builder(YourContext, YourDropInService::class..java,"YOUR_CLIENT_KEY")
    8. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
    9. .setEnvironment(Environment.TEST)
    10. // Required for versions earlier than v4.5.0. When you're ready to accept live payments, change the value to ENVIRONMENT_PRODUCTION.
    11. .setGooglePayEnvironment(WalletConstants.ENVIRONMENT_TEST)
    12. .addGooglePayConfiguration(googlePayConfig)
    13. .build()

    c. Check if Google Pay™ is available on the shopper's device. If available, initialize the Component and present a client key. You can also include Google Pay™ button according to Google Pay™ specifications.

    1. val googlePayConfig = GooglePayConfiguration.Builder(YourContext, "YOUR_CLIENT_KEY")
    2. .setAmount(amount)
    3. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
    4. .setEnvironment(Environment.TEST)
    5. .build()
    6. val dropInConfiguration =
    7. DropInConfiguration.Builder(YourContext, YourDropInService::class..java,"YOUR_CLIENT_KEY")
    8. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
    9. .setEnvironment(Environment.TEST)
    10. // Required for versions earlier than v4.5.0. When you're ready to accept live payments, change the value to ENVIRONMENT_PRODUCTION.
    11. .setGooglePayEnvironment(WalletConstants.ENVIRONMENT_TEST)
    12. .addGooglePayConfiguration(googlePayConfig)
    13. .build()

    d. When the shopper selects the Google Pay™ button, call startGooglePayScreen.

                                                googlePayComponent.startGooglePayScreen(YourContext, googlePayRequestCode)
                                                
                                            

    e. Pass the result to the Component, and wait to be notified by the observer.

    1. val googlePayConfig = GooglePayConfiguration.Builder(YourContext, "YOUR_CLIENT_KEY")
    2. .setAmount(amount)
    3. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
    4. .setEnvironment(Environment.TEST)
    5. .build()
    6. val dropInConfiguration =
    7. DropInConfiguration.Builder(YourContext, YourDropInService::class..java,"YOUR_CLIENT_KEY")
    8. // When you're ready to accept live payments, change the value to one of our live environments (for example, Environment.LIVE).
    9. .setEnvironment(Environment.TEST)
    10. // Required for versions earlier than v4.5.0. When you're ready to accept live payments, change the value to ENVIRONMENT_PRODUCTION.
    11. .setGooglePayEnvironment(WalletConstants.ENVIRONMENT_TEST)
    12. .addGooglePayConfiguration(googlePayConfig)
    13. .build()

Make a payment

When the shopper proceeds to pay, Drop-in returns the paymentComponentData.paymentMethod

  1. Pass the paymentComponentData.paymentMethod to your server.
  2. From your server, make a /payments request, specifying:
    • paymentMethod : The paymentComponentData.paymentMethod from your client app.
    • browserInfo : Required if you want to trigger 3D Secure authentication .
    • returnURL URL where the shopper will be redirected back to after completing a 3D Secure authentication. The returnUrl can have a maximum of 1024 characters. Get this URL from the Component in the RedirectComponent.getReturnUrl(context).
  1. curl https://checkout-test.Noqoody.com/v68/payments \
  2. -H "x-API-key: YOUR_X-API-KEY" \
  3. -H "content-type: application/json" \
  4. -d '{
  5. "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
  6. "reference":"YOUR_ORDER_NUMBER",
  7. "amount":{
  8. "currency":"EUR",
  9. "value":1000
  10. },
  11. "paymentMethod":{
  12. "type":"googlepay",
  13. "googlePayToken": "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}"
  14. },
  15. "browserInfo: {
  16. "userAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. },
  19. "returnUrl":"Noqoodycheckout://your.package.name"
  20. }'
  1. # Set your X-API-KEY with the API key from the Customer Area.
  2. Noqoody = Noqoody::Client.new
  3. Noqoody.api_key = "YOUR_X-API-KEY"
  4.  
  5. response = Noqoody.checkout.payments({
  6. :amount => {
  7. :currency => "EUR" ,
  8. :value => 1000
  9. }
  10. :reference => "YOUR_ORDER_NUMBER" ,
  11. :paymentMethod => {
  12. :type => "googlepay" ,
  13. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  14. }
  15. :browserInfo => {
  16. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. };
  19. :returnUrl => "Noqoodycheckout://your.package.name" ,
  20. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  21. })
  1. // Set YOUR_X-API-KEY with the API key from the Customer Area.
  2. // Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments.
  3. Client client = new Client( "YOUR_X-API-KEY" , Environment.TEST);
  4. Checkout checkout = new Checkout(client);
  5.  
  6. PaymentsRequest paymentsRequest = new PaymentsRequest();
  7.  
  8. String merchantAccount = "YOUR_MERCHANT_ACCOUNT"
  9. paymentsRequest.setMerchantAccount(merchantAccount);
  10.  
  11. GooglePayDetails googlePayDetails = new GooglePayDetails();
  12.  
  13. googlePayDetails.setGooglePayToken(state.data.paymentMethod.googlePayToken);
  14. paymentsRequest.setPaymentMethod(googlePayDetails);
  15.  
  16. BrowserInfo browserInfo = new BrowserInfo();
  17. browserInfo.setUserAgent( "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36" );
  18. browserInfo.setAcceptHeader( "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" );
  19.  
  20. paymentsRequest.setBrowserInfo(browserInfo);
  21.  
  22. paymentsRequest.setReference( "YOUR_ORDER_NUMBER" );
  23. paymentsRequest.setReturnUrl( "Noqoodycheckout://your.package.name" );
  24.  
  25. PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. $client = new \Noqoody\Client();
  3. $client->setXApiKey( "YOUR_X-API-KEY" );
  4. $service = new \Noqoody\Service\Checkout($client);
  5.  
  6. $params = array (
  7. "amount" => array (
  8. "amount" => array (
  9. "currency" => "EUR" ,
  10. "value" => 1000
  11. )
  12. "reference" => "YOUR_ORDER_NUMBER" ,
  13. :paymentMethod => {
  14. :type => "googlepay" ,
  15. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  16. }
  17. :browserInfo => {
  18. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  19. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  20. };
  21. :returnUrl => "Noqoodycheckout://your.package.name" ,
  22. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  23. )
  24. $result = $service->payments($params);
  1. # Set your X-API-KEY with the API key from the Customer Area.
  2. Noqoody = Noqoody.Noqoody()
  3. Noqoody.client.xapikey = 'YOUR_X-API-KEY'
  4.  
  5. response = Noqoody.checkout.payments({
  6. :amount => {
  7. :value => 1000
  8. :currency => "EUR" ,
  9. }
  10. :reference => "YOUR_ORDER_NUMBER" ,
  11. :paymentMethod => {
  12. :type => "googlepay" ,
  13. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  14. }
  15. :browserInfo => {
  16. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. };
  19. :returnUrl => "Noqoodycheckout://your.package.name" ,
  20. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  21. })
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. var client = new Client ( "YOUR_X-API-KEY" , Environment.Test);
  3.  
  4. var amount = new Model.Checkout.Amount( "EUR" , 1000 );
  5. var details = new Model.Checkout.DefaultPaymentMethodDetails{
  6. $service = new \Noqoody\Service\Checkout($client);
  7.  
  8. Type = "googlepay" ,
  9. GooglePayToken = "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}"
  10. };
  11. var browserInfo = new Model.Checkout.BrowserInfo{
  12. UserAgent = @"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36" ,
  13. AcceptHeader = @"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" ,
  14. };
  15. var paymentRequest = new Noqoody.Model.Checkout.PaymentRequest
  16. {
  17. Reference = "YOUR_ORDER_NUMBER" ,
  18. Amount = amount,
  19. ReturnUrl = @"Noqoodycheckout://your.package.name" ,
  20. MerchantAccount = "YOUR_MERCHANT_ACCOUNT" ,
  21. PaymentMethod = details,
  22. BrowserInfo = browserInfo
  23. };
  24.  
  25. var paymentResponse = checkout.Payments(paymentsRequest);
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. const {Client, Config, CheckoutAPI} = require ( '@Noqoody/api-library' );
  3. const config = new Config();
  4. // Set your X-API-KEY with the API key from the Customer Area.
  5. config.apiKey = '[API_KEY]' ;
  6. config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]' ;
  7. const client = new Client({ config });
  8. client.setEnvironment( "TEST" );
  9. const checkout = new CheckoutAPI(client);
  10. checkout.payments({
  11. amount: { currency: "EUR" , value: 1000 }
  12. paymentMethod: {
  13. type: 'googlepay' ,
  14. googlePayToken: '{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}'
  15. },
  16. browserInfo: {
  17. userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36', ,
  18. acceptHeader: 'text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8' }
  19. },
  20. reference: "YOUR_ORDER_NUMBER" ,
  21. merchantAccount: config.merchantAccount,
  22. returnUrl: "Noqoodycheckout://your.package.name"
  23. }).then(res => res);

The response contains the result of the payment.

/payments response
  1. {
  2. "pspReference": "JDD6LKT8MBLZNN84" ,
  3. "resultCode": "Authorised"
  4. }

If the shopper used a card that requires 3D Secure authentication before the payment can be completed, you receive an action.type redirect in the response.

/payments response for a card that requires 3D Secure authentication
  1. {
  2. "resultCode": "RedirectShopper" ,
  3. "action": {
  4. "url": "https://test.Noqoody.com/hpp/3d/validate.shtml" ,
  5. "paymentMethodType": "scheme" ,
  6. "data": {
  7. "MD": "OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09..." ,
  8. "PaReq": "eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe..." ,
  9. "TermUrl": "https://example.com/checkout?shopperOrder=12xy..." ,
  10. },
  11. "method": "POST" ,
  12. "type": "redirect" ,
  13. }
  14. }

3. If you received an action object, pass the action object to your client app and return it inside a DropInServiceResult.Action.

If you did not receive an action object, proceed to present the payment result to your shopper.

Cards with 3D Secure: Check the payment result

Drop-in redirects the shopper to complete the payment. When the shopper returns back to your app, Drop-in provides the actionComponentData object.

From your server, make a POST /payments/details request providing:

  • details: The actionComponentData.details object from Drop-in.
/payments/details request
  1. curl https://checkout-test.Noqoody.com/v68/payments \
  2. -H "x-API-key: YOUR_X-API-KEY" \
  3. -H "content-type: application/json" \
  4. -d ' {
  5. "details":{
  6. "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ=="
  7. },
  8. }'

You receive a response containing:

  • resultCode: Use this to present the payment result to your shopper.
  • pspReference : Our unique identifier for the transaction.
/payments/details response
  1. {
  2. "resultCode": "Authorised"
  3. "pspReference": "JDD6LKT8MBLZNN84" ,
  4. }

Present the payment result

Use the resultCode that you received in the /payments or //payments/details response to present the payment result to your shopper.

The resultCode values you can receive for Google Pay™ are:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
Error There was an error when the payment was being processed. Inform the shopper that there was an error processing their payment. The response contains a refusalReason, indicating the cause of the error.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

Recurring payments

To make recurring Google Pay™ payments, you first need to create a shopper token and then make subsequent recurring transactionswith the token.

Refer to Tokenization for more information and detailed instructions.

Test and go live

To test Google Pay, log in to a Google account and create a Google Pay wallet with the details of a real card, not a test card. When you make a test payment, the card number is automatically mapped to our test card number starting with 4111, so the real card is not charged.

To test Google Pay™ with the 3D Secure flow, contact our Support Team.

You can check the status of a Google Pay™ test payment in your Customer Area  > Transactions > Payments.

For more information, see Google Pay's test environment setup for Android .

Before you go live

  1. Make sure your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.
  2. Contact our Support Team and submit a request to configure your Google Pay™ merchantID .
  3. Complete all of the steps in the Google Pay™ API deploy to production documentation for Web .

Google Pay™ for API only

Add Google Pay™ to an existing API-only integration.

Accept Google Pay™ payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Before you begin

These instructions explain how to add Google Pay™ to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your Google Pay™ integration:

  1. Contact our Support Team to add Google Pay in your test Customer Area.
  2. Make sure you've integrated Checkout API v67 or later..
  3. Integrate Google Pay™ API with Noqoody as your gateway. Follow the procedure on Google Pay™ documentation to integrate your web or Android application.
  4. Register with the Google Pay™ and Wallet Console and receiving a Google merchant ID

In the step where you choose a payment tokenization method, choose Gateway . Set Noqoody as your gateway and provide your merchant or company account name in the gatewayMerchantId parameter.

Defining payment gateway for Web
  1. "tokenizationSpecification": {
  2. "type": "PAYMENT_GATEWAY" ,
  3. "parameters" : {
  4. "gateway" : "Noqoody" ,
  5. "gatewayMerchantId" : "YOUR_MERCHANT_ACCOUNT_NAME"
  6. }
  7. }

Build your payment form for Google Pay

Show Google Pay™ as an available payment method in countries where Google Pay™ is supported. When the shopper selects Google Pay, they are presented with the payment sheet.

We provide logos for Google Pay™ which you can use on your payment form. For more information, refer to Downloading logos. .

You can also submit a /paymentMethods request specifying:

  • countryCode : Country where Google Pay™ is supported. For example, NL.
  • amount.currency : Any supported currency. For example,EUR.
  • channel Set this to Web if the payment is being initiated on the web, or Android for in-app payments.

In the response, you receive paymentMethod.type : googlepay.

Make a payment

  1. Get the token from PaymentData response from the Google Pay™ API.
  2. From your server, make a /payments request, providing:
    • paymentMethod.type : googlepay
    • browserInfo : Required if you want to trigger 3D Secure authentication .
    • googlePayToken This is the token that you obtained from the Google Pay™ API PaymentData response. For more information about the fields this token contains, refer to Google Pay™ API documentation.
    • browserInfo : Required if you want to trigger 3D Secure authentication .
    • returnUrl : URL where the shopper will be redirected back to after completing a 3D Secure authentication.
  1. curl https://checkout-test.Noqoody.com/v68/payments \
  2. -H "x-API-key: YOUR_X-API-KEY" \
  3. -H "content-type: application/json" \
  4. -d '{
  5. "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
  6. "reference":"YOUR_ORDER_NUMBER",
  7. "amount":{
  8. "currency":"EUR",
  9. "value":1000
  10. },
  11. "paymentMethod":{
  12. "type":"googlepay",
  13. "googlePayToken": "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}"
  14. },
  15. "browserInfo: {
  16. "userAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. "acceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. },
  19. "returnUrl":"Noqoodycheckout://your.package.name"
  20. }'
  1. # Set your X-API-KEY with the API key from the Customer Area.
  2. Noqoody = Noqoody::Client.new
  3. Noqoody.api_key = "YOUR_X-API-KEY"
  4.  
  5. response = Noqoody.checkout.payments({
  6. :amount => {
  7. :currency => "EUR" ,
  8. :value => 1000
  9. }
  10. :reference => "YOUR_ORDER_NUMBER" ,
  11. :paymentMethod => {
  12. :type => "googlepay" ,
  13. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  14. }
  15. :browserInfo => {
  16. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. };
  19. :returnUrl => "Noqoodycheckout://your.package.name" ,
  20. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  21. })
  1. // Set YOUR_X-API-KEY with the API key from the Customer Area.
  2. // Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments.
  3. Client client = new Client( "YOUR_X-API-KEY" , Environment.TEST);
  4. Checkout checkout = new Checkout(client);
  5.  
  6. PaymentsRequest paymentsRequest = new PaymentsRequest();
  7.  
  8. String merchantAccount = "YOUR_MERCHANT_ACCOUNT"
  9. paymentsRequest.setMerchantAccount(merchantAccount);
  10.  
  11. GooglePayDetails googlePayDetails = new GooglePayDetails();
  12.  
  13. googlePayDetails.setGooglePayToken(state.data.paymentMethod.googlePayToken);
  14. paymentsRequest.setPaymentMethod(googlePayDetails);
  15.  
  16. BrowserInfo browserInfo = new BrowserInfo();
  17. browserInfo.setUserAgent( "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36" );
  18. browserInfo.setAcceptHeader( "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" );
  19.  
  20. paymentsRequest.setBrowserInfo(browserInfo);
  21.  
  22. paymentsRequest.setReference( "YOUR_ORDER_NUMBER" );
  23. paymentsRequest.setReturnUrl( "Noqoodycheckout://your.package.name" );
  24.  
  25. PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. $client = new \Noqoody\Client();
  3. $client->setXApiKey( "YOUR_X-API-KEY" );
  4. $service = new \Noqoody\Service\Checkout($client);
  5.  
  6. $params = array (
  7. "amount" => array (
  8. "amount" => array (
  9. "currency" => "EUR" ,
  10. "value" => 1000
  11. )
  12. "reference" => "YOUR_ORDER_NUMBER" ,
  13. :paymentMethod => {
  14. :type => "googlepay" ,
  15. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  16. }
  17. :browserInfo => {
  18. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  19. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  20. };
  21. :returnUrl => "Noqoodycheckout://your.package.name" ,
  22. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  23. )
  24. $result = $service->payments($params);
  1. # Set your X-API-KEY with the API key from the Customer Area.
  2. Noqoody = Noqoody.Noqoody()
  3. Noqoody.client.xapikey = 'YOUR_X-API-KEY'
  4.  
  5. response = Noqoody.checkout.payments({
  6. :amount => {
  7. :value => 1000
  8. :currency => "EUR" ,
  9. }
  10. :reference => "YOUR_ORDER_NUMBER" ,
  11. :paymentMethod => {
  12. :type => "googlepay" ,
  13. :googlePayToken => "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}" ,
  14. }
  15. :browserInfo => {
  16. :userAgent => "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
  17. :acceptHeader => "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8"
  18. };
  19. :returnUrl => "Noqoodycheckout://your.package.name" ,
  20. :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
  21. })
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. var client = new Client ( "YOUR_X-API-KEY" , Environment.Test);
  3.  
  4. var amount = new Model.Checkout.Amount( "EUR" , 1000 );
  5. var details = new Model.Checkout.DefaultPaymentMethodDetails{
  6. $service = new \Noqoody\Service\Checkout($client);
  7.  
  8. Type = "googlepay" ,
  9. GooglePayToken = "{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}"
  10. };
  11. var browserInfo = new Model.Checkout.BrowserInfo{
  12. UserAgent = @"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36" ,
  13. AcceptHeader = @"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8" ,
  14. };
  15. var paymentRequest = new Noqoody.Model.Checkout.PaymentRequest
  16. {
  17. Reference = "YOUR_ORDER_NUMBER" ,
  18. Amount = amount,
  19. ReturnUrl = @"Noqoodycheckout://your.package.name" ,
  20. MerchantAccount = "YOUR_MERCHANT_ACCOUNT" ,
  21. PaymentMethod = details,
  22. BrowserInfo = browserInfo
  23. };
  24.  
  25. var paymentResponse = checkout.Payments(paymentsRequest);
  1. // Set your X-API-KEY with the API key from the Customer Area.
  2. const {Client, Config, CheckoutAPI} = require ( '@Noqoody/api-library' );
  3. const config = new Config();
  4. // Set your X-API-KEY with the API key from the Customer Area.
  5. config.apiKey = '[API_KEY]' ;
  6. config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]' ;
  7. const client = new Client({ config });
  8. client.setEnvironment( "TEST" );
  9. const checkout = new CheckoutAPI(client);
  10. checkout.payments({
  11. amount: { currency: "EUR" , value: 1000 }
  12. paymentMethod: {
  13. type: 'googlepay' ,
  14. googlePayToken: '{\"signature\":\"MEUCIFNbi10fa\\u003d\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"u4YsMQ4i56lTS..D+2m9vYwY\\\",\\\"ephemeralPublicKey\\\":\\\"BIwdzX4a+rC1DiKY6/8Y\\\\u003d\\\",\\\"tag\\\":\\\"pe0MF+z7\\\\u003d\\\"}\"}'
  15. },
  16. browserInfo: {
  17. userAgent: 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36', ,
  18. acceptHeader: 'text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8' }
  19. },
  20. reference: "YOUR_ORDER_NUMBER" ,
  21. merchantAccount: config.merchantAccount,
  22. returnUrl: "Noqoodycheckout://your.package.name"
  23. }).then(res => res);

The response contains the result of the payment.

/payments response
  1. {
  2. "pspReference": "JDD6LKT8MBLZNN84" ,
  3. "resultCode": "Authorised"
  4. }

If the shopper used a card that requires 3D Secure authentication before the payment can be completed, you receive an action.type redirect in the response.

/payments response for a card that requires 3D Secure authentication
  1. {
  2. "resultCode": "RedirectShopper" ,
  3. "action": {
  4. "url": "https://test.Noqoody.com/hpp/3d/validate.shtml" ,
  5. "paymentMethodType": "scheme" ,
  6. "data": {
  7. "MD": "OEVudmZVMUlkWjd0MDNwUWs2bmhSdz09..." ,
  8. "PaReq": "eNpVUttygjAQ/RXbDyAXBYRZ00HpTH3wUosPfe..." ,
  9. "TermUrl": "https://example.com/checkout?shopperOrder=12xy..." ,
  10. },
  11. "method": "POST" ,
  12. "type": "redirect" ,
  13. }
  14. }

3. If you received an action object, pass the action object to your client app and return it inside a DropInServiceResult.Action.

If you did not receive an action object, proceed to present the payment result to your shopper.

Cards with 3D Secure: Check the payment result

If the shopper used a card that requires 3D Secure authentication, you need to redirect the shopper to another website where they complete the authentication. To learn how to handle the redirect, follow our Handling redirects guide.

Present the payment result

Use the resultCode that you received in the /payments or //payments/details response to present the payment result to your shopper.

The resultCode values you can receive for Google Pay™ are:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
Error There was an error when the payment was being processed. Inform the shopper that there was an error processing their payment. The response contains a refusalReason, indicating the cause of the error.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

Recurring payments

To make recurring Google Pay™ payments, you first need to create a shopper token and then make subsequent recurring transactionswith the token.

Refer to Tokenization for more information and detailed instructions.

Test and go live

To test Google Pay, log in to a Google account and create a Google Pay wallet with the details of a real card, not a test card. When you make a test payment, the card number is automatically mapped to our test card number starting with 4111, so the real card is not charged.

To test Google Pay™ with the 3D Secure flow, contact our Support Team.

You can check the status of a Google Pay™ test payment in your Customer Area  > Transactions > Payments.

For more information, see Google Pay's test environment setup for Web .

Before you go live

  1. Make sure your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.
  2. Complete all of the steps in the Google Pay™ API deploy to production documentation for Web .
  3. Contact our Support Team and submit a request to configure your Google Pay™ merchantID .

In the live environment, note that Google Pay™ will only be available if:

  • The shopper is logged in to their Google account.
  • The shopper has at least one valid payment method on their Google Pay™ account.