SagePay Server Integration Verify Signature

醉酒当歌 提交于 2019-12-05 16:52:39

The string you build doesn't seem to match the documentation, which states:

MD5 signature of the concatenation of the values of: VPSTxId + VendorTxCode + Status + TxAuthNo + VendorName+ AVSCV2 + SecurityKey + AddressResult + PostCodeResult + CV2Result + GiftAid + 3DSecureStatus + CAVV + AddressStatus + PayerStatus + CardType + Last4Digits + DeclineCode + ExpiryDate + FraudResponse + BankAuthCode.

NOTE: MD5 value is returned in UPPER CASE.

Please ensure the VendorName is LOWER CASE prior to hashing. Use urldecode to reverse the urlencoding you received from Sagepay If a field is returned without a value this should not be be checked against the string

Compare the fields after CAVV with your fields. Yours seems to be missing the AddressStatus and PayerStatus.

Also, I don't think @dav83's number (3) in his comment is correct. In my code where it's working correctly, my VPSTxId does contain the curly braces (just like in your example).

This was in fact due to URL encoding in the end.

The 'html_entity_decode' was required for the VPSTxId. The POST needs to be urlencode and the response needs to be urldecode.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!