Android: The merchant is not enabled for google pay
See original GitHub issueBefore I have submitted the issue
[x] I have read an installation guide
[x] I have read a linking guide and checked that everything is OK like in manual linking guide
[x] I know that before using tipsi-stripe
I need to set options for my app as described in usage guide
The problem
Trying to open Google Pay in release version fails with the message ‘The merchant is not enabled for Google Pay’. In dev mode everything works fine.
I downloaded the release version directly from an apk file, NOT via the Play Store, so that might be the problem.
Otherwise, I guess I have to add the merchantId
somewhere in my code, but the docs don’t mention anything.
Environment
tipsi-stripe
version: 7.5.0- Last
tipsi-stripe
version where the issue was not reproduced (if applicable): N/A - iOS or Android: Android
- OS version: 6.0.0
- React-Native version: 0.59.9
- (Android only)
com.google.firebase:firebase-core
version: 16.0.6 - (Android only)
com.google.android.gms:play-services-base
version: 16.0.1
For Android
, please provide the following sections from android/app/build.gradle
:
- android.compileSdkVersion 28
- android.buildToolsVersion 28.0.3
- android.defaultConfig.minSdkVersion 19
- android.defaultConfig.targetSdkVersion 28
- android.defaultConfig.multiDexEnabled true
Screenshot
Code To Reproduce Issue (Good To Have)
Please remember that with sample code it’s easier to reproduce the bug and it’s much faster to fix it.
This is how I set stripe options:
stripe.setOptions({
publishableKey: AppConfig.STRIPE_PUBLIC_KEY,
merchantId: Platform.OS === 'ios' ? AppConfig.APPLE_PAY_MERCHANT_ID : AppConfig.GOOGLE_PAY_MERCHANT_ID,
androidPayMode: __DEV__ ? 'test' : 'production',
})
This is how I the function I use to request payment:
const requestPay = async () => {
try {
const items = [{
label: `Some item`,
amount: `10.00`,
}]
const options = Platform.select({
ios: {
currencyCode: 'EUR',
countryCode: 'de',
shippingType: 'store_pickup',
},
android: {
total_price: `${amountToPay}`,
currency_code: 'EUR',
line_items: [],
},
})
const token = await stripe.paymentRequestWithNativePay(options, items)
await stripe.completeNativePayRequest()
handleNativePayment({
...token,
paymentType: Platform.OS === 'ios' ? 'native-apple-pay' : 'native-google-pay',
})
} catch (error) {
console.log('Error requesting native pay:', error)
stripe.cancelNativePayRequest()
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (5 by maintainers)
Top GitHub Comments
@zeromaro I had the same query, I checked this------> link, and focused on the part
Check the returned error details for more information.
In my error Log, I found:-GPay payWithGpay error:----> loadPaymentData failed. Error code: 405
There are many reasons as to why this error can occur, to find them :- Make sure that your device is connected to System and the system has adb installed. Then:- in your terminal, type:-adb -d logcat -s WalletMerchantError
, and then in the log search forError in loadPaymentData
I gotSigning key fingerprints {*******} do not match our records for this app.
which means that i had to use the signed apk, notreact-native run-android
. you can find your error-----> hereThe error goes away once the Google Payment API team accepted our request. Thanks @cybergrind for better docs 😃 Closing this issue.