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
This code sample retrieves the SaleRequest object from the
PaymentGatewayContext
class.
commercepayments.SaleRequest = (commercepayments.SaleRequest)gatewayContext.getPaymentRequest()
SaleRequest Constructors
The following are constructors for SaleRequest.
SaleRequest(amount)
Constructor for defining an amount for the sale request. This
constructor is intended for test usage and throws an exception if used outside of the Apex
test context.
Signature
global SaleRequest(Double amount)
Parameters
- amount
- Type: Double
- Amount of the sale request.
SaleRequest Properties
The following are properties for SaleRequest.
SaleRequest Methods
The following are methods for SaleRequest.
equals(obj)
Compares this object with the specified object and returns
true if both objects are equal; otherwise, returns
false.
Signature
global Boolean equals(Object obj)
Parameters
- obj
- Type: Object
Return Value
Type: Boolean
hashCode()
Maintains the integrity of lists of type SaleRequest by determining the uniqueness of the external
object records in a list.
Signature
global Integer hashCode()
Return Value
Type: Integer