Giter VIP home page Giter VIP logo

merchant_e_solutions's Introduction

MerchantESolutions

A gem to more easily interact with the Merchant e-Solutions API(v2.3).

Installation

Add this line to your application's Gemfile:

gem 'merchant_e_solutions'

And then execute:

$ bundle

Or install it yourself as:

$ gem install merchant_e_solutions

Usage

Request a report:

report = MerchantESolutions.settlement_detail_report

Each report has records which hold all the data passed back and some convience methods:

record = report.records.first

record.card_code        # => "MD"
record.credit_company   # => "MasterCard"
record.credit_type      # => "Debit"

Configuration

Add your user id and password in an initializer:

MerchantESolutions.configure do |config|
  config.user_id = "yourUserID"
  config.password = "yourPassword"
end

or as environment variables:

echo $MERCHANT_E_SOLUTIONS_USER_ID  # yourUserID
echo $MERCHANT_E_SOLUTIONS_PASSWORD # yourPassword

A Note on Acquirer Reference Numbers (ARNs)

The MeS detailed report APIs return an acquirer reference number for every transaction. Take a look at the MeS reporting API documentation under 'Links' for more.

One issue we've seen is that the MeS API always returns reference numbers pre-pended with an apostrophe. Instead of 123456789, we consistently see '123456789.

The MeS docs are inconsistent in its examples, showing apostrophes pre-pended to some and none pre-pended to others. The MeS reporting front-end never shows apostrophes in reference numbers, and the apostrophe is never addressed in the documentation.

Further, the reference number is documented as a 23-character field. The apostrophe consistently brings this field's length to 24 characters.

This is probably sloppiness on MeS' end, so by default this library removes these apostrophes. If you want to keep the apostrophe for any reason -- personal preference, interfacing with legacy records that have them -- you can get the reference number unchanged from a record thusly:

reference_number = record.reference_number(:unchanged => true)

Links

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Need a different report?

Adding new reports is easy! Each report consists of two classes, the report and the report record:

Creating a report requires the #report_type and #report_id methods to be defined as the params you would pass into the API. Additional default parameters can be specified in #report_specific_params. includeTridentTranId, includePurchaseId, includeClientRefNum are turned on by default right now, because they would change the order of the columns in some reports. The report class must also specify its #record class. If a report has both a summary and detail version, they should be defined as different classes. The BatchDetailReport is a good example to reference.

For each row in a report available in the web view there is an instance of a report's report record. Report records specify their attributes, and the order in which the attributes are pulled off of the report CSV. Report record classes also a good place to add co convenience methods. DetailRecord is a good example to reference.

###TODO

  1. Instances of reports can write out CSVs
  2. Instances of reports can be generated by passing in CSVs(instead of having to pull CSVs directly from the API)
  3. Report records pull their attributes from CSV column names instead of column orders

merchant_e_solutions's People

Contributors

se3000 avatar voberoi avatar

Stargazers

Paul Ort avatar

Watchers

Omar Johnson avatar Brian Cobb avatar Neha avatar Marshall Yount avatar Gemma Barlow avatar Daniel Schwartz avatar  avatar Thomas Boyt avatar Pierre Jambet avatar James Cloos avatar James Petty avatar Johnny Lin avatar William Garcia avatar Jack Tarantino avatar Jacy Clare avatar Aaron Rosen avatar Joe Letizia avatar Matthew Kuzyk avatar Janahan Sivaraman avatar Benson Tucker avatar Kristian von Rickenbach avatar Dani Grant avatar Michael avatar Meka avatar Michael Fu avatar Daniel Shlyuger avatar Steven Natera avatar Andrea Heyman avatar Connor Brogan avatar Tom Vogels avatar CODE CLIMATE BOT avatar  avatar Pablo Borges avatar

merchant_e_solutions's Issues

Record classes should parse using CSV headers instead of column indices.

MeS added a column to the middle of settlement & batch transaction detail records, breaking parsing in our record classes.

I submitted PR #3 to fix the issue for settlement & batch transaction detail records, but we need to modify our other record classes as well (otherwise MeS is likely to break them too). This is an easy change if anyone wants to take it on and explore the codebase -- if Harry's was sticking with MeS I'd invest the time but at the moment this isn't important to us.

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.