dousendun8411 2016-01-17 18:36
浏览 35
已采纳

如何在我的成功页面上知道客户端paypal交易是否成功

On my order page, I'm using this form:

<input type="hidden" name="item_number" value="<?php echo $refNumber; ?>">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $paypal_email; ?>" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="<?=$_SESSION["web_site_url"]?>/payment_success.php?OrderID=<?=$refNumber;?>" />
input type="hidden" name="amount" id="amount" value="<?=$product_vals["discount_prize"]?>" />
<input type="hidden" name="item_name" id="item_name" value="<?=$product_vals["name"]?>" />

now I want a sample code for my payment_success page from that i came to know whether paypal authenticate the client payment or the client's payment is success of not.. so that i can proceed to next step of gathering information from client.

I have read the Paypal docs but unable to learn useful from them. help me out to solve this problem.Moreover i also want to get the paypal email of client and transaction id / payment_success variable (that is true/false) so that i will help me to identify the payment is succesful or not..

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • dongya6997 2017-10-28 19:36
    关注

    You can use paypal class by Micah Carrick. This is pretty clear class which support notify URL, return URL and success URL. You dont need to use any form or something but just use this class and let this class to do your job. sample code is:

    $p = new paypal_class;   
    $p->add_field('business', $paypal_email);
    $p->add_field('return', $add_fund_url.'/success.php');
    $p->add_field('cancel_return', $add_fund_url.'/cancel.php');
    $p->add_field('notify_url', $notify_url );
    $p->add_field('item_name', $item_name);
    $p->add_field('item_number', $item_number);
    $p->add_field('custom',$custom_field);
    $p->add_field('amount', $amount);
    $p->add_field('no_shipping', '1');
    $p->submit_paypal_post(); // submit the fields to paypal
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 arduino控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题