我在最近的一篇博文中详细介绍了这个主题:How to automate Moneybookers (Skrill) using status_url (IPN)。有 PHP 和 C# 的示例代码和说明要点的图片:
- 注册 Moneybookers 测试帐户
- 创造一个“秘密词”
- 创建您自己的付款表单(在 Moneybookers 结帐页面上带有您的徽标)
- 验证 Moneybookers 订单
我不会在这里涵盖每一步,因为如果我这样做了,我的答案会占据好几页。但是,我将介绍第四个主题(验证 Moneybookers 订单),因为当前此页面上的答案充满了问题(SQL 注入等)。如果您想了解每个步骤的详细说明,请read my article。
您网站上的简单付款表格
我会更详细地讨论这个in the article,但这里有一个简单的付款表格。将粗体值替换为您的正确价格、应用名称和 Moneybookers 电子邮件:
<form action="https://www.moneybookers.com/app/payment.pl" method="post">
<input type="hidden" name="pay_to_email" value="merchant-email@example.com"/>
<input type="hidden" name="status_url" value="http://example.com/verify.php"/>
<input type="hidden" name="language" value="EN"/>
<input type="hidden" name="amount" value="Total amount (e.g. 39.60)"/>
<input type="hidden" name="currency" value="Currency code (e.g. USD)"/>
<input type="hidden" name="detail1_description" value="YourApp"/>
<input type="hidden" name="detail1_text" value="License"/>
<input type="submit" value="Pay!"/>
</form>
验证 Moneybookers 订单
在用户为您的软件、电子书或其他数字内容付款后,您需要自动验证订单并将他们订购的内容发送到他们的电子邮件地址。在这个例子中我提到了 creating a product key using LimeLM,但你真的可以做任何事情。
在上面的示例表单中,您设置了验证 Moneybookers 订单的脚本位置:
<input type="hidden" name="status_url" value="http://example.com/verify.php"/>
脚本的相关部分是这样的:
// Validate the Moneybookers signature
$concatFields = $_POST['merchant_id']
.$_POST['transaction_id']
.strtoupper(md5('Paste your secret word here'))
.$_POST['mb_amount']
.$_POST['mb_currency']
.$_POST['status'];
$MBEmail = 'merchant-email@example.com';
// Ensure the signature is valid, the status code == 2,
// and that the money is going to you
if (strtoupper(md5($concatFields)) == $_POST['md5sig']
&& $_POST['status'] == 2
&& $_POST['pay_to_email'] == $MBEmail)
{
// Valid transaction.
//TODO: @987654325@ and
// send them to your customer.
}
else
{
// Invalid transaction. Bail out
exit;
}
如果您不知道如何在 Moneybookers 中设置密码,我会在“How to automate Moneybookers (Skrill) using status_url (IPN)”文章中解释如何设置。
全额付款示例
如果您不想自己编写此代码,那么我们为我们的 LimeLM 客户提供了一个完整的付款表单。它是为 PHP、C# 和 VB.NET 编写的,它对我们所有的客户(甚至我们的免费用户)都是免费的。因此,您可以下载它,将其集成到您的网站中,然后无需支付一分钱即可使用。
payment selection page 是这样的: