-
-
Notifications
You must be signed in to change notification settings - Fork 648
Card details not Complete on Andriod #2005
Copy link
Copy link
Closed
Description
Describe the bug
Creating Payment Method from Card on Andriod throws "Card details not complete". The below code works perfect on ios. I get the card details from the customer using card form field and then create payment method and then confirm payment method, it throws exception "incomplete card details" on the andriod.
To Reproduce
Steps to reproduce the behavior:
- Use CardFormField and enter any testing card number
- Create Payment Method from the card
- StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: Card details not complete, message: Card details not complete, stripeErrorCode: null, declineCode: null, type: null))
// ------ CARD FORM FIELD.
CardFormField(
controller: controller,
onCardChanged:(){},
autofocus: true,
onFocus: (cardFocus) {
log(cardFocus.toString());
},
enablePostalCode: true,
style: CardFormStyle(
backgroundColor: AppColors.NEUTRAL_100,
textColor: AppColors.NEUTRAL_950,
cursorColor: AppColors.PRIMARY_BASE,
borderColor: Colors.transparent,
placeholderColor: AppColors.NEUTRAL_800,
borderWidth: 2,
),
),
CustomButton(
width: Get.width,
height: 50.h,
buttonStyle: CustomButtonStyle.ACTIVE,
title: "Apply",
onPressed: () async {
if (controller.details.complete == true) {
CardFieldInputDetails details = controller.details;
PaymentCardModel card = PaymentCardModel(
last4: details.last4.toString(),
expMonth: details.expiryMonth,
expYear: details.expiryYear,
cardType: CardTypeExtension.fromString(details.brand),
);
widget.onApplyCardTap?.call(card);
} else {
SnackbarUtil.showError(
title: "Required",
message: "Please enter valid card details");
}
},
),
],
);
// -------- CREATING PAYMENT METHOD.
try {
PaymentMethod paymentMethod = await Stripe.instance.createPaymentMethod(
params: PaymentMethodParams.card(
paymentMethodData: PaymentMethodData(
billingDetails: billingDetails,
),
),
);
return PaymentProcessResponse(exception: null, object: paymentMethod);
} on StripeException catch (e) {
throw e;
} catch (e) {
throw e;
}
}
Expected behavior
Should return Payment Method.
Smartphone / tablet
- Pixel 7 pro, Emulator
- OS: Andriod 15
- Package version: 11.3.0
- Flutter version [e.g. 2.0.0.]
Additional context
It's perfectly working on ios but on the andriod it throws that the card details are incomplete, and exception is thrown from creatPaymentMethod catch fun.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working