2014-10-31 5 views
0

나는 거래를 완료 한 후 sagepay 서버가 다음 값의 응답을 반환합니다. 내가 버튼을 Sagepay를 서버가 오류를 던져 "환불"을 클릭하면sageapy에서 RelatedSecurityKey가 필요합니다.

[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 

나는, 위의 매개 변수가 "환불 TRANSACTION"에 입력 전달합니다.

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>"; 
    ?> 

일부 사람은 그것을 해결하기 위해 어떻게 나를 도울 수있는 "RelatedSecurityKey"을 전달하는 방법을 ....

답변

0

this Sagepay API documentation에 문서화 된 요청 개체를 기반으로 "RelatedSecur"라는 필드를 전달해야합니다 ityKey ".

처음 거래를 등록 할 때 Sagepay 응답의 일부로 값을 부여 받았을 것입니다 (리디렉션/iframe에 대해 "NextUrl"을 얻은 시점에서). "SecurityKey"-이 값을 나중에 다시 사용할 수 있도록 데이터베이스에 저장해야합니다.

+0

실제로는 구현에 따라 크게 달라집니다. 이 페이지의 SagePay에서 제공하는 API 예제를 참조하십시오. http://www.sagepay.co.uk/support/find-an-integration-document/server-inframe-integration-documents – Carl