我遵循简单的 PHP 代码进行 Paypal 集成
这是我的代码,
<form action="<?php echo $paypal_url; ?>" method="post">
<input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="<?php echo $row['name']; ?>">
<input type="hidden" name="item_number" value="<?php echo $row['id']; ?>">
<input type="hidden" name="amount" value="<?php echo $row['price']; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type='hidden' name='cancel_return' value='http://localhost/paypal_integration_php/cancel.php'>
<input type='hidden' name='return' value='http://localhost/paypal_integration_php/success.php'>
<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" >
</form>
而且, 这是Success.php
<?php
include 'db_config.php';
$item_number = $_REQUEST['item_number'];
$txn_id = $_REQUEST['tx'];
$payment_gross = $_REQUEST['amount'];
$currency_code = $_REQUEST['currency_code'];
$payment_status = $_REQUEST['st'];
?>
我不清楚 IPN 和 PDT 概念clearlry..
最佳答案
试试这个
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
关于php - paypal付款成功后如何获取后值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36034758/