WeidianOpen
Weidian Open Platform(微店开放平台) API in Ruby
Installation
Add this line to your application's Gemfile:
gem 'weidian_open'
And then execute:
$ bundle
Or install it yourself as:
$ gem install weidian_open
Usage
Information about this gem:
puts WeidianOpen::API
puts WeidianOpen::HOWTO_CONFIG
Configuration
WeidianOpen.config do
@app_key = '1111111' # your app_key
@app_secret = '1111111111111111' # your app_secret
end
or
WeidianOpen.app_key = '111111' # your app_key
WeidianOpen.app_secret = '1111111111' # your app_secret
###Access Token Access Token can be refreshed automatically by this Gem. You can show access token used currently after configuration:
WeidianOpen.access_token
Normally, you can use any Offical API method if HTTP Method of it is GET. All you need to do is subsituing "." inside API method name with "_".
Example:
- API method: vdian.order.list.get
WeidianOpen.vdian_order_list_get(page_num: "1",
order_type: "unpay",
add_start: "2015-03-18 14:15:12",
add_end: "2015-03-20 14:15:12")
WeidianOpen.vdian_order_list_get(order_type: "unpay", page_num: "1")
- API method: vdian.order.get
WeidianOpen.vdian_order_get(order_id: "1164787976")
Contributing
- Fork it ( https://github.com/yanyingwang/weidian_open/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request