= 0 ; $i--){ // Find the position in the string $start = strpos($thisString, $Tokens[$i]); // If it's present if ($start !== false){ // Record position and token name $resultArray[$i]->start = $start; $resultArray[$i]->token = $Tokens[$i]; } } // Sort in order of position sort($resultArray); // Go through the result array, getting the token values for ($i = 0; $istart + strlen($resultArray[$i]->token) + 1; // Get the length of the value if ($i==(count($resultArray)-1)) { $output[$resultArray[$i]->token] = substr($thisString, $valueStart); } else { $valueLength = $resultArray[$i+1]->start - $resultArray[$i]->start - strlen($resultArray[$i]->token) - 2; $output[$resultArray[$i]->token] = substr($thisString, $valueStart, $valueLength); } } // Return the ouput array return $output; } // Randomise based on time function randomise() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } ///////////////////////////////////////////////////////// /////////////// END OF PROTX FUNCTIONS /////////////// ///////////////////////////////////////////////////////// function repeatVars() { return FALSE; } function fixedVars() { global $module, $orderSum, $config; if(!empty($orderSum['add_2_d'])) { $delAdd = $orderSum['add_1_d'].", ".$orderSum['add_2_d'].", ".$orderSum['town_d'].", ".$orderSum['county_d'].", ".$orderSum['country_d']; } else { $delAdd = $orderSum['add_1_d'].", ".$orderSum['town_d'].", ".$orderSum['county_d'].", ".$orderSum['country_d']; } if(!empty($orderSum['add_2'])) { $invAdd = $orderSum['add_1'].", ".$orderSum['add_2'].", ".$orderSum['town'].", ".$orderSum['county'].", ".getCountryFormat($orderSum['country'],"id","printable_name"); } else { $invAdd = $orderSum['add_1'].", ".$orderSum['town'].", ".$orderSum['county'].", ".getCountryFormat($orderSum['country'],"id","iso"); } $VendorTxCode = 'CC4'.(rand(0,32000)*rand(0,32000)); $cryptVars = "VendorTxCode=".$VendorTxCode ."&Amount=".$orderSum['prod_total'] ."&Currency=".$config['defaultCurrency'] ."&Description=Cart - ".$orderSum['cart_order_id'] ."&CustomerEmail=".$orderSum['email'] ."&CustomerName=".$orderSum['name'] ."&VendorEmail=".$config['masterEmail'] ."&DeliveryAddress=".$delAdd ."&DeliveryPostCode=".$orderSum['postcode_d'] ."&BillingAddress=".$invAdd ."&BillingPostCode=".$orderSum['postcode'] ."&ContactNumber=".$orderSum['phone'] // ."&ApplyAVSCV2=0&Apply3DSecure=0&ShoppingBasket=ON" We have taken our the ShoppingBasket Variable - It seemed Protx didn't need it. ."&ApplyAVSCV2=0&Apply3DSecure=0" ."&SuccessURL=".$GLOBALS['storeURL']."/index.php?_g=rm&type=gateway&cmd=process&module=Protx&cart_order_id=".$orderSum['cart_order_id'] ."&FailureURL=".$GLOBALS['storeURL']."/index.php?_g=rm&type=gateway&cmd=process&module=Protx&cart_order_id=".$orderSum['cart_order_id']; $encrypted = base64Encode(SimpleXor($cryptVars,$module['passphrase'])); $hiddenVars = " "; return $hiddenVars; } /////////////////////////// // Other Vars //////// if($module['gate'] == "sim") { $formAction = "https://ukvpstest.protx.com/VSPSimulator/VSPFormGateway.asp"; } elseif($module['gate'] == "test") { $formAction ="https://ukvpstest.protx.com/vps2form/submit.asp"; } elseif($module['gate'] == "live"){ $formAction ="https://ukvps.protx.com/vps2form/submit.asp"; } $formMethod = "post"; $formTarget = "_self"; $transfer = "auto"; ?>