> For the complete documentation index, see [llms.txt](https://intella2.gitbook.io/scan2pay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intella2.gitbook.io/scan2pay/appendix/google-pay-tm-developer-guide-integrating-with-scan2pay-olpay.md).

# Google Pay™ Developer Guide (Integrating with Scan2Pay OLPay)

### Overview

Scan2Pay OLPay supports Google Pay through a hosted checkout integration. After a merchant creates a Scan2Pay OLPay order, Scan2Pay returns a payment URL in `urlToken`. The customer opens the URL and selects Google Pay or another enabled payment method on the Scan2Pay payment page to complete the payment.

The Google Pay button, payment sheet, payment data encryption, token verification and decryption, and subsequent transaction processing are handled by intella through Scan2Pay OLPay.

> The availability of Google Pay is determined by Scan2Pay based on the merchant's enablement status, the customer's device and browser, their Google Account, and their eligible payment methods.

### Google Policies

Merchants offering Google Pay through Scan2Pay OLPay must comply with:

* [Google Pay API Terms of Service](https://payments.developers.google.com/terms/sellertos)
* [Google Pay API Acceptable Use Policy](https://payments.developers.google.com/terms/aup)

The Google Pay button and brand assets displayed on the Scan2Pay OLPay payment page are managed by intella in accordance with the [Google Pay Web Brand Guidelines](https://developers.google.com/pay/api/web/guides/brand-guidelines). Merchants must not extract, modify, or reproduce the Google Pay button or brand assets displayed on the Scan2Pay payment page.

For additional information, see:

* [Google Pay Web developer documentation](https://developers.google.com/pay/api/web/overview)
* [Google Pay Web integration checklist](https://developers.google.com/pay/api/web/guides/test-and-deploy/integration-checklist)

### Supported Configuration

| Item                             | Supported configuration                                                                                                           |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Integration type                 | Scan2Pay OLPay (hosted checkout)                                                                                                  |
| Scan2Pay ServiceType             | `OLPay`                                                                                                                           |
| Platform                         | Web hosted checkout; Google Pay is available only in Android environments that can provide Google Wallet device token credentials |
| Transaction currency             | TWD                                                                                                                               |
| Acquiring country/region         | Taiwan                                                                                                                            |
| Supported card networks          | Visa, Mastercard, and JCB<sup>Note 1</sup>                                                                                        |
| Google Pay authentication method | `CRYPTOGRAM_3DS` (Google Wallet)                                                                                                  |
| Refunds                          | Full refunds are supported; partial refunds are currently unavailable                                                             |

Scan2Pay accepts only `CRYPTOGRAM_3DS` device token credentials returned by Google Wallet. These credentials contain a 3-D Secure cryptogram generated on the device. Scan2Pay does not support `PAN_ONLY`. `PAN_ONLY` is associated with funding primary account number (FPAN) credentials for payment cards stored in the user's Google Account; it does not mean that card numbers are transmitted in plaintext. Device token and cryptogram verification and transaction processing are handled by intella. Merchants do not need to integrate a separate 3-D Secure flow.<sup>Note 2</sup>

### Integration Flow

1. The merchant contacts intella to apply for the Scan2Pay API and Google Pay payment service.
2. The merchant creates a transaction through the Scan2Pay `OLPay` API.
3. Scan2Pay returns the OLPay payment URL in `urlToken`.
4. The merchant redirects the customer to `urlToken` or converts the URL into a QR code for the customer to scan.
5. The customer selects Google Pay on the Scan2Pay OLPay payment page.
6. Scan2Pay displays the Google Pay button and payment sheet.
7. After the customer confirms the payment, Scan2Pay verifies and decrypts the token and processes the transaction.
8. The merchant obtains the final transaction result through a transaction result notification or a single-order inquiry.

```
Merchant system
   │  Create an OLPay order
   ▼
Scan2Pay API
   │  Return urlToken
   ▼
Scan2Pay OLPay payment page
   │  Customer selects Google Pay
   │  intella processes the Google Pay token and transaction
   ▼
Transaction result notification / Single-order inquiry
```

### Application and Required Information

Contact an intella sales representative to apply for Google Pay and obtain:

* A Scan2Pay test merchant account (`MchId`)
* Scan2Pay test and production API domains
* The Scan2Pay API RSA public key and AES IV
* The Scan2Pay transaction password
* Test and production merchant configurations with Google Pay enabled

### Create a Scan2Pay OLPay Order

Google Pay and other Scan2Pay payment methods share the `OLPay` API. For request fields, data encryption, API endpoints, response formats, and complete examples, see the [Customer Scan (OLPay) specification](https://intella2.gitbook.io/scan2pay/api-specification/customer-scan).

After the merchant creates an order according to the Customer Scan specification, Scan2Pay returns the OLPay payment URL in `Data.urlToken`. Google Pay configuration and token processing are handled by Scan2Pay.

### Open the Scan2Pay OLPay Payment Page

The merchant may redirect the customer to `urlToken`, open it in a new window, or convert it into a QR code. Redirecting the customer directly to the Scan2Pay OLPay payment page or displaying a QR code is recommended.

Merchants must not:

* Modify the Scan2Pay OLPay payment page
* Hide, obscure, or alter the Google Pay button
* Reproduce a Google Pay button outside the Scan2Pay OLPay payment page without invoking the Google Pay API
* Provide a payment URL to a customer or transaction unrelated to the original order

### Transaction Results and Post-Transaction Operations

Transaction results, signature verification, inquiries, and refunds follow the existing Scan2Pay specifications:

* [Transaction result notification](https://intella2.gitbook.io/scan2pay/api-callback)
* [Single-order inquiry](https://intella2.gitbook.io/scan2pay/api-specification/single-order-query)
* [Refund](https://intella2.gitbook.io/scan2pay/api-specification/refund)

### Technical Support

For questions about Scan2Pay accounts, the OLPay payment page, Google Pay availability, APIs, transaction processing, or test data, contact an intella sales or technical support representative.

***

<sup>Note 1</sup> JCB availability depends on the card issuer, card type, and Google Wallet support status. See [Supported payment methods in Taiwan for Google Wallet](https://support.google.com/wallet/answer/12059326?co=GENIE.CountryCode%3DTW\&hl=en-G).

<sup>Note 2</sup> Merchants must continue to apply appropriate order, account, fulfillment, and other risk controls based on their business requirements. Google Pay validation does not replace the merchant's or Scan2Pay's existing risk controls.
