Replies: 2 comments 10 replies
-
|
Did you also comply to: This is an issue coming from the Stripe sdk and normally means the config is wrong in some area. It also helps to ask stripe for support. |
Beta Was this translation helpful? Give feedback.
-
|
I also get this error Error Details |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true added in manifest
implementation 'com.google.android.gms:play-services-wallet:19.1.0' added in build.gradle
Future startGooglePay(String amount) async {
try {
final response = await createPaymentIntent(amount);
final clientSecret = response['client_secret'];
await Stripe.instance.initGooglePay(const GooglePayInitParams(
testEnv: true, merchantName: "Test", countryCode: 'us'));
const IsGooglePaySupportedParams(testEnv: true);
await Stripe.instance.presentGooglePay(
PresentGooglePayParams(clientSecret: clientSecret),
);
} catch (e) {
print('Gpay Error: $e');
}
}
createPaymentIntent(String amount) async {
try {
Map<String, dynamic> body = {
'amount': amount.toString(),
'currency': 'usd'
};
var response = await http.post(
Uri.parse('https://api.stripe.com/v1/payment_intents'),
body: body,
headers: {
'Authorization': 'Bearer $stripeSecretKey',
'Content-Type': 'application/x-www-form-urlencoded'
});
return jsonDecode(response.body);
} catch (err) {
print(err.toString());
}
Error Details
Gpay Error: StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: presentForPaymentIntent() may only be called when Google Pay is available on this device., message: presentForPaymentIntent() may only be called when Google Pay is available on this device., stripeErrorCode: null, declineCode: null, type: null)
New Text Document (2).txt
)
Beta Was this translation helpful? Give feedback.
All reactions