Search Overlay

Pass Decrypted Card Data

If you are a merchant or a partner and want to minimize PCI scope by avoiding direct handling of card data, you should use the standard integration with Paysafe and Google Pay. In this case, specify 'paysafe' as your gateway as explained in Google Pay's gateway parameter documentation. This will provide you with an encrypted card data payload, which only Paysafe can decrypt and use on your behalf.

However, if you are a large platform, an orchestrator, or a big merchant, you might choose to decrypt the Google Pay encrypted payload yourself. This way, you can access the clear card data and decide which processors/gateway to use to include that card data as part of a transaction request. If this is the case, see Google Pay's direct parameter documentation for more details. Keep in mind that this will bring you under full PCI scope, and you must adhere to PCI DSS requirements for processing and storing card data.

This page provides guidance on passing the decrypted Google Pay card payload to Paysafe in order to initiate a transaction request.

Steps to follow

Depending on the response from the Google Pay/Google Wallet service, you may receive PAN_ONLY card data or CRYPTOGRAM_3DS card data. The process for passing the decrypted data to Paysafe varies slightly according to the type of card data received.

To pass the decrypted card data payload to Paysafe:

  1. Retrieve the encrypted Google Pay payload that you received from Google.

  2. Remove the paymentMethodData.tokenizationData.token object from the payload.

  3. Insert a decryptedToken object inside the paymentMethodData.tokenizationData object.

  4. Fill the decryptedToken object with the decrypted card details you received from the payload.

    To understand the structure of the decrypted card data, refer to Google Pay's payment data cryptography documentation.

  5. Pass the modified Google Pay payload to the /singleusepaymenthandles endpoint in a googlePay.googlePayPaymentToken object:

    POST /paymenthub/v1/singleusepaymenthandles

{
"merchantRefNum": "04e9dfee-0929-49bb-921e-43b5541b261a",
"transactionType": "PAYMENT",
"amount": 123,
"currencyCode": "USD",
"accountId": "1002602570",
"googlePay": {
"googlePayPaymentToken": {
"apiVersionMinor": 0,
"apiVersion": 2,
"paymentMethodData": {
"description": "Visa•••• 2503",
"tokenizationData": {
"type": "PAYMENT_GATEWAY",
"decryptedToken": {
"paymentMethod": "CARD",
"paymentMethodDetails": {
"authMethod": "PAN_ONLY",
"pan": "4000000000002503",
"expirationMonth": 5,
"expirationYear": 2029
},
"messageId": "AH2EjteVmzuCDWRRE9MDbRH-DI3bVgpteaiids3oxwUfrzft3pBHnq6CThTQMXOnk7h9r6JG47fhUtIuzsKJnqrzaLmtCLehL89838brbXzzodeCpdR15LU",
"messageExpiration": 1728028957120,
}
},
"type": "CARD",
"info": {
"billingAddress": {
"address1": "5335 Gate Parkway",
"address2": "",
"address3": "",
"administrativeArea": "",
"countryCode": "US",
"locality": "Jacksonville",
"name": "John Doe",
"phoneNumber": "",
"postalCode": "32256",
"sortingCode": ""
},
"cardDetails": "2503",
"cardNetwork": "VISA"
}
}
}
},
"threeDs": {
"merchantUrl": "https://example.com",
"deviceChannel": "BROWSER",
"messageCategory": "PAYMENT",
"transactionIntent": "GOODS_OR_SERVICE_PURCHASE",
"authenticationPurpose": "PAYMENT_TRANSACTION"
},
"billingDetails": {
"nickName": "Home",
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"zip": "32256",
"country": "US",
"state": "FL"
},
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"paymentType": "CARD",
"returnLinks": [
{
"rel": "on_completed",
"href": "https://example.com/completed/",
"method": "GET"
},
{
"rel": "on_failed",
"href": "https://example.com/failed/",
"method": "GET"
},
{
"rel": "default",
"href": "https://example.com/default/",
"method": "GET"
}
]
}

