5.2 Available Variables

There are several variables available to the third party scripts, given different information such as the customer's profile, order information, and so on. Below explains all variables available:


5.2.1 %CUSTOMER Hash

The %CUSTOMER has is available to all third party scripts. The keys are the fields of your customer database, and the values are the customer's profile. For example, to get the customer's ID#, you would use $CUSTOMER{'customer_id'}, or to get the customer's first_name, you would use $CUSTOMER{'first_name'}. Please note, all keys in the hash are lowercase.


5.2.2 %RESELLER Hash

The %RESELLER hash is available to all third party scripts, except those located in the /scripts/customer/ directory. This hash contains the reseller's profile, and is similar to the %CUSTOMER hash. The keys of the hash are the fields in your member database, and the values are the reseller's profile. For example, $RESELLER{'username'}, and $RESELLER{'email'}, would give you the reseller's username and e-mail.


5.2.3 %ORDER Hash

The %ORDER hash is available to all third party scripts, except those located in the /scripts/customer/ directory. This hash contains information on the order. The following variables are contained within the %ORDER hash:
Variable
Name
Description
$ORDER{'order_id'}
Order ID#
The ID# of the order being processed
$ORDER{'transaction_id'}
Transaction ID#
The transaction ID# of the payment being processed.
$ORDER{'amount'}
Amount
The total amount being charged
$ORDER{'coupon'}
Coupon Amount
If a coupon code was used, the amount deducted from the order. This amount is positive.
$ORDER{'tax'}
Tax Amount
The total amount of tax added to the order.
$ORDER{'merchant_ref'}
Merchant Reference #
The reference number assigned by your merchant account / payment processor for the order.
$ORDER{'merchant_text'}
Merchant Text
A small text message given off by the merchant account / payment processor.
$ORDER{'ip_address'}
IP Address
The IP address used to submit the order.
$ORDER{'payment_date'}
Payment Date
The date the payment was processed. Formatted in YYYY-MM-DD
$ORDER{'payment_time'}
Payment Time
The exact time the payment was processed. Formatted in HH:MM:SS

If the third party script is located in the /product/ directory, and is executed when a specific product is purchased, the following variables are also available:
Variable
Name
Description
$ORDER{'product_id'}
Product ID#
The ID# of the product being purchased.
$ORDER{'product_name'}
Product Name
The name of the product being purchased.
$ORDER{'quantity'}
Quantity
The quantity of the product being purchased.
$ORDER{'unit_amount'}
Unit Amount
The amount per unit (quantity) that was charged.
$ORDER{'total_amount'}
Total Amount
The total amount charged for this product. Basically, this is the quantity and unit amount multiplied.