No description, website, or topics provided.
Clone or download
Latest commit 01e294a Jul 3, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src typescript Jun 29, 2018
test typescript Jun 29, 2018
.babelrc callable Payjp object Feb 7, 2016
.eslintrc.json yarn May 9, 2017
.gitignore typescript Jun 29, 2018
.npmignore update .npmignore Feb 10, 2016
.travis.yml typescript Jun 29, 2018
LICENSE typo... Feb 3, 2016
README.md Update README.md May 16, 2018
jsconfig.json fix separator Nov 25, 2015
package.json typescript Jun 29, 2018
tsconfig.json typescript Jun 29, 2018

README.md

PAY.JP for Node.js

Build Status npm

Installation

npm install --save payjp

Dependencies

  • superagent

Documentation

Example

const payjp = require('payjp')('sk_test_c62fade9d045b54cd76d7036');
const charge = await payjp.charges.create({
  amount: 1000,
  currency: 'jpy',
  card: {
    number: 4242424242424242,
    exp_month: 12,
    exp_year: 2020,
  },
  capture: true
});

Options

Options can be specified in the constructor.

  • Cert

You can specify the certificate to be used for the request.

const options = {
  cert: 'path/to/ca-certificates.crt'
}
const payjp = require('payjp')('sk_...', options);

Charge

payjp.charges.retrieve(id)
payjp.charges.create(query = {})
payjp.charges.update(id, query = {})
payjp.charges.list(query = {})
payjp.charges.capture(id, query = {})
payjp.charges.refund(id, query ={})

Customer

payjp.customers.retrieve(id)
payjp.customers.create(query = {})
payjp.customers.update(id, query = {})
payjp.customers.delete(id)
payjp.customers.list(query = {})

Card

payjp.customers.cards.retrieve(customer_id, card_id)
payjp.customers.cards.create(customer_id, query = {})
payjp.customers.cards.update(customer_id, card_id, query = {})
payjp.customers.cards.delete(customer_id, card_id)
payjp.customers.cards.list(customer_id, query = {})

Plan

payjp.plans.retrieve(id)
payjp.plans.create(query = {})
payjp.plans.update(id, query = {})
payjp.plans.delete(id)
payjp.plans.list(query = {})

Subscription

payjp.subscriptions.retrieve(id)
payjp.subscriptions.create(query = {})
payjp.subscriptions.update(id, query = {})
payjp.subscriptions.delete(id)
payjp.subscriptions.list(query = {})
payjp.subscriptions.pause(id)
payjp.subscriptions.resume(id, query = {})
payjp.subscriptions.cancel(id)
payjp.subscriptions.delete(id, query = {})
payjp.customers.subscriptions.list(customer_id, query = {})
payjp.customers.subscriptions.retrieve(customer_id, subscription_id)

Token

payjp.tokens.create(query = {})
payjp.tokens.retrieve(id)

Transfer

payjp.transfers.list(query = {})
payjp.transfers.retrieve(id)
payjp.transfers.charges(id, query = {})

Event

payjp.events.retrieve(id)
payjp.events.list(query = {})

Account

payjp.accounts.retrieve()