TransactionAPI Class

The TransactionAPI class includes global methods for several payment features.

Namespace 

blng

TransactionAPI Methods 

The following are methods for TransactionAPI.

generateToken(mapOfTransactionParameterById) 

Generates a token for a payment method.

Signature 

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

Parameters 

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

Return Value 

Type: List<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 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

captureTransaction(mapOfTransactionParameterById) 

Captures a payment for an authorize transaction.

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

captureTransaction(captureInputParameters) 

Captures a payment for an authorization transaction using input parameters.

Signature 

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

1blng.TransactionAPI, captureTransaction, [List<CaptureInputParameter>], List<CaptureOutputResult>

Parameters 

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

Return Value 

Type: List<CaptureOutputResult>

chargeTransaction(mapOfTransactionParameterById) 

Authorize and capture a credit card payment or ACH payment.

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

getPaymentStatus(mapOfTransactionParameterById) 

Gets the status of a payment transaction.

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

voidTransaction(mapOfTransactionParameterById) 

Cancels an original transaction that hasn’t been settled.

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

refundTransaction(mapOfTransactionParameterById) 

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

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

nonReferredRefund(mapOfTransactionParameterById) 

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

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

voidRefundTransaction(mapOfTransactionParameterById) 

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

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

getRefundStatus(mapOfTransactionParameterById) 

Gets the status of a refund transaction.

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

voidTokenTransaction(mapOfTransactionParameterById) 

Voids a credit card token.

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

refundPayment(listofRefundParameters) 

Refunds a payment.

Signature 

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

Parameters 

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

Return Value 

Type: List<TransactionResult>

List of Transaction Results : List<TransactionResult>

resetInvoiceCorrectiveAction(invoices) 

Unlocks an invoice.

Signature 

global static Boolean resetInvoiceCorrectiveAction(List<Invoice__c> invoices)

Parameters 

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

Return Value 

Type: Boolean

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

validateRefundTransactionId(transactionId) 

Validates whether a payment transaction can be refunded.

Signature 

global static String validateRefundTransactionId(Id transactionId)

Parameters 

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

Return Value 

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.

authorizeTransaction(invoiceID) 

Authorizes a payment for an invoice.

Signature 

global static TransactionResult authorizeTransaction(Id invoiceID)

Parameters 

invoiceID: Type: Id

Return Value 

Type: TransactionResult

chargeTransaction(invoiceID) 

Authorizes a payment for an invoice.

Signature 

global static TransactionResult chargeTransaction(Id invoiceID)

Parameters 

invoiceID: Type: Id

Return Value 

Type: TransactionResult