Newer Version Available
PaymentGatewayContext Class
Namespace
Usage
The constructor of this class takes no arguments. For example:
CommercePayments.PaymentGatewayContext pgc = new CommercePayments.PaymentGatewayContext();Example
1global commercepayments.GatewayResponse processRequest(commercepayments.PaymentGatewayContext gatewayContext) {
2 commercepayments.RequestType requestType = gatewayContext.getPaymentRequestType();
3 if (requestType == commercepayments.RequestType.Capture) {
4 commercepayments.CaptureRequest captureRequest = (commercepayments.CaptureRequest) gatewayContext.getPaymentRequest();
5 }
6}PaymentGatewayContext Constructors
The following are constructors for PaymentGatewayContext.
PaymentGatewayContext(request, requestType)
Constructor to enable instance creation. This constructor is intended
for test usage and throws an exception if used outside of the Apex test
context.
Signature
global PaymentGatewayContext(commercepayments.PaymentGatewayRequest request, String requestType)
Parameters
- request
- Type: commercepayments.PaymentGatewayRequest
- Raw payload. Sensitive attributes are masked to ensure PCI compliance.
- requestType
- Type: String
- Defines the type of request made to the gateway
PaymentGatewayContext Methods
The following are methods for PaymentGatewayContext.