Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

like-paypal

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

like-paypal

Simple PayPal API for Node.js

  • 1.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
0
Weekly downloads
 
Created
Source

like-paypal

Simple PayPal API for Node.js

npm i like-paypal

Usage

const PayPal = require('like-paypal')

const account = new PayPal({
  clientId: 'AXH41VU0Lji...',
  secretKey: 'ECJeQAFuLn...',
})

main()

async function main () {
  const product = await account.products.create({
    name: 'Video Streaming Service',
    description: 'A video streaming service',
    type: 'SERVICE',
    category: 'SOFTWARE',
    image_url: 'https://example.com/streaming.jpg',
    home_url: 'https://example.com/home'
  })
  console.log(product)
}

API

const account = new PayPal([options])

Creates an instance of a PayPal account.

Available options:

{
  clientId: null, // To auto create an access token
  clientKey: null,
  accessToken: null // Or pass a token directly to avoid creating one
}
const accessToken = await account.auth()

Generates an access token.

const response = await account.api(pathname, [options])

Request to any endpoint easily.

pathname can be i.e. /v1/catalogs/products, etc.

Available options:

{
  auth: null, // Default is `Bearer {accessToken}`
  method: 'POST',
  body: undefined, // Normally an object { ... }
  requestType: 'json',
  responseType: 'json'
}
const product = await account.products.create([options])

Creates a product.

Available options:

{
  name: 'Any name',
  description: 'Some description',
  type: 'SERVICE', // TODO: what are other types?
  category: 'SOFTWARE', // TODO: what are other categories?
  image_url: 'https://example.com/streaming.jpg',
  home_url: 'https://example.com/home'
} // TODO: what are other options? Want to know the full options
const plan = await account.plans.create(options)

Creates a billing plan.

Available options are in docs and schema.

const subscription = await account.subscriptions.create(options)

Creates a subscription for a billing plan.

Available options are in docs and schema.

License

Unlicensed

FAQs

Package last updated on 07 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc