zaui_zapi 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/lib/version.rb +1 -1
  3. data/lib/zapi_xml.rb +14 -16
  4. data/lib/zaui.rb +0 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3007dd51974f56669dd8433a722b35ad3a4b1555
4
- data.tar.gz: 39b06d54701f3c19cb1f179612842f1eca6a5f7f
3
+ metadata.gz: ceb13ccb4a5113a33016f6cfd417607a3d34d4fb
4
+ data.tar.gz: 91c94c720b602a23d3b5355b57ce70fd0cb35c96
5
5
  SHA512:
6
- metadata.gz: d9e2bd3d5a40f9d4c68c16460cb45583cd24324214bbda69d39e2700e7d6f22bfd0fdc371b7f4e802dfe79859a97583243b386bf405702009e0f621675527cf0
7
- data.tar.gz: 0618d06ccc2a2a94b25ddc6ba3cdb9f75fda79d60bd80f54a8e77ff6c798b9c40d92f6a8a4cb3a60efb11f1f819f057f430e3cc018f71f4fbb83ee0a613e6715
6
+ metadata.gz: 48bc7321a4e497895e8351251a3b0300d6600e32535b0c2f9f3661c96f7ee231a2306b8d2db10dfea512fbb4f1a5261ec5a0e96670d4cbc325457348c96c6eb3
7
+ data.tar.gz: fd505a11fcfd57e2aff4812350e51c9cc240eaae70fd8935c506ca2d88f4a9c750e81c5ff86898fb23af7f04e2474c3c381bfe19ef4189d162d8c78a9c1a6cfd
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION = '0.1.7'
1
+ VERSION = '0.1.9'
data/lib/zapi_xml.rb CHANGED
@@ -169,31 +169,29 @@ class ZapiXML
169
169
  end
170
170
 
171
171
  def add_activity_to_cart hash: {}
172
- _wrap_xml_request({
172
+ for_xml = {
173
173
  "methodName" => 'zapiAddActivityToCart',
174
174
  "cartId" => session.cart_id,
175
175
  "activityId" => hash[:activity_id],
176
176
  "activityDate" => hash[:activity_date],
177
177
  "activityEndDate" => hash[:activity_end_date],
178
- "rentalStartTime" => hash[:rental_start_time],
179
- "rentalEndTime" => hash[:rental_end_time],
180
- "pricingOptions" => {
181
- "option" => {
182
- "optionId" => hash[:pricing_option_id],
183
- "quantity" => hash[:pricing_option_quantity]
184
- }
185
- },
178
+ "rentalStartTime" => nil,
179
+ "rentalEndTime" => nil,
180
+ "pricingOptions" => nil,
186
181
  "passengers" => {
187
- "seniors" => hash[:seniors].to_i,
188
- "adults" => hash[:adults].to_i,
189
- "students" => hash[:students].to_i,
190
- "children" => hash[:children].to_i,
191
- "infants" => hash[:infants].to_i
192
182
  },
193
183
  "activityTime" => hash[:activity_time],
194
- "pickupLocationId" => hash[:pickup_location_id],
184
+ "pickupLocationId" => nil,
195
185
  "dropOffLocationId" => hash[:dropoff_location_id]
196
- })
186
+ }
187
+
188
+
189
+ for_xml['passengers']['adults'] = hash[:adults].to_i unless hash[:adults].to_i == 0
190
+ for_xml['passengers']['children'] = hash[:children].to_i unless hash[:children].to_i == 0
191
+ for_xml['passengers']['infants'] = hash[:infants].to_i unless hash[:infants].to_i == 0
192
+ for_xml['pickupLocationId'] = hash[:pickup_location_id].to_i unless hash[:pickup_location_id].blank?
193
+
194
+ _wrap_xml_request(for_xml)
197
195
  end
198
196
 
199
197
  def remove_activity_cart_item activity_id:, date: nil
data/lib/zaui.rb CHANGED
@@ -29,7 +29,6 @@ class Zaui
29
29
  infants: passengers[:infants],
30
30
  pickup_location_id: pickup_location_id
31
31
  }
32
-
33
32
  raw = _zapi(xml.add_activity_to_cart(hash: hash))
34
33
  end
35
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaui_zapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Kretzmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest