Hello

I am working with Paypal REST apis and I am having a hard time finding my error. I have read all the documentation and cant seem to find a solution so I thought I would try you guys for some help. I have this code to process my calls and I am getting the error unexpected T_PUBLIC on the line that starts the process payment function. If anyone can figure out why as I have made sure all of my closing brackets are there so I do not understand where this error is coming from.

PHP Code:
class paypal {
        private 
$access_token;
        private 
$token_type;
        
        
/**
        * Constructor
        *
        * Handles oauth 2 bearer token fetch
        * @link https://developer.paypal.com/webapps/developer/docs/api/#authentication--headers
        */
        
public function __construct(){
            
$postvals "grant_type=client_credentials";
            
$uri PAYMENT_URI "v1/oauth2/token";
            
            
$auth_response self::curl($uri'POST'$postvalstrue);
            
$this->access_token $auth_response['body']->access_token;
            
$this->token_type $auth_response['body']->token_type;
        }
     
        
/**
        * cURL
        *
        * Handles GET / POST requests for auth requests
        * @link http://php.net/manual/en/book.curl.php
        */
        
private function curl($url$method 'GET'$postvals null$auth false){
            
$ch curl_init($url);
            
            
//if we are sending request to obtain bearer token
            
if ($auth){
                
$headers = array("Accept: application/json""Accept-Language: en_US");
                
curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_BASIC);
                
curl_setopt($chCURLOPT_USERPWDCLIENT_ID ":" .CLIENT_SECRET);
                
curl_setopt($chCURLOPT_SSLVERSION3);
                
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
                
curl_setopt($chCURLOPT_SSL_VERIFYHOST2);
            
//if we are sending request with the bearer token for protected resources
            
} else {
                
$headers = array("Content-Type:application/json""Authorization:{$this->token_type} {$this->access_token}");
            }
               
            
$options = array(
                
CURLOPT_HEADER => true,
                
CURLINFO_HEADER_OUT => true,
                
CURLOPT_HTTPHEADER => $headers,
                
CURLOPT_RETURNTRANSFER => true,
                
CURLOPT_VERBOSE => true,
                
CURLOPT_TIMEOUT => 10
            
);
            
            if (
$method == 'POST'){
                
$options[CURLOPT_POSTFIELDS] = $postvals;
                
$options[CURLOPT_CUSTOMREQUEST] = $method;
            }
            
            
curl_setopt_array($ch$options);
         
            
$response curl_exec($ch);
            
$header substr($response0curl_getinfo($ch,CURLINFO_HEADER_SIZE));
            
$body json_decode(substr($responsecurl_getinfo($ch,CURLINFO_HEADER_SIZE)));
            
curl_close($ch);
            
            return array(
'header' => $header'body' => $body);
        }
    }
    
    
// Function for Processing Payment
    
public function process_payment($request) {
        
$postvals $request;
        
$uri PAYMENT_URI "v1/payments/payment";
        return 
self::curl($uri'POST'$postvals);
    } 
*If I take public out then I get a different error stating "Fatal error: Cannot access self:: when no class scope is active" I do not understand that error either.

Any help would be great.