Newer Version Available

This content describes an older version of this product. View Latest

PaymentMethodTokenizationRequest Class

Stores data about a request to tokenize a card payment method.

Namespace

CommercePayments

Usage

The constructor of this class takes no arguments. For example:

CommercePayments.PaymentMethodTokenizationRequest pmtr = new CommercePayments.PaymentMethodTokenizationRequest();

The tokenization process replaces sensitive customer data, such as a card number or CVV, with unique identification symbols while the data is handled by Salesforce, the payment gateway, and the customer bank.

This class holds all required details about the tokenize request. Gateway adapters read the fields of this class object while constructing a tokenization JSON request, which is sent to the payment gateway.

Example

1global commercepayments.GatewayResponse processRequest(commercepayments.PaymentGatewayContext gatewayContext) {
2    commercepayments.RequestType requestType = gatewayContext.getPaymentRequestType();
3    if (requestType == commercepayments.RequestType.Tokenize) {
4        commercepayments.PaymentMethodTokenizationRequest tokenizeRequest = (commercepayments.*PaymentMethodTokenizationRequest*) gatewayContext.getPaymentRequest();
5    }
6}

PaymentMethodTokenizationRequest Constructors

The following are constructors for PaymentMethodTokenizationRequest.

PaymentMethodTokenizationRequest(paymentGatewayId)

Payment gateway ID constructor used with paymentMethodTokenizationRequest. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

Signature

global PaymentMethodTokenizationRequest(String paymentGatewayId)

Parameters

paymentGatewayId
Type: String
The payment method’s payment gateway ID that will be tokenized.

PaymentMethodTokenizationRequest()

The following are constructors for PaymentMethodTokenizationRequest.

Signature

global PaymentMethodTokenizationRequest()

PaymentMethodTokenizationRequest Properties

The following are properties for PaymentMethodTokenizationRequest.

address

The card payment method address to be tokenized.

Signature

global commercepayments.AddressRequest address {get; set;}

Property Value

Type: AddressRequest

cardPaymentMethod

The card payment method containing data to be tokenized.

Signature

global commercepayments.CardPaymentMethodRequest cardPaymentMethod {get; set;}

Property Value

Type: CardPaymentMethodRequest

PaymentMethodTokenizationRequest Methods

The following are methods for PaymentMethodTokenizationRequest.

equals(obj)

Maintains the integrity of lists of type PaymentMethodTokenizationRequest by determining the equality of external objects in a list. This method is dynamic and is based on the equals method in Java.

Signature

global Boolean equals(Object obj)

Parameters

obj
Type: Object
External object whose key is to be validated.

Return Value

Type: Boolean

hashCode()

Maintains the integrity of lists of type PaymentMethodTokenizationRequest by determining the uniquness of the external object records in a list.

Signature

global Integer hashCode()

Return Value

Type: Integer

toString()

Converts a date to a string.

Signature

global String toString()

Return Value

Type: String