Codeigniter and Paypal: how it works

Two random questions when I try to integrate Paypal IPN into my Codeigniter based web application.

1) Are these two lines the same?

$data['pp_info'] = $this->input->post();

$data['pp_info'] = $_POST;

2) The user agrees to pay a monthly periodic fee for using your service using paypal - the first payment that you know about, he paid when you receive the data returned from PayPal. But how do you track if users paid for the following months? How do you know that the user has not canceled his PayPal account?

Thank you all for your help.

+3
source share
3 answers

1) , , CI ( ..).

2) PayPal URL-, , , " " " ". URL- PayPal.

+1

1) - PostIgniter CodeIgniter, , , CI \n, PayPal \r\n. , , PayPal INVALID. IPN PayPal, :

    foreach (array_keys($_POST) as $field)
    {
            $value = $this->input->post($field);
            $ipnData[$field] = str_replace("\n", "\r\n", $value);
    }

2) IPN , PayPal IPN-. txn_type - subscr_signup, subscr_failed subscr_eot ( ). .

+2

1) , .

$this- > input- > post(); , , POST-.

, $_POST ['mydata'], , . , "if (isset ($ _ POST ['mydata'])), CI .

, , Coronatus, CI

2) are not called paypal every few hours, for example, what alex dean said. use IPN, so paypal will push to your server whenever something happens.

0
source

Source: https://habr.com/ru/post/1738729/


All Articles