0
votes

we want User can payment with saved list card from BackEnd. you can see this image

current image

We success handle payment with new card and save it to use again in the future. But, when we want payment using saved card, we always still got error like Card details not complete.

this is what we do currently.

  var paymentIntent = await getPaymentIntent(
          selectedPaymentMethod.id, availabilityResponse.timeslotId.toString());

      if (paymentIntent.paymentClientSecret != null) {
        await Stripe.instance.confirmPayment(
          paymentIntent.paymentClientSecret,
          PaymentMethodParams.cardFromMethodId(
                paymentMethodData: PaymentMethodDataCardFromMethod(
                    paymentMethodId: selectedPaymentMethod.id
                )
          ),
        );

      } else {
        print("here");

        await Stripe.instance.confirmSetupIntent(
          paymentIntent.setupClientSecret,
          PaymentMethodParams.cardFromMethodId(
              paymentMethodData: PaymentMethodDataCardFromMethod(
                  paymentMethodId: selectedPaymentMethod.id,
              )
          ),
        );
      }

we always got error Card detail is not complete when using confirmSetupIntent. any idea ?

Hard to tell if you're doing anything wrong with the above code. flutter_stripe isn't an official Stripe library. You could open an issue on their Github and see if there's any traction. Otherwise, I'd just verify you're building your API requests correctly (using flutter_stripe's docs) and verify the payment method ID's you're passing are valid (by logging the values prior to using them). - codename_duchess
Yes. it's really strange because its work perfectly on Android but always got Card detail not complete error on iOS. Unfortunately, my client just need iOS, so it really hard time for me. - Aa Maulana