Welcome Guest, Not a member yet? Register   Sign In
Orderly Paypal Library Issue
#1

[eluser]Unknown[/eluser]
Hi All,

I am having a difficult time getting paypal set up with CodeIgniter. I am using the Orderly library, which can be found here: https://github.com/orderly/codeigniter-paypal-ipn

Has anyone had any experience with this library? I am trying to get my code working, but what I have found is that it works for the paypal SANDBOX but when I try to go live I am having issues.

here's the code in my controller. The idea was to have the ipnprocessing controller function called called as an IPN processor, and then have the createUser function called in the autodirect from paypal ("website preferences") with no PDT. Once the user is created and they are emailed a link, they are then taken to my registration page (which is still on the old version of the site) to create their account. This all works BEAUTIFULLY in SANDBOX but I am getting errors in the live version. I have already verified that I am changing the LIVE = TRUE setting.

Code:
function ipnprocessing()
    {
        $this->load->library('PayPal_IPN'); // Load the library
        $this->load->helper('url');

        // Try to get the IPN data.
        if ($this->paypal_ipn->validateIPN())
        {
            // Succeeded, now let's extract the order
            $this->paypal_ipn->extractOrder();

            // And we save the order now (persist and extract are separate because you might only want to persist the order in certain circumstances).
            $this->paypal_ipn->saveOrder();
        }
    }

            function createUser()
    {
        $this->load->library('PayPal_IPN'); // Load the library
        $this->load->helper('url');

        // Try to get the IPN data.
        if ($this->paypal_ipn->validateIPN())
        {
            // Now let's check what the payment status is and act accordingly
            if ($this->paypal_ipn->orderStatus == PayPal_IPN::PAID)
            {
             $this->paypal_ipn->createUser();
             $this->paypal_ipn->emailRegistrationLink();

             $redirectLink = 'http://speedwayscanner.com/register.php?verifyAccount=' . $this->paypal_ipn->ipnData['txn_id'];
             redirect($redirectLink, 'refresh');
            }
        }
        else // Just redirect to the root URL
        {
            $this->load->helper('url');
            #redirect('../', 'refresh');
        }
    }

Any help would be GREATLY appreciated. I HAVE modified the paypal_ipn library to add two of my own functions (createUser and emailRegistrationLink) but neither of these should affect the live instance of paypal not playing nicely with my script.




#2

[eluser]Tpojka[/eluser]
What error you get?




Theme © iAndrew 2016 - Forum software by © MyBB