Overview
This module is a part of yocto node modules for NodeJS.
Please see our NPM repository for complete list of available tools (completed day after day).
An utility tool to provide payment via Atos API
Motivation
After each development, conclusion is the same : we need to create an utility tools with all our utility method to be able to reuse them in other program. That's why we create this utility tools.
Although this module was completed day after day.
How to use
- First you need to create an Store with Atos, and retrieve <client_id> and <secret_key>
All methods returned promise for success of fail
Load config
This wrapper use the two mode of Atos : 'sandbox' and 'live' The module must be loaded like this :
var atos = ; atos;
Create authorization payment
An Atos authorization payment permit you to capture payment during in period of 29 days. NB : Atos will honor the funds for a 6-day period after the basic authorization
With credit card
To create payment with an credit card
var paymentData = amount : 123 cardNumber : '559955995599559955' cardExpiryDate : '201905' cardCSCValue : '985' merchantId : '1' orderId : '57358b7fea9d4398641209e5' // optional transactionReference : '57358b7fea9d4398641209e5' // optional s10TransactionReference : // optional s10TransactionId : '777888899445566112233' s10TransactionIdDate : '20050606' ; atosmodulescreditCard;
Capture payment
TO capture an payment you should have an valid capture payment. The field "transactionReference" or "s10TransactionReference" should be set.
var captureData = operationAmount : 100 merchantId : '1' transactionReference : '57358b7fea9d4398641209e5' s10TransactionReference : s10TransactionId : '777888899445566112233' s10TransactionIdDate : '20050606' ; atos;
Cancel payment
An payment authorization can be void only if was previously captured and not sent to the bank. The field "transactionReference" or "s10TransactionReference" should be set.
var cancelData = transactionReference : '3aabcedaapfa1f33a00425aa8' operationOrigin : 'my app' merchantId : '1' operationAmount : 974 s10TransactionReference : s10TransactionId : '777888899445566112233' s10TransactionIdDate : '20050606' atos;