SaleRequest Class
Namespace
Usage
This class holds all the required details about a sale request. Gateway adapters read the fields of this class object while constructing a sale JSON request thatis sent to the payment gateway. The object of this class is made available through commercepayments.paymentGatewayContext by calling getPaymentRequest().
Example
SaleRequest Constructors
The following are constructors for SaleRequest.
SaleRequest(amount)
Signature
global SaleRequest(Double amount)
Parameters
-
amount:
Type: Double
Amount of the sale request.
SaleRequest Properties
The following are properties for SaleRequest.
enhancedPaymentData
Supported only for third-party payment gateways; not supported for native payments.
Signature
public commercepayments.EnhancedPaymentDataInput enhancedPaymentData {get; set;}
Property Value
Type: commercepayments.EnhancedPaymentDataInput
paymentInitiationSourceId
Supported only for third-party payment gateways; not supported for native payments. See PaymentInitiationSource object documentation for more information.
Signature
public String paymentInitiationSourceId {get; set;}
Property Value
Type: String
paymentMethod
Signature
global commercepayments.SaleApiPaymentMethodRequest paymentMethod {get; set;}
Property Value
paymentMethodData
This field is populated when SaleInput specifies a saved payment method. Accessible using paymentMethodData on SaleRequest. The map contains these fields from SavedPaymentMethod: GatewayToken, Type, GatewayReference, and StandardEntryCode for direct gateway interaction without querying the database.
Signature
public Map<String,String> paymentMethodData {get; set;}
submittedByMerchant
Signature
public Boolean submittedByMerchant {get; set;}
Property Value
Type: Boolean
SaleRequest Methods
The following are methods for SaleRequest.
equals(obj)
Signature
global Boolean equals(Object obj)
Parameters
-
obj:
Type: Object
Return Value
Type: Boolean
hashCode()
Signature
global Integer hashCode()
Return Value
Type: Integer