0.0.3 • Published 4 months ago

bc-paypal-sdk v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

BetterCommerce PayPal NodeJS SDK

BetterCommerce's PayPal NodeJS SDK enables BC client applications to integrate with PayPal merchant API system. It publishes an interface to interact with PayPal API v2 endpoints.

Use below command for package installation:

npm install @better-commerce/bc-paypal-sdk

Architecture Diagram

Architecture Diagram

SDK Initialization

Use following snippet to initialize the SDK:

PayPalEnvironment.init("<client_id>", "<app_secret>", [useSandbox: boolean]);

Usage Example

Get Order Details

const order = new Order();
const result = await order.get("<order_id>");

Response

{
  id: '<order_id>',
  intent: 'CAPTURE',
  status: 'COMPLETED',
  payment_source: {
    paypal: {
      email_address: '<email_address>',
      account_id: '<account_id>',
      name: [Object],
      address: [Object]
    }
  },
  ...
  ...
  ...
}
0.0.3

4 months ago

0.0.2

12 months ago

0.0.1

12 months ago