Ruby中的Sagepay crypt字段

时间:2014-01-27 21:41:13

标签: ruby sagepay

如何编写'Crypt'字段以使其在Ruby中使用协议3.00有效?目前我的字符串如下:

=hidden_field_tag 'Crypt', Base64.encode64('VendorTxCode=406227821909&Amount=32.00&Currency=GBP&Description=Test&SuccessURL=http://example.com/success.php&FailureURL=http://example.com/fail.php&BillingSurname=Smith&BillingFirstnames=John&BillingAddress1=123 Main Street&BillingCity=Anywhere&BillingPostCode=29555&BillingCountry=UK&DeliverySurname=Smith&DeliveryFirstnames=John&DeliverAddress1=123 Main Street&DeliveryCity=Anywhere&DeliveryPostCode=29555&DeliveryCountry=UK')

但每次我都将此错误视为回复:

Status Detail:  5068 : The encryption method is not supported by this protocol version.

提前致谢, 奥斯卡

1 个答案:

答案 0 :(得分:0)

AES加密字符串应以“@”为前缀,以便识别Sage Pay网关的加密方法。相反,在解码之前应删除'@'。

同样使用AES,不需要base64编码....