The first thing to do is to confirm that mcrypt is installed and running on the server. It is necessary to get v3 to work and users have had issues with that typically and need to contact their hosting provider.
To check, add this code to a blank page and view it in the browser:
<?php
phpinfo();
?>
Search the result for mcrypt... if it isn't listed, contact your hosting provider and let them know you need it installed.
Here is a new include file that includes the functions for v3 support (attached).
Upload this file in place of the one that is there.
Then open the confirm.php page. The rest of the changes will be made to this page.
Find the hidden form element named "VPSProtocol" and update it to version 3. It will look like:
<input type="hidden" name="VPSProtocol" id="VPSProtocol" value="3.0" />
Then, just below it you can add php code to specify the values being passed to it. Use this code:
<?php
$timeStamp = WAEC_getTimestamp();
$optionArray = array();
$optionArray['VendorTxCode'] = $timeStamp;
$optionArray['Amount'] = $[yourcart]->GrandTotal();
$optionArray['Currency'] = "GBP";
$optionArray['Description'] = $timeStamp;
$optionArray['SuccessURL'] = "http://[yourdomain]/checkout_success.php";
$optionArray['FailureURL'] = "http://[yourdomain]/checkout_failure.php";
$optionArray['CustomerEmail'] = ((isset($_POST["email"]))?$_POST["email"]:"");
$optionArray['VendorEmail'] = "[youremail]";
$optionArray['DeliverySurname'] = ((isset($_POST["shipping_lastname"]))?$_POST["shipping_lastname"]:"");
$optionArray['DeliveryFirstnames'] = ((isset($_POST["shipping_firstname"]))?$_POST["shipping_firstname"]:"");
$optionArray['DeliveryAddress1'] = ((isset($_POST["shipping_street1"]))?$_POST["shipping_street1"]:"");
$optionArray['DeliveryAddress2'] = ((isset($_POST["shipping_street2"]))?$_POST["shipping_street2"]:"");
$optionArray['DeliveryPostCode'] = ((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"");
$optionArray['DeliveryCity'] = ((isset($_POST["shipping_city"]))?$_POST["shipping_city"]:"");
$optionArray['DeliveryCountry'] = ((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"");
$optionArray['BillingSurname'] = ((isset($_POST["lastname"]))?$_POST["lastname"]:"");
$optionArray['BillingFirstnames'] = ((isset($_POST["firstname"]))?$_POST["firstname"]:"");
$optionArray['BillingAddress1'] = ((isset($_POST["street1"]))?$_POST["street1"]:"");
$optionArray['BillingAddress2'] = ((isset($_POST["street2"]))?$_POST["street2"]:"");
$optionArray['BillingPostCode'] = ((isset($_POST["postcode"]))?$_POST["postcode"]:"");
$optionArray['BillingCity'] = ((isset($_POST["city"]))?$_POST["city"]:"");
$optionArray['BillingCountry'] = ((isset($_POST["country"]))?$_POST["country"]:"");
$optionArray['ContactNumber'] = ((isset($_POST["phone"]))?$_POST["phone"]:"");
$optionArray['ContactFax'] = ((isset($_POST["fax"]))?$_POST["fax"]:"");
$optionArray['AllowGiftAid'] = "0";
$optionArray['ApplyAVSCV2'] = "0";
$optionArray['Apply3DSecure'] = "0";
$optionArray['EMailMessage'] = "";
?>
Replace [yourdomain] with the actual web address to your server... replace [youremail] with the business email address, and replace [yourcart] with the name of the eCart object you are using.
You will also have to change the form element names listed to match yours (these are from eCart v5)... you can find those references in the hidden form element named "Crypt" below.
Once you have populated the code above onto the page with the correct values, the final step is to update the "Crypt" hidden form element to use the V3 version of the code.
The new Crypt hidden form element will look like:
<input type="hidden" name="Crypt" id="Crypt" value="<?php echo WA_Protx_VSPFormHash_v3($[yourcart], "[yourprotxpassword]", $optionArray); ?>" />
That should be it. If you have any questions let me know.
(download the attachment from post #39 of this thread)