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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +56 -1
- data/lib/janio_api/version.rb +1 -1
- data/lib/janio_api.rb +1 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f568782501508c7b5b13039c6ce89f5f6ae073ec2d1fe1d6fd66fc0e5b908d4a
|
4
|
+
data.tar.gz: 9f9ad1f843851690362e287e95a067acd74b3031074a030ece4a57417ec3d1f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abcb7552cada0dd924751a5b1b65347bb7ee7b5827a2e801559d730f692b4430b854e51f46686f6b3f3e69f5b745a31cc83dc1422cbd93967f9dd8bd752df8da
|
7
|
+
data.tar.gz: 94f1a93ee8eb1c060bcb76a63324ef316941705f352633a4b745f048ef62954becd3c5c6c260253a5872fc49d198942f4013e6978865ae9b7c1682eae3037c2f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,62 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
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
|
|
data/lib/janio_api/version.rb
CHANGED
data/lib/janio_api.rb
CHANGED