🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

paypal-node-api

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paypal-node-api

Unofficial API to make working with paypal bearable

0.1.1
Source
npm
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Paypal Node API

A wrapper around paypal's REST API, featuring events, promise support and auto auth.

Only supports subscriptions for now, others will be added per request.

THIS IS NOT AN OFFICIAL API

Installation

NPM:

npm i kik-paypal-api

Usage

  • Getting started
  • The error object
Requests

Getting Started

You can use the API by creating an instance of PaypalClient.

const PaypalClient = require("paypal-node-api");

paypal = new PaypalClient({
    env: "sandbox",
    clientId: "id",
    secret: "secret",
    config: {}
});

env: one of either "sandbox" or "live"

clientId: your app's client id

secret: your app's secret

config: a config object

Sharing a paypal instance:
const PaypalClient = require("paypal-node-api");

const clientId = "yourApp'sId";
const secret = "yourApp'sSecret";

const paypal = new PaypalClient("sandbox", clientId, secret);

//event handlers go here
paypal.on("auth", () => {
    console.log("Paypal token refreshed");
});

module.exports = paypal;

Getting Started

The Extras Object

All required parameters are supplied directly to the functions, non required parameters can be supplied via the extras parameter, this object is merged into the request's payload

Requests

Subscriptions

Create
await paypal.subscriptions.create(planId, extras);

planId: the plan associated with this subscription

Details
await paypal.subscriptions.details(subscriptionId);

subscriptionId: the subscription id to retrieve

returns the subscription object

Webhooks

Verify
await paypal.webhooks.verify(authAlgo, certUrl, transmissionId, transmissionSig, transmissionTime, webhookId, webhookEvent)

returns true if verified, false if not

License

GNU AGPLv3

Keywords

paypal

FAQs

Package last updated on 18 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts