ApplePayParams constructor

  1. @JsonSerializable(explicitToJson: true)
const ApplePayParams({
  1. required String merchantCountryCode,
  2. required String currencyCode,
  3. List<String>? additionalEnabledNetworks,
  4. required List<ApplePayCartSummaryItem> cartItems,
  5. List<ApplePayContactFieldsType>? requiredShippingAddressFields,
  6. List<ApplePayContactFieldsType>? requiredBillingContactFields,
  7. List<ApplePayShippingMethod>? shippingMethods,
  8. List<ApplePayMerchantCapability>? merchantCapabilities,
  9. ApplePayShippingType? shippingType,
  10. List<String>? supportedCountries,
  11. bool? supportsCouponCode,
  12. String? couponCode,
  13. PaymentRequestType? request,
})

Implementation

@JsonSerializable(explicitToJson: true)
const factory ApplePayParams({
  /// ISO 3166-1 alpha-2 country code where the transaction is processed.
  required String merchantCountryCode,

  /// ISO 4217 alphabetic currency code.
  required String currencyCode,

  /// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork.
  List<String>? additionalEnabledNetworks,

  /// The list of items that describe a purchase. For example: total, tax, discount, and grand total.
  required List<ApplePayCartSummaryItem> cartItems,

  /// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there.
  List<ApplePayContactFieldsType>? requiredShippingAddressFields,

  /// The list of fields that you need for a billing contact in order to process the transaction.
  List<ApplePayContactFieldsType>? requiredBillingContactFields,

  /// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there.
  List<ApplePayShippingMethod>? shippingMethods,

  /// Set the payment capabilities you support. If set, 3DS is required.
  List<ApplePayMerchantCapability>? merchantCapabilities,

  /// An optional value that indicates how to ship purchased items. Defaults to 'Shipping'.
  ApplePayShippingType? shippingType,

  /// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions.
  List<String>? supportedCountries,

  /// Enables support for coupon codes in the Apple Pay button.
  /// When this is set to true it shows the coupon code field and if [couponCode]
  /// has a value it will display the value as default
  ///
  /// Supported on iOS 15 and higher.
  bool? supportsCouponCode,

  /// Default coupon code display in the apple pay sheet
  String? couponCode,

  /// Use this to support different types of payment request.
  ///
  /// Only supported on iOS 16 and higher.
  PaymentRequestType? request,
}) = _ApplePayParams;