1 | <?php |
||
19 | class Paypal extends AbstractService |
||
20 | { |
||
21 | /** |
||
22 | * Defined scopes |
||
23 | * @link https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/ |
||
24 | * @see #attributes |
||
25 | */ |
||
26 | const SCOPE_OPENID = 'openid'; |
||
27 | const SCOPE_PROFILE = 'profile'; |
||
28 | const SCOPE_PAYPALATTRIBUTES = 'https://uri.paypal.com/services/paypalattributes'; |
||
29 | const SCOPE_EMAIL = 'email'; |
||
30 | const SCOPE_ADDRESS = 'address'; |
||
31 | const SCOPE_PHONE = 'phone'; |
||
32 | const SCOPE_EXPRESSCHECKOUT = 'https://uri.paypal.com/services/expresscheckout'; |
||
33 | |||
34 | public function __construct( |
||
35 | CredentialsInterface $credentials, |
||
36 | ClientInterface $httpClient, |
||
37 | TokenStorageInterface $storage, |
||
38 | $scopes = array(), |
||
39 | UriInterface $baseApiUri = null |
||
40 | ) { |
||
41 | parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri); |
||
42 | |||
43 | if (null === $baseApiUri) { |
||
44 | $this->baseApiUri = new Uri('https://api.paypal.com/v1/'); |
||
45 | } |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function getAuthorizationEndpoint() |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function getAccessTokenEndpoint() |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | protected function getAuthorizationMethod() |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | protected function parseAccessTokenResponse($responseBody) |
||
103 | } |
||
104 |