node-stripe-api
node.js wrapper for the Stripe API.
install
npm install stripe-api
usage
var stripe = require('stripe-api')(<your_stripe_api_key);
stripe.<api_group>.<api_group_command>([arguments,] callback);
example
stripe.charges.create(
{
amount: 100,
currency: 'usd',
card:
{
number: 4242424242424242,
exp_month: 12,
exp_year: 15
},
description: 'Quick stripe-api example.'
},
function(error, response) {
console.log(response);
}
);
api
The data
argument is a javascript object that has key/value pairs that match what's expected by the Stripe API.
create(data, cb)
retrieve(charge_id, cb)
refund(charge_id, [data,] cb)
capture(charge_id, [data,] cb)
list([data,] cb)
create(data, cb)
retrieve(customer_id, cb)
update(customer_id, data, cb)
del(customer_id, cb)
list([data,] cb)
update(customer_id, data, cb)
cancel(customer_id, [data,] cb)
create(data, cb)
retrieve(plan_id, cb)
update(plan_id, data, cb)
del(plan_id, cb)
list([data,] cb)
create(data, cb)
retrieve(coupon_id, cb)
del(coupon_id, cb)
list([data,] cb)
retrieve(invoice_id, cb)
retrieveLineItems(invoice_id, [data,] cb)
create(customer_id, cb)
pay(invoice_id, cb)
update(invoice_id, data, cb)
list([data,] cb)
retrieveUpcoming(customer_id, cb)
create(data, cb)
retrieve(invoiceItem_id, cb)
update(invoiceItem_id, data, cb)
del(invoiceItem_id, cb)
list([data,] cb)
update(charge_id, data, cb)
create(data, cb)
retrieve(transfer_id, cb)
cancel(transfer_id, cb)
list([data,] cb)
create(data, cb)
retrieve(recipient_id, cb)
update(recipient_id, data, cb)
del(recipient_id, cb)
list([data,] cb)
retrieve(cb)
list([data,] cb)
retrieve(event_id, cb)
list([data,] cb)
create(data, cb)
retrieve(token_id, cb)
test
All tests use should.js and were run with Mocha.