close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Sagepay Version 3

Thread began 4/14/2015 10:58 pm by J7HNW | Last modified 8/17/2015 12:31 pm by J7HNW | 7793 views | 54 replies

Ray BorduinWebAssist

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:
<?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:
<?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:

php:
<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)


Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...