submitOrder static method
- BuildContext context, {
- required CardData card,
- required PaymentRequest paymentRequest,
- required PaymentRequest addCardPaymentRequest,
- required void onNewCardAdded(
- CardData input
- void onSuccessPayment(
- BuildContext submittingContext,
- Map<
String, dynamic> merchantResponse
- BuildContext? mountedCheckContext,
- void onPaymentFailed(
- BuildContext submitModalContext,
- String message, {
- String? code,
- VoidCallback? onRetryPayment,
Opens the non-dismissible submit-order (card payment) modal bottom sheet.
On payment failure, schedules PaymentFailedSheetAction.show on the next frame
(after the submit sheet can settle). Uses mountedCheckContext for
mounted before showing (defaults to context).
onPaymentFailed is optional host callback when the payment API fails
(message / code / submit-modal context; UI is handled here).
onRetryPayment is optional host callback when the user taps Retry on the
failed sheet. Re-opening the submit-order flow for the same card is handled
inside the SDK.
onNewCardAdded is called when the user adds a card from the payment-failed sheet.
onSuccessPayment is called after a successful payment (when the user finishes
the confirmation sheet), with the submit-order sheet BuildContext.
Implementation
static Future<void> submitOrder(
BuildContext context, {
required CardData card,
required PaymentRequest paymentRequest,
required PaymentRequest addCardPaymentRequest,
required void Function(CardData input) onNewCardAdded,
void Function(BuildContext submittingContext, Map<String, dynamic> merchantResponse)? onSuccessPayment,
BuildContext? mountedCheckContext,
void Function(
BuildContext submitModalContext,
String message, {
String? code,
})? onPaymentFailed,
VoidCallback? onRetryPayment,
}) {
return _presentSubmitOrder(
context,
card: card,
paymentRequest: paymentRequest,
addCardPaymentRequest: addCardPaymentRequest,
onNewCardAdded: onNewCardAdded,
onSuccessPayment: onSuccessPayment,
mountedCheckContext: mountedCheckContext,
onPaymentFailed: onPaymentFailed,
onRetryPayment: onRetryPayment,
);
}