Socket
Socket
Sign inDemoInstall

payjp

Package Overview
Dependencies
38
Maintainers
5
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    payjp

PAY.JP node.js bindings


Version published
Maintainers
5
Created

Readme

Source

PAY.JP for Node.js

Build Status npm

Installation

npm install --save payjp

Dependencies

Documentation

Example

In advance, you need to get a token by Checkout or payjp.js.

Javascript

const payjp = require('payjp')('sk_test_c62fade9d045b54cd76d7036');
payjp.charges.create({
  amount: 1000,
  currency: 'jpy',
  card: 'token_id_by_Checkout_or_payjp.js'
}).then(console.log).catch(console.error);

Typescript

import * as Payjp from 'payjp';
const payjp = Payjp('sk_test_c62fade9d045b54cd76d7036');
payjp.charges.create({
  amount: 1000,
  currency: 'jpy',
  card: 'token_id_by_Checkout_or_payjp.js'
}).then((charge: Payjp.Charge) => console.log(charge)
).catch((e: Payjp.ResponseError) => console.error(e.response.body as Payjp.PayjpError));

Options

Options can be specified in the constructor.

Timeout

Timeout is configurable for the entire request (including all uploads, redirects, server processing time) to complete. If the response isn't fully downloaded within that time, the request will be aborted.

const payjp = require('payjp')('sk_...', {timeout: 20 * 1000}); // in ms (this is 20 seconds)

Keywords

FAQs

Last updated on 08 Mar 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc