xpost 0.1.3.1 → 0.1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xpost/configuration.rb +1 -1
- data/lib/xpost/order.rb +2 -4
- data/lib/xpost/orders.rb +8 -8
- data/lib/xpost/version.rb +1 -1
- data/sample/sample_essential_order_details.json +0 -1
- data/spec/order/order_spec.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d53b5036d879ad363041c6f2cfb8d9971348274e
|
4
|
+
data.tar.gz: 8d5fabbb2d8acc355d508b7958cbd2bf1fa2d1d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e56b6f038b60194296aa9c6599927878a934357c6bd368cf6d53621566bf95378ea6d47058b3ce0208d10bb70cd9b5422d0aaee35e11321f890d7191767cf9
|
7
|
+
data.tar.gz: 5568190538ba950bb0a7f2f7da8b2a4a20c622134e23a9ff5228f8f1bd0d7b435728f4e54d88a9626f20aba4a841ffd001e7d5ff54501f4763bbc7f11c62056c
|
data/lib/xpost/configuration.rb
CHANGED
@@ -19,7 +19,7 @@ module Xpost
|
|
19
19
|
config.api_key = api_key
|
20
20
|
config.secret_key = secret_key
|
21
21
|
config.staging_url = "https://api.staging.lbcx.ph/v1"
|
22
|
-
config.production_url = "https://api.
|
22
|
+
config.production_url = "https://api.lbcx.ph/v1"
|
23
23
|
end
|
24
24
|
Xpost.configuration
|
25
25
|
end
|
data/lib/xpost/order.rb
CHANGED
@@ -8,11 +8,11 @@ module Xpost
|
|
8
8
|
|
9
9
|
CONFIRMABLE_PARAMETERS = Set[:status, :email, :buyer_name, :contact_number, :delivery_address, :items,
|
10
10
|
:shipment, :total, :currency, :payment_method, :payment_provider]
|
11
|
-
FOR_PICKUP_PARAMETERS = Set[:pickup_address
|
11
|
+
FOR_PICKUP_PARAMETERS = Set[:pickup_address]
|
12
12
|
|
13
13
|
attr_accessor :email, :buyer_name, :contact_number, :reference_id
|
14
14
|
attr_accessor :total, :currency, :payment_method, :payment_provider
|
15
|
-
attr_accessor :delivery_address, :pickup_address
|
15
|
+
attr_accessor :delivery_address, :pickup_address
|
16
16
|
attr_accessor :status, :items, :shipment
|
17
17
|
|
18
18
|
validates_presence_of :email, :buyer_name, :contact_number
|
@@ -32,7 +32,6 @@ module Xpost
|
|
32
32
|
@payment_method = options[:payment_method]
|
33
33
|
@payment_provider = options[:payment_provider]
|
34
34
|
@pickup_address = options[:pickup_address]
|
35
|
-
@pickup_at = options[:pickup_at]
|
36
35
|
end
|
37
36
|
|
38
37
|
def self.sample_order
|
@@ -126,7 +125,6 @@ module Xpost
|
|
126
125
|
items: self.order_items,
|
127
126
|
delivery_address: self.delivery_address.attributes,
|
128
127
|
pickup_address: self.pickup_address.nil? ? nil : self.pickup_address.attributes,
|
129
|
-
pickup_at: self.pickup_at
|
130
128
|
}
|
131
129
|
end
|
132
130
|
|
data/lib/xpost/orders.rb
CHANGED
@@ -70,14 +70,6 @@ module Xpost
|
|
70
70
|
res = res[:message] == "Not Found" ? "Not Found" : res
|
71
71
|
end
|
72
72
|
|
73
|
-
def self.cancel(auth_token, tracking_number)
|
74
|
-
cancel_order_url = "orders/#{tracking_number}/cancel"
|
75
|
-
raise "Order isn't pending" if Xpost::Orders.find(auth_token, tracking_number)[:status] != "pending"
|
76
|
-
|
77
|
-
res = put_url(cancel_order_url, headers: auth_header(auth_token))
|
78
|
-
res = res[:message] == "Not Found" ? "Not Found" : res
|
79
|
-
end
|
80
|
-
|
81
73
|
def self.for_pickup(auth_token, tracking_number, pickup_address)
|
82
74
|
raise "Order isn't confirmed" if Xpost::Orders.find(auth_token, tracking_number)[:status] != "confirmed"
|
83
75
|
for_pickup_url = "orders/#{tracking_number}/for-pickup"
|
@@ -90,6 +82,14 @@ module Xpost
|
|
90
82
|
res = res[:message] == "Not Found" ? "Not Found" : res
|
91
83
|
end
|
92
84
|
|
85
|
+
def self.cancel(auth_token, tracking_number)
|
86
|
+
cancel_order_url = "orders/#{tracking_number}/cancel"
|
87
|
+
raise "Order isn't pending" if Xpost::Orders.find(auth_token, tracking_number)[:status] != "pending"
|
88
|
+
|
89
|
+
res = put_url(cancel_order_url, headers: auth_header(auth_token))
|
90
|
+
res = res[:message] == "Not Found" ? "Not Found" : res
|
91
|
+
end
|
92
|
+
|
93
93
|
def self.get_shipping_labels(auth_token, tracking_number)
|
94
94
|
if tracking_number.kind_of?(Array)
|
95
95
|
shipping_labels_url = "orders/download/awb/zebra"
|
data/lib/xpost/version.rb
CHANGED
data/spec/order/order_spec.rb
CHANGED