贝宝沙盒显示一个产品

时间:2013-08-03 18:21:22

标签: asp.net-mvc paypal paypal-sandbox

这是我的表单视图源,

当我点击提交按钮

重定向到Paypal sendbox并显示一个项目

<form id="Paypal" name="Paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<form action="/ShoppingCart/PostToPaypal" method="post"><input id="cmd" name="cmd"       type="hidden" value="_xclick" /><input id="business" name="business" type="hidden" value="anilcs_1361585097_biz@gmail.com" /><input id="no_shipping" name="no_shipping" type="hidden" value="" /><input id="return" name="return" type="hidden" value="http://localhost:49424/Checkout/IPN" /><input id="cancel_return" name="cancel_return" type="hidden" value="http://localhost:49424/SportsStore/CancelFromPaypal" /><input id="notify_url" name="notify_url" type="hidden" value="http://localhost:49424/SportsStore/NotifyFromPaypal" /><input id="currency_code" name="currency_code" type="hidden" value="USD" />    <input type="hidden" name="item_name" value="2252330"/>
<input type="hidden" name="amount" value="122.75"/>
<input type="hidden" name="item_name" value="51057"/>
<input type="hidden" name="amount" value="32.99"/>
<input type="hidden" name="item_name" value="2252330"/>
<input type="hidden" name="amount" value="122.75"/>
<input type="hidden" name="item_name" value="51057"/>
<input type="hidden" name="amount" value="32.99"/>
<input type="hidden" name="item_name" value="2252330"/>
<input type="hidden" name="amount" value="122.75"/>
<input type="image" name="btnsubmit"  src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
    alt="PayPal - The safer, easier way to pay online" />
 </form>

可以帮助我如何在Paypal中显示我的5项

1 个答案:

答案 0 :(得分:1)

预计“立即购买”按钮(cmd = _xclick) 如果你想显示多个项目,你会想要使用这样的东西:

<form id="Paypal" name="Paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr method="POST">
    <input id="cmd" name="cmd" type="hidden" value="_cart" />
    <input id="business" name="business" type="hidden" value="anilcs_1361585097_biz@gmail.com" />
    <input id="return" name="return" type="hidden" value="http://localhost:49424/Checkout/IPN" />
    <input id="cancel_return" name="cancel_return" type="hidden" value="http://localhost:49424/SportsStore/CancelFromPaypal" />
    <input id="notify_url" name="notify_url" type="hidden" value="http://localhost:49424/SportsStore/NotifyFromPaypal" />
    <input id="currency_code" name="currency_code" type="hidden" value="USD" />
    <input type="hidden" name="item_name_1" value="2252330"/>
    <input type="hidden" name="amount_1" value="122.75"/>
    <input type="hidden" name="item_name_2" value="51057"/>
    <input type="hidden" name="amount_2" value="32.99"/>
    <input type="hidden" name="item_name_3" value="2252330"/>
    <input type="hidden" name="amount_3" value="122.75"/>
    <input type="hidden" name="item_name_4" value="51057"/>
    <input type="hidden" name="amount_4" value="32.99"/>
    <input type="hidden" name="item_name_5" value="2252330"/>
    <input type="hidden" name="amount_5" value="122.75"/>
    <input type="hidden" name="upload" value="1">
    <input type="image" name="btnsubmit"  src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
        alt="PayPal - The safer, easier way to pay online" />
 </form>

在此,我有:

  1. 向第一个<form>
  2. 添加了“操作”
  3. 添加了input upload = 1
  4. 将cmd从_xclick更改为_cart
  5. 数字购物车项目(_n)
  6. 顺便说一句,我注意到您将return网址设置为'something / IPN' 您确实知道IPN与return网址不同,对吧? IPN is an asynchronous PayPal server-to-server POST,其中包含有关事务的有效负载。而return是买方被重定向回的网址 您可以通过填充notify_url参数(您已经完成)来设置IPN URL。