ocpaycomet
v3.1.0
Published
Ocpayment is a library to interact with paycomet.
Downloads
169
Readme
#ocpaycomet
Ocpayment is a library to interact with paycomet.
Installation
Download
npm install ocpaycomet
Example
const ocPaycometClass = require('ocpaycomet')
const ocPaycomet = new ocPaycometClass.Ocpaycomet(
{
terminal: "",
paycometApiToken: ""
}
);
Usage
To create a new user
paycomet.addUser(tpvToken, "ca")
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});
To charge a payment
paycomet.charge(
idUser,
tokenUser,
1000,
'Test payment',
true, // true if it's needed user interaction
true // true if it's first payment
{
id: '1',
name: 'John',
surname: 'Doe',
email: '[email protected]',
homePhone: '+34936666666',
mobilePhone: '+34666666666'
}
'ca'
)
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});
Documentation
Read documentation from ocpaycomet for further details.