Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 通知功能isn';t在执行paypal支付时更新数据库_Php_Codeigniter_Paypal_Payment Gateway_Paypal Ipn - Fatal编程技术网

Php 通知功能isn';t在执行paypal支付时更新数据库

Php 通知功能isn';t在执行paypal支付时更新数据库,php,codeigniter,paypal,payment-gateway,paypal-ipn,Php,Codeigniter,Paypal,Payment Gateway,Paypal Ipn,这是我第一次将Paypal支付集成到一个项目中,这是在CI中。所以问题是,除了通知Url应该使我能够将付款状态从“待定”更改为“成功”之外,其他一切都运行得很好,但我的情况并非如此。我有下面的代码,我真的尝试了很多东西,但仍然不知道我在哪里滑倒 <form id="paypal-pre" action="<?php echo base_url('auth/process'); ?>" method="post"> <input type="hidd

这是我第一次将Paypal支付集成到一个项目中,这是在CI中。所以问题是,除了通知Url应该使我能够将付款状态从“待定”更改为“成功”之外,其他一切都运行得很好,但我的情况并非如此。我有下面的代码,我真的尝试了很多东西,但仍然不知道我在哪里滑倒

    <form id="paypal-pre" action="<?php echo  base_url('auth/process'); ?>" method="post">
    <input type="hidden" name="user_id" value="<?php echo $_POST['register_user_id']; ?>">
    <input type="hidden" name="first_name" value="<?php echo $_POST['customer_first_name']; ?>">
    <input type="hidden" name="last_name" value="<?php echo $_POST['customer_last_name']; ?>">
    <input type="hidden" name="addr1" value="<?php echo $_POST['customer_address1']; ?>">
    <input type="hidden" name="addr2" value="<?php echo $_POST['customer_address2']; ?>">
    <input type="hidden" name="city" value="<?php echo $_POST['customer_city']; ?>">
    <input type="hidden" name="county" value="<?php echo $_POST['customer_county']; ?>">
    <input type="hidden" name="postcode" value="<?php echo $_POST['customer_postcode']; ?>">
    <input type="hidden" name="amount" value="<?php echo $_POST['payment_total']; ?>">
    <!-- 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" >
   </form>
进程和通知控制器功能

    <?php $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$paypal_id = '******@yahoo.com';
$amount = $_POST['amount'];
$id = mysql_insert_id();?>
<form id="paypal" action="<?= $paypal_url; ?>" method="post">
<input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
    <input type="hidden" name="amount" value="<?php echo $amount; ?>">
    <input type="hidden" name="currency_code" value="GBP">
    <input type="hidden" name="item_name" value="<?php echo 'Business Register'; ?>">
    <input type="hidden" name="custom" value="<?php echo $id; ?>" />
    <input type='hidden' name='notify_url' value='<?php echo base_url('auth/notify'); ?>'>
    <input type='hidden' name='cancel_return' value='<?php echo base_url('auth/cancel'); ?>'>
    <input type='hidden' name='return' value='<?php echo base_url();?>'>
</form><script type="text/javascript">
document.getElementById('paypal').submit();
</script>
来自demo_auth_模型的流程模型

任何帮助都将不胜感激


另外,所有数据库信息都是正确的

对于codeigniter,我更喜欢这个库 原因有二 1.自动重定向到我们的网站 2.将会话中的所有数据带到我们的网站
试着享受吧

反正我解决了。。我所做的是,在我被重定向到“return”ur之后,我从那里获取POST值并将其保存到表中。。
    <?php $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$paypal_id = '******@yahoo.com';
$amount = $_POST['amount'];
$id = mysql_insert_id();?>
<form id="paypal" action="<?= $paypal_url; ?>" method="post">
<input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="<?php echo $paypal_id; ?>">
    <input type="hidden" name="amount" value="<?php echo $amount; ?>">
    <input type="hidden" name="currency_code" value="GBP">
    <input type="hidden" name="item_name" value="<?php echo 'Business Register'; ?>">
    <input type="hidden" name="custom" value="<?php echo $id; ?>" />
    <input type='hidden' name='notify_url' value='<?php echo base_url('auth/notify'); ?>'>
    <input type='hidden' name='cancel_return' value='<?php echo base_url('auth/cancel'); ?>'>
    <input type='hidden' name='return' value='<?php echo base_url();?>'>
</form><script type="text/javascript">
document.getElementById('paypal').submit();
</script>
 public function process($arr) {
        $this->db->set($arr['user']);
        $this->db->insert('user_payments');
        return;
    }