为sagepay网关创建基本付费按钮

Dan*_*ter 5 button opayo

我有一个客户已经注册了一个sagepay帐户.他目前的网站运行wordpress 3.0,目前没有任何电子商务功能.

他需要一个按钮,让用户通过sagepay提交300英镑的押金(这个金额永远不会改变).(通常情况下,我建议使用PayPal这样的东西,但显然由于他的业务的旅行性质,paypal将不会让我的客户有专业帐户)

我已经看过三月份在类似线程中描述的方法(我如何制作一个SagePay BuyNow按钮?),但我不确定如何在wordpress的页面中实现这个,而不是非常了解php栏基本模板编辑,所以我完全迷失在$ PAYMENT_CRYPT部分.

如果有人能够提供我需要采取的步骤来实现每次提交相同金额的基本按钮,然后收集所有卡片详细信息/客户详细信息,一旦将它们发送到sagepay网关,我们将非常感激!

The*_*Kid 2

简而言之,不。这些并不是解决这个问题的简单方法。除非您将付款表单链接到 SagePay 并使用新的 IFRAME 功能。您可以在 WordPress 中获取某些允许在模板页面或模板文件上编写 PHP 代码的信息。

\n\n

1 - 在 PHP 服务器中对表单进行 IFRAME,并自行对表单进行编码,这样 CSS 将变得像 WordPress 页面上的 CSS 一样

\n\n

2 - 为其创建支付模块

\n\n

3 - 使用 WordPress 现有的支付电子商务服务器模块 - 已经有很多插件

\n\n

4 - 创建一个付款按钮超链接,单击后,它将转到您服务器上的 PHP 表单,金额为 \xc2\xa3300。

\n\n

5 - 使用 Nochex 或其他支付供应商、Google 钱包等(这对客户来说不是一个简单的选择)

\n\n

通过 FORM,您可以:

\n\n
<? \n\n# Define your vars\n\n$serverLive="https://live.sagepay.com/gateway/service/vspform-register.vsp"\n//$serverLive="https://test.sagepay.com/gateway/service/vspform-register.vsp"\n$YOUR_VENDOR_LOGIN_NAME="";\n$VendorTxCode="406227821909";\n$Amount="350.00";\n$Currency="GBP";\n$Description="1 ACME Widget";\n$SuccessURL="http://example.com/success.php";\n$FailureURL="http://example.com/fail.php";\n$BillingSurname="Smith";\n$BillingFirstnames="John";\n$BillingAddress1="123 Main Street";\n$BillingCity="Anywhere";\n$BillingPostCode="29555";\n$BillingCountry="USA";\n$DeliverySurname="Smith";\n$DeliveryFirstnames="John";\n$DeliverAddress1="123 Main Street";\n$DeliveryCity="Anywhere";\n$DeliveryPostCode="29555";\n$DeliveryCountry="GBP";\n\n# The address information can be done via jQuery on your page or get some defaults\n\n?>\n<form action="<?=$serverLive?>" method="POST" id="SagePayForm" name="SagePayForm">\n    <input type="hidden" name="VPSProtocol" value="2.23" />\n    <input type="hidden" name="TxType" value="PAYMENT" />\n    <input type="hidden" name="Vendor" value="<?= $YOUR_VENDOR_LOGIN_NAME ?>" />\n    <input type="hidden" name="Crypt" value="<?= $PAYMENT_CRYPT ?>">    \n    <input type="image" src="images/buynow-sagepay.png" />\n</form>\n<script type="text/javascript">\nfunction submitform()\n{\n  document.SagePayForm.submit();\n}\nsubmitform();\n</script>\n
Run Code Online (Sandbox Code Playgroud)\n\n

即使使用此代码,您仍然需要使用一些 SagePay 库,例如 XOR 和 Crypt 函数:

\n\n
// Crypt and XOR functions\nprivate function simpleXor($string, $password) {\n    $data=array();\n    for ($i=0; $i < utf8_strlen($password); $i++) {\n        $data[$i]=ord(substr($password, $i, 1));\n    }\n    $output=\'\';\n    for ($i=0; $i < utf8_strlen($string); $i++) {\n    $output .= chr(ord(substr($string, $i, 1)) ^ ($data[$i % utf8_strlen($password)]));\n    }\n    return $output;     \n}\n
Run Code Online (Sandbox Code Playgroud)\n