如何在paypal的notify_url页面中获取交易详情 [英] How to get transaction details in notify_url page in paypal

查看:89
本文介绍了如何在paypal的notify_url页面中获取交易详情的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 paypal notify_url 页面中,当我使用 cmd 值作为 _cart 时,我没有得到任何值.如何在 notify_url 页面中获取交易详细信息

In paypal notify_url page I am not getting any values when I use cmd value as _cart.How can I get the transaction details in notify_url page

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST" name="_xclick" id="paypal_form">
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="cmd" value="_xclick" />
<!-- The business email address, where you want to receive the payment -->
<!--<input type="hidden" name="business" value="yesidealpayment@gmail.com" />-->
<input type="hidden" name="business" value="arun_1260247381_per@galtechsupport.us" />
<!-- The customer email address -->

<input type="hidden" name="item_name_1" value="<?php echo ucfirst($couponname); ?>" />

<input type="hidden" name="amount_1" value="<?php echo $total_payable_amount; ?>" />
<!--<input type="hidden" name="currency_code" value="AUD" />-->
<input type="hidden" name="currency_code" value="USD" />

<input type="hidden" name="amount" value="25.58" /> 
<!-- Where you want to return after PayPal Payment -->
<input type="hidden" name="return" value="http://yes-i-deal.com.au/test/paypal_ipn.php" />
<!-- A back-end notification send to the specific page after successful payment  -->
<!--<input type="hidden" name="notify_url" value="http://yes-i-deal.com.au/test/paypal.php" />-->
<input type="hidden" name="notify_url" value="http://yes-i-deal.com.au/test/paypal_ipn.php" />
<!-- Where you want to return after cancel the PayPal Payment  -->
<input type="hidden" name="cancel_return" value="http://yes-i-deal.com.au/" />
<input type="hidden" name="custom" value="<?php echo $coupon_id."_".$userid;?>" />  




            <input type="image" name="submit"   src="http://yes-i-deal.com.au/themes/green/images/Buy-Now-Button.png" />
</form> 

在我的 notify_url 页面中,我得到的值是

In my notify_url page I am getting values as

 session_start(); 
require("ipn_cls1.php");
 $paypal_info = $_POST; 
print_r($paypal_info); 
$paypal_ipn = new paypal_ipn($paypal_info); 
$payment_status = trim($paypal_info['payment_status']); // Si Completed : tout est OK echo 
$payment_amount = trim($paypal_info['mc_gross']);

推荐答案

有一个 非常好的指南即时付款通知 (IPN) 并了解它们的工作原理.本指南为您提供了使 notify_url 正常工作所需的步骤.

There is a really good guide to Instant Payment Notifications (IPN) and understanding how they work. This guide provides you the steps you need to have your notify_url working properly.

Paypal 提供了 良好的代码示例,可为您提供验证响应,这真的很好.您可以使用这些作为您自己的起点.

There are good code samples provided by Paypal that do the validation response for you, which is really nice. You can use these are the starting point for your own.

这篇关于如何在paypal的notify_url页面中获取交易详情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