ASP.NET的WorldPay的集成 [英] ASP .Net WorldPay Integration

查看:148
本文介绍了ASP.NET的WorldPay的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否有人有集成WorldPay的成ASP.Net Web应用程序的任何有用的信息?我期待直接从网站,无需购物车采取支付的固定金额。

I'm wondering whether anyone has any useful information on integrating WorldPay into an ASP.Net web application? I'm looking to take payments for a fixed amount directly from the web site, no shopping cart required.

基本上我只是在寻找一些参考源$ C ​​$ C或一篇好文章的覆盖需要什么。是否WorldPay的支持Web服务或REST等?

Essentially I'm just looking for some reference source code or a good article covering what's required. Does WorldPay support web services or REST etc?

干杯,

布莱恩。

推荐答案

你的结帐页面包括以下形式(相关值):

Include on your "checkout" page the following form (with the relevant values):

<form action="https://select.worldpay.com/wcc/purchase" method="post">
    <input type="hidden" name="instId" value="<your worldpay installation ID>" />
    <input type="hidden" name="cartId" value="<a reference for this transaction>" />
    <input type="hidden" name="amount" value="<the amount to pay>" />
    <input type="hidden" name="currency" value="<your currency code i.e. GBP>" />
    <input type="hidden" name="desc" value="<a description of this transaction>" />
    <input type="hidden" name="testMode" value="<worldpay's test mode ID>" />
    <input type="hidden" name="name" value="<customer's name>" />
    <input type="hidden" name="address" value="<customer's full address>" />
    <input type="hidden" name="postcode" value="<customer's postcode>" />
    <input type="hidden" name="country" value="<country code i.e. GB>" />
    <input type="hidden" name="email" value="<customer's email address>" />
</form>

然后在你的WorldPay的配置文件(在他们的网站,一旦你注册的),你有回发网址的选项(不记得确切的标签),这将发布以下按键来此URL(所以它会在您的网站的网页,收到此),包含交易的结果是:

Then in your Worldpay profile (on their website once you've registered) you'll have an option for postback URL (can't remember the exact label) which will POST the following keys to this URL (so it'll be a page on your website that receives this) containing the result of the transaction:

string wp_rawauthcode = Request.Form["rawauthcode"];
string wp_amount = Request.Form["amount"];
string wp_installation = Request.Form["installation"];
string wp_tel = Request.Form["tel"];
string wp_address = Request.Form["address"];
string wp_mc_log = Request.Form["mc_log"];
string wp_rawauthmessage = Request.Form["rawauthmessage"];
string wp_authamount = Request.Form["authamount"];
string wp_amountstring = Request.Form["amountstring"];
string wp_cardtype = Request.Form["cardtype"];
string wp_avs = Request.Form["avs"];
string wp_cost = Request.Form["cost"];
string wp_currency = Request.Form["currency"];
string wp_testmode = Request.Form["testmode"];
string wp_authamountstring = Request.Form["authamountstring"];
string wp_fax = Request.Form["fax"];
string wp_transstatus = Request.Form["transstatus"];
string wp_compname = Request.Form["compname"];
string wp_postcode = Request.Form["postcode"];
string wp_authcost = Request.Form["authcost"];
string wp_desc = Request.Form["desc"];
string wp_cartid = Request.Form["cartid"];
string wp_transid = Request.Form["transid"];
string wp_callbackpw = Request.Form["callbackpw"];
string wp_sessionId = Request.Form["MC_sessionId"];
string wp_CusId = Request.Form["MC_cusId"];
string wp_authmode = Request.Form["authmode"];
string wp_name = Request.Form["name"];
string wp_shop = Request.Form["MC_shop"];
string wp_wafMerchMessage = Request.Form["wafMerchMessage"];
string wp_authentication = Request.Form["authentication"];
string wp_email = Request.Form["email"];

在这里就像确保执行一些基本的验证安装ID(wp_installation)匹配您的期望,并设置订单状态前的金额,币种等,以付费什么的。

Perform some basic validation here like making sure the installation ID (wp_installation) matches what you expect, and the amount, currency etc before setting the order status to "Paid" or something.

这篇关于ASP.NET的WorldPay的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