MasriviView constructor

const MasriviView({
  1. Key? key,
  2. required String publishableApiKey,
  3. required String transactionId,
  4. required String configurationId,
  5. FutureOr<void> onPaymentSuccess(
    1. bool isSuccess
    )?,
  6. VoidCallback? onBackPress,
  7. VoidCallback? onPaymentDeclined,
  8. MasriviWebViewPresentation presentation = MasriviWebViewPresentation.fullPage,
  9. String? phoneNumber,
})

Creates a new MasriviView instance.

  • publishableApiKey: The API key for authenticating the payment.
  • transactionId: The transaction ID for the payment.
  • configurationId: The configuration ID (payment method ID) from PaymentMethod.id.
  • onPaymentSuccess: The callback to call when the payment is successful.
  • onBackPress: The callback to call when the back button is pressed.
  • onPaymentDeclined: The callback to call when the payment is declined.
  • presentation: Whether to render as a full page or bottom sheet.
  • phoneNumber: Optional phone number to prefill in the Masrivi page.

Implementation

const MasriviView({
  super.key,
  required this.publishableApiKey,
  required this.transactionId,
  required this.configurationId,
  this.onPaymentSuccess,
  this.onBackPress,
  this.onPaymentDeclined,
  this.presentation = MasriviWebViewPresentation.fullPage,
  this.phoneNumber,
});