I have complected transactions then the sagepay server return the response of following values.
[VendorTxCode] => 14-10-31-10-49-36-196489754
[VPSTxId] => {AADB57CA-B7BF-1A70-682F-60303C2AF7E2}
[Status] => OK
[StatusDetail] => 0000 : The Authorisation was Successful.
[TxAuthNo] => 145552
[AVSCV2] => SECURITY CODE MATCH ONLY
[AddressResult] => NOTMATCHED
[PostCodeResult] => NOTMATCHED
[CV2Result] => MATCHED
[GiftAid] => 0
[3DSecureStatus] => OK
[CAVV] => AAABARR5kwAAAAAAAAAAAAAAAAA=
[CardType] => VISA
[Last4Digits] => 0006
[DeclineCode] => 00
[Amount] => 10.00
[BankAuthCode] => 999777
I pass the above parameters are input to the "REFUND TRANSACTION",When I click the "REFUND"button the sagepay server throw an error.
ERROR:
VPSProtocol=3.00
Status=INVALID
StatusDetail=3033 : The RelatedSecurityKey is required.
VPSTxId={B67E6F2C-1E84-4C36-1E49-0AF89DD8B200}
Actual Code:
<?php
$responseArray = decode($_REQUEST['crypt']); //call to the decode method it return the human readable format
$relatedVendorTxCode = $responseArray['VendorTxCode'];
$amout = $responseArray['Amount'];
$relatedVPSTxId = $responseArray['VPSTxId'];
$relatedTxAuthNo = $responseArray['TxAuthNo'];
$vendorTxCode = 'REF'.$responseArray['VendorTxCode'];
echo "
<form method='POST' id='SagePayForm' action='https://test.sagepay.com/gateway/service/refund.vsp'>
<input type='hidden' name='VPSProtocol' value= '3.00'>
<input type='hidden' name='TxType' value= 'REFUND'>
<input type='hidden' name='Vendor' value= 'protxross'>
<input type='hidden' name='Currency' value= 'GBP'>
<input type='hidden' name='Description' value= 'Description'>
<input type='hidden' name='RelatedVendorTxCode' value= '{$relatedVendorTxCode}'>
<input type='hidden' name='RelatedVPSTxId' value= '{$relatedVPSTxId}'>
<input type='hidden' name='Amount' value= '{$amout}'>
<input type='hidden' name='VendorTxCode' value= '{$vendorTxCode}'>
<input type='submit' value='REFUND'>
</form>";
?>
How to pass the "RelatedSecurityKey"?Some one can help me,How to fix it?....