pp-server-sdk
v1.0.0
Published
The PayPal API is used to integrate PayPal's payment services into websites, mobile apps, and backend systems. It allows businesses, developers, and platforms to accept, process, and manage online payments securely and efficiently.
Downloads
3
Readme
Getting Started with Orders
Introduction
An order represents a payment between two or more parties. Use the Orders API to create, update, retrieve, authorize, and capture orders.
Find out more here: https://developer.paypal.com/docs/api/orders/v2/
Install the Package
Run the following command from your project directory to install the package from npm:
npm install [email protected]For additional package details, see the Npm page for the [email protected] npm.
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.Production |
| timeout | number | Timeout for API calls.Default: 0 |
| httpClientOptions | Partial<HttpClientOptions> | Stable configurable http client options. |
| unstableHttpClientOptions | any | Unstable configurable http client options. |
| clientCredentialsAuthCredentials | ClientCredentialsAuthCredentials | The credential object for clientCredentialsAuth |
The API client can be initialized as follows:
import { Client, Environment } from 'pp-server-sdk';
const client = new Client({
clientCredentialsAuthCredentials: {
oAuthClientId: 'OAuthClientId',
oAuthClientSecret: 'OAuthClientSecret'
},
timeout: 0,
environment: Environment.Production,
});Environments
The SDK can be configured to use a different environment for making API calls. Available environments are:
Fields
| Name | Description | | --- | --- | | production | Default PayPal Sandbox Environment | | environment2 | PayPal Live Environment |
Authorization
This API uses the following authentication schemes.
