Ruby Wrapper for OCA e-Pak API

Gem Version Build Status

Getting Started

For command line usage:

$ gem install oca-epak

If you intend to use it within an application, add gem "oca-epak" to your Gemfile.


First, initialize an Oca client:

oca = Oca.new("[email protected]", "your-password")

To check whether your credentials are valid or not, run #check_credentials

=> true

NOTE: Keep in mind that you cannot register/create an operation code via Oca's API, you have to get in touch with someone from Oca and they take care of the registration.

After you have your operation code active for a given delivery type, you can begin calculating shipping rates and delivery estimates:

opts = { total_weight: "50", total_volume: "0.027", origin_zip_code: "1646",
         destination_zip_code: "2000", declared_value: "100",
         package_quantity: "1", cuit: "30-99999999-7", operation_code: "77790" }

=> [{:tarifador=>"15",
    :xml=>"<row Tarifador=\"15\" Precio=\"328.9000\"/>",

Contributing & Development

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write your feature (and tests)
  4. Run tests (bundle exec rake)
  5. Commit your changes (git commit -am 'Added some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

Release the Gem

$ bundle exec rake release