PlatformPayWebPaymentRequestCreateOptions constructor

  1. @JsonSerializable(explicitToJson: true)
const PlatformPayWebPaymentRequestCreateOptions({
  1. required String country,
  2. required String currency,
  3. required PlatformPayWebPaymentItem total,
  4. @Default([]) List<PlatformPayWebPaymentItem> displayItems,
  5. @Default(false) bool requestPayerName,
  6. @Default(false) bool requestPayerEmail,
  7. @Default(false) bool requestPayerPhone,
  8. @Default(false) bool requestShipping,
  9. @Default([]) List<PlatformPayWebShippingOption> shippingOptions,
  10. @Default([]) List<PlatformPayWebWalletType> disableWallets,
})

Implementation

@JsonSerializable(explicitToJson: true)
const factory PlatformPayWebPaymentRequestCreateOptions({
  /// The two-letter country code of your Stripe account (e.g., US).
  required String country,

  /// Three character currency code (e.g., usd).
  required String currency,

  /// A PaymentItem object. This PaymentItem is shown to the customer in the browser’s payment interface.
  required PlatformPayWebPaymentItem total,

  /// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface.
  /// Note that the sum of the line item amounts does not need to add up to the total amount above.
  @Default([]) List<PlatformPayWebPaymentItem> displayItems,

  /// By default, the browser‘s payment interface only asks the customer for actual payment information. A customer
  /// name can be collected by setting this option to true. This collected name will appears in the PaymentResponse object.
  ///
  ///  We highly recommend you collect name as this also results in collection of billing address for Apple Pay.
  ///  The billing address can be used to perform address verification and block fraudulent payments.
  ///  For all other payment methods, the billing address is automatically collected when available.
  @Default(false) bool requestPayerName,

  /// See the requestPayerName option.
  @Default(false) bool requestPayerEmail,

  /// See the requestPayerName option.
  @Default(false) bool requestPayerPhone,

  /// Collect shipping address by setting this option to true. The address appears in the PaymentResponse.
  ///
  ///  You must also supply a valid [ShippingOptions] to the shippingOptions property. This can be up front at the
  ///  time stripe.paymentRequest is called, or in response to a shippingaddresschange event using the updateWith callback.
  @Default(false) bool requestShipping,

  /// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option.
  @Default([]) List<PlatformPayWebShippingOption> shippingOptions,

  /// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option
  /// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards.
  @Default([]) List<PlatformPayWebWalletType> disableWallets,
}) = _PaymentRequestCreateOptions;