CI PayPal Log Status Completed (Unkown)

  codeigniter, paypal, paypal-ipn, php

I have a problem with my paypal, after payment is made and return to my website. I should get my virtual currency like before, but now when i went to see my log i got this error:

[11:07AM] [173.0.81.65] [Unknown] Paypal request cmd=_notify-validate&mc_gross=1.00&protection_eligibility=Eligible&payer_id=2W3K4AE6PE9HJ
&tax=0.00&payment_date=06%3A07%3A02+Nov+25%2C+2021+PST&payment_status=
Completed&charset=UTF-8&first_name=Ion&mc_fee=0.66&notify_version=3.9&custom=test&payer_status=verified&[email protected]&quantity=1&verify_sign=ACbjPDXxxaJSEjDaJEQejl6pQVCUATOP6jTlpnDdtn.xY4lDsdAn4jeO&payer_email=
[email protected]&txn_id=76J30634F7655745J&payment_type=instant&last_name=Popescu&receiver_email=
[email protected]&payment_fee=&shipping_discount=0.00&receiver_id=7YY8KTY9FGRU4&insurance_amount=0.00&txn_type=web_accept&item_name=Donate&discount=0.00&mc_currency=BRL&item_number=d418511cde1399add8ce553329f198fb&residence_country=GB&shipping_method=Default&transaction_subject=&payment_gross=&ipn_track_id=f994859f51574

I checked my mysql tables and paypal_transactions,paypal_orders looks fine, but account table where should be my virtual currency is not updated .

    private function insert_transaction_status(){
        $stmt = $this->db->prepare('INSERT INTO lastchaos_donate_paypal_transactions (transaction_id, amount, currency, acc, credits, order_date, status, payer_email) VALUES (:trans_id, :gross, :currency, :account, :credits, :time, :payment_status, :payer_email)');
        return $stmt->execute(array(':trans_id' => $this->vars['txn_id'], ':gross' => $this->vars['mc_gross'], ':currency' => $this->vars['mc_currency'], ':account' => $this->order_details['account'], ':credits' => $this->order_details['credits'], ':time' => time(), ':payment_status' => $this->vars['payment_status'], ':payer_email' => $this->vars['payer_email']));
    }
    public function reward_user($acc, $credits){                
        $loyal = number_format($credits*30/100, 0);
        $stmt = $this->db->prepare('UPDATE bg_user SET cash = cash + :credits WHERE user_id = :account');
        $stmt->execute(array(':account' => $acc, ':credits' => abs($credits), ':loyal' => abs($loyal)));
    }
    
    private function decrease_credits($acc, $credits){
        $stmt = $this->db->prepare('UPDATE bg_user SET cash = cash - :credits WHERE user_id = :account');
        $stmt->execute(array(':credits' => abs($credits), ':account' => $acc));
    }
    
    private function block_user($acc){
        return;
    }

Also 173.0.81.65 i dont know from where it comes and paypal return me to website.com/?PayerID=2W3K4AE6PE9HJ instead of website.com/payment

Appreciate in advice for help.

Source: Ask PHP

LEAVE A COMMENT