0.2.0 • Published 11 years ago
paymill v0.2.0
paymill-nodejs
Node.js wrapper for Paymill API/V2.x.
This module as been created as a drop in replacement for komola's paymill-node which does not support the latest features in the Paymill API/V2.1
Installation
npm install paymill
Usage
The first thing to do, is create a paymill instance using your Paymill private key and an optional apiVersion (which can be either v2 or v2.1, with the last one being the default, if the argument is omitted).
var paymill = require('paymill')('apiKey'[, 'apiVersion']);We can now access the API using a generic pattern, and all methods takes a callback as the last argument.
paymill.{resourceName}.{method}(..., function (err, ...) {
// ...
});API endpoints
Plain JavaScript object, e.g. { key: 'value' } is expected as data and as the argument in all create-method
- clients
create(client)list(data)details(clientId)update(clientId, data)remove(clientId)- offers
create(offer)list(data)details(offerId)update(offerId, data)remove(offerId)- payments
create(payment)list(data)details(paymentsId)remove(paymentsId)- preauthorizations
create(preauthorization)list(data)details(preauthorizationId)remove(preauthorizationId)- refunds
create(transactionId, amount[, description])
(for consistency,amountcan also be an object withamountanddescription)list(data)details(refundId)- subscriptions
create(subscription)list(data)details(subscriptionId)update(subscriptionId, data)remove(subscriptionId, data)- transactions
create(transaction)list(data)details(transactionId)update(transactionId, data)- webhooks
create(webhook)list(data)details(webhookId)update(webhookId, data)remove(webhookId)
TODO
- Add unit and integration tests
- Add examples to show how to use the wrapper in various cases
Author
Written by Daniel Juhl. Inspiration from Ask Bjørn Hansen and komola's paymill-node.