<form id="dvrr" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table border="0" cellpadding="5" cellspacing="5" align="center" width="100%">
<tr>
<td></td>
<td><input type="hidden" name="business" value="ceo@world-airport-city-transfer.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Cab Booking">
<input type="hidden" name="item_number" value="<?php echo $orderid; ?>">
<input type="hidden" name="amount" value="<?php echo number_format((float)$data['price'], 2, '.', ''); ?>">
<input type="hidden" name="currency_code" value="USD">
<!-- Specify URLs -->
<input type="hidden" name="cancel_return" value="http://www.wer.com/payment-cancel/">
<input type="hidden" name="return" value="http://www.wer.com/payment-processing/">
<input type="hidden" name="notify_url" value="http://www.wer.com/notify-payment/">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" ></td>
</tr>
</table>
这是我的PayPal表单,我正在使用付款,在感谢你页面上,我们添加代码来获得响应,并在我们的系统上更新它的交易是否完成。
我们将此代码放在weburl.com/payment-processing/上,这是我们返回的URL
$data=$_POST;
if($_POST['payment_status']!=''){
$item_name=$_POST['item_name'];
$item_number=$_POST['item_number'];
$txn_id=$_POST['txn_id'];
$payer_email=$_POST['payer_email'];
$payment_gross=$_POST['payment_gross'];
$payment_status=$_POST['payment_status'];
$insert = mysql_query("INSERT INTO cr_payments(item_name,item_number,txn_id,payer_email,payment_gross,payment_status) VALUES('".$item_name."','".$item_number."','".$txn_id."','".$payer_email."','".$payment_gross."','".$payment_status."')") or die(mysql_error());
global $wpdb;
$is_added = $wpdb->query("UPDATE cr_booking SET fld_booking_status = '$payment_status' WHERE fld_booking_id = '$item_number'");但是当我们在沙箱模式下运行代码时,我们会得到数据。但在实时模式下,我们得到的是空白数组
发布于 2015-06-14 10:05:13
PayPal网站支付标准,包括您使用的PayPal按钮,不要将任何东西带回您的返回网址。
在跳转到PayPal支付页面之前,您必须将数据存储在购物车中。
您可以使用的另一个PayPal产品是快速结帐,它与您正在使用的产品非常不同。它需要你对服务器和PayPal之间的API调用进行编程,但实际的费用是通过在你的服务器上调用doexoresscheckout来完成的,所以你可以根据这个API调用的结果来决定显示什么。
发布于 2015-06-16 18:51:04
我通过我的自定义方式解决了这个问题,我只是用file_put_content把ipn数据写在一个文件上,然后把文件数据转换成数组,然后用&和=两次分解它,得到了确切的数据,在此基础上,我们在我们的网站上处理支付数据
https://stackoverflow.com/questions/30821923
复制相似问题