Code Monkey home page Code Monkey logo

trexlejs's Introduction

Trexle.js - Node.js module for Trexle

Trexle.js is an node.js API client for Trexle 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

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

var Trexle = require('trexlejs');

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

trexle.createCharge({
  amount: 400,
  currency: 'usd',
  description: 'test charge',
  email: '[email protected]',
  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);
});

trexlejs's People

Contributors

hossamhossny avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.