No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.babelrc
.eslintrc.json
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
jsconfig.json
package.json
tsconfig.json

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()