doubiao7410 2017-07-05 14:19
浏览 159

Paypal立即购买按钮,具有可变/动态价格

This is not a duplicate of this post.

I quote from the linked post:

As of June 29, 2017 I see this not working. Paypal has again changed its rules, and I don't think it any longer accepts hidden HTML fields in the form submission: they must be set in the button editor at Paypal.

Paypal documentation is a mess. Half of the links are broken and the other half of the links point to the documentation index.

Does any brain out there know how to achieve a Paypal Payment Button where I can set the price dynamically?

  • 写回答

2条回答 默认 最新

  • doudongdang4483 2017-07-07 12:35
    关注

    PayPal recommended to use Express checkout client side integration and you can send the amount dynamically from your website to PayPal code.

    Refer the following links for PayPal Express checkout client side integration:

    https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/client-side-REST-integration/

    https://developer.paypal.com/demo/checkout/#/pattern/client

    Otheriwse, please try with the below PayPal HTML button code.

     <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
            <!-- Identify your business so that you can collect the payments. -->
            <input type="hidden" name="business" value="Yourbusinessemail@paypal.com"> <!-- Add your PayPal Seller/Business email address Required-->
            <!-- Specify a Buy Now button. -->
            <input type="hidden" name="cmd" value="_xclick">
            <!-- Specify details about the item that buyers will purchase. -->
            <input type="hidden" name="item_name" value=""> <!-- Add Description e.g your room type Required-->
            <input type="hidden" name="amount" value=""> <!-- Dynamically add Total Amount Required-->
            <input type="hidden" name="currency_code" value=""> <!-- Update to your currency -->
            <input id="invoice" type="hidden" value="" name="invoice"> <!-- Add Unique invoice for each transaction -->
            <input type="hidden" name="notify_url" value="www.yourwebsite.com/ipn.php"> <!-- 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='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  -->
            <!-- Display the payment button. -->
            <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>
    
    HTML Variables - https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/  
    Buy Now button - https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/buy_now_step_1/ 
    IPN - https://developer.paypal.com/docs/classic/ipn/gs_IPN/ 
    IPN - https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSetup/ 
    IPN Sample: https://github.com/paypal/ipn-code-samples 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大