Properties

$id

$id :

Type

$account_id

$account_id :

Type

$userid

$userid :

Type

$user_confirm_id

$user_confirm_id :

Type

$admin_confirm_id

$admin_confirm_id :

Type

$status

$status :

Type

$controller_alias

$controller_alias :

Type

$index_id

$index_id :

Type

$reference_id

$reference_id :

Type

$currency

$currency :

Type

$from_currency

$from_currency :

Type

$amount

$amount :

Type

$from_amount

$from_amount :

Type

$fee

$fee :

Type

$fee_percent

$fee_percent :

Type

$payment_id

$payment_id :

Type

$ip_address

$ip_address :

Type

$date_added

$date_added :

Type

$user

$user :

Type

$account

$account :

Type

$controller

$controller :

Type

$payment_method

$payment_method :

Type

$extra

$extra :

Type

Methods

__construct()

__construct(\apex\transaction\int  $id)

Constructor

Parameters

\apex\transaction\int $id

load()

load(boolean  $for_display = false)

Load the transaction

Parameters

boolean $for_display

Whether or not to format the transaction for display in web browser.

get_id()

get_id(): integer

Get the transaction ID#

Returns

integer —

The ID# of the transaction.

set_user()

set_user(integer  $userid,\apex\users\user  $user = null)

Set the user

Parameters

integer $userid

The ID# of the user.

\apex\users\user $user

The UserInterface object of the loaded user.

set_account()

set_account(integer  $account_id,\apex\transaction\tx_account  $account = null)

Set the transaction account.

Parameters

integer $account_id

The id# of the transaction account.

\apex\transaction\tx_account $account

The transaction account object.

set_amount()

set_amount(float  $amount,string  $currency = '')

Set amount

Parameters

float $amount

The amount of the transaction.

string $currency

The currency of the transaction. If undefined, user's the base currency in settings.

set_from_amount()

set_from_amount(float  $amount,string  $currency = '')

Set the from amount / currency. Used in cases of currency conversion.

Parameters

float $amount

The from amount of the transaction.

string $currency

The from currency. If undefined, defaults to the base currency from settings.

set_fee()

set_fee(float  $fee,float  $percent = 0.0)

Set fee.

Parameters

float $fee

The amount amount if dollars.

float $percent

The fee is percent.

set_controller()

set_controller(string  $controller_alias,integer  $index_id)

Set controller and index id

Parameters

string $controller_alias

The alias of the transaction controller.

integer $index_id

Optional index_id to help identify the transaction.

set_payment_method()

set_payment_method(integer  $payment_id,\apex\transaction\payment_method  $payment_method = null)

Set payment method.

Parameters

integer $payment_id

The id# of the payment method.

\apex\transaction\payment_method $payment_method

The payment_method object, loaded.

set_status()

set_status(string  $status)

Set status of transaction

Parameters

string $status

The status of the transaction.

set_reference_id()

set_reference_id(integer  $reference_id)

Set reference ID

Parameters

integer $reference_id

The reference ID# of the transaction.

get_user()

get_user()

Get user

get_account()

get_account()

Get the transaction account.

get_controller()

get_controller(): object

Get controller

Returns

object —

He object controlle for the transaction

get_controller_alias()

get_controller_alias(): string

Get the controller alias.

Returns

string —

The controller alias.

get_payment_method()

get_payment_method(): \apex\transaction\payment_methods

Get the payment method.

Returns

\apex\transaction\payment_methods —

The payment method of the tx.

get_user_confirm_id()

get_user_confirm_id(): integer

Get the user confirm id

Returns

integer —

The user confirm id#

get_admin_confirm_id()

get_admin_confirm_id(): integer

Get admin confirm id

Returns

integer —

The admin confirm id#

prepare_creation()

prepare_creation()

Prepare transaction for creation.

toArray()

toArray(): array

Return the transaction in an array.

Returns

array —

The full transaction in array

get_status()

get_status(): string

Get status.

Returns

string —

The status off the transaction.

get_amount()

get_amount(): float

Get amount.

Returns

float —

The amount of the transaction.

update_status()

update_status(string  $new_status,\apex\transaction\string  $note = '')

Update status of tx.

Parameters

string $new_status

The status to update transaction to.

\apex\transaction\string $note

update_amount()

update_amount(float  $amount,string  $note = '')

Update amount

Parameters

float $amount

The new amount of the tx.

string $note

optional note for the transaction.

format_view()

format_view()

Format transaction for view display