PaymentGateway Interface

Interface for standard payment transaction operations such as voids and refunds.

Namespace 

blng

Usage 

A gateway implementor uses logic such as paymentGatewayParameter.getTransactionType() == "generateToken" and calls underlying payment transaction functions. Similar logic applies for voids, refunds, and other actions.

PaymentGateway Methods 

The following are methods for PaymentGateway.

generateToken(mapOfTransactionParameterById) 

Generates a token for a payment method.

Signature 

global Map<String, TransactionResult> generateToken(Map<String, TransactionParameter> mapOfTransactionParameterById)

Parameters 

mapOfTransactionParameterById: Type: Map<String, TransactionParameter> Map of parameter is based on the payment gateway.

Return Value 

Type: Map<String, TransactionResult>

List of Transaction Results : List<TransactionResult>

chargeTransaction(mapOfTransactionParameterById) 

Authorize and capture a credit card payment and ACH payment.

Signature 

global Map<String, TransactionResult> chargeTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

Parameters 

mapOfTransactionParameterById: Type: Map<String, TransactionParameter> Map of parameter is based on the payment gateway.

Return Value 

Type: Map<String, TransactionResult>

List of Transaction Results : List<TransactionResult>

voidTransaction(mapOfTransactionParameterById) 

The Void transaction type can cancel either an original transaction or a transaction that hasn’t been settled.

Signature 

global Map<String, TransactionResult> voidTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

Parameters 

mapOfTransactionParameterById: Type: Map<String, TransactionParameter> Parameter map is based on the payment gateway.

Return Value 

Type: Map<String, TransactionResult>

List of Transaction Results : List<TransactionResult>

authorizeTransaction(mapOfTransactionParameterById) 

Authorizes a credit card payment. To perform a charge transaction, the user must follow the authorization with a capture transaction.

Signature 

global Map<String, TransactionResult> authorizeTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

Parameters 

mapOfTransactionParameterById: Type: Map<String, TransactionParameter> Map of parameter is based on the payment gateway.

Return Value 

Type: Map<String, TransactionResult>

List of Transaction Results : List<TransactionResult>

refundTransaction(mapOfTransactionParameterById) 

Refund a customer for a transaction that wsa successfully settled through the payment gateway.

Signature 

public Map<String, TransactionResult> refundTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

Parameters 

mapOfTransactionParameterById: Type: Map<String, TransactionParameter> Map of parameter is based on the payment gateway.

Return Value 

Type: Map<String, TransactionResult>

List of Transaction Results : List<TransactionResult>

PaymentGateway Example Implementation 

The YourGatewayAPI class implements the PaymentGateway, PaymentGateways, and PaymentGatewayStatus interfaces.