简体   繁体   English

dotnetnuke中的支付网关模块

[英]Payment Gateway module in dotnetnuke

I have done an interswitch payment gateway in my regular asp.net webform and asp.net mvc. 我已经在常规的asp.net webform和asp.net mvc中完成了一个跨交换机支付网关。

But I have a requirement to do the same in dotnetnuke which i know i can through module. 但是我有一个要求在dotnetnuke中做同样的事情,我知道我可以通过模块完成。

In my pay now pay of my application i have a form to send data across to interswitch webservice the form is below 在我现在的应用程序付款中,我有一个表格可以将数据发送到Interswitch Web服务,该表格如下

<form name="form1" action="https://stageserv.interswitchng.com/test_paydirect/pay"
method="post">
    <input name="product_id" type="hidden" value="XX" />
    <input name="pay_item_id" type="hidden" value="XX" />
    <input name="amount" type="hidden" value="XXXXXXX" />
    <input name="currency" type="hidden" value="566" />
    <input name="site_redirect_url" type="hidden" value="http://abc.com /getresponse”/>
   <input name="txn_ref" type="hidden" value=" XXXAFTXXX”" />
<input name="hash" type="hidden" value="BB292DF9268F05CB9CBBC5E0C13CC1B13ACA34DC" />
</form>

I need someone to help me out on how i can implement this in my dotnetnukes module. 我需要有人来帮助我解决如何在dotnetnukes模块中实现这一点。

I faced a similar problem and asked this question. 我遇到了类似的问题,并提出了这个问题。 The accepted answer here is how I ended up doing it. 我接受的答案是我最终是怎么做的。

I just added the input fields to the page and then changed the "Pay" buttons PostBackUrl 我只是将输入字段添加到页面,然后更改了“付款”按钮PostBackUrl

This way you don't need to add an additional form to the page, and when the user clicks the button, it will submit those fields, so obviously it will pick up the ones it's looking for. 这样,您无需在页面上添加其他表单,并且当用户单击该按钮时,它将提交这些字段,因此很明显它将选择要查找的字段。

So in your case it would be: 因此,在您的情况下,它将是:

<%-- other page content before --%>

<input name="product_id" type="hidden" value="XX" />
<input name="pay_item_id" type="hidden" value="XX" />
<input name="amount" type="hidden" value="XXXXXXX" />
<input name="currency" type="hidden" value="566" />
<input name="site_redirect_url" type="hidden" value="http://ipsum.com/getresponse”/>
<input name="txn_ref" type="hidden" value=" XXXAFTXXX”" />
<input name="hash" type="hidden" value="BB292DF9268F05CB9CBBC5E0C13CC1B13ACA34DC" />

<%-- pay button would look like this --%>
<asp:Button ID="btnPayNow" runat="server" PostBackUrl="https://stageserv.interswitchng.com/test_paydirect/pay" Text="Pay Now!" />

<%-- other page content after --%>

Of course if you have multiple payment gateway options you can set the PostBackUrl programatically before you display the form: btnPayNow.PostBackUrl = "http://<url>.com" 当然,如果您有多个付款网关选项,则可以在显示表单之前以编程方式设置PostBackUrlbtnPayNow.PostBackUrl = "http://<url>.com"

If you are posting to another site, not even anything on your site then you don't need a module at all. 如果要发布到另一个站点,甚至不发布任何内容,那么您根本不需要模块。

With DNN you cannot include another form on your site like that. 使用DNN,您不能在您的网站上添加其他形式的表单。 But you could make that a .html page and include that on your site as an iframe or something like that. 但是您可以创建一个.html页面,并将其作为iframe或类似内容包含在您的网站上。

That should post to that other service fine. 那应该向其他服务处罚款。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM