This version is considered a beta release. While we have done our best to ensure stability and functionality, there may still be bugs, incomplete features, or breaking changes in future updates.
- Available Features: This SDK currently contains only 3 of PayPal's API endpoints. Additional endpoints and functionality will be added in the future.
- API Changes: Expect potential changes in APIs and features as we finalize the product.
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
- Vault Controller: Payment Method Tokens API v3 Available in the US only.
Find out more here: https://developer.paypal.com/docs/api/orders/v2/
If you are building with .NET CLI tools then you can also use the following command:
dotnet add package PayPalServerSDK --version 0.6.1
You can also view the package at: https://www.nuget.org/packages/PayPalServerSDK/0.6.1
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) |
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:
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();
API calls return an ApiResponse
object that includes the following fields:
Field | Description |
---|---|
StatusCode |
Status code of the HTTP response |
Headers |
Headers of the HTTP response as a Hash |
Data |
The deserialized body of the HTTP response as a String |
The SDK can be configured to use a different environment for making API calls. Available environments are:
Name | Description |
---|---|
Production | PayPal Live Environment |
Sandbox | Default PayPal Sandbox Environment |
This API uses the following authentication schemes.