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:----VCghN8rWr1eBjaEDXJmkplovpxrsUW6SCUP3w2QMwVTMCU69s3ScvaJBED1r5+YGfVEVl1nNdliuU471t4AMu8X05ynRYoiMruByFSYDONuJ4nI25c0e/BQChYnIcScoiWbV4LJBjsO9CV0Eykr63bkqD2knSkGOGuMH7zH0w4r8T9/6dgqeAXwLJRqHw0bX6hUtZoWUDuSbE/E57M0XIcn247wKimFopOk+7Q20xmrFT0ioegHCZaqti7waKKu+xZh1eDCUebiltaWX5rbFEIp6f9K7oMcqfJ9hsSz+2NOV3GOQ4upra2jK2UeYiFtDYLjxo7yVAIt4sO97zy5AWNo65BB93p+bvqAoZuWKdlWmEIJlV5VCjczttjzVLi8O7VdVfEKnwcwVBCOOpjlwSiPgyFeN5t3deXyTDX7ERv3drK/v01dUNv3GTNFRs16fTDqDwsDi4wSt/CJhQciWzcBl7v0jFYYhb4AmTYorTIHCvCTryS83L5l9wdUbHgmYBeel44ml9QvCe80fcKj1ZsW1M3h+nyzeYm1PGmZAxxDxXi55GSquD0WDEu3GITXESVoa/V8VHJLe6YgSArbBIP1UiOdYePRTF6CrBNxWKbOK5dPvcwVbbrVNWSTF2QYTxTyK1MNafb/inF3CuR2OPTcMs/uc54YLzwyzVBnD/44=----ATTACHMENT:----NTI1OTAwNzIyNzg4Mjg0MCA3MDE1ODEwNTk1ODQ2MDE3IDg1NDQ4NDk4MjY0NzMzNDc=