initPaymentSheet method
Future<PaymentSheetPaymentOption?>
initPaymentSheet({
- 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<PaymentSheetPaymentOption?> 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();
return _platform.initPaymentSheet(paymentSheetParameters);
}