# payplus-node

![alt text](https://circleci.com/gh/mikimn/payplus-node.svg?style=shield "CircleCI Build")

payplus-node is a Node.js wrapper for PayPlus' payment processing and retainer SOAP API

PayPlus' website: http://www.payplus.co.il/

## Installation

Install using npm:
```bash
npm install payplus-node
```

## Usage

### 1. Obtain a client

```ecmascript 6
const PayPlus = require('payplus-node');

PayPlus.generateClient(options, function(err, client) {
    // Your code here
});
```

`options` object must contain these strings:
* `username`: PayPlus terminal username
* `password`: PayPlus terminal password
* `cashierNum`: PayPlus assigned cashier number
* `merchantNum`: PayPlus assigned merchant number

### 2. Invoking methods

Once a client is obtained, it exposes all the available methods:

```ecmascript 6
PayPlus.generateClient(options, function(err, client) {
    // ...
    client.storeCard(cardNum, expMonth, expYear, function(err, result) {
        console.log(result.token); // Obtained UUID for the stored information
    })
});
```

## Todo

- [ ] Finish writing all tests
- [ ] Write documentation for available payments processing and retainer methods

## License

Copyright 2018 Miki Mendelson-Mints

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.