← ClaudeAtlas

php-authenticationlisted

Set credentials on the PayPal Server SDK PHP SDK. Load before configuring any scheme, or when a call comes back 401 or 403. The builder won't tell you each scheme has its own credentials builder, that a single-scheme OAuth SDK drops the `Credentials` suffix from the accessor, or that the token provider lives on the credentials builder rather than the client.
MuHamza30/paypal-api-plugin · ★ 0 · API & Backend · score 70
Install: claude install-skill MuHamza30/paypal-api-plugin
# Authenticating an APIMatic PHP SDK client Which schemes exist is decided by the API spec. **The authoritative list is the set of `->{scheme}Credentials(…)` setters on `src/{Client}Builder.php`** (mirrored on `src/ConfigurationInterface.php` as one `get{Scheme}CredentialsBuilder()` plus one credentials getter per scheme, and documented one-file-per-scheme under `doc/auth/`). Start there — and note that only the *setter* name is uniform: the credentials getter is `get{Scheme}Credentials()`, **except** when the API has exactly one scheme and it is an OAuth 2 grant, where the `Credentials` suffix is dropped and it is `get{Scheme}()`. Grepping only for the suffixed getter on such an SDK finds nothing and looks like the scheme is absent. ## The shape: one credentials builder per scheme ```php use PaypalServerSdkLib\{Client}Builder; use PaypalServerSdkLib\Authentication\{Scheme}CredentialsBuilder; $client = {Client}Builder::init() ->{scheme}Credentials( {Scheme}CredentialsBuilder::init(/* required params, positionally */) // optional params are fluent setters ) ->build(); ``` Every credentials builder follows the same rules: - `init(...)` takes the scheme's **required** parameters, positionally. - Optional parameters are fluent setters returning `$this`. - The builder is passed to the client builder, which merges its config — you never call `getConfiguration()` yourself. **Where `{scheme}` comes from depends on how many schemes the API has.*