1

我正在使用 paypal_lib 库。它工作正常。但是在支付过程中通知ipn url没有调用那个函数

下面是隐藏字段功能:

public function user_pay() {

    $userId = $this->encrypt->decode(base64_decode($this->uri->segment(4))); 
    $pamount = $this->encrypt->decode(base64_decode($this->uri->segment(5)));
    $product_id =  $this->encrypt->decode(base64_decode($this->uri->segment(6)));
    $product_name = $this->encrypt->decode(base64_decode($this->uri->segment(7)));

    $get_paypal_email = $this->Common_model->getTableData('jet_users', array('user_id' => $userId))->row();
    $this->paypal_lib->add_field('business', $get_paypal_email->user_paypal_email);
    $this->paypal_lib->add_field('return', site_url('admin/admin/transactions'));
    $this->paypal_lib->add_field('cancel_return', site_url('admin/admin/transactions'));
    $this->paypal_lib->add_field('notify_url', site_url('admin/admin/admin_payment_ipn')); // <-- IPN url
    $this->paypal_lib->add_field('custom', $userId.'@'.$product_id);
    // Verify return
    $this->paypal_lib->add_field('currency_code', 'EUR');
    $this->paypal_lib->add_field('item_name', $product_name);
    $this->paypal_lib->add_field('item_number', '89657' );
    $this->paypal_lib->add_field('amount', $pamount);
    $this->paypal_lib->image('button_03.gif');
    $data['admin_paypal_form'] = $this->paypal_lib->paypal_form();
    $this->paypal_lib->paypal_auto_form();
}

IPN 通知 URL 功能是:

public function admin_payment_ipn() {
    $custom_data = explode('@', $_REQUEST['custom']);
    if($_REQUEST['payment_status']=='Pending' || $_REQUEST['payment_status']=='Completed') {
        $this->db->query("UPDATE `payments` SET admin_pay_status=1 WHERE owner_id=".$custom_data[0]." AND product_id=".$custom_data[1]);
    }
}
4

0 回答 0