【发布时间】:2016-03-16 11:44:55
【问题描述】:
我遵循简单的 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 的概念。。
【问题讨论】:
-
如果您可以将问题缩小到某些特定的行并明确提出有关某一特定事物的问题,您将获得更好的回答。如指南中所述,don't just copy in your entire program 并创建一个 Minimal, Complete, and Verifiable example。
标签: php paypal paypal-ipn