PHP表格整合 - 购物篮格式无效

时间:2015-04-14 14:33:19

标签: php forms sagepay

好的,这让我烦恼,我需要一点帮助或第二双眼睛。 我在测试并将订单确认表单提交给sagepay付款协议3.00时收到以下错误消息:

  

状态:无效

     

状态明细:3021:购物篮格式无效。

以下是加密前的表单内容:

VendorTxCode=wilkies-PAYMENT-20150414141140-263293450
&Amount=245.72
&Currency=GBP
&Description= from J&D Wilkie Ltd
&CustomerName=Foo-Wing Li
&CustomerEMail=foo@jdwilkie.co.uk
&VendorEMail=foo@jdwilkie.co.uk
&SendEMail=1
&eMailMessage=Thank you so very much for your order.
&BillingSurname=Li
&BillingFirstnames=Foo-Wing
&BillingAddress1=Marywell Works
&BillingAddress2=Marywell Brae
&BillingCity=Kirriemuir
&BillingPostCode=DD8 4BJ
&BillingCountry=GB
&BillingPhone=+4401575572502
&ApplyAVSCV2=0
&Apply3DSecure=0
&AllowGiftAid=0
&BillingAgreement=1
&BillingState=
&customerEmail=foo@jdwilkie.co.uk
&DeliveryFirstnames=Foo-Wing
&DeliverySurname=Li
&DeliveryAddress1=Marywell Works
&DeliveryAddress2=Marywell Brae
&DeliveryCity=Kirriemuir
&DeliveryPostCode=DD8 4BJ
&DeliveryCountry=GB
&DeliveryPhone=+4401575572502
&BasketXML=<basket>
<item>
<description>Oil Absorbency 80x86cm</description>
<productSku></productSku>
<productCode></productCode>
<quantity>1</quantity>
<unitNetAmount>102.68</unitNetAmount>
<unitTaxAmount>20.54</unitTaxAmount>
<unitGrossAmount>123.22</unitGrossAmount>
<totalGrossAmount>123.22</totalGrossAmount>
</item>
<item>
<description>Removal Blankets - 60x108</description>
<productSku></productSku>
<productCode></productCode>
<quantity>1</quantity>
<unitNetAmount>102.08</unitNetAmount>
<unitTaxAmount>20.42</unitTaxAmount>
<unitGrossAmount>122.50</unitGrossAmount>
<totalGrossAmount>122.50</totalGrossAmount>
</item>
<deliveryNetAmount></deliveryNetAmount>
<deliveryTaxAmount></deliveryTaxAmount>
<deliveryGrossAmount></deliveryGrossAmount>
</basket>
&SuccessURL=http://www.jdwilkie.co.uk/shop/cart/order_successful.php
&FailureURL=http://www.jdwilkie.co.uk/shop/cart/order_failed.php

由于

1 个答案:

答案 0 :(得分:0)

好的,我找到了解决问题的方法,这让我可以缩小问题所在。

我所做的就是将crypt形式删除了BasketXML数据,因为Sagepay或我们不需要这样做。

&#13;
&#13;
VendorTxCode=wilkies-PAYMENT-20150415105304-104385424
&Amount=255.73
&Currency=GBP
&Description=from J&D Wilkie Ltd
&CustomerName=Foo-Wing Li
&CustomerEMail=foo@jdwilkie.co.uk
&VendorEMail=foo@jdwilkie.co.uk
&SendEMail=1
&eMailMessage=Thank you so very much for your order.
&BillingSurname=Li
&BillingFirstnames=Foo-Wing
&BillingAddress1=Marywell Works
&BillingAddress2=Marywell Brae
&BillingCity=Kirriemuir
&BillingPostCode=DD8 4BJ
&BillingCountry=GB
&BillingPhone=+4401575572502
&ApplyAVSCV2=0
&Apply3DSecure=0
&AllowGiftAid=0
&BillingAgreement=1
&BillingState=
&customerEmail=foo@jdwilkie.co.uk
&DeliveryFirstnames=Foo-Wing
&DeliverySurname=Li
&DeliveryAddress1=Marywell Works
&DeliveryAddress2=Marywell Brae
&DeliveryCity=Kirriemuir
&DeliveryPostCode=DD8 4BJ
&DeliveryCountry=GB
&DeliveryPhone=+4401575572502
&BasketXML=
&SuccessURL=http://www.jdwilkie.co.uk/shop/cart/order_successful.php
&FailureURL=http://www.jdwilkie.co.uk/shop/cart/order_failed.php
&#13;
&#13;
&#13;

每个项目和总总额的增值税似乎都有误,因为它们与根据没有增值税(税)的所有项目的总价值计算的&amp; Amount数量不匹配,然后增值税是从所有项目的总和,它们从计算行项目VAT(Tax)中得出不同的结果,然后将它们一起添加。如果您使用增值税,那么您将理解我的意思。 (如果不提供某种显示价值和增值税(税)的视觉辅助,很难解释。)