xpost 0.1.4 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. data/.DS_Store +0 -0
  3. data/.gitignore +1 -2
  4. data/.rspec +0 -0
  5. data/Gemfile +0 -0
  6. data/LICENSE +0 -0
  7. data/README.md +0 -0
  8. data/TODO.md +1 -28
  9. data/lib/xpost.rb +6 -8
  10. data/lib/xpost/authentication.rb +0 -5
  11. data/lib/xpost/configuration.rb +0 -15
  12. data/lib/xpost/models.rb +5 -0
  13. data/lib/xpost/models/address.rb +38 -0
  14. data/lib/xpost/models/item.rb +31 -0
  15. data/lib/xpost/models/order.rb +54 -0
  16. data/lib/xpost/orders.rb +16 -57
  17. data/lib/xpost/version.rb +1 -1
  18. data/spec/{order/address/address_spec.rb → address_spec.rb} +0 -0
  19. data/spec/factories/addresses.rb +28 -46
  20. data/spec/factories/items.rb +10 -10
  21. data/spec/factories/orders.rb +16 -39
  22. data/spec/helpers.rb +0 -0
  23. data/spec/{order/items/item_spec.rb → item_spec.rb} +5 -5
  24. data/spec/line_item_spec.rb +16 -0
  25. data/spec/orders/order_create_spec.rb +46 -0
  26. data/spec/orders/order_for_pickup_spec.rb +17 -0
  27. data/spec/orders/{find_spec.rb → orders_find_spec.rb} +2 -3
  28. data/spec/orders/{track_spec.rb → orders_track_spec.rb} +2 -2
  29. data/spec/spec_helper.rb +0 -1
  30. data/spec/xpost_spec.rb +0 -27
  31. data/xpost.gemspec +2 -6
  32. metadata +17 -68
  33. data/lib/.DS_Store +0 -0
  34. data/lib/xpost/.DS_Store +0 -0
  35. data/lib/xpost/address.rb +0 -77
  36. data/lib/xpost/item.rb +0 -44
  37. data/lib/xpost/order.rb +0 -135
  38. data/lib/xpost/statuses.rb +0 -29
  39. data/sample/sample_essential_order_details.json +0 -63
  40. data/sample/sample_xpost_order-confirmed.json +0 -317
  41. data/sample/sample_xpost_order-for-pickup.json +0 -379
  42. data/sample/sample_xpost_order-pending.json +0 -306
  43. data/sample/webhook_sample.json +0 -105
  44. data/spec/order/cancel_spec.rb +0 -37
  45. data/spec/order/confirm_spec.rb +0 -38
  46. data/spec/order/create_spec.rb +0 -97
  47. data/spec/order/for_pickup_spec.rb +0 -42
  48. data/spec/order/get_shipping_label_spec.rb +0 -60
  49. data/spec/order/order_spec.rb +0 -96
