confirmSetupIntent method
Future<SetupIntent>
confirmSetupIntent(
- String setupIntentClientSecret,
- PaymentMethodParams data,
- PaymentMethodOptions? options
override
Implementation
@override
Future<SetupIntent> confirmSetupIntent(
String setupIntentClientSecret,
PaymentMethodParams data,
PaymentMethodOptions? options,
) async {
final response = await data
.maybeWhen<Future<stripe_js.SetupIntentResponse>>(card: (params) {
final data = stripe_js.ConfirmCardSetupData(
paymentMethod: stripe_js.CardPaymentMethodDetails(
card: element!,
billingDetails: params.billingDetails?.toJs(),
),
);
return js.confirmCardSetup(
setupIntentClientSecret,
data: data,
);
}, orElse: () {
throw UnimplementedError();
});
if (response.error != null) {
throw response.error!;
}
return response.setupIntent!.parse();
}