react-native-payments icon indicating copy to clipboard operation
react-native-payments copied to clipboard

Google/Android pay tray not opening

Open rajatgyl opened this issue 4 years ago • 3 comments

I am trying to integrate Apple/Google pay in an application, I was able to implement apple pay in the application but I am getting an error when I am doing it on android. I have attached a screen shot of the error.

const OPTIONS = { requestPayerName: true, requestShipping: false, };

const METHOD_DATA_ANDROID = [ { supportedMethods: ["android-pay"], data: { supportedNetworks: ["visa", "mastercard", "amex"], currencyCode: "AED", environment: "TEST", // defaults to production paymentMethodTokenizationParameters: { tokenizationType: "GATEWAY_TOKEN", parameters: { gateway: "stripe", gatewayMerchantId: "BOdoXP+9Aq473SnGwg3JU1aiNpsd9vH2ognq4PtDtlLGa3Kj8TPf+jaQNPyDSkh3JUhiS0KyrrlWhAgNZKHYF2Y=", }, }, }, }, ];

const payWithGoogle = () => { const paymentRequest = new PaymentRequest( METHOD_DATA_ANDROID, { id: "basic-example", displayItems: [ { label: "Movie Ticket", amount: { currency: "AED", value: "15.00" }, }, ], total: { label: "Merchant Name", amount: { currency: "AED", value: "15.00" }, }, }, OPTIONS ); console.log("request is ", paymentRequest); paymentRequest.canMakePayments().then((canMakePayment) => { if (canMakePayment) { console.log("Can Make Payment"); paymentRequest.show().then((paymentResponse) => { const { transactionIdentifier, paymentData, } = paymentResponse.details; console.log("paymentResponse ==> ", paymentResponse); console.log("transactionIdentifier ==> ", transactionIdentifier); console.log("paymentData ==> ", paymentData); paymentResponse.complete("success"); }); } else { console.log("Cant Not Make Payment"); } }); };

error_android_pay

rajatgyl avatar Jun 11 '21 11:06 rajatgyl

Try downgrading the play-services-wallet dependency in your build.gradle to 17.0.0

com.google.android.gms:play-services-wallet:17.0.0

BlagojeV93 avatar Jul 23 '21 17:07 BlagojeV93

Try downgrading the play-services-wallet dependency in your build.gradle to 17.0.0

com.google.android.gms:play-services-wallet:17.0.0

already try but still smae issue

Tanzeel-ur-rehman-git avatar Sep 02 '21 12:09 Tanzeel-ur-rehman-git

Try downgrading the play-services-wallet dependency in your build.gradle to 17.0.0 com.google.android.gms:play-services-wallet:17.0.0

already try but still smae issue did you find a solution ?

anis-18 avatar Dec 13 '21 13:12 anis-18