AuthorizationRequest Class
Sends information about an authorization request to a gateway adapter during a service call. This class extends the BaseRequest class and inherits all its methods.
This class contains information about a transaction authorization request. The gateway adapter reads fields from this class while constructing an authorization JSON request to send to the payment gateway. An object of this class is available by calling getPaymentRequest() in the PaymentGatewayContext Class.
Creating a buildAuthRequest class to store information about the authorization request.
The following are constructors for AuthorizationRequest.
-
Constructor for building the amount in an authorization request. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.
Constructor for building the amount in an authorization request. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.
global AuthorizationRequest(Double amount)
-
amount:
Type: Double
The amount of the authorization.
The following are properties for AuthorizationRequest.
-
The customer account where the authorization is performed.
-
The total amount of the authorization. Can be positive or negative.
-
Comments about the authorization. Users can enter comments to provide additional information.
-
The ISO currency code for the authorization request.
-
The payment method used to process the authorization in the authorization request.
-
Payment method data used in the authorize payment request.
The customer account where the authorization is performed.
global String accountId {get; set;}
Type: String
The total amount of the authorization. Can be positive or negative.
global Double amount {get; set;}
Type: Double
Comments about the authorization. Users can enter comments to provide additional information.
global String comments {get; set;}
Type: String
The ISO currency code for the authorization request.
global String currencyIsoCode {get; set;}
Type: String
The payment method used to process the authorization in the authorization request.
global AuthApiPaymentMethodRequest paymentMethod {get; set;}
Type: AuthApiPaymentMethodRequest
Payment method data used in the authorize payment request.
This field is populated when AuthorizationInput specifies a saved payment method. Accessible using paymentMethodData on AuthorizationRequest. The map contains these fields from SavedPaymentMethod: GatewayToken, Type, GatewayReference, and StandardEntryCode for direct gateway interaction without querying the database. This field is supported only for saved payment methods of type card.
public Map<String,String> paymentMethodData {get; set;}
The following are methods for AuthorizationRequest.
-
Maintains the integrity of lists of type
AuthorizationRequestby determining the equality of external objects in a list. This method is dynamic and based on the equals method in Java. -
Maintains the integrity of lists of type
AuthorizationRequestby determining the uniqueness of the external object in a list. -
Converts a date to a string.
Maintains the integrity of lists of type AuthorizationRequest by determining the equality of external objects in a list. This method is dynamic and based on the equals method in Java.
global Boolean equals(Object obj)
-
obj:
Type:
Object External object whose key is to be validated.
Type: Boolean
Maintains the integrity of lists of type AuthorizationRequest by determining the uniqueness of the external object in a list.
global Integer hashCode()
Type: Integer
Converts a date to a string.
global String toString()
Type: String