我已完成交易,然后 sagepay 服务器返回以下值的响应。
[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
我把上面的参数都输入到了“退款交易”,当我点击“REFUND“按钮 sagepay 服务器抛出错误。
ERROR:
VPSProtocol=3.00
Status=INVALID
StatusDetail=3033 : The RelatedSecurityKey is required.
VPSTxId={B67E6F2C-1E84-4C36-1E49-0AF89DD8B200}
实际代码:
<?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>";
?>
如何传递“相关安全密钥”?有人可以帮助我,如何修复它?......
基于记录在请求对象这个 Sagepay API 文档 http://www.sagepay.co.uk/file/12251/download-document/SHARED_Protocol_Guidelines_010814.pdf,您需要传递一个名为“RelatedSecurityKey”的字段。
当您第一次注册交易时,您将获得此值作为 Sagepay 响应的一部分(同时您获得重定向/iframe 的“NextUrl”) - 此时它被称为“SecurityKey” -您应该将此值存储在数据库中以供以后重用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)