confirmSetupIntent method

Future<Map<String, dynamic>> confirmSetupIntent(
  1. String clientSecret,
  2. String paymentMethod, {
  3. String? webReturnPath,
  4. required BuildContext context,
})

Confirm and authenticate a SetupIntent https://stripe.com/docs/api/setup_intents/confirm

Implementation

Future<Map<String, dynamic>> confirmSetupIntent(String clientSecret, String paymentMethod,
    {String? webReturnPath, required BuildContext context}) async {
  var returnUrlForSca = getReturnUrlForSca(webReturnUrl: webReturnPath);
  final Map<String, dynamic> intent = await api.confirmSetupIntent(
    clientSecret,
    data: {
      'return_url': returnUrlForSca,
      'payment_method': paymentMethod,
    },
  );
  return _handleSetupIntent(intent, context);
}