PaymentRequest.addCard constructor

const PaymentRequest.addCard({
  1. required List<OrderDetails> orderDetails,
  2. required CustomerDetails customerDetails,
  3. required BillingDetails billingDetails,
  4. ShippingDetails shippingDetails = const ShippingDetails(),
  5. Urls? urls,
  6. List parameters = const [],
  7. List<Map<String, dynamic>> customData = const [],
  8. PaymentViewType viewType = PaymentViewType.bottomsheet,
})

Add-card: omits amount, convenience_fee, and quantity from JSON, while still allowing Urls and request-level paymentToken when provided.

Implementation

const PaymentRequest.addCard({
  required this.orderDetails,
  required this.customerDetails,
  required this.billingDetails,
  this.shippingDetails = const ShippingDetails(),
  this.urls,
  this.parameters = const [],
  this.customData = const [],
  this.viewType = PaymentViewType.bottomsheet,
}) : paymentToken = null,
      action = 'AUTH_REVERSAL',
//  toSaveCards = false,
      kind = PaymentRequestType.addCard;