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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c93413f70d691f77195abe33a325531e782431cb
4
- data.tar.gz: 8856f5040219998599f4943efadf4af56622de96
3
+ metadata.gz: d53b5036d879ad363041c6f2cfb8d9971348274e
4
+ data.tar.gz: 8d5fabbb2d8acc355d508b7958cbd2bf1fa2d1d0
5
5
  SHA512:
6
- metadata.gz: f80c3ef9ef8d41905db4389b765bcbd75de8a778d635ae936a93c610b5327dd45f3ed4c0048203b47184dfbb9d7ec4fef5285ed9cfc78fe5a4696c4aac18e152
7
- data.tar.gz: 2c9b665f5b07aa17869125faa1262f13fabfa9a1a329227c1de08add188882a4610e71778876249a623b58b18d4723af74de3beb207569d7f67fa0319b73f7fe
6
+ metadata.gz: e9e56b6f038b60194296aa9c6599927878a934357c6bd368cf6d53621566bf95378ea6d47058b3ce0208d10bb70cd9b5422d0aaee35e11321f890d7191767cf9
7
+ data.tar.gz: 5568190538ba950bb0a7f2f7da8b2a4a20c622134e23a9ff5228f8f1bd0d7b435728f4e54d88a9626f20aba4a841ffd001e7d5ff54501f4763bbc7f11c62056c
@@ -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.staging.lbcx.ph/v1"
22
+ config.production_url = "https://api.lbcx.ph/v1"
23
23
  end
24
24
  Xpost.configuration
25
25
  end
@@ -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, :pickup_at]
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, :pickup_at
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
 
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module Xpost
2
- VERSION = "0.1.3.1"
2
+ VERSION = "0.1.3.2"
3
3
  end
@@ -21,7 +21,6 @@
21
21
  }
22
22
  },
23
23
  "metadata": {"key_1":"value_1","key_2":"value_2"},
24
- "pickup_at": "2017-07-06",
25
24
  "pickup_address": {
26
25
  "name": "Thea Lizardo",
27
26
  "company": "xpanse",
@@ -87,8 +87,7 @@ RSpec.describe "Xpost::Order" do
87
87
  # district: "Manhattan",
88
88
  # remarks: "Send ASAP"
89
89
  # },
90
- # pickup_address: nil,
91
- # pickup_at: nil
90
+ # pickup_address: nil
92
91
  # }.to_json
93
92
 
94
93
  # expect(@order.to_json).to eq order_json
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xpost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.1
4
+ version: 0.1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Marquez