Crypt Field加密错误PHP

时间:2013-12-03 21:27:55

标签: php payment-gateway sagepay

我正在尝试从我的php表单发送Crypt数据到sagepay测试网站。 我正在使用saegepay 2.23 php kit使用函数encryptAndEncode()来加密数据。

当我传递数据时,我收到错误 状态:无效

状态明细:3003:货币无效。

我的代码如下

  

包括“library.php”;

     

$ CRYPT =“VendorTxCode = 56g9& Amount = 320& Currency = GBP   & Description = Ticket& SuccessURL = EDITED-OUT / registered-thanks   & FailureURL = EDITED-OUT / registered-fail& BillingSurname = aaqib   & BillingFirstnames = Abc& BillingAddress1 = abc& BillingCity = London   & BillingPostCode = se1234& BillingCountry = UK& DeliverySurname = zar   & DeliveryFirstnames =& DeliverAddress1 =& DeliveryCity =   & DeliveryPostCode =& DeliveryCountry = UK& AllowGiftAid = 1“;

     

$ strCrypt = encryptAndEncode($ CRYPT);

     

&GT?;

form
 action="https://test.sagepay.com/gateway/service/vspform-register.vsp"
 method="POST" id="SagePayForm" name="SagePayForm">
     <input type="hidden" name="VPSProtocol" value="2.23" />
     <input type="hidden" name="TxType" value="PAYMENT" />
     <input type="hidden" name="Vendor" value="myvendorkey" />
     <input type="hidden" name="Crypt" value="<?= $strCrypt  ?>">    
     <input type="image" src="http://ebizmarts.com/addons/shared_addons/themes/baseebizmarts/img/logos/sagepay_logo_main-250.gif"
 /> </form>

在库文件中,我将$ strEncryptionPassword分配给sagepay提供的加密密钥。

谢谢

2 个答案:

答案 0 :(得分:0)

请三重检查加密密码是否正确,错误消息可能会产生误导,但通常错误是由于加密密码错误。

此致

巴勃罗

答案 1 :(得分:0)

您似乎在所有字段的末尾都有空格,因此货币以GBP的形式发送(包括空格在内的四个字符)。删除空格。

相关问题