# trexlejs

> Api client for Trexle

Latest version **1.0.9** (published 2018-08-22) · bsd license · 0 weekly downloads

## Install

```sh
npm install trexlejs
pnpm add trexlejs
yarn add trexlejs
bun add trexlejs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2018-08-22 |
| First published | 2017-04-12 |
| Weekly downloads | 0 |
| License | bsd |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hossam Hossny |
| Maintainers | hossamhossny |
| Keywords | payment, transactions |

## Links

- npm: https://www.npmjs.com/package/trexlejs
- npm.io page: https://npm.io/package/trexlejs

## Dependencies (1)

- [superagent](https://npm.io/package/superagent.md) 3.7.0

## Recent versions

- 1.0.9 (latest) — 2018-08-22
- 1.0.8 — 2017-05-07
- 1.0.7 — 2017-05-07
- 1.0.6 — 2017-05-07
- 1.0.5 — 2017-04-15
- 1.0.4 — 2017-04-15
- 1.0.3 — 2017-04-13
- 1.0.2 — 2017-04-12
- 1.0.1 — 2017-04-12

## README

# Trexle.js - Node.js module for [Trexle](https://trexle.com)


Trexle.js is an node.js API client for [Trexle](https://trexle.com/) an online recurring subscription billing platform with support to 100+ payments gateways.    The module has wrapped all documented Trexle resources.


## Getting started

```
npm install trexlejs
```

## Methods

First instantiate trexlejs by passing in your api key 

```javascript
var Trexle = require('trexlejs');

var trexle = Trexle.setup({
  key: 'yourkey',
  production: false
});
// fields is an object, see the example for more info
trexle.createCard(fields, callback)
trexle.createCustomer(fields, callback)
trexle.refundCharge(chargeId, fields, callback)
trexle.retrieveCharge(chargeId, callback)
trexle.createCharge(fields, callback)
trexle.captureCharge(uncapturedChargeToken, callback)
```

## Example

This is the basic syntax of how to create a new charge, checkout the demos folder for the rest of the methods

```javascript
var Trexle = require('trexlejs');

var trexle = Trexle.setup({
  key: 'your-api-key',
  production: false
});

trexle.createCharge({
  amount: 400,
  currency: 'usd',
  description: 'test charge',
  email: 'john@trexle.com',
  ip_address: '66.249.79.118',
  card: {
    number: '4242424242424242',
    expiry_month: 8,
    expiry_year: 2018,
    cvc: 123,
    name: 'John Milwood',
    address_line1: '423 Shoreline Park',
    address_city: 'Mountain View',
    address_postcode: 94043,
    address_state: 'CA',
    address_country: 'US'
  }  
}, function (response) {  
  console.log(response.body);
});
```

---
_Source: https://npm.io/package/trexlejs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
