SagePay协议3.00 PHP服务器集成查询字符串POST

时间:2015-07-23 11:03:16

标签: php server integration query-string sagepay

我是一名初学PHP开发人员,并尝试将sagepay与我的网站集成,以便客户访问我网站上的链接'www.example.com/payment'并填写一张表格,其中包含他们欠我的金额和我分配给他们的相应发票号码及其帐号,帐单明细,地址,全名,邮政编码和送货地址,然后应创建发送到SagePay服务器的查询字符串。

下面,我有一个我将在网站上添加的表单示例:

<form action="https://test.sagepay.com/gateway/service/vspform-register.vsp" method="post" id="SagePayForm" name="SagePayForm">
<input type="hidden" name="Vendor" value="Vendorname" />
<input type="hidden" name="VPSProtocol" value="3.00" />
<input type="hidden" name="TxType" value="PAYMENT" />
<input type="hidden" name="Currency" value="GBP"><br />
<input type="hidden" name="NotificationURL" value="http://example.com/payment/"
<input type="number" name="VendorTxCode" placeholder="Invoice Number" value="123456"><br />
<input type="number" name="Amount" placeholder="Amount" value="250"><br />
<input type="text" name="Description" placeholder="Description of Invoice" value="Payment for your services"><br />
<input type="text" name="BillingFirstnames" placeholder="Firstname(s)" value="Fname Mname"><br />
<input type="text" name="BillingSurname" placeholder="Surname" value="Surname"><br />
<input type="text" name="BillingAddress1" placeholder="Address Line 1" value="BillAddress Line 1"><br />
<input type="text" name="BillingAddress2" placeholder="Surname" value="BillAddress Line 2"><br />
<input type="text" name="BillingCity" placeholder="City" value="BillCity"><br />
<input type="text" name="BillingPostCode" placeholder="Post/Zip Code" value="W1A 1BL"><br />
<input type="text" name="BillingCountry" placeholder="Country" value="United Kingdom"><br /><br />

<input type="text" name="DeliveryFirstnames" placeholder="Firstname(s)" value="Fname Mname"><br />
<input type="text" name="DeliverySurname" placeholder="Surname" value="Surname"><br />
<input type="text" name="DeliveryAddress1" placeholder="Address Line 1" value="BillAddress Line 1"><br />
<input type="text" name="DeliveryAddress2" placeholder="Surname" value="BillAddress Line 2"><br />
<input type="text" name="DeliveryCity" placeholder="City" value="BillCity"><br />
<input type="text" name="DeliveryPostCode" placeholder="Post/Zip Code" value="W1A 1BL"><br />
<input type="text" name="DeliveryCountry" placeholder="Country" value="United Kingdom"><br />

<input type="submit" name="submit" value="Submit">
</form>

我一直收到INVALID状态错误,错误代码为:5030,上面写着:5030:我们无法处理您的消息,请检查您的集成设置或联系支持团队

任何指导将不胜感激。感谢

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

直接api: https://github.com/colinbm/sagepay-php

使用起来非常简单。