2014-01-20 25 views
0

我一直试图解决这个问题现在整整一天(​​浪费我的时间)。 我也有一位来自sagepay的技术人员,但他们只是花了很长时间才完成这项工作。Sagepay 3121:DeliveryFirstnames值太长

当我提交以下资料,我得到3121:该DeliveryFirstnames值太长

VendorTxCode=fake 
&Amount=320 
&Currency=GBP 
&Description=Ticket 
&SuccessURL=obscured 
&FailureURL=obscured 
&VendorEmail=obscured.com 
&CustomerName=John Deer 
&CustomerEMail=obscured.com 
&BillingSurname=aaqib 
&BillingFirstnames=Abc 
&BillingAddress1=abc 
&BillingCity=London 
&BillingPostCode=se1234 
&BillingCountry=GB 
&DeliverySurname=Deer 
&DeliveryFirstnames=John   
&DeliverAddress1=Bleh 
&DeliveryCity=TEST 
&DeliveryPostCode=1234 
&DeliveryCountry=GB 
&AllowGiftAid=0 

我试图在这一领域的各种组合和他们没有工作。

回答

1

很抱歉,您今天遇到了解决您的问题的困难。您能否请您将测试交易发布到我们的showpost地址,以便我可以为您进行调查。地址是https://test.sagepay.com/showpost/showpost.asp

如果您可以让Sage Pay知道您尝试此交易的时间,我们可以找到它。

DeliveryFirstnames的值不能超过20个字符。 DeliverySurname,BillingFirstnames和BillingSurname相同。如果该值超过20个字符,则会出现该错误。

感谢,

贤者支付抚养费

+0

谢谢,其中一个支持团队帮助我,我们终于解决了这个问题。看来我的加密函数打破了帖子的值,并在'DeliveryFirstnames'后面删除了“&”,从而使得它之后的所有字段成为字符串的一部分。 我刚刚使用了一个新的加密类,问题得到解决。 –

0

确定这样一个大的斗争后,我改变了我的加密功能,这个问题得到了解决。 以下是我目前用于成功付款的功能。

function pkcs5_pad($text, $blocksize) 
{ 
    $pad = $blocksize - (strlen($text) % $blocksize); 
    return $text . str_repeat(chr($pad), $pad); 
} 

function encryptFieldData($input) 
{ 
    $key = 'your password here'; 
    $iv = $key; 

    $input = pkcs5_pad($input, 16); 
    $strCrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $input, MCRYPT_MODE_CBC,$iv); 
    return "@".bin2hex(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $input, MCRYPT_MODE_CBC, $iv)); 
} 
cryptString = 'All your encryption data seperated by an &'; 
$cryptedData = encryptFieldData($cryptString);