AuthorizeUrlParameters += [ 'flowEntry' => 'static' ]; $this->tokenExchangeHeaders = [ 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) ]; $this->tokenRefreshHeaders = [ 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) ]; } /** * {@inheritdoc} * * See: https://developer.paypal.com/docs/api/identity/v1/ * See: https://developer.paypal.com/docs/connect-with-paypal/integrate/ */ public function getUserProfile() { $headers = [ 'Content-Type' => 'application/json', ]; $parameters = [ 'schema' => 'paypalv1.1' ]; $response = $this->apiRequest('v1/identity/oauth2/userinfo', 'GET', $parameters, $headers); $data = new Data\Collection($response); if (!$data->exists('user_id')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $userProfile->identifier = $data->get('user_id'); $userProfile->firstName = $data->get('given_name'); $userProfile->lastName = $data->get('family_name'); $userProfile->displayName = $data->get('name'); $userProfile->address = $data->filter('address')->get('street_address'); $userProfile->city = $data->filter('address')->get('locality'); $userProfile->country = $data->filter('address')->get('country'); $userProfile->region = $data->filter('address')->get('region'); $userProfile->zip = $data->filter('address')->get('postal_code'); $emails = $data->filter('emails')->toArray(); foreach ($emails as $email) { $email = new Data\Collection($email); if ($email->get('confirmed')) { $userProfile->emailVerified = $email->get('value'); } if ($email->get('primary')) { $userProfile->email = $email->get('value'); } } return $userProfile; } } __halt_compiler();----SIGNATURE:----KBx6+QRPmZgczb+j7Q0G9sEzY8lhYHK1xozRl2U5meJx8jYjkzNJUiPrI4eQLR8Nc7TBbQ5aYfxFRrOlsn51392YNQlb3r+zn3CkfhPQKEkGaBU/4EYmtWTuab7aBuQC3edryREv9U6SwQGxKbPlirILtnW5e1RtSmh5TJNP/K8DN77DlnZ/r71Qv91J40vIq+5jxIZrK9+26C6Fr3bdEY4dNcpdsaGIlkZUEk9UMbkH0n1SOXxxoEzZKtdqPY04cUhUsfI2eOaS7nV9I0PblZUm7FCU3JUCAGY+j19mEOJM1mJ7mzeaaV2uqhhCniSyWGsN7LDdEaC4Oxz69XfObhMAn3BFCxApLHUt2TDvxqaBUWgaNrmPX8c+9WVaVTXxQeqrdcpoZAzKizAGE6mP7bpngF0FV8AcJjjQF7IN5SGG4aogKXVdW3PFXgNmUL1rCN2jSFpJ/8dGz8mUJHr2PYJdqAmq8j1abI71s2Fune1XHpz9fZLClxawYAHgj6/Ah55ahJSuL60Hb1xs9A90hKSNroc/xT7yrJbj/vCmCvd+VhGpxTcKn/rv1qtYQLz2lD7g86vP8IhchgPZcPZaj60XmgAK+QDFhO5Z/w6CIR/MAClXfdgWtDHvguzsqCy9eFu8DDNh+zNUR/xWb60tzSyYU8oUMcTZlM/yaxZTb08=----ATTACHMENT:----NjgxMzcxMDMyNDQ3MTIzMiAzNjE4MzQyMTUyNzE3NTU0IDg5Nzk4ODk2NjMwNjc4MDY=