dth8312 2014-01-25 10:50
浏览 72
已采纳

Paypal返回产品ID数组

I am using paypal payment gateway with my website for payment.

Here I want a feature like where I could send list of product id those I want to purchase. And after successful payment I want to these all id so that I could update my datasbe. I can not use IPN, because its already used for other site.

Below is my html form for paypal..

 <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> 
            <input type="hidden" name="cmd" value="_xclick">
            <input type="hidden" name="business" value="praveend06-facilitator@gmail.com">
            <input type="hidden" name="item_name" value="PAYMENT REASON">
            <input type="hidden" name="amount" value="10">
            <input type="hidden" name="quantity" value="1"> 
            <input type="hidden" name="no_shipping" value="0">
            <input type="hidden" name="no_note" value="1">
            <input type="hidden" name="currency_code" value="USD">
            <input type="hidden" name="lc" value="MX">
            <input type="hidden" name="bn" value="PP-BuyNowBF">
            <input type="hidden" name="notify_url" value="http://localhost/paypal/notify.php">
            <input type="hidden" name="return" value="http://localhost/paypal/success.php">
            <input type="hidden" name="rm" value="2">
            <input type="hidden" name="cbt" value="Return to The Store">
            <input type="hidden" name="cancel_return" value="http://localhost/paypal/fail.php">
            <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
            <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
        </form>

I wrote below code in success.php but its returning blank array. Even i didn't get transaction id.

Please help me to achieve this. Thank you

  • 写回答

2条回答 默认 最新

  • douchun6108 2014-01-25 12:15
    关注

    There is only one parameter that you can use for custom data with Website Payments Standard and that's "custom".

    Simply pass in you custom data in

    <input type="hidden" name="custom" value="your custom data here">

    In the custom data, first add the product IDs as a comma separated string and then you will get that back on successful payment.

    You can retrieve the value for 'custom' by polling through PayPal PDT (https://www.paypal.com/pdt/) or getting the data POST'ed to you by PayPal, using PayPal IPN (https://www.paypal.com/ipn/).

    But you already mentioned that you cannot use IPN. So go for PDT instead.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答