# Check Google Pay PAN_ONLY token

> Check whether a Google Pay token is PAN_ONLY and needs a CVC before creating the direct transaction when you collect the CVC yourself.

```yaml
openapi: 3.1.0
info:
  title: Check Google Pay PAN_ONLY token
  version: 1.0.0
  description: Check whether a Google Pay token is PAN_ONLY and needs a CVC before
    creating the direct transaction when you collect the CVC yourself.
paths:
  /txn/apiCheckGooglePay:
    post:
      summary: Check Google Pay PAN_ONLY token
      description: Check whether a Google Pay token is PAN_ONLY and needs a CVC before
        creating the direct transaction when you collect the CVC yourself.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Merchant number assigned by Onerway. See
                    [Setup](/payments/get-started/setup#retrieve-your-credentials)
                    for how to obtain it.
                appId:
                  type: string
                  description: Application or site identifier assigned by Onerway. It identifies
                    the merchant application that shows the Google Pay button.
                merchantTxnId:
                  type: string
                  description: Merchant transaction ID of the order that this Google Pay token
                    will pay for.
                  x-onerway-constraints:
                    - kind: consistency
                      text: Use the same value as `merchantTxnId` in the [Create direct
                        transaction](/payments/api-reference/endpoints/direct-create-transaction)
                        request that follows this check.
                gatewayName:
                  type: string
                  description: Google Pay gateway identifier. Use the `gatewayName` returned for
                    the `GooglePay` record by [List available payment
                    methods](/payments/api-reference/endpoints/list-available-payment-methods).
                tokenInfoJson:
                  type: string
                  description: Google Pay token to check, in the same structure as `tokenInfo` of
                    Create direct transaction.
                  contentMediaType: application/json
                  contentSchema:
                    type: object
                    properties:
                      provider:
                        type: string
                        description: Wallet token provider.
                        enum:
                          - GooglePay
                        x-enum-descriptions:
                          GooglePay: Google Pay wallet.
                      tokenId:
                        type: string
                        description: Encrypted payment token returned by the Google Pay JS SDK in
                          `paymentMethodData.tokenizationData.token`; pass it
                          through unchanged.
                    required:
                      - provider
                      - tokenId
                  x-onerway-constraints:
                    - kind: consistency
                      text: Submit the same encrypted token in `tokenInfo` of the Create direct
                        transaction request that follows; do not request a new
                        token from Google Pay between the check and the payment.
                  x-onerway-format: json_string
                sign:
                  type: string
                  description: Request signature string. See [Request
                    signing](/payments/get-started/request-signing) for how to
                    generate it.
              required:
                - merchantNo
                - appId
                - merchantTxnId
                - gatewayName
                - tokenInfoJson
                - sign
            examples:
              check-google-pay-pan-only:
                summary: Check Google Pay PAN_ONLY token
                value:
                  merchantNo: replace_with_merchant_no
                  appId: replace_with_app_id
                  merchantTxnId: txn_demo_google_pay_202609090001
                  gatewayName: replace_with_gateway_name
                  tokenInfoJson: '{"provider":"GooglePay","tokenId":"{{GOOGLE-PAY-TOKEN}}"}'
                  sign: "{{SIGN}}"
      responses:
        "200":
          description: PAN_ONLY token, CVC required
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Response code returned by Onerway. `20000` means the token was
                      checked; other values indicate failure. See [Response
                      codes](/payments/api-reference/response-codes).
                  respMsg:
                    type: string
                    description: Human-readable message for the response code.
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      cardNum:
                        type: string
                        description: Masked card number extracted from the token, keeping only the first
                          6 and last 4 digits, for display on your CVC
                          collection page.
                      checkResult:
                        type: boolean
                        description: "Authentication method of the token: `true` for `CRYPTOGRAM_3DS`,
                          which already carries 3DS credentials; `false` for
                          `PAN_ONLY`, which needs the CVC before it can be
                          charged."
                        x-onerway-constraints:
                          - kind: rule
                            text: When `checkResult=false`, collect the CVC from the customer and submit it
                              in `cardInfo.cvv` with the same `tokenInfo` when
                              creating the direct transaction. Alternatively,
                              submit the same `tokenInfo` without
                              `cardInfo.cvv`; the transaction response contains
                              `data.status=R` and `data.redirectUrl`. Redirect
                              the customer to `data.redirectUrl` to enter the
                              CVC on the Onerway-hosted page.
                          - kind: rule
                            text: When `checkResult=true`, create the direct transaction with the same
                              `tokenInfo`; `cardInfo` is not required.
                    description: Check result for the submitted Google Pay token.
                    x-onerway-value:
                      nullable: true
                      when:
                        en: Has a value only when `respCode=20000`.
                        zh: 仅当 `respCode=20000` 时有值。
              examples:
                pan-only:
                  summary: PAN_ONLY token, CVC required
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      cardNum: 411111******1111
                      checkResult: false
                cryptogram-3ds:
                  summary: CRYPTOGRAM_3DS token, no CVC required
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      cardNum: 411111******1111
                      checkResult: true
```
