Search code examples
kotlinpayment-gatewaygoogle-pay

we couldn't complete this action. Try a different payment method or contact us. [OR_CCREU_02]


I implement google pay from google pay docs and when i am testing it in test environment i am getting an error

"we couldn't complete this action. Try a different payment method or contact us. [OR_CCREU_02]"

i spend almost 4 days to resolving this error but nothing helps for me. Anyone have any idea how to resolve this error and test google pay transaction for Test Environment

image 1 this is my json:

{
    "apiVersion": 2,
    "apiVersionMinor": 0,
    "allowedPaymentMethods": [
        {
            "type": "CARD",
            "parameters": {
                "allowedAuthMethods": [
                    "PAN_ONLY",
                    "CRYPTOGRAM_3DS"
                ],
                "allowedCardNetworks": [
                    "AMEX",
                    "DISCOVER",
                    "JCB",
                    "MASTERCARD",
                    "VISA"
                ],
                "billingAddressRequired": true,
                "billingAddressParameters": {
                    "format": "FULL"
                }
            },
            "tokenizationSpecification": {
                "type": "PAYMENT_GATEWAY",
                "parameters": {
                    "gateway": "example",
                    "gatewayMerchantId": "DCR2DFGGHP7EJS"
                }
            }
        }
    ],
    "transactionInfo": {
        "totalPrice": "1000",
        "totalPriceStatus": "FINAL",
        "countryCode": "US",
        "currencyCode": "USD"
    },
    "merchantInfo": {
        "merchantName": "example"
    },
    "shippingAddressParameters": {
        "phoneNumberRequired": false,
        "allowedCountryCodes": [
            "US",
            "GB"
        ]
    },
    "shippingAddressRequired": true
}

i followed the google docs but nothing help for me

Edited

image3

image 4

image5


Solution

  • The first image shows the "add card" screen. You are trying to add a new test card. This won't work and results in OR_CCREU_02. In order for the Google Pay sheet to show test cards when using the test environment you have to join this Google group: https://groups.google.com/forum/#!forum/googlepay-test-mode-stub-data

    After joining the group, trigger a payment in test env with the same Google account you used to join the group. Now the Google Pay sheet should show all the test cards the PSP supports:

    Google Pay payment sheet

    Update:

    For Braintree use a gateway configration similar to:

    new JSONObject() {{
      put("type", "PAYMENT_GATEWAY");
      put("parameters", new JSONObject() {{
        put("gateway", "braintree");
        put("braintree:apiVersion", "v1");
        put("braintree:sdkVersion", "braintree.client.3.40.0");
        put("braintree:merchantId", "your_merchant_id");
        put("braintree:clientKey", "your_client_key");
      }});
    }};