Search code examples
angulartransactionsgoogle-pay

Your request failed. Use a different payment method, or contact us. Learn more [OR-CCSEH-21] in Google Pay


I need to test google pay with fake card. But as I insert card details Your request failed. Use a different payment method, or contact us. Learn more [OR-CCSEH-21] this error occurs. Here is my code in Angular. I am using these fake cards from following[link]https://developers.google.com/pay/api/android/guides/resources/sample-tokens

paymentRequest: google.payments.api.PaymentDataRequest = {
        apiVersion: 2,
        apiVersionMinor: 0,
        allowedPaymentMethods: [
          {
            type: 'CARD',
            parameters: {
              allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
              allowedCardNetworks: ['AMEX', 'VISA', 'MASTERCARD']
            },
            tokenizationSpecification: {
              type: 'PAYMENT_GATEWAY',
              parameters: {
                gateway: 'moneris',
                gatewayMerchantId: 'monca05217',
                
              }
            }
          }
        ],
        merchantInfo: {
          merchantId: '12345678901234567890',
          merchantName: 'Demo Merchant',
        },
        transactionInfo: {
          totalPriceStatus: 'FINAL',
          totalPriceLabel: 'Total',
          totalPrice: '0.10',
          currencyCode: 'EUR',
          countryCode: 'BE'
        },
        callbackIntents: ['PAYMENT_AUTHORIZATION']
      };
    
      onLoadPaymentData = (
        event: Event
      ): void => {
        const eventDetail = event as CustomEvent<google.payments.api.PaymentData>;
        console.log('load payment data', eventDetail.detail);
      }
    
      onPaymentDataAuthorized: google.payments.api.PaymentAuthorizedHandler = (
        paymentData
        ) => {
          console.log('payment authorized', paymentData);
          return {
            transactionState: 'SUCCESS'
          };
        }
    
      onError = (event: ErrorEvent): void => {
        console.error('error', event.error);
      }

Solution

  • To test Google Pay in a sandbox mode. Please try the following

    1. Create a new Gmail account for testing purposes
    2. Using the newly created Gmail account and join the google groups https://groups.google.com/g/googlepay-test-mode-stub-data.
    3. All the required test cards will be added to your Gmail account.
    4. For the testing of Google Pay, use the newly created Gmail account.

    More details can be found here: https://developers.google.com/pay/api/android/guides/resources/test-card-suite

    I am not very sure of your use case but I hope this helps.