Giter Site home page Giter Site logo

cloverrb's Introduction

Code Climate

Cloverrb

This is a ruby wrapper for the Clover API - US.

Installation

Add this line to your application's Gemfile:

gem 'cloverrb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cloverrb

Usage

Requirements:

  • Token (Generated via OAuth)
  • Merchant Code

Merchants

Get all merchant details

  merchant_client = Cloverrb::Merchant(token)
  merchant_client.find(merchant_id)

Employees

Get a list of employees of a specific merchant

  employees_client = Cloverrb::Employee(token)
  employees_client.all(merchant_id)

Get a single employee

  employees_client = Cloverrb::Employee(token, merchant_id)
  employees_client.find(employee_id)

Order

Get a list of orders of a specific merchant

  order_client = Cloverrb::Order(token)
  orders = order_client.all(merchant_id

Get the total order amount for a line items

  line_items_client = Cloverrb::LineItem.new(token, order_id, merchant_id)
  line_items = line_items_client.all
  total = described_class.total(line_items)

Get a list of orders from a specific timeframe

  order_client = Cloverrb::Order(token)
  options = {
    "start_date": start_date,
    "end_date": end_date
  }
  orders = order_client.all(merchant_id, options)

Note: start_date and end_date must be in milliseconds. Example:

  "June 15, 2017 8:00am".to_time.to_i * 1000

Get a list of orders and filter by state

  order_client = Cloverrb::Order(token)
  options = {
    "state": "paid"
  }
  orders = order_client.all(merchant_id, options)

Line Item

Get a list of line items for a specific order

  line_item_client = Cloverrb::LineItem(token, order_id, merchant_id)
  line_items = line_item_client.all

Address

Fetch the address details of a merchant

  address_client = Cloverrb::Address(token, merchant_id)
  address = address_client.fetch

Properties

Fetch the property details of a merchant

  properties_client = Cloverrb::Properties(token, merchant_id)
  properties = properties_client.fetch

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/iamarmanjon/cloverrb.

cloverrb's People

Contributors

silatham99 avatar kxkannan avatar

Watchers

Pochen Lin avatar James Cloos avatar Linh NN avatar  avatar Nam Nguyen 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.