Google Pay™

Learn how to accept payments using Google Pay.

Overview

Integrate Google Pay with xMoney to provide a seamless checkout experience for your customers. This guide will walk you through the steps needed to integrate Google Pay into your website using Twispay/xMoney as the payment processor.

Please note that xMoney is fully licensed to provide payment services in the European Economic Area (EEA) countries.

Since September 2019, the Strong Customer Authentication (SCA) regulation has required businesses across Europe to implement additional authentication measures for online payments.

Google Pay fully complies with SCA, as its payment process already includes a built-in authentication layer, such as biometric verification (fingerprint or facial recognition) or password authentication.

By integrating Google Pay, you agree to Google’s terms of service.

Prerequisites

Before you begin, ensure you have the following:

  1. xMoney merchant account.

With your account, you will be given a siteId and a secret unique key (aka apiKey). This key is used to authenticate and communicate with our servers securely. The apiKey can be found in the merchant account on the following url: https://merchant.twispay.com

For test accounts use https://merchant-stage.twispay.com.

Under the “Sites” menu – clicking the number found at column # will bring up a site details window. The apiKey is listed in the Website details view as “Private key”

Note:

  • The apiKey is unique for each website – if you had a test account, the apiKey used for tests is not the same as the one you will need to use for the live environment.
  • Integrate Google Pay API with xMoney as your gateway. Follow the procedure in the Google Pay documentation to integrate your web or Android application.
  1. A website running on HTTPS (Google Pay requires a secure connection).
  2. A working xMoney working integration with our checkout secure page or directly with our API.

- for checkout secure page you can find details on how to configure an order request using our documentation found here

- for API ( server to server) integration details can be found here

Note: If you have a module integration( woocomerce, shopify) requirement 3 is not required.

Supported card networks are:

  • Visa
  • Mastercard

Accept a payment using GooglePay in your Website

Below is the option best suited for your integration. Please refer to Google’s branding guidelines to correctly incorporate the Google Play brand on your website.

The Google Pay digital wallet button will be displayed on our checkout payment page. To enable this feature, we will activate the option in your account. If you encounter any issues, please contact support@twispay.com to confirm that Google Pay has been activated.

Merchants must adhere to the Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.


Accept a payment using GooglePay in your Android App

Prerequisites

You app must be:

  • Distributed through the Google Play store
  • Built using the following configuration:
    • A minSdkVersion of 21 or higher
    • A compileSdkVersion of 34 or higher
  • Follow the Google Pay Android Brand Guidelines

If you wish to test with your own device, you need to add a payment method to your Google Account.

More details about how to configure the app can be found on the official Google Pay API documentation.

1. Setup your integration

To start the setup follow this guide.

For requesting a payment token you will need to use the following configs:

gateway: "xmomeypay"
gatewayMerchantId: "googlePayMID_{your_merchant_id}"

We will provide you with the correct merchant_id to use in your setup.

Supported card networks are:

  • Visa
  • Mastercard

Supported Authorization methods are:

  • PAN_ONLY
  • CRYPTOGRAM_3DS

When configuring the card parameters, we need the billingAddressParameters as follows:

{
  format: "MIN",
  phoneNumberRequired: true
}

See BillingAddressParameters for more information.

2. Add the Google Pay button

Add the Google Pay button to your app by following Google’s tutorial. This ensures you’re using the correct assets.

3. Handle the result

  • Get the token from the PaymentData response from the Google Pay API.
  • From you API make a POST /order request to xMoney API and include the token info in transactionOption as shown bellow:
{
  "digitalWallet":{
    "walletType":"googlePay",
    "data": "insert your received json from google pay here (Base64 encoded)"
  }
}

If the shoper used a card that requires 3D secure authentication, before the payment can be completed, you receive a response with redirect instructions:

{
  "code": 201,
  "message": "Created",
  "data": {
    "orderId": 0,
    "transactionId": 0,
    "is3d": 1,
    "isRedirect": true,
    "redirect": {
      "url": "https://secure.xmoney.com/acs20...",
      "formMethod": "POST",
      "params": {
        "PaReq": "",
        "MD": "",
        "TermsUrl": ""
      }
    }
  }
}

Use the redirect information to redirect the shopper to another webview to complete the 3D secure authentication.

Otherwise proceed to presenting the payment result to your shopper.

Refer to our 3D Secure Overview for more on frictionless vs. challenge flows.

4. Test your integration

Follow this Integration Checkist Google and Test Your Integration.

5. Go live with Google Pay

Follow Google's instructions to request production access for your app. Choose the integration type Gateway when prompted, and provide screenshots of your app for review.


Testing and Going Live

Test Your Integration

Go Live.

  • Ensure your xMoney API keys are correct for production.
  • Test real transactions to confirm proper payment processing.

Additional Resources

By following these steps, you will have a functional Google Pay integration with Twispay/xMoney, offering customers a smooth and secure checkout experience.