Class: TransactionBuilder

TransactionBuilder()

new TransactionBuilder()

Source:

Methods

(static) this.amount(amount, currency, errorFunction) → {TransactionBuilder}

Set the amount and currency type
Parameters:
Name Type Description
amount string The amount to be sent to the payment device for charging. This should be a String so we dont loose any precision.
currency string The type of currency.
errorFunction function
Source:
Returns:
Type
TransactionBuilder

(static) this.build(successFunction, errorFunction)

Build the Transaction object to process payment.
Parameters:
Name Type Description
successFunction function A transaction object will be passed in when succeed.
errorFunction function
Source:

(static) this.reference(reference, errorFunction) → {TransactionBuilder}

Optional: The reference for this transaction. This is searchable in the backend. If this is not provided, a uuid will be auto generated.
Parameters:
Name Type Description
reference string A unique reference for this transaction. Avoid using UUID for reference as FreedomPay has shorter length requirement.
errorFunction function
Source:
Returns:
Type
TransactionBuilder

(static) this.transactionType(type, transactionID, errorFunction) → {TransactionBuilder}

Set the type of transaction (e.g.: "Sale", "Refund"...)
Parameters:
Name Type Description
type TransactionType The transaction type. One of QBrowser.QPay.TransactionType
transactionID string If this is a refund, void, undo, capture transaction type, the transactionID of the original Sale transaction must be passed here. Otherwise pass in null for other types.
errorFunction function
Source:
Returns:
Type
TransactionBuilder