<commit_before># CMCIC

[![Build Status](https://travis-ci.org/PierrickP/cmcic.png?branch=master)](https://travis-ci.org/PierrickP/cmcic)
[![Dependency Status](https://david-dm.org/PierrickP/cmcic.png)](https://david-dm.org/PierrickP/cmcic)
[![NPM version](https://badge.fury.io/js/cmcic.png)](http://badge.fury.io/js/cmcic)

## How-to use

```JavaScript
var cmcic = require('cmcic');

var tpe = new cmcic.tpe({
	CMCIC_TPE: 'tpeid',
	CMCIC_CODESOCIETE: 'societykey',
	CMCIC_CLE: '1234567890abcdef',
	CMCIC_BANK: 'CIC',
	CMCIC_LNG: 'FR',
	CMCIC_CURRENCY: 'EUR',
	CMCIC_URL_RETOUR: '/url/return',
	CMCIC_URLOK: '/url/ok',
	CMCIC_URLKO: '/url/ko'
});

var t = {
	email: '<EMAIL>',
	amount: 300,
	reference: 'qwerty'
};

var trans = new cmcic.transaction(tpe, t);

// if you use expressjs

res.send(trans.form('paimentid', true));

```

On your return url (still with expressjs)

```JavaScript
var ret = tpe.checkTransactionReturn((req.method == 'POST')? req.body : req.query);
if (ret.status) {
	console.error('Payment is ok');
	res.send(tpe.RETURN_OK);
} else {
	console.error('Payment is fail : ', ret.motifrefus );
	res.send(tpe.RETURN_NOTOK);
}
```

# Tips

For handle different kind of payment with the same TPE, you can use the 'texte-libre' field !
You can use 'texte-libre' field like an object, it ll be *stringified*/*parsed* for you.

# Coding Style

* tabulation (4 width)
* JsHint

# License

Under [MIT license](LICENSE.md), feel free to contribuate with fork and PR !<commit_msg>Add Badge to README<commit_after># CMCIC

[![Build Status](https://travis-ci.org/PierrickP/cmcic.png?branch=master)](https://travis-ci.org/PierrickP/cmcic)
[![Dependency Status](https://david-dm.org/PierrickP/cmcic.png)](https://david-dm.org/PierrickP/cmcic)
[![NPM version](https://badge.fury.io/js/cmcic.png)](http://badge.fury.io/js/cmcic)

[![NPM](https://nodei.co/npm/cmcic.png?downloads=true&stars=true)](https://nodei.co/npm-dl/cmcic/)

## How-to use

```JavaScript
var cmcic = require('cmcic');

var tpe = new cmcic.tpe({
	CMCIC_TPE: 'tpeid',
	CMCIC_CODESOCIETE: 'societykey',
	CMCIC_CLE: '1234567890abcdef',
	CMCIC_BANK: 'CIC',
	CMCIC_LNG: 'FR',
	CMCIC_CURRENCY: 'EUR',
	CMCIC_URL_RETOUR: '/url/return',
	CMCIC_URLOK: '/url/ok',
	CMCIC_URLKO: '/url/ko'
});

var t = {
	email: '<EMAIL>',
	amount: 300,
	reference: 'qwerty'
};

var trans = new cmcic.transaction(tpe, t);

// if you use expressjs

res.send(trans.form('paimentid', true));

```

On your return url (still with expressjs)

```JavaScript
var ret = tpe.checkTransactionReturn((req.method == 'POST')? req.body : req.query);
if (ret.status) {
	console.error('Payment is ok');
	res.send(tpe.RETURN_OK);
} else {
	console.error('Payment is fail : ', ret.motifrefus );
	res.send(tpe.RETURN_NOTOK);
}
```

# Tips

For handle different kind of payment with the same TPE, you can use the 'texte-libre' field !
You can use 'texte-libre' field like an object, it ll be *stringified*/*parsed* for you.

# Coding Style

* tabulation (4 width)
* JsHint


# TODO

https://github.com/PierrickP/cmcic/issues?labels=new-feature&page=1&state=open 

# License

Under [MIT license](LICENSE.md), feel free to contribuate with fork and PR !
{'fraction_non_alphanumeric': 0.1765261170547514, 'fraction_numerical': 0.009125235997482694, 'mean_word_length': 4.769509981851179, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2154543', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1292, 'n_words': 266}