naoufal/react-native-payments

Google Pay paymentToken always null

GFean opened this issue · 3 comments

GFean commented

I'm trying to implement google pay. Everything seems fine, the payment goes through, but the paymentToken contains this kind of object :
{\"error\":{\"message\":\"Record not found\"},\"fieldErrors\":[]}

Any help please ?

hello please can you tell me if it work with you ?

I'm trying to implement google pay. Everything seems fine, the payment goes through, but the paymentToken contains this kind of object :
{\"error\":{\"message\":\"Record not found\"},\"fieldErrors\":[]}

Any help please ?

Screenshot 2021-09-02 at 6 05 48 PM

can you please help me out how you open the google play payment console I am getting this error and in your case people suggest this

const ANDROID_METHOD_DATA = [
  {
    supportedMethods: ['android-pay'],
    data: {
      supportedNetworks: ['visa', 'mastercard', 'amex'],
      currencyCode: 'USD',
      environment: 'TEST', // defaults to production
      paymentMethodTokenizationParameters: {
        // tokenizationType: "GATEWAY_TOKEN",
        tokenizationType: 'NETWORK_TOKEN',
        parameters: {
          publicKey:'pk_test_51I5wapmXmOyoqYiJvT9QU00JMWuQtpg'
          // gateway: "stripe",
          // 'stripe:publishableKey':
          //   'pk_test_51SjonY7g500rYY0D6YE',
            
        },
      },
    },
  },
];
  sendPaymentToServer(paymentResponse) {
        window.setTimeout(function() {
            console.log('...sendPaymentToServer(paymentResponse)');
                   // const { getPaymentToken } = paymentResponse.details;
            const token =Platform.OS == 'ios' ? paymentResponse.details.paymentToken : paymentResponse.details.getPaymentToken().then(console.log);
            // let token = paymentResponse.details.getPaymentToken().then(console.log);
            console.log('TOKEN: ', token);
            console.log('Payment Detail',paymentResponse);
        }, 2000);
        paymentResponse.complete('success');
    }

I'm trying to implement google pay. Everything seems fine, the payment goes through, but the paymentToken contains this kind of object :
{\"error\":{\"message\":\"Record not found\"},\"fieldErrors\":[]}
Any help please ?

Screenshot 2021-09-02 at 6 05 48 PM

can you please help me out how you open the google play payment console I am getting this error and in your case people suggest this

const ANDROID_METHOD_DATA = [
  {
    supportedMethods: ['android-pay'],
    data: {
      supportedNetworks: ['visa', 'mastercard', 'amex'],
      currencyCode: 'USD',
      environment: 'TEST', // defaults to production
      paymentMethodTokenizationParameters: {
        // tokenizationType: "GATEWAY_TOKEN",
        tokenizationType: 'NETWORK_TOKEN',
        parameters: {
          publicKey:'pk_test_51I5wapmXmOyoqYiJvT9QU00JMWuQtpg'
          // gateway: "stripe",
          // 'stripe:publishableKey':
          //   'pk_test_51SjonY7g500rYY0D6YE',
            
        },
      },
    },
  },
];
  sendPaymentToServer(paymentResponse) {
        window.setTimeout(function() {
            console.log('...sendPaymentToServer(paymentResponse)');
                   // const { getPaymentToken } = paymentResponse.details;
            const token =Platform.OS == 'ios' ? paymentResponse.details.paymentToken : paymentResponse.details.getPaymentToken().then(console.log);
            // let token = paymentResponse.details.getPaymentToken().then(console.log);
            console.log('TOKEN: ', token);
            console.log('Payment Detail',paymentResponse);
        }, 2000);
        paymentResponse.complete('success');
    }

@Tanzeel-ur-rehman-git
hey, did you solve this issue? how?