@@ -1,379 +0,0 @@
1
- {
2
- "id": 789566,
3
- "party_id": 6191,
4
- "service_id": 6191,
5
- "currency": "PHP",
6
- "reference_id": "2309174223312",
7
- "tracking_number": "0078-9566-ABLV",
8
- "payment_method": "cod",
9
- "payment_provider": "lbcx",
10
- "service": "next_day",
11
- "status": "for_pickup",
12
- "status_updated_at": "2018-08-13 11:56:12.948396+00",
13
- "buyer_name": "Thea Lizardo",
14
- "email": "thealizardo@gmail.com",
15
- "contact_number": "+639176788488",
16
- "subtotal": "1750.00",
17
- "tax": "0.00",
18
- "fee": "0.00",
19
- "insurance": "0.00",
20
- "discount": "0.00",
21
- "shipping": "0.00",
22
- "total": "1750.00",
23
- "transaction_fee": "61.25",
24
- "insurance_fee": "17.50",
25
- "shipping_fee": "240.00",
26
- "metadata": {
27
- "key_1": "value_1",
28
- "key_2": "value_2"
29
- },
30
- "preferred_pickup_time": "morning",
31
- "preferred_delivery_time": "3pm - 5pm",
32
- "created_at": "2018-08-13 11:52:15+00",
33
- "tat": {
34
- "confirmed": 1534161320,
35
- "for_pickup": 1534161372
36
- },
37
- "shipment": "box",
38
- "remarks": null,
39
- "buyer_id": "12345",
40
- "parcel": {
41
- "weight": {
42
- "uom": "kg",
43
- "value": "4"
44
- },
45
- "dimensions": {
46
- "uom": "cm",
47
- "width": 22,
48
- "height": 22,
49
- "length": 22
50
- }
51
- },
52
- "updated_at": "2018-08-13 11:56:12.948396+00",
53
- "client": "Xpanse",
54
- "organization": {
55
- "party_id": 6191,
56
- "name": "Xpanse",
57
- "external_id": null
58
- },
59
- "pickup_address": {
60
- "id": 1600969,
61
- "code": null,
62
- "name": "Thea Lizardo",
63
- "title": null,
64
- "email": null,
65
- "phone_number": "",
66
- "mobile_number": "+639171234567",
67
- "fax_number": null,
68
- "company": "xpanse",
69
- "line_1": "Payless Warehouse",
70
- "line_2": "",
71
- "district": null,
72
- "city": "Paranaque City",
73
- "state": "Metro Manila",
74
- "postal_code": "1634",
75
- "region": "Mmb",
76
- "country": {
77
- "code": "PH",
78
- "name": "Philippines"
79
- },
80
- "city_approximation": "Paranaque City",
81
- "branch_code": null
82
- },
83
- "delivery_address": {
84
- "id": 1600609,
85
- "code": null,
86
- "name": "Thea Lizardo",
87
- "title": null,
88
- "email": null,
89
- "phone_number": "",
90
- "mobile_number": "+639171234567",
91
- "fax_number": null,
92
- "company": "",
93
- "line_1": "Payless Warehouse",
94
- "line_2": "",
95
- "district": null,
96
- "city": "Paranaque City",
97
- "state": "Metro Manila",
98
- "postal_code": "1634",
99
- "region": "Mmb",
100
- "country": {
101
- "code": "PH",
102
- "name": "Philippines"
103
- },
104
- "city_approximation": "Paranaque City"
105
- },
106
- "return_address": {
107
- "id": null,
108
- "code": null,
109
- "name": null,
110
- "title": null,
111
- "email": null,
112
- "phone_number": null,
113
- "mobile_number": null,
114
- "fax_number": null,
115
- "company": null,
116
- "line_1": null,
117
- "line_2": null,
118
- "district": null,
119
- "city": null,
120
- "state": null,
121
- "postal_code": null,
122
- "region": null,
123
- "country": {
124
- "code": null,
125
- "name": null
126
- }
127
- },
128
- "dropoff_address": {
129
- "id": null,
130
- "code": null,
131
- "name": null,
132
- "title": null,
133
- "email": null,
134
- "phone_number": null,
135
- "mobile_number": null,
136
- "fax_number": null,
137
- "company": null,
138
- "line_1": null,
139
- "line_2": null,
140
- "district": null,
141
- "city": null,
142
- "state": null,
143
- "postal_code": null,
144
- "region": null,
145
- "country": {
146
- "code": null,
147
- "name": null
148
- }
149
- },
150
- "charge": {
151
- "order_id": 789566,
152
- "status": "pending",
153
- "reference_id": "71001373530487",
154
- "total_amount": "1750.00",
155
- "tendered_amount": "0.00",
156
- "change_amount": "0.00",
157
- "remarks": null,
158
- "created_at": "2018-08-13 11:52:15+00",
159
- "updated_at": "2018-08-13 11:52:16+00"
160
- },
161
- "claim": {
162
- "status": null,
163
- "amount": null,
164
- "shipping_fee_flag": null,
165
- "insurance_fee_flag": null,
166
- "transaction_fee_flag": null,
167
- "assets": null,
168
- "reason": null,
169
- "remarks": null,
170
- "created_at": null,
171
- "updated_at": null,
172
- "tat": null,
173
- "reference_id": null
174
- },
175
- "buyer_name_parsed": {
176
- "first_name": "Thea Lizardo",
177
- "middle_name": null,
178
- "last_name": null
179
- },
180
- "items": [
181
- {
182
- "type": "product",
183
- "description": "Women's Abby Pointed Sling",
184
- "amount": "1750.00",
185
- "quantity": 1,
186
- "total": "1750.00",
187
- "metadata": {
188
- "sku": "FSRI-174290070",
189
- "size": "7",
190
- "color": "Floral",
191
- "width": "Regular"
192
- },
193
- "insured_value": null
194
- }
195
- ],
196
- "segments": [
197
- {
198
- "courier": "South Hub",
199
- "type": "pick_up",
200
- "barcode_format": "qr",
201
- "tat": {
202
- "end_date": null,
203
- "start_date": null
204
- },
205
- "shipping_type": "land",
206
- "currency": null,
207
- "amount": null,
208
- "reference_id": "0078-9566-ABLV",
209
- "active": false,
210
- "pickup_address": {
211
- "name": "Thea Lizardo",
212
- "title": null,
213
- "email": null,
214
- "phone_number": "",
215
- "mobile_number": "+639171234567",
216
- "fax_number": null,
217
- "company": "xpanse",
218
- "line_1": "Payless Warehouse",
219
- "line_2": "",
220
- "district": null,
221
- "city": "Paranaque City",
222
- "state": "Metro Manila",
223
- "postal_code": "1634",
224
- "region": "Mmb",
225
- "country": {
226
- "code": "PH",
227
- "name": "Philippines"
228
- }
229
- },
230
- "delivery_address": {
231
- "name": "South Hub",
232
- "title": null,
233
- "email": null,
234
- "phone_number": null,
235
- "mobile_number": null,
236
- "fax_number": null,
237
- "company": null,
238
- "line_1": "",
239
- "line_2": null,
240
- "district": "",
241
- "city": "Manila City",
242
- "state": "Metro Manila",
243
- "postal_code": "",
244
- "region": "MMB",
245
- "country": {
246
- "code": "PH",
247
- "name": "Philippines"
248
- }
249
- }
250
- },
251
- {
252
- "courier": "South Hub",
253
- "type": "delivery",
254
- "barcode_format": "qr",
255
- "tat": {
256
- "end_date": null,
257
- "start_date": null
258
- },
259
- "shipping_type": "land",
260
- "currency": null,
261
- "amount": null,
262
- "reference_id": "71001373530487",
263
- "active": false,
264
- "pickup_address": {
265
- "name": "South Hub",
266
- "title": null,
267
- "email": null,
268
- "phone_number": null,
269
- "mobile_number": null,
270
- "fax_number": null,
271
- "company": null,
272
- "line_1": "",
273
- "line_2": null,
274
- "district": "",
275
- "city": "Manila City",
276
- "state": "Metro Manila",
277
- "postal_code": "",
278
- "region": "MMB",
279
- "country": {
280
- "code": "PH",
281
- "name": "Philippines"
282
- }
283
- },
284
- "delivery_address": {
285
- "name": "Thea Lizardo",
286
- "title": null,
287
- "email": null,
288
- "phone_number": "",
289
- "mobile_number": "+639171234567",
290
- "fax_number": null,
291
- "company": "",
292
- "line_1": "Payless Warehouse",
293
- "line_2": "",
294
- "district": null,
295
- "city": "Paranaque City",
296
- "state": "Metro Manila",
297
- "postal_code": "1634",
298
- "region": "Mmb",
299
- "country": {
300
- "code": "PH",
301
- "name": "Philippines"
302
- }
303
- }
304
- },
305
- {
306
- "courier": "South Hub",
307
- "type": "pick_up",
308
- "barcode_format": "qr",
309
- "tat": {
310
- "end_date": null,
311
- "start_date": null
312
- },
313
- "shipping_type": "land",
314
- "currency": null,
315
- "amount": null,
316
- "reference_id": "0078-9566-ABLV",
317
- "active": true,
318
- "pickup_address": {
319
- "name": "Thea Lizardo",
320
- "title": null,
321
- "email": null,
322
- "phone_number": "",
323
- "mobile_number": "+639171234567",
324
- "fax_number": null,
325
- "company": "xpanse",
326
- "line_1": "Payless Warehouse",
327
- "line_2": "",
328
- "district": null,
329
- "city": "Paranaque City",
330
- "state": "Metro Manila",
331
- "postal_code": "1634",
332
- "region": "Mmb",
333
- "country": {
334
- "code": "PH",
335
- "name": "Philippines"
336
- }
337
- },
338
- "delivery_address": {
339
- "name": "South Hub",
340
- "title": null,
341
- "email": null,
342
- "phone_number": null,
343
- "mobile_number": null,
344
- "fax_number": null,
345
- "company": null,
346
- "line_1": "",
347
- "line_2": null,
348
- "district": "",
349
- "city": "Manila City",
350
- "state": "Metro Manila",
351
- "postal_code": "",
352
- "region": "MMB",
353
- "country": {
354
- "code": "PH",
355
- "name": "Philippines"
356
- }
357
- }
358
- }
359
- ],
360
- "events": [
361
- {
362
- "id": 2197070,
363
- "status": "confirmed",
364
- "created_at": "2018-08-13 11:55:20.723494+00",
365
- "remarks": null,
366
- "status_updated_at": "2018-08-13 11:55:20.723494+00",
367
- "status_name": "Confirmed"
368
- },
369
- {
370
- "id": 2197071,
371
- "status": "for_pickup",
372
- "created_at": "2018-08-13 11:56:12.948396+00",
373
- "remarks": null,
374
- "status_updated_at": "2018-08-13 11:56:12.948396+00",
375
- "status_name": "Ready for pickup"
376
- }
377
- ],
378
- "children": []
379
- }
@@ -1,306 +0,0 @@
1
- {
2
- "id": 789566,
3
- "party_id": 6191,
4
- "service_id": 6191,
5
- "currency": "PHP",
6
- "reference_id": "2309174223312",
7
- "tracking_number": "0078-9566-ABLV",
8
- "payment_method": "cod",
9
- "payment_provider": "lbcx",
10
- "service": "next_day",
11
- "status": "for_pickup",
12
- "status_updated_at": "2018-08-13 11:52:15.948365+00",
13
- "buyer_name": "Thea Lizardo",
14
- "email": "thealizardo@gmail.com",
15
- "contact_number": "+639176788488",
16
- "subtotal": "1750.00",
17
- "tax": "0.00",
18
- "fee": "0.00",
19
- "insurance": "0.00",
20
- "discount": "0.00",
21
- "shipping": "0.00",
22
- "total": "1750.00",
23
- "transaction_fee": "61.25",
24
- "insurance_fee": "17.50",
25
- "shipping_fee": "240.00",
26
- "metadata": {
27
- "key_1": "value_1",
28
- "key_2": "value_2"
29
- },
30
- "preferred_pickup_time": "morning",
31
- "preferred_delivery_time": "3pm - 5pm",
32
- "created_at": "2018-08-13 11:52:15+00",
33
- "tat": {
34
- "for_pickup": 1534161135
35
- },
36
- "shipment": "box",
37
- "remarks": null,
38
- "buyer_id": "12345",
39
- "parcel": {
40
- "weight": {
41
- "uom": "kg",
42
- "value": "4"
43
- },
44
- "dimensions": {
45
- "uom": "cm",
46
- "width": 22,
47
- "height": 22,
48
- "length": 22
49
- }
50
- },
51
- "updated_at": "2018-08-13 11:52:16+00",
52
- "client": "Xpanse",
53
- "organization": {
54
- "party_id": 6191,
55
- "name": "Xpanse",
56
- "external_id": null
57
- },
58
- "pickup_address": {
59
- "id": 1600969,
60
- "code": null,
61
- "name": "Thea Lizardo",
62
- "title": null,
63
- "email": null,
64
- "phone_number": "",
65
- "mobile_number": "+639171234567",
66
- "fax_number": null,
67
- "company": "xpanse",
68
- "line_1": "Payless Warehouse",
69
- "line_2": "",
70
- "district": null,
71
- "city": "Paranaque City",
72
- "state": "Metro Manila",
73
- "postal_code": "1634",
74
- "region": "Mmb",
75
- "country": {
76
- "code": "PH",
77
- "name": "Philippines"
78
- },
79
- "city_approximation": "Paranaque City",
80
- "branch_code": null
81
- },
82
- "delivery_address": {
83
- "id": 1600609,
84
- "code": null,
85
- "name": "Thea Lizardo",
86
- "title": null,
87
- "email": null,
88
- "phone_number": "",
89
- "mobile_number": "+639171234567",
90
- "fax_number": null,
91
- "company": "",
92
- "line_1": "Payless Warehouse",
93
- "line_2": "",
94
- "district": null,
95
- "city": "Paranaque City",
96
- "state": "Metro Manila",
97
- "postal_code": "1634",
98
- "region": "Mmb",
99
- "country": {
100
- "code": "PH",
101
- "name": "Philippines"
102
- },
103
- "city_approximation": "Paranaque City"
104
- },
105
- "return_address": {
106
- "id": null,
107
- "code": null,
108
- "name": null,
109
- "title": null,
110
- "email": null,
111
- "phone_number": null,
112
- "mobile_number": null,
113
- "fax_number": null,
114
- "company": null,
115
- "line_1": null,
116
- "line_2": null,
117
- "district": null,
118
- "city": null,
119
- "state": null,
120
- "postal_code": null,
121
- "region": null,
122
- "country": {
123
- "code": null,
124
- "name": null
125
- }
126
- },
127
- "dropoff_address": {
128
- "id": null,
129
- "code": null,
130
- "name": null,
131
- "title": null,
132
- "email": null,
133
- "phone_number": null,
134
- "mobile_number": null,
135
- "fax_number": null,
136
- "company": null,
137
- "line_1": null,
138
- "line_2": null,
139
- "district": null,
140
- "city": null,
141
- "state": null,
142
- "postal_code": null,
143
- "region": null,
144
- "country": {
145
- "code": null,
146
- "name": null
147
- }
148
- },
149
- "charge": {
150
- "order_id": 789566,
151
- "status": "pending",
152
- "reference_id": "71001373530487",
153
- "total_amount": "1750.00",
154
- "tendered_amount": "0.00",
155
- "change_amount": "0.00",
156
- "remarks": null,
157
- "created_at": "2018-08-13 11:52:15+00",
158
- "updated_at": "2018-08-13 11:52:16+00"
159
- },
160
- "claim": {
161
- "status": null,
162
- "amount": null,
163
- "shipping_fee_flag": null,
164
- "insurance_fee_flag": null,
165
- "transaction_fee_flag": null,
166
- "assets": null,
167
- "reason": null,
168
- "remarks": null,
169
- "created_at": null,
170
- "updated_at": null,
171
- "tat": null,
172
- "reference_id": null
173
- },
174
- "buyer_name_parsed": {
175
- "first_name": "Thea Lizardo",
176
- "middle_name": null,
177
- "last_name": null
178
- },
179
- "items": [
180
- {
181
- "type": "product",
182
- "description": "Women's Abby Pointed Sling",
183
- "amount": "1750.00",
184
- "quantity": 1,
185
- "total": "1750.00",
186
- "metadata": {
187
- "sku": "FSRI-174290070",
188
- "size": "7",
189
- "color": "Floral",
190
- "width": "Regular"
191
- },
192
- "insured_value": null
193
- }
194
- ],
195
- "segments": [
196
- {
197
- "courier": "South Hub",
198
- "type": "pick_up",
199
- "barcode_format": "qr",
200
- "tat": {
201
- "end_date": null,
202
- "start_date": null
203
- },
204
- "shipping_type": "land",
205
- "currency": null,
206
- "amount": null,
207
- "reference_id": "0078-9566-ABLV",
208
- "active": true,
209
- "pickup_address": {
210
- "name": "Thea Lizardo",
211
- "title": null,
212
- "email": null,
213
- "phone_number": "",
214
- "mobile_number": "+639171234567",
215
- "fax_number": null,
216
- "company": "xpanse",
217
- "line_1": "Payless Warehouse",
218
- "line_2": "",
219
- "district": null,
220
- "city": "Paranaque City",
221
- "state": "Metro Manila",
222
- "postal_code": "1634",
223
- "region": "Mmb",
224
- "country": {
225
- "code": "PH",
226
- "name": "Philippines"
227
- }
228
- },
229
- "delivery_address": {
230
- "name": "South Hub",
231
- "title": null,
232
- "email": null,
233
- "phone_number": null,
234
- "mobile_number": null,
235
- "fax_number": null,
236
- "company": null,
237
- "line_1": "",
238
- "line_2": null,
239
- "district": "",
240
- "city": "Manila City",
241
- "state": "Metro Manila",
242
- "postal_code": "",
243
- "region": "MMB",
244
- "country": {
245
- "code": "PH",
246
- "name": "Philippines"
247
- }
248
- }
249
- },
250
- {
251
- "courier": "South Hub",
252
- "type": "delivery",
253
- "barcode_format": "qr",
254
- "tat": {
255
- "end_date": null,
256
- "start_date": null
257
- },
258
- "shipping_type": "land",
259
- "currency": null,
260
- "amount": null,
261
- "reference_id": "71001373530487",
262
- "active": false,
263
- "pickup_address": {
264
- "name": "South Hub",
265
- "title": null,
266
- "email": null,
267
- "phone_number": null,
268
- "mobile_number": null,
269
- "fax_number": null,
270
- "company": null,
271
- "line_1": "",
272
- "line_2": null,
273
- "district": "",
274
- "city": "Manila City",
275
- "state": "Metro Manila",
276
- "postal_code": "",
277
- "region": "MMB",
278
- "country": {
279
- "code": "PH",
280
- "name": "Philippines"
281
- }
282
- },
283
- "delivery_address": {
284
- "name": "Thea Lizardo",
285
- "title": null,
286
- "email": null,
287
- "phone_number": "",
288
- "mobile_number": "+639171234567",
289
- "fax_number": null,
290
- "company": "",
291
- "line_1": "Payless Warehouse",
292
- "line_2": "",
293
- "district": null,
294
- "city": "Paranaque City",
295
- "state": "Metro Manila",
296
- "postal_code": "1634",
297
- "region": "Mmb",
298
- "country": {
299
- "code": "PH",
300
- "name": "Philippines"
301
- }
302
- }
303
- }
304
- ],
305
- "children": []
306
- }