Hey All,
I'm trying to pass a custom variable to the following function that appears in my Payment Gateway module.
The custom variable is created like this inside classes/order.php like this:
PHP Code:
$getordercount = $db->Execute("select date_purchased
from " . TABLE_ORDERS . "
where customers_id = '" . ((int)$_SESSION['customer_id']) . "'");
$orderCount = ($getordercount->RecordCount()) + 1;
$customOID = 'WOOHOO'. sprintf("%05d", ((int)$_SESSION['customer_id'])) . 'R' . sprintf("%03d",$orderCount);
What I'm using this for is a custom order reference - so basically I use it in place of the Order ID - BUT REMEMBER, I DO NOT REPLACE THE ORDER ID that stays as is and is unaffected.
Now I've managed to pass the $customOID to the process_button() function in the payment module by adding the following in classes/order.php within the function cart() function, like this:
PHP Code:
$this->orderef = array('orderef' => $customOID);
And then I call it in the payment module's process_button() like this:
PHP Code:
$order->orderef['orderef'];
I don't like this solution, it seems wrong. Though it works, it just feels wrong. Any guidance? Thanks.
Bookmarks