janio_api 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64be649aa911d63a575983fb264d6eccb1110181730087bf4c597c356d380f3d
4
- data.tar.gz: d6e5ac35aa954e8e9f2f01dcad588aa0e03ee97e984347377771cba7b0bb89c0
3
+ metadata.gz: f568782501508c7b5b13039c6ce89f5f6ae073ec2d1fe1d6fd66fc0e5b908d4a
4
+ data.tar.gz: 9f9ad1f843851690362e287e95a067acd74b3031074a030ece4a57417ec3d1f5
5
5
  SHA512:
6
- metadata.gz: d1f027f9b7a248d1126cf8a1bb3e0ad8cab9db0b1b51b28eca0bc0c802bc500b0aef1a6e6a64f9de94a8e0efcb2cd4082f4e7d589a42d169fd72ecb7a5de1c74
7
- data.tar.gz: 68796a18371a5d99ec452b2d8422dd24bda865d523aac4a0417cde2344341120f8173bfcc33aeb1b19c96f0a7889ce480c220f366cd66803f8d72efa4909c720
6
+ metadata.gz: abcb7552cada0dd924751a5b1b65347bb7ee7b5827a2e801559d730f692b4430b854e51f46686f6b3f3e69f5b745a31cc83dc1422cbd93967f9dd8bd752df8da
7
+ data.tar.gz: 94f1a93ee8eb1c060bcb76a63324ef316941705f352633a4b745f048ef62954becd3c5c6c260253a5872fc49d198942f4013e6978865ae9b7c1682eae3037c2f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- janio_api (0.1.0)
4
+ janio_api (0.1.1)
5
5
  activeresource
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -22,7 +22,62 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ 1. Create a file under the `initializers` folder.
26
+ 2. Set the `api_host` and `api_token` as following sample:
27
+ ```ruby
28
+ JanioAPI.configure do |config|
29
+ config.api_host = ENV["API_HOST"]
30
+ config.api_token = ENV["API_TOKEN"]
31
+ end
32
+ ```
33
+ 3. Then you can start creating Janio orders! Here's an example:
34
+
35
+ ```ruby
36
+ attributes={
37
+ service_id: 1,
38
+ tracking_no: "TRACKINGNUMBERHTH333ASDA1",
39
+ shipper_order_id: nil,
40
+ order_length: 12,
41
+ order_width: 12,
42
+ order_height: 12,
43
+ order_weight: 12,
44
+ payment_type: "cod",
45
+ cod_amount_to_collect: 40.5,
46
+ consignee_name: "Susan",
47
+ consignee_number: "+6291234567891",
48
+ consignee_country: "Indonesia",
49
+ consignee_address: "Pos 5 security komp perumahan PT INALUM tanjung gading., Jln berangin.",
50
+ consignee_postal: "12420",
51
+ consignee_state: "Daerah Khusus Ibukota Jakarta",
52
+ consignee_city: "Jakarta Selatan",
53
+ consignee_province: "Cilandak",
54
+ consignee_email: "susan123@email.com",
55
+ pickup_contact_name: "Jackson",
56
+ pickup_contact_number: "+6591234567",
57
+ pickup_country: "Singapore",
58
+ pickup_address: "Jurong West Ave 1",
59
+ pickup_postal: "640534",
60
+ pickup_state: "Singapore State",
61
+ pickup_city: nil,
62
+ pickup_province: nil,
63
+ pickup_date: nil,
64
+ pickup_notes: nil,
65
+ items: [
66
+ {
67
+ item_desc: "Blue Male T-Shirt",
68
+ item_quantity: 2,
69
+ item_product_id: "PROD123",
70
+ item_sku: "ITEMSKU123",
71
+ item_category: "Fashion Apparel",
72
+ item_price_value: 23.5,
73
+ item_price_currency: "IDR"
74
+ }
75
+ ]
76
+ }
77
+
78
+ order = JanioAPI::Order.new(attributes)
79
+ order.save
80
+ ```
26
81
 
27
82
  ## Development
28
83
 
@@ -1,3 +1,3 @@
1
1
  module JanioAPI
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/janio_api.rb CHANGED
@@ -14,9 +14,4 @@ module JanioAPI
14
14
 
15
15
  class Error < StandardError; end
16
16
  # Your code goes here...
17
- end
18
-
19
- JanioAPI.configure do |config|
20
- config.api_host = ENV["API_HOST"]
21
- config.api_token = ENV["API_TOKEN"]
22
- end
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: janio_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Chong