PayPalServerSDK 1.1.1
Getting Started with PayPal Server SDK
Introduction
Important Notes
- Available Features: This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future.
Information
The PayPal Server SDK provides integration access to the PayPal REST APIs. The API endpoints are divided into distinct controllers:
- Orders Controller: Orders API v2
- Payments Controller: [Payments API v2](https://developer.paypal.com/docs/api/payments/v2
- Vault Controller: Payment Method Tokens API v3 Available in the US only.
Install the Package
If you are building with .NET CLI tools then you can also use the following command:
dotnet add package PayPalServerSDK --version 1.1.1
You can also view the package at: https://www.nuget.org/packages/PayPalServerSDK/1.1.1
Initialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
|---|---|---|
| Environment | Environment |
The API environment. Default: Environment.Sandbox |
| Timeout | TimeSpan |
Http client timeout. Default: TimeSpan.FromSeconds(100) |
| HttpClientConfiguration | Action<HttpClientConfiguration.Builder> |
Action delegate that configures the HTTP client by using the HttpClientConfiguration.Builder for customizing API call settings. Default: new HttpClient() |
| LogBuilder | LogBuilder |
Represents the logging configuration builder for API calls |
| ClientCredentialsAuth | ClientCredentialsAuth |
The Credentials Setter for OAuth 2 Client Credentials Grant |
The API client can be initialized as follows:
using Microsoft.Extensions.Logging;
using PaypalServerSdk.Standard;
using PaypalServerSdk.Standard.Authentication;
PaypalServerSdkClient client = new PaypalServerSdkClient.Builder()
.ClientCredentialsAuth(
new ClientCredentialsAuthModel.Builder(
"OAuthClientId",
"OAuthClientSecret"
)
.Build())
.Environment(PaypalServerSdk.Standard.Environment.Sandbox)
.LoggingConfig(config => config
.LogLevel(LogLevel.Information)
.RequestConfig(reqConfig => reqConfig.Body(true))
.ResponseConfig(respConfig => respConfig.Headers(true))
)
.Build();
Environments
The SDK can be configured to use a different environment for making API calls. Available environments are:
Fields
| Name | Description |
|---|---|
| Production | PayPal Live Environment |
| Sandbox | Default PayPal Sandbox Environment |
Authorization
This API uses the following authentication schemes.
List of APIs
SDK Infrastructure
Configuration
- HttpClientConfiguration
- HttpClientConfigurationBuilder
- LogBuilder
- LogRequestBuilder
- LogResponseBuilder
- ProxyConfigurationBuilder
HTTP
Utilities
No packages depend on PayPalServerSDK.
.NET Standard 2.0
- APIMatic.Core (>= 0.4.10 && < 0.5.0)
- Microsoft.CSharp (>= 4.7.0)