You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error while saving payment
PlatformException(Failed, There was an unexpected error -- try again in a few seconds, null, null)
#0 JSONMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:155:7) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
I implement the card register like it is on the example enter (card number, expiry date, and CVC) and on saving, it shows this message on the log and looks at how the result appears at this video,
https://user-images.githubusercontent.com/29921959/122156864-d8c14500-ce37-11eb-841c-c338d288e511.mov
`static Future handlePayPress(BuildContext context,CardFieldInputDetails _card, String _email) async {
if (_card == null) {
return null;
}
setSettings();
try {
// 1. Create setup intent on backend
final clientSecret = await _createSetupIntentOnBackend(context,_email);
print("SECRET==================== $clientSecret");
// 3. Confirm setup intent
final setupIntentResult = await Stripe.instance.confirmSetupIntent(clientSecret, PaymentMethodParams.card(setupFutureUsage: PaymentIntentsFutureUsage.OffSession));
log('Setup Intent created $setupIntentResult');
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Success: Setup intent created. Intent status: $setupIntentResult',
),
),
);
return setupIntentResult;
} catch (error, s) {
log('Error while saving payment', error: error, stackTrace: s);
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text('Error code: $error')));
}
}`
The text was updated successfully, but these errors were encountered: