npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yocto-atos

v1.1.1

Published

Yocto module to make payment with Atos - Wrapper for Sips Office Json Interface

Downloads

17

Readme

NPM

alt text Code Climate Test Coverage Issue Count Build Status

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 = require('yocto-atos')();

atos.loadConfig({
  // "sandbox" or "live"
  mode : 'sandbox',
  secretKey         : '484GEF87A45AEAA87842634A684A354A643541AA',
  config : {
    currencyCode      : '978',
    keyVersion        : 1,
  }
}).then(function (config) {
  console.log('success')
}).catch(function (error) {
  console.log('error : ', error)
});

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'
  }
};

atos.modules.creditCard.createAuthorization(paymentData).then(function (config) {
  console.log('success')
}).catch(function (error) {
  console.log('error : ', error)
});

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.capturePayment(captureData).then(function (config) {
  console.log('success')
}).catch(function (error) {
  console.log('error : ', error)
});

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.cancelPayment(cancelData).then(function () {
  console.log('success')
}).catch(function (error) {
  console.log('error : ', error)
});