{
"merchantRefNum": "{{$guid}}",
"transactionType": "PAYMENT",
"amount": 123,
"currencyCode": "USD",
"accountId": "1002602570",
"googlePay": {
"googlePayPaymentToken": {
"apiVersionMinor": 0,
"apiVersion": 2,
"paymentMethodData": {
"description": "Visa•••• 2503",
"tokenizationData": {
"type": "PAYMENT_GATEWAY",
"decryptedToken": {
"paymentMethod": "CARD",
"paymentMethodDetails": {
"authMethod": "CRYPTOGRAM_3DS",
"pan": "4053259650000003",
"expirationMonth": 5,
"expirationYear": 2029,
"cryptogram": "YwAAABDDEDqZemoRR24MgA2bHAA",
"eciIndicator": "05"
},
"messageId": "AH2EjteVmzuCDWRRE9MDbRH-DI3bVgpteaiids3fhsUfrzft3pBHnq6CThTTMXOnk7h9r6JG47fhUtIuzsKJnqrzaTmtCLehL89838brbXzzodeCpdR15LU",
"messageExpiration": 1728028957120
}
},
"type": "CARD",
"info": {
"billingAddress": {
"address1": "5335 Gate Parkway",
"address2": "",
"address3": "",
"administrativeArea": "",
"countryCode": "US",
"locality": "Jacksonville",
"name": "John Doe",
"phoneNumber": "",
"postalCode": "32256",
"sortingCode": ""
},
"cardDetails": "2503",
"cardNetwork": "VISA"
}
}
}
},
"threeDs": {
"merchantUrl": "https://example.com",
"deviceChannel": "BROWSER",
"messageCategory": "PAYMENT",
"transactionIntent": "GOODS_OR_SERVICE_PURCHASE",
"authenticationPurpose": "PAYMENT_TRANSACTION"
},
"billingDetails": {
"nickName": "Home",
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"zip": "32256",
"country": "US",
"state": "FL"
},
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"paymentType": "CARD",
"returnLinks": [
{
"rel": "on_completed",
"href": "https://example.com/completed/",
"method": "GET"
},
{
"rel": "on_failed",
"href": "https://example.com/failed/",
"method": "GET"
},
{
"rel": "default",
"href": "https://example.com/default/",
"method": "GET"
}
]
}
  1. You receive a payment handle in the response.

    NOTE:
    • If you have 3DS turned on and the card image is PAN_ONLY, you will receive a redirect link containing the 3DS challenge. You need to open the link in front of the consumer to resolve the challenge.
    • In cases where the authMethod is CRYPTOGRAM_3DS (instead of PAN_ONLY), you will not receive a 3DS challenge link even if 3DS is configured for your account. This is because a transaction made with CRYPTOGRAM_3DS card details is already considered to be an authenticated and SCA-compliant transaction, and does not require an additional 3DS challenge.

