TransactionAPI Class

The TransactionAPI class includes global methods for several payment features.

blng

The following are methods for TransactionAPI.

Generates a token for a payment method.

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

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

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

public static List<TransactionResult> authorizeTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Captures a payment for an authorize transaction.

global static List<TransactionResult> captureTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Captures a payment for an authorization transaction using input parameters.

global static List<CaptureOutputResult> captureTransaction(List<CaptureInputParameter> captureInputParameters)

captureInputParameters: Type: List<CaptureInputParameter> A list of input parameters passed from the CaptureInputParameter class.

Type: List<CaptureOutputResult>

Authorize and capture a credit card payment or ACH payment.

public static List<TransactionResult> chargeTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Gets the status of a payment transaction.

global static List<TransactionResult> getPaymentStatus(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Cancels an original transaction that hasn’t been settled.

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

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Refunds a customer for a transaction that has been succesfully settled through the payment gateway.

global static List<TransactionResult> refundTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Performs a non-referred refund of a credit card payment or an ACH payment.

global static List<TransactionResult> nonReferredRefund(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Voids an unsettled refund transaction from a credit card payment or ACH payment.

global static List<TransactionResult> voidRefundTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Gets the status of a refund transaction.

global static List<TransactionResult> getRefundStatus(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Voids a credit card token.

global static List<TransactionResult> voidTokenTransaction(Map<String, TransactionParameter> mapOfTransactionParameterById)

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

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Refunds a payment.

global static List<TransactionResult> refundPayment(List<RefundParameter> listofRefundParameters)

listofRefundParameters: Type: List<RefundParameter> Parameter map is based on the payment gateway.

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

Unlocks an invoice.

global static Boolean resetInvoiceCorrectiveAction(List<Invoice__c> invoices)

invoices: Type: List<Invoice__c> List of invoices to unlock due to payment issues.

Type: Boolean

Returns True if invoice update is succesful, otherwise returns False.

Validates whether a payment transaction can be refunded.

global static String validateRefundTransactionId(Id transactionId)

transactionId: Type: Id Single transactionId passed to validate whether a refund is allowed.

Type: String

Returns String values such as the following.

  • PAYMENT_TRANSACTION_NO_GATEWAY_ID_MESSAGE - Cannot refund payment transactions without gateway IDs. The invoice has been unlocked.
  • INVALID_PAYMENT_TRANSACTION_FOR_REFUND_MESSAGE - Cannot refund payment transaction. This transaction is not currently eligible for refunding.
  • ALLOW_REFUND_TRANSACTION - True
  • REFUND_INVALID_PAYMENT_TRANSACTION_MESSAGE_ALOHA- Cannot refund invalid transactions or transactions without invoices.

Authorizes a payment for an invoice.

global static TransactionResult authorizeTransaction(Id invoiceID)

invoiceID: Type: Id

Type: TransactionResult

Authorizes a payment for an invoice.

global static TransactionResult chargeTransaction(Id invoiceID)

invoiceID: Type: Id

Type: TransactionResult