Project

ghtk

0.0
Low commit activity in last 3 years
No release in over a year
Ruby gem for call GHTK API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 4.1.1
~> 10.0
~> 3.0
 Project Readme

GHTK API Caller

GHTK Documentation: https://docs.giaohangtietkiem.vn

Installation

Add this line to your application's Gemfile:

gem 'ghtk'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ghtk

Setup for Rails

Add config/initializers/ghtk.rb file

  Ghtk.setup do |config|
    config.domain = '' # Add domain for sandbox or production
    config.access_token = '' # Add your token of sandbox or production
    config.version = 1.5
  end

Usage

How to create Order

  serializer = ShippingServices::GhtkSerializer.new(Shipment.last)
  Ghtk::Order.create(serializer)

How to get Order detail for check status,.....

  Ghtk::Order.get_detail(tracking_code)

How to cancel Order

  Ghtk::Order.cancel(tracking_code)

How to check shipping fee

  serializer = ShippingServices::GhtkFeeSerializer.new(Shipment.last)
  Ghtk::ShippingFee.check(serializer)