在贝宝notify_url页面,我没有得到任何值,当我使用cmd值as _cart.我怎么才能得到notify_url页面的交易细节
<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页面中,我获取的值为
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']);
3条答案
按热度按时间bwitn5fc1#
创建paypal_ipn. php文件并将php代码放入其中。
vfwfrxfs2#
有一个really good guide到即时支付通知(IPN)和了解他们是如何工作的。本指南为您提供了你需要有你的
notify_url
正常工作的步骤。有Paypal提供的good code samples为你做验证响应,这真的很不错。你可以用这些作为自己的起点。
monwx1rj3#
我有同样的问题贝宝自适应付款在我目前的项目。我已经给了我的
notify_url为http://mysite.com/payment-success。在这个页面中,我只编写了
$请求= $_POST;
电子邮件('我的身份证@我的帐户',$request);
然后我把交易结果发到邮箱里查看。
注意,在这里我的邮件,我可以看到交易结果,如果我插入到数据库,它是插入,但我不能看到交易结果在我的网页。尝试发送到您的邮件交易结果。