{
"id": "e3e2b639-1cb2-47fa-b827-9aee51c82cce",
"accountId": "1002602570",
"paymentType": "CARD",
"paymentHandleToken": "GpRTROIjdphByTy",
"merchantRefNum": "a2cf78b2-531e-4c78-a819-e990255d1efb",
"currencyCode": "USD",
"txnTime": "2024-10-04T10:54:55Z",
"billingDetails": {
"nickName": "Home",
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"zip": "32256",
"state": "FL",
"country": "US"
},
"customerIp": "87.120.141.76",
"status": "INITIATED",
"links": [
{
"method": "GET",
"rel": "redirect_payment",
"href": "https://hosted.test.paysafe.com/cardadapter/v1/authentication/app/index.html?id=e3e2b639-1cb2-47fa-b827-9aee51c82cce"
}
],
"amount": 123,
"action": "REDIRECT",
"usage": "SINGLE_USE",
"timeToLiveSeconds": 899,
"transactionType": "PAYMENT",
"executionMode": "SYNCHRONOUS",
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"card": {
"holderName": "John Doe",
"status": "ACTIVE",
"cardType": "VI",
"cardBin": "400000",
"lastDigits": "2503",
"cardCategory": "DEBIT"
},
"googlePay": {
"googlePayPaymentToken": {
"paymentMethodData": {
"description": "Visa•••• 2503",
"type": "CARD",
"info": {
"cardNetwork": "VISA",
"cardDetails": "2503",
"billingAddress": {
"countryCode": "US",
"address1": "5335 Gate Parkway",
"postalCode": "32256",
"name": "John Doe",
"locality": "Jacksonville"
}
}
}
"paymentMethod": "CARD_ON_FILE",
"messageId": "AH2EjteVmzuCDWRRE9MDbRH-DI3bVgpteaiids3oxwUfrzft3pBHnq6CThTQMXOnk7h9r6JG47fhUtIuzsKJnqrzaLmtCLehL89838brbXzzodeCpdR15LU",
"messageExpiration": "1728028957120"
}
},
"returnLinks": [
{
"method": "GET",
"rel": "on_completed",
"href": "https://example.com/completed/"
},
{
"method": "GET",
"rel": "on_failed",
"href": "https://example.com/failed/"
},
{
"method": "GET",
"rel": "default",
"href": "https://example.com/default/"
}
],
"skip3ds": false,
"threeDs": {
"merchantUrl": "https://example.com",
"deviceChannel": "BROWSER",
"messageCategory": "PAYMENT",
"transactionIntent": "GOODS_OR_SERVICE_PURCHASE",
"authenticationPurpose": "PAYMENT_TRANSACTION"
}
}

{
"id": "d10c5ea5-3bf8-4517-b05a-2a7e02a4b613",
"accountId": "1002602570",
"paymentType": "CARD",
"paymentHandleToken": "G1dmWemnXiVuD6r",
"merchantRefNum": "1d2b911b-952e-46c9-8180-77518eb1c139",
"currencyCode": "USD",
"txnTime": "2024-10-04T12:46:23Z",
"billingDetails": {
"nickName": "Home",
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"zip": "32256",
"state": "FL",
"country": "US"
},
"customerIp": "87.120.141.76",
"status": "PAYABLE",
"amount": 123,
"action": "NONE",
"usage": "SINGLE_USE",
"timeToLiveSeconds": 899,
"transactionType": "PAYMENT",
"executionMode": "SYNCHRONOUS",
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"card": {
"holderName": "John Doe",
"status": "ACTIVE",
"cardType": "VI",
"cardBin": "405325",
"lastDigits": "0003",
"cardCategory": "CREDIT"
},
"googlePay": {
"googlePayPaymentToken": {
"paymentMethodData": {
"description": "Visa•••• 2503",
"type": "CARD",
"info": {
"cardNetwork": "VISA",
"cardDetails": "2503",
"billingAddress": {
"countryCode": "US",
"address1": "5335 Gate Parkway",
"postalCode": "32256",
"name": "John Doe",
"locality": "Jacksonville"
}
}
}
"paymentMethod": "TOKENIZED_CARD",
"messageId": "AH2EjteVmzuCDWRRE9MDbRH-DI3bVgpteaiids3fhsUfrzft3pBHnq6CThTTMXOnk7h9r6JG47fhUtIuzsKJnqrzaTmtCLehL89838brbXzzodeCpdR15LU",
"messageExpiration": "1728028957120"
}
},
"returnLinks": [
{
"method": "GET",
"rel": "on_completed",
"href": "https://example.com/completed/"
},
{
"method": "GET",
"rel": "on_failed",
"href": "https://example.com/failed/"
},
{
"method": "GET",
"rel": "default",
"href": "https://example.com/default/"
}
],
"skip3ds": false,
"threeDs": {
"merchantUrl": "https://example.com",
"deviceChannel": "BROWSER",
"messageCategory": "PAYMENT",
"transactionIntent": "GOODS_OR_SERVICE_PURCHASE",
"authenticationPurpose": "PAYMENT_TRANSACTION"
}
}

  1. Once the challenge is successfully resolved (i.e. either the 'success' url is hit or you receive a webhook, depending on your integration), the payment handle status changes to PAYABLE.

    Pass the payment handle to the /paymenthub/v1/payments endpoint to complete the payment:

    POST /paymenthub/v1/payments

