English 中文(简体)
我怎么能够使用薪棕榈订阅纽顿的形式? 或者说,只有含薪字面的表格是没有任何办法的?
原标题:How can I post a form using paypal subscription button? Or is there any way to post a form containing paypal content only?

I am using PayPal subscription I have issue with paypal subscribe button. I have subscribe button with 4 subscription options. I want to add this selected option in query string. So that my query string will look like this:

https://www.paypal.com/cgi-bin/webscr?cmd=_s-lick&hosted_button_id=Y1TOJTYQ2ALDJ&os0=Silver Membership

在以上询问中,我想为0参数确定选定的选择。

我的法典:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="X9TEPZ7Q2ALDJ"/>
<table>
<tr><td><input type="hidden" name="on0" value="Memberships">Memberships</td></tr><tr><td>
<select name="os0">
<option value="Registration - One month">Registration - One month : $1.00USD - monthly</option>
<option value="Trial Membership">Trial Membership : $25.00USD - monthly</option>
<option value="Silver Membership">Silver Membership : $250.00USD - yearly</option>
<option value="Gold Membership">Gold Membership : $400.00USD - yearly</option>
</select> 
</td></tr>
</table>
<input type="hidden" name="currency_code" value="USD"/>
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online."/>
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"/>                            
<a id="paypalDonate" target="_blank" href ="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y1TOJTYQ2ALDJ&os0=document.getelementbyid(os0).value">

<img border="0" id="payPalImage" src="https://www.paypalobjects.com/en_GB/i/btn/btn_subscribeCC_LG.gif" alt="Donate to DevtheWeb.NET" />
</a>
</form>
最佳回答

我通过使用图像Button而不是固定标签来确定这一问题。

如下:

<asp:ImageButton ID="payPalImage" ImageUrl="https://www.paypalobjects.com/en_GB/i/btn/btn_subscribeCC_LG.gif" runat="server" OnClick="payPalImage_Click" />

On click event of ImageButton, in back end file(.cs file), I attached selected subscription option like:

protected string _SubscriptionVal = "";

....
protected void payPalImage_Click(object sender, ImageClickEventArgs e)
{
    _SubscriptionVal = Request["os0"];
    Response.Redirect("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X34EQZ8Q2AFASLDJ&os0="+_SubscriptionVal);
}

最后,我可以调整方向,用适当的价值支付笔记。

问题回答

It s not possible. Either don t use dropdowns and use the email link PayPal gives you (which is basically the link you have, minus the option select), or use a <form> POST.
You cannot combine a dropdown selection with a link.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签