Accepting paypal parameters of payment success and transaction number on return url and write entry to database?

Permalink
Hi Concrete5 community,

I am having quite a load on a custom package which I have coded for that uses the paypal HTML form API.

What I am facing now is how am I going to pass the returned parameters from the paypal transaction marked complete on the return url to the block controller and write the rest of details which is already filled out by the user to the database.

The problem now is when the action_send function is executed in package controller the POST data is lost when the return url is going back to the same url of the package, so nothing gets written into the database.

Here is part of the code snippet for action_send () function:
public function action_send($bID = false){
        $returnPage = 'http://xxxxx/xxxxx/donation';
        $bUID = \Request::request('bUID');
        if($this ->bID !== $bID){
            return;
        }
        $title = $this->post('dTitle'.$bUID);
        $initials = $this -> post('dInitials'.$bUID);
        $email = $this->post('dEmail'.$bUID);
        $mobile = $this->post('dMobile'.$bUID);
        $phone = $this->post('dPhone'.$bUID);
        $firstname = $this->post('dFirstName'.$bUID);
        $lastname = $this->post('dLastName'.$bUID);
        $address1 = $this->post('dAddress1'.$bUID);
        $address2 = $this->post('dAddress2'.$bUID);