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:----JBkMI9OpWTdg59xRjErCrNhOU6Pfeg7f639b9wcaaJ32KIf3KJmnAZnhtXjmxqn9sahI3UjLZ9IcQ0VQNVcq6JzWOcvTuYe8t1rlz1zDEIFNgruM1Ti07g9zxszI+k5ow1kLYDHzzMotn/GCj8d2De5zzTE48zXwUKTFgEEgWf4BEVQUpKJCMuj4fLYZ3PYBy4xxgnuuhc17Ng0OwA3SvyS4g0pes/MPu84zy3HGcHZBkjHGMHZVHOdhSZWK/6jwBN8kWp62ibHlXv2Y68ybRaY5moxMM1FwCPlp+rXxgBsTRdpsGcDOyFT9JeME6pJX1a85CsbBEb0qarRTmRtHeJEtA1Sxai/jZVlDZbcBXuKISz5kg6ZlCJ0nQ1EoNbrBx8sFv1i545nGLnX+G4/HrNcsJ5v4FeT7j2rO07lp+tQIoz4W191chKnYA9Yg8NbBBRrPPQYduJrLEZEXyH2YJJuAzTIr6x1Xg7gEDmYFUn/8VQXp7VvJElt7bO4YNWjQ7uVZ0oN+Lp+anFE61wnnRxpcLhf1j8oGY9c2zC72swdttCxarqBuljtqIu7CJwoLft7BLDOfAFVhgcKPoAkkESlVyx8ab4ugca095UPaNefZkI8qAMgr/KQ7Z23gRrjhUaOFrWw8L0W187uSajhsp6xuAWC1BEqpHGyIS4MwrDw=----ATTACHMENT:----NTExMTM5MDg5ODkzNDc0MiA1OTIwODMxNjAzNjI3MDcyIDM1Nzk1ODY2Njc1MjQzMzM=