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 求指导ADS低噪放设计
  • ¥15 CARSIM前车变道设置
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存