A Node.js module for Billmate API integration.
Read the Billmate API documentation and contact Billmate to obtain a Store ID and API secret.
npm install billmate
Require the module:
let Billmate = require('billmate');
Initialize the module with your Store ID and secret key:
let billmate = new Billmate('12345', '1234567890');
To target the test environment:
let billmate = new Billmate('12345', '1234567890', { test: true });
Get Address data for a person or organization.
billmate.getAddress('550101-1018').then(response => {
/*
response.data:
{
firstname: 'Testperson',
lastname: 'Approved',
street: 'Teststreet',
zip: '12345',
city: 'Testcity',
country: 'SE',
phone: '0700123456',
email: 'test@teststore123.com'
}
*/
}).catch(error => {
// Handle error
});
Get info about a payment.
billmate.getPaymentinfo('1077').then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
Used for fetching part payment plans.
billmate.getPaymentplans('SEK', 'SE', 'sv').then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
Used for fetching the Billmate payment terms.
billmate.getTerms(1, 231700).then(html => {
// Do stuff with the HTML
}).catch(error => {
// Handle error
});
Used for creating payments.
let data = { ... };
billmate.addPayment(data).then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
Used to cancel a created payment.
billmate.cancelPayment(1077).then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
Used for updating an existing payment.
let data = { ... };
billmate.updatePayment(data).then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
Used for activate a payment created with autoactivate=0.
billmate.updatePayment(1000235).then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
Used for crediting payments. The original payment can be credited fully or partially.
billmate.creditPayment(1077).then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
Used for initiating a checkout payment.
let data = { ... };
billmate.initCheckout(data).then(response => {
// Do stuff
}).catch(error => {
// Handle error
});
- Emil Isaksson - Creator - emilisaksson
This project is licensed under the GNU General Public License - see the LICENSE.md file for details