html - 通过 Paypal 发送多个产品

标签 html paypal

我想将多个产品发送到 Paypal 。 我知道发送产品到payPal的格式是:

 <input type="hidden" name="item_name_x" value="test 1">

不幸的是,它不起作用。 您认为问题出在哪里?

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
                <input type="hidden" name="cmd" value="_xclick">
                <input type="hidden" name="business" value="ronny@hoojima.com">
                <input type="hidden" name="item_name_1" value="test 1">
                <input type="hidden" name="item_number_1" value="1">
                <input type="hidden" name="item_name_2" value="test 2">
                <input type="hidden" name="item_number_2" value="2">
                <input type="hidden" name="item_name_3" value="test 3">
                <input type="hidden" name="item_number_3" value="3">
                <input type="hidden" name="amount_1" value="99.00">
                <input type="hidden" name="amount_2" value="2">
                <input type="hidden" name="amount_3" value="99.00">
                <input type="image" name="submit" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png" alt="PayPal - The safer, easier way to pay online">
            </form>
</body>
</html>

最佳答案

使用 PayPal 立即购买按钮,您不能传递多个项目。要允许多个项目到 PayPal,请使用“购物车上传”按钮代码。请引用以下示例代码和链接供您引用:

<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="paypalemail"><!-- Add your PayPal Seller/Business email address mandatory-->
        <input type="hidden" name="item_name_1" value="Item Name 1"> <!--  sample item name -->
        <input type="hidden" name="amount_1" value="1.00"><!--  sample amount -->
        <input type="hidden" name="shipping_1" value="1.75"><!--  sample shipping -->
        <input type="hidden" name="item_name_2" value="Item Name 2">
        <input type="hidden" name="amount_2" value="2.00">
        <input type="hidden" name="shipping_2" value="2.50">
        <input type='hidden' name='invoice' value='your Invoice Id' /> <!-- add Unique invoice for different customer -->
        <input type="hidden" name="notify_url" value="www.yourwebsite.com/ipn"> <!-- Please add IPN URL You can use this service to automate back-office and administrative functions, including fulfilling orders, tracking customers, and providing status and other information related to transactions. -->
        <input type='hidden' name='currency_code' value='Your currency' />
        <input type='hidden' name='cancel_return' value='' /><!-- Take customers to this URL when they cancel their checkout -->
        <input type='hidden' name='return' value='' /><!-- Take customers to this URL when they finish their checkout  -->
        <input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
    </form>

对于 PayPal 按钮 HTML 变量,请引用以下链接:https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/

即时付款通知(IPN):https://developer.paypal.com/docs/classic/ipn/gs_IPN/

关于html - 通过 Paypal 发送多个产品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45128964/

相关文章:

html - Wordpress CSS 无法正确显示导航

html - 位置相对但固定标题

html - 停止 CSS 层次结构

email - 检查 Paypal 电子邮件地址是否是经过验证的用户

php - 如何将 JSON 数据发布到 Paypal Adaptive

php - Paypal Express Checkout 负面测试

javascript - 下拉菜单-如何让用户进行添加?

html - 为什么内部 div 顶部边距会带来它的包装 div 顶部边距

objective-c - 使用适用于 iOS 的 PayPal Express Checkout 库直接付款

javascript - 向客户端发送错误作为 HTTP 请求的回调