Angell EYE PayPal Payments Pro CodeIgniter Library Sample

The following samples demonstrate how to work with this library.

GetBalance

This call is very straight forward and simply returns the current account balance for the requesting API caller.

The fully functional sample code displayed here is found in /application/controllers/paypal/samples/Payments_pro.php.

An empty version of this function can be found in /application/controlles/paypal/templates/Payments_pro.php.


        function Get_balance()
        {
            $GBFields = array('returnallcurrencies' => '1');
            $PayPalRequestData = array('GBFields'=>$GBFields);
            $PayPalResult = $this->paypal_pro->GetBalance($PayPalRequestData);

            if(!$this->paypal_pro->APICallSuccessful($PayPalResult['ACK']))
            {
                $errors = array('Errors'=>$PayPalResult['ERRORS']);
                $this->load->view('paypal/samples/error',$errors);
            }
            else
            {
                // Successful call.  Load view or whatever you need to do here.
                $data = array('PayPalResult'=>$PayPalResult);
                $this->load->view('paypal/samples/get_balance',$data);
            }
        }