PEApplePayButton constructor

const PEApplePayButton({
  1. Key? key,
  2. required PEPaymentRequest paymentRequest,
  3. double width = double.infinity,
  4. double height = 36,
  5. dynamic onPaymentFailed(
    1. Exception
    )?,
  6. VoidCallback? onPaymentSheetDismissed,
  7. dynamic onTokenDidReturn(
    1. String token,
    2. dynamic metadata,
    3. PEApplePayContact? billingContact,
    4. PEApplePayContact? shippingContact,
    )?,
})

Creates an instance of PEApplePayButton.

  • paymentRequest: The payment request details.
  • onPaymentFailed: Callback triggered on payment failure.
  • onPaymentSheetDismissed: Callback triggered when the payment sheet is dismissed.
  • onTokenDidReturn: Callback triggered when a payment token is successfully received.
  • width: The button's width (default is full width).
  • height: The button's height (default is 36).

Implementation

const PEApplePayButton({
  Key? key,
  required this.paymentRequest,
  this.width = double.infinity,
  this.height = 36,
  this.onPaymentFailed,
  this.onPaymentSheetDismissed,
  this.onTokenDidReturn,
}) : super(key: key);