5.) Transaction Variables
Every time a new transaction is added to the database, regardless of the status, xFlow will check to see if a third party script exists for that transaction, and if needed, execute the script. On top of the global variables explained in Section 3. Global Variables, the %TRANS hash is also available, which contains the following variables:

Variable
Name
Description
$TRANS{'id'}
Transaction ID#
The unique ID# of the transaction
$TRANS{'userid'}
Member ID#
The ID# of the member who has been assigned this transaction. Same as the $PROFILE{'id'} variable.
$TRANS{'index_id'}
Transaction Index ID#
The ID# of the transaction from the index, which can be found through the Transaction->Transaction Settings menu.
$TRANS{'recurring_id'}
Recurring ID#
If a recurring transaction, the unique ID#, pointing to another database table, which contains additional information on the recurring transaction, such as next payment date, ect.
$TRANS{'amount'}
Amount
Amount of the transaction
$TRANS{'status'}
Status
A one digit number, representing the status of the transaction. Will be:
  • 1 - Approved
  • 2 - Declined
  • 3 - Error
  • 4 - Pending
  • 5 - Expired (pending)

$TRANS{'method'}
Method
The transaction method, which will be:
  • 1 - Deposit
  • 2 - Withdraw

$TRANS{'coupon'}
Coupon Code
If a coupon code was used, this variable will contain information on the coupon. Formatted in T,A, where:
  • T - Discount Type
    • 1 - Dollar Amount
    • Percentage

  • A - Amount Discounted

$TRANS{'date'}
Transaction Date
The date the transaction was added to the database. Formatted in YYYY-MM-DD
$TRANS{'time'}
Transaction Time
The exact time the transaction was added to the database. Formatted in HH:MM:SS
$TRANS{'payment_id'}
Payment ID#
If payment was required, the ID# of the payment method used.
$TRANS{'merchant_ref'}
Merchant Reference #
If payment was required, the reference number assigned by your payment processor. If your payment processor ever needs to be contacted regarding the transaction, this is the number to give them.
$TRANS{'reference'}
Reference ID#
If this transaction is referenced to another transaction, the ID# of the referenced transaction.


NOTE: Be sure to check the $TRANS{'status'} variable in your script! xFlow will execute the script every time the transaction is added, regardless of the status.

If the transaction is part of a recurring transaction, and the $TRANS{'recurring_id'} variable is greater than 0, the %TRANS_RECURRING hash will also be available, which includes the following variables:

Please note, to save space, $TRANS_RECURRING has been replaced with $REC in the below table. So, if you want the 'start_date' variable, you would actually use $TRANS_RECURRING{'start_date'}.

Variable
Name
Description
$REC{'id'}
Recurring ID#
The unique ID# of the recurring transaction.
$REC{'status'}
Status
A one digit number, representing the status of the recurring transaction. Will be:
  • 1 - Active
  • 2 - Inactive
  • 3 - Cancelled
  • 4 - Pending

$REC{'amount'}
Amount
The amount of the recurring transaction. Please note, this is not applicable for recurring commission transactions, as the amounts are always taken from the transaction index.
$REC{'start_date'}
Date Started
The date which the recurring transaction was first added to the database. Formatted in YYYY-MM-DD
$REC{'lastpay_date'}
Last Payment Date
The date which the recurring transaction was last processed. Formatted in YYYY-MM-DD
$REC{'nextpay_date'}
Recurring ID#
The next date which the recurring transaction will be processed again. Formatted in YYYY-MM-DD