{
"merchantRefNum": "65ee2b64-11e9-4fb9-9754-d7976300baec",
"amount": 123,
"currencyCode": "USD",
"dupCheck": true,
"settleWithAuth": true,
"paymentHandleToken": "GpRTROIjdphByTy",
}

{
"merchantRefNum": "c25f7f5a-a4d6-4cf7-a50e-0696699561a0",
"amount": 123,
"currencyCode": "USD",
"dupCheck": true,
"settleWithAuth": true,
"paymentHandleToken": "G1dmWemnXiVuD6r"
}
  1. The expected response for a successful transaction looks like the following:

{
"id": "12aec8b6-32e3-4de1-9ea2-5cbb1ccd208a",
"paymentType": "CARD",
"paymentHandleToken": "Gr6gxe91M2WR21R",
"merchantRefNum": "627b495d-c14d-4e60-8b70-73e5b29cc824",
"currencyCode": "USD",
"settleWithAuth": true,
"txnTime": "2024-10-04T10:54:59Z",
"billingDetails": {
"nickName": "Home",
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"zip": "32256",
"state": "FL",
"country": "US"
},
"status": "COMPLETED",
"amount": 123,
"preAuth": false,
"availableToSettle": 0,
"gatewayResponse": {
"authCode": "110062",
"avsResponse": "MATCH",
"cvvVerification": "NOT_PROCESSED",
"serializable": true
},
"settlements": [
{
"merchantRefNum": "627b495d-c14d-4e60-8b70-73e5b29cc824",
"amount": 123,
"id": "12aec8b6-32e3-4de1-9ea2-5cbb1ccd208a",
"availableToRefund": 123,
"txnTime": 1728039299000,
"status": "PENDING"
}
],
"authentication": {
"id": "f4112f8a-087b-4666-b82d-b27d382416f5",
"eci": "5",
"cavv": "AAIBBYNoEwAAACcKhAJkdQAAAAA=",
"status": "COMPLETED",
"threeDResult": "Y",
"threeDSecureVersion": "2.2.0",
"directoryServerTransactionId": "473917b9-518e-469c-854b-0a56dd30f897"
},
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"card": {
"cardExpiry": {
"month": "5",
"year": "2029"
},
"holderName": "John Doe",
"status": "ACTIVE",
"cardType": "VI",
"cardBin": "400000",
"lastDigits": "2503",
"cardCategory": "DEBIT"
}
}

{
"id": "8ad570c8-3295-4a1b-82a9-c54808ad2fdb",
"paymentType": "CARD",
"paymentHandleToken": "G1dmWemnXiVuD6r",
"merchantRefNum": "cff77062-5d55-46b7-a525-70e2c5a32c57",
"currencyCode": "USD",
"settleWithAuth": true,
"txnTime": "2024-10-04T12:47:54Z",
"billingDetails": {
"nickName": "Home",
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"zip": "32256",
"state": "FL",
"country": "US"
},
"status": "COMPLETED",
"amount": 123,
"preAuth": false,
"availableToSettle": 0,
"gatewayResponse": {
"authCode": "110069",
"avsResponse": "MATCH",
"cvvVerification": "NOT_PROCESSED",
"serializable": true
},
"settlements": [
{
"merchantRefNum": "cff77062-5d55-46b7-a525-70e2c5a32c57",
"amount": 123,
"id": "8ad570c8-3295-4a1b-82a9-c54808ad2fdb",
"availableToRefund": 123,
"txnTime": 1728046074000,
"status": "PENDING"
}
],
"authentication": {
"eci": "5"
},
"profile": {
"locale": "en",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"card": {
"cardExpiry": {
"month": "5",
"year": "2029"
},
"holderName": "John Doe",
"status": "ACTIVE",
"cardType": "VI",
"cardBin": "405325",
"lastDigits": "0003",
"cardCategory": "CREDIT"
}
}

For a complete list of the test card numbers and eci indicators that you can use in our TEST environment, see Test Cards.

On this Page