PaymentRequest class

Full payment request payload.

Constructors

PaymentRequest.addCard({required List<OrderDetails> orderDetails, required CustomerDetails customerDetails, required BillingDetails billingDetails, ShippingDetails shippingDetails = const ShippingDetails(), Urls? urls, List parameters = const [], List<Map<String, dynamic>> customData = const [], PaymentViewType viewType = PaymentViewType.bottomsheet})
Add-card: omits amount, convenience_fee, and quantity from JSON, while still allowing Urls and request-level paymentToken when provided.
const
PaymentRequest.deriveForAddCard(PaymentRequest submitOrderRequest)
Builds an add-card request from a submit-order request (same customer/shipping, minimal order line).
factory
PaymentRequest.submitOrder({String? paymentToken, required List<OrderDetails> orderDetails, required CustomerDetails customerDetails, required BillingDetails billingDetails, ShippingDetails shippingDetails = const ShippingDetails(), Urls? urls, List parameters = const [], List<Map<String, dynamic>> customData = const [], String action = 'AUTH', PaymentViewType viewType = PaymentViewType.bottomsheet})
Checkout: includes order amounts, callback Urls, and optional toSaveCards. Request-level paymentToken is optional; when null or empty it is omitted from toJson card details.
const

Properties

action → String
final
billingDetails → BillingDetails
final
customData → List<Map<String, dynamic>>
final
customerDetails → CustomerDetails
final
hashCode → int
The hash code for this object.
no setterinherited
hasSdkPaymentCardPayload → bool
Whether cardDataForSdkPayment includes a PAN or payment token.
no setter
kind → PaymentRequestType
final
orderDetails → List<OrderDetails>
final
parameters → List
final
paymentToken → String?
Request-level token for /sdk/payment. Always null for PaymentRequestType.addCard.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shippingDetails → ShippingDetails
final
urls → Urls?
Present only for PaymentRequestType.submitOrder.
final
viewType → PaymentViewType
When true, the user can save the card for future use. Always false for add-card. Whether to show the payment gateway as a PaymentViewType.bottomsheet or full PaymentViewType.screen.
final

Methods

cardDataForSdkPayment() → CardData
Builds CardData for POST .../sdk/payment from paymentToken and any card-like keys in parameters / customData maps (e.g. payment_token, m_payment_token, card_number, cvv, expiry).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson(CardData card) → Map<String, dynamic>
JSON body for PayOrc POST .../sdk/payment ({ "data": { ... } }).
toString() → String
A string representation of this object.
inherited
toTabbyInitJson() → Map<String, dynamic>
JSON body for PayOrc POST .../sdk/tabby/init ({ "data": { ... } }).

Operators

operator ==(Object other) → bool
The equality operator.
inherited