How to perform Opayo Integration using PHP

668 Views Asked by At

I'm trying to add integration with Opayo payment on website.

The form

I just have this code: I change card and card holder details for security reason

$text ='Description=Finishing transaction&Currency=GBP&VendorTxCode=22013115512924219800&amount=5.00&BillingSurname=Paul&BillingFirstnames=Smith&BillingAddress1=ddd&BillingCity=London&BillingPostCode=BH99PU&BillingCountry=GB&DeliveryState=&DeliverySurname=Jhon&DeliveryFirstnames=Jhon&DeliveryAddress1=ddd&DeliveryCity=London&DeliveryPostCode=BH99PU&BillingState=&DeliveryCountry=GB&VendorData=Testing Data &ApplyAVSCV2=2&referid=&language=&website=&Phone=SendEmail=&CardHolder=Smith Alves Gomety&Cardnumber=5434391244446116&ExpiryDate=1229&CardType=MC';

$key = "yuG4B75PE2Gaqgus";
$iv = hex2bin('00000000000000000000000000000000');
$ciphertext_raw = openssl_encrypt($text , "AES-128-CBC", $key , OPENSSL_RAW_DATA, $iv);
$hex = bin2hex($ciphertext_raw);
$hex ='@' . $hex;
<form method="POST" id="SagePayForm" action="https://test.sagepay.com/gateway/service/vspform-register.vsp">
    <input type="hidden" name="VPSProtocol" value= "4.00">
    <input type="hidden" name="TxType" value= "PAYMENT">
    <input type="hidden" name="Vendor" value= "xxxxxxxxxxxxxxx">
    <input type="hidden" name="Crypt" value= "<?php echo $hex; ?>">
    <input type="submit" value="continue to SagePay">
</form>

The page comes like following

Page generated

And, when I click on "Continue to SagePay" I'm receiving the following

Ssubmiting result

Does anyone can help me with this?

How to integrate in my own form or on SagePay?

Does anyone has full PHP code to this integration including returnings codes,,,,

0

There are 0 best solutions below