1
0

2.0.0 Release (#58)

* Automated commit message

* Automated commit message

* add changelog

---------

Co-authored-by: PayPalServerSDKs <server-sdks@paypal.com>
This commit is contained in:
Patrick Powers
2025-11-13 16:32:53 -06:00
committed by GitHub
parent 6da8b9b5b8
commit 1fc2cf1e07
488 changed files with 32110 additions and 4157 deletions

View File

@@ -27,6 +27,9 @@ Documentation for accessing and setting credentials for Oauth2.
You must initialize the client with *OAuth 2.0 Client Credentials Grant* credentials as shown in the following code snippet. This will fetch the OAuth token automatically when any of the endpoints, requiring *OAuth 2.0 Client Credentials Grant* authentication, are called.
```php
use PaypalServerSdkLib\Authentication\ClientCredentialsAuthCredentialsBuilder;
use PaypalServerSdkLib\PaypalServerSdkClientBuilder;
$client = PaypalServerSdkClientBuilder::init()
->clientCredentialsAuthCredentials(
ClientCredentialsAuthCredentialsBuilder::init(
@@ -46,6 +49,9 @@ Your application can also manually provide an OAuthToken using the setter `oAuth
Whenever the OAuth Token gets updated, the provided callback implementation will be executed. For instance, you may use it to store your access token whenever it gets updated.
```php
use PaypalServerSdkLib\Authentication\ClientCredentialsAuthCredentialsBuilder;
use PaypalServerSdkLib\PaypalServerSdkClientBuilder;
$client = PaypalServerSdkClientBuilder::init()
->clientCredentialsAuthCredentials(
ClientCredentialsAuthCredentialsBuilder::init(
@@ -68,6 +74,9 @@ $client = PaypalServerSdkClientBuilder::init()
To authorize a client using a stored access token, set up the `oAuthTokenProvider` in `ClientCredentialsAuthCredentialsBuilder` along with the other auth parameters before creating the client:
```php
use PaypalServerSdkLib\Authentication\ClientCredentialsAuthCredentialsBuilder;
use PaypalServerSdkLib\PaypalServerSdkClientBuilder;
$client = PaypalServerSdkClientBuilder::init()
->clientCredentialsAuthCredentials(
ClientCredentialsAuthCredentialsBuilder::init(