initPaymentSheet method

Future<void> initPaymentSheet({
  1. required SetupPaymentSheetParameters paymentSheetParameters,
})

Initializes the payment by providing a configuration

See SetupPaymentSheetParameters for more info. In order to show the payment sheet it is required to call presentPaymentSheet.

Implementation

Future<void> initPaymentSheet({
  required SetupPaymentSheetParameters paymentSheetParameters,
}) async {
  assert(
      !(paymentSheetParameters.applePay != null &&
          instance._merchantIdentifier == null),
      'merchantIdentifier must be specified if you are using Apple Pay. Please refer to this article to get a merchant identifier: https://support.stripe.com/questions/enable-apple-pay-on-your-stripe-account');
  await _awaitForSettings();
  await _platform.initPaymentSheet(paymentSheetParameters);
}