Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This merchant is having trouble accepting your payment right now. Try using a different payment method. [OR_BIBED_06] #287

Open
Usama9999 opened this issue Jan 2, 2025 · 4 comments

Comments

@Usama9999
Copy link

My Code:

pay.GooglePayButton(
paymentConfiguration: pay.PaymentConfiguration.fromJsonString('''{
"provider": "google_pay",
"data": {
"environment": "TEST",
"apiVersion": 2,
"apiVersionMinor": 0,
"allowedPaymentMethods": [{
"type": "CARD",
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "stripe",
"stripe:version": "2022-11-15",
"stripe:publishableKey": "pk_test_..."
}
},
"parameters": {
"allowedCardNetworks": ["VISA", "MASTERCARD"],
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"billingAddressRequired": true,
"billingAddressParameters": {
"format": "FULL",
"phoneNumberRequired": true
}
}
}],
"merchantInfo": {
"merchantId": "BR.....",
"merchantName": "E....."
},
"transactionInfo": {
"countryCode": "US",
"currencyCode": "USD"
}
}
}'''),
paymentItems: [
pay.PaymentItem(
amount: (int.parse(controller.amount ?? '0') +
(int.parse(controller.amount ?? '0') *
(controller.paymentMethodModel?.eureecaFee ?? 0)))
.floor()
.toString(),
type: pay.PaymentItemType.total,
label: 'Add money into Eureeca wallet')
],
width: double.infinity,
height: 48,
type: pay.GooglePayButtonType.pay,
cornerRadius: 4,
margin: const EdgeInsets.only(top: 15.0),
onPaymentResult: (paymentResult) async {
TokenData token =
await Stripe.instance.createApplePayToken(paymentResult);

        final params = PaymentMethodParams.cardFromToken(
            paymentMethodData: PaymentMethodDataCardFromToken(
          token: token.id,
          billingDetails: BillingDetails(
            phone: controller.phone.text,
            email: LocalStorageProvider.instance.getUser()?.email ?? "",
            name: controller.name.text,
          ),
        ));

        PaymentMethod paymentMode =
            await Stripe.instance.createPaymentMethod(params: params);

        controller.confirmStripePayment(paymentMode, null);
      },
      loadingIndicator: const Center(
        child: CircularProgressIndicator(),
      ),
    ),
    
    Can some one please help me what's wrong here?
    Thanks
@JlUgia
Copy link
Member

JlUgia commented Jan 13, 2025

Good day @Usama9999, I've tried your configuration with a valid pk_test_ key and it works for me.
Double check your publishable key and see if you get a result.

@Usama9999
Copy link
Author

@JlUgia I used the same key in a Kotline project, which works for me. So I am using native code to use google pay.

@JlUgia
Copy link
Member

JlUgia commented Jan 13, 2025

What error(s) do you see when you filter for the WalletMerchantError tag in the logcat? – adb logcat -s WalletMerchantError

@dmengelt
Copy link
Member

@Usama9999 I dropped you an note on X. please tell us your email address you are using when testing Google Pay.

You can also join our Discord channel and drop your email address there: https://goo.gle/payments-dev-community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@JlUgia @dmengelt @Usama9999 and others