How to make a BuyNow SagePay button?

With PayPal, I can easily create a BuyNow button containing my trading information, price, tax, delivery, etc. Is this possible in SagePay?

+4
source share
1 answer

The desired system is called the SagePay form in relation to the similarity to the PayPal BuyNow + PDT button. First, you need to create a FORM, for example:

<form action="https://live.sagepay.com/gateway/service/vspform-register.vsp" method="POST" id="SagePayForm" name="SagePayForm">
    <input type="hidden" name="VPSProtocol" value="2.23" />
    <input type="hidden" name="TxType" value="PAYMENT" />
    <input type="hidden" name="Vendor" value="<?= $YOUR_VENDOR_LOGIN_NAME ?>" />
    <input type="hidden" name="Crypt" value="<?= $PAYMENT_CRYPT ?>">    
    <input type="image" src="images/buynow-sagepay.png" />
</form>

(You can change the current URL with the test one: https://test.sagepay.com/gateway/service/vspform-register.vsp )

As for $ PAYMENT_CRYPT, you should first create a line like this:

VendorTxCode=406227821909
&Amount=32.00
&Currency=USD
&Description=1 ACME Widget
&SuccessURL=http://example.com/success.php
&FailureURL=http://example.com/fail.php
&BillingSurname=Smith
&BillingFirstnames=John
&BillingAddress1=123 Main Street
&BillingCity=Anywhere
&BillingPostCode=29555
&BillingCountry=USA
&DeliverySurname=Smith
&DeliveryFirstnames=John
&DeliverAddress1=123 Main Street
&DeliveryCity=Anywhere
&DeliveryPostCode=29555
&DeliveryCountry=USA

, , PayPal , . , , , , , .

, PP, , BuyNow, , , . "& Basket =", , , . , & Amount , . ( & Basket). , & Basket , . , .

VendorTxCode, , , .

$PAYMENT_CRYPT XOR + Base64, , SagePay. AES + Binhex, , mcrypt. STILL !

XOR, , " ", ASCII ASCII- ( XOR). Base64 POST. Base64 PHP.

PayPal PDT, IPN PayPal. - success.php fail.php URL GET, (base64 decode + XOR), , , . SagePay .

success.php fail.php , . , query & crypt , , , "OK".

, success.php. success.php? Custom = value, , . & crypt = . fail.php.

SagePay , , PHP- mail() .

: , URL- . , -, ( 1 ) " ".

http://www.sagepay.com/sites/default/files/downloads/sagepayformprotocolandintegrationguidelines_0.pdf

EDIT: (25 2017 .) - https://www.sagepay.co.uk/file/25041/download-document/FORM_Integration_and_Protocol_Guidelines_270815.pdf

+7

All Articles