Paying for multiple items (at once) via paypal

前端 未结 3 768
傲寒
傲寒 2020-11-27 14:51

I have a list of products that I\'d like to add a \"pay now\" button to so that I can allow my customers to pay via Paypal.

I\'ve gone through the documentation and

相关标签:
3条回答
  • 2020-11-27 15:05

    See this sample and make the changes to yours accordingly. Basically add underscore to item name before number and give unique name to amount also with underscore and number.

    You have to give amount to each item based on your carts totals.

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="upload" value="1">
    <input type="hidden" name="business" value="youremail@mail.com">
    <input type="hidden" name="currency_code" value="USD">
    
    <input type="hidden" name="item_name_1" value="beach ball">
    <input type="hidden" name="amount_1" value="15">
    
    <input type="hidden" name="item_name_2" value="towel">
    <input type="hidden" name="amount_2" value="20">
    
    <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
    </form>
    

    Specify Quantity(optional)

    <input type="hidden" name="quantity_1" value="1">
    

    for more reference about cart: Paypal Cart

    0 讨论(0)
  • 2020-11-27 15:07

    it will not work in

    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    

    please update me if you know multiple item payment option in recurrent payment method or in any ways i can add tax in this method.

    0 讨论(0)
  • 2020-11-27 15:10

    PayPal Add to Cart button helps you to accept payment for multiple items. The button HTML will like the following.

    <form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="business" value="paypal@email.com">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="add" value="1">
    <input type="hidden" name="item_name" value="PHP Book">
    <input type="hidden" name="item_number" value="PB123">
    <input type="hidden" name="amount" value="25">
    <input type="hidden" name="currency_code" value="USD">
    <input type='hidden' name='cancel_return' value='http://www.example.com/cancel.php'>
    <input type='hidden' name='return' value='http://www.example.com/success.php'>
    <input type="image" name="submit"
    src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_addtocart_120x26.png"
    alt="Add to Cart">
    <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
    </form>
    
    0 讨论(0)
提交回复
热议问题