I did try that with no success so I then tried echoing it back on other pages to see if the right attribute we getting called in at all.
here is how i inserted it into the payment module:
Code:
function before_process() {
global $_POST, $response, $db, $order, $orders;
$erpNumber = '';
if (isset($order->products[$i]['attributes']))
{
for ($j = 0, $m = sizeof($order->products[$i]['attributes']); $j < $m; $j ++)
{
if ($order->products[$i]['attributes'][$j]['option_id'] == 28) {
if ($order->products[$i]['attributes'][$j]['value_id'] == 0) {
$erpNumber = $order->products[$i]['attributes'][$j]['value'];
break;
}
}
}
}
if (MODULE_PAYMENT_DIRECTONE_STORE_CC_NUMBER == 'True') {
$order->info['cc_number'] = $_POST['cc_number'];
}
$order->info['cc_expires'] = $_POST['cc_expires'];
$order->info['cc_type'] = $_POST['cc_type'];
$order->info['cc_owner'] = $_POST['cc_owner'];
$order->info['cc_cvv'] = $_POST['cc_cvv'];
// DATA PREPARATION SECTION
unset($submit_data); // Cleans out any previous data stored in the variable
// create a random order id
$uid = $erpNumber; // Create a UID for the order to be sent as payment_reference
// Populate an array that contains all of the data to be sent to DirectOne
$submit_data = array(
vendor_name => MODULE_PAYMENT_DIRECTONE_VENDOR_NAME, // Vendor Login ID
vendor_password => MODULE_PAYMENT_DIRECTONE_VENDOR_PASSWORD, // Vendor Password
card_number => $_POST['cc_number'],
card_type => 'AUTO',
card_expiry => $_POST['cc_expires'],
card_holder => $_POST['cc_owner'],
card_cvv => $_POST['cc_cvv'],
payment_amount => number_format($order->info['total'], 2, '.', '') * 100,
payment_reference => $uid); // Unique Transaction ID
Anything wrong?
Was I using the right tables to collect the option_id and values_id numbers?
Bookmarks