Current File : /home/inlingua/public_html/sensoriumpsychologists.com/backup/include/pg/protx/form.php |
<?php
if(isset($_GET['id']) && $_GET['id']!=''):
$id=$_GET['id'];
endif;
$ord=new query('orders');
$ord->Where="where id='".$id."'";
$order=$ord->DisplayOne();
$order_detail= new query('order_detail');
$order_detail->Where="where order_id='".$id."'";
$order_detail->DisplayAll();
# make basket string;
$basket_in_string='';
$basket_line='';
$basket_items=0;
while($od= $order_detail->GetObjectFromRecord()):
$basket_in_string.=':'.$od->product_name.':'.$od->quantity;
$basket_in_string.=':'.number_format($od->price, 2).':';
$basket_in_string.=':'.$od->price.':'.number_format($od->price*$od->quantity, 2);
++$basket_items;
endwhile;
# add shipping string.
$basket_in_string.=':'.'shipping'.':1:'.$order->shipping.':::'.$order->shipping;
$basket_in_string=($basket_items+1).$basket_in_string;
# order details
$intRandNum = rand(0,32000)*rand(0,32000);
$strVendorTxCode=$order->id.'_'.$intRandNum;
$order_detail_4_protx="VendorTxCode=" . $strVendorTxCode; /** As generated above **/
$order_detail_4_protx=$order_detail_4_protx . "&Amount=" . number_format($order->grand_total,2); // Formatted to 2 decimal places with leading digit
$order_detail_4_protx=$order_detail_4_protx . "&Currency=" . CURRENCY;
$order_detail_4_protx=$order_detail_4_protx . "&Description= online order for " . PROTX_VENDER_NAME;
$order_detail_4_protx=$order_detail_4_protx . "&SuccessURL=" .DIR_WS_SITE.'include/pg/protx/success.php';
$order_detail_4_protx=$order_detail_4_protx . "&FailureURL=" .make_url('fail');
$order_detail_4_protx=$order_detail_4_protx . "&CustomerName=" . $order->billing_firstname;
$order_detail_4_protx=$order_detail_4_protx . "&CustomerEMail=" . $order->billing_email;
$order_detail_4_protx=$order_detail_4_protx . "&VendorEMail=" .ADMIN_EMAIL;
$order_detail_4_protx=$order_detail_4_protx . "&eMailMessage=Thank you so very much for your order.";
$order_detail_4_protx=$order_detail_4_protx . "&BillingAddress=" . $order->billing_address1.','.$order->billing_address2;
$order_detail_4_protx=$order_detail_4_protx . "&BillingPostCode=" . $order->billing_zip;
$order_detail_4_protx=$order_detail_4_protx . "&DeliveryAddress=" . $order->shipping_address1.','.$order->shipping_address2;
$order_detail_4_protx=$order_detail_4_protx . "&DeliveryPostCode=" . $order->shipping_zip;
$order_detail_4_protx=$order_detail_4_protx . "&Basket=" . $basket_in_string; // As created above
$order_detail_4_protx=$order_detail_4_protx . "&AllowGiftAid=0";
$order_detail_4_protx=$order_detail_4_protx . "&Apply3DSecure=0";
$strCrypt = base64Encode(SimpleXor($order_detail_4_protx,PROTX_ENT_PASSWORD));
?>
<input type="hidden" name="VPSProtocol" value="2.22">
<input type="hidden" name="TxType" value="PAYMENT">
<input type="hidden" name="Vendor" value="<?=PROTX_VENDER_NAME?>">
<input type="hidden" name="Crypt" value="<?=$strCrypt ?>">