zaui_zapi 0.2.8 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/lib/version.rb +1 -1
  3. data/lib/zapi_xml.rb +6 -2
  4. data/lib/zaui.rb +15 -9
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63e39dcd2c8dc9946d6a0a4dbb64b4ff63436ac2
4
- data.tar.gz: 70df99b590f4008f3daf1ae4816c58b331bbdf77
3
+ metadata.gz: 01027f409143000c226dab07a58e57a82242825d
4
+ data.tar.gz: 6d41e3205a2431159fa675d66f2927339d415a82
5
5
  SHA512:
6
- metadata.gz: 297b10692caa58b7374ae0948dfee95ad013ee0ecc3e3230a718bda921de1754b6efde1724d1fe97c23d2f4781b26ecc5c9510a780035261fe70d0448561fbb4
7
- data.tar.gz: 16112b36409a04fa428b3bb4427b19d1f70e3553a4880802d4ab0d4e5013d7a2f0c567183f1ec5c9fb6f651f386cb6c827bc3e70df2c4ae3734e7798ae60d22d
6
+ metadata.gz: 7c6f7ad19f38254954f64eaab6f20de7bd8628277032a128d3fb7853d784fd63545e0ae822cd3957b2f89b3ed5b6f8f04d950b88d922ae34a2846f09939645ec
7
+ data.tar.gz: db2de8c80f79386aca4a50b4ea968b2c1637c0cbef952c4552737d934fdee8e5dcc71b200658282b10b34697972517eec739eb376b9e4c2431af7b378e086188
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION = '0.2.8' #started at 0.2.7
1
+ VERSION = '0.3.1'
data/lib/zapi_xml.rb CHANGED
@@ -194,6 +194,7 @@ class ZapiXML
194
194
  "pricingOptions" => nil,
195
195
  "passengers" => {
196
196
  },
197
+ "checkOnlineThresholds" => nil,
197
198
  "activityTime" => hash[:activity_time],
198
199
  "pickupLocationId" => nil,
199
200
  "dropOffLocationId" => hash[:dropoff_location_id]
@@ -205,6 +206,9 @@ class ZapiXML
205
206
  for_xml['passengers']['infants'] = hash[:infants].to_i unless hash[:infants].to_i == 0
206
207
  for_xml['pickupLocationId'] = hash[:pickup_location_id].to_i unless hash[:pickup_location_id].blank?
207
208
 
209
+ #new undocumented flag so Zaui validates the activity time against the thresholds (defaulting to 1 for true)
210
+ for_xml['checkOnlineThresholds'] = hash[:check_online_thresholds].to_i || 1
211
+
208
212
  _wrap_xml_request(for_xml)
209
213
  end
210
214
 
@@ -271,12 +275,12 @@ class ZapiXML
271
275
  })
272
276
  end
273
277
 
274
- def process_cart_with_payment hash:
278
+ def process_cart_with_payment hash:, paymentMethodType:
275
279
  _wrap_xml_request({
276
280
  "methodName" => 'zapiProcessCartWithPayment',
277
281
  "cartId" => session.cart_id,
278
282
  "paymentMethod" => {
279
- "paymentMethodType" => 2000
283
+ "paymentMethodType" => paymentMethodType
280
284
  },
281
285
  "paymentGatewayId" => nil,
282
286
  "creditCardDetails" => {
data/lib/zaui.rb CHANGED
@@ -104,15 +104,21 @@ class Zaui
104
104
  raw = _zapi(xml.promotion_code_apply(promo_code: code))
105
105
  end
106
106
 
107
- def process_cart_with_payment hash: {}
108
- cart_data = {
109
- name_on_card: hash[:name_on_card],
110
- cc_num: hash[:cc_num].gsub(/[^\d]/, ''),
111
- expiration_month: hash[:expiration_month],
112
- expiration_year: hash[:expiration_year],
113
- csv: hash[:csv]
114
- }
115
- raw = _zapi(xml.process_cart_with_payment(hash: cart_data))
107
+ def process_cart_with_payment hash: {}, paymentMethodType: 2000
108
+ case paymentMethodType
109
+ when 2000
110
+ cart_data = {
111
+ name_on_card: hash[:name_on_card],
112
+ cc_num: hash[:cc_num].gsub(/[^\d]/, ''),
113
+ expiration_month: hash[:expiration_month],
114
+ expiration_year: hash[:expiration_year],
115
+ csv: hash[:csv]
116
+ }
117
+ when 2003
118
+ cart_data = {}
119
+ end
120
+
121
+ raw = _zapi(xml.process_cart_with_payment(hash: cart_data, paymentMethodType: paymentMethodType))
116
122
  end
117
123
 
118
124
  def process_single_transaction hash: {}
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.2.8
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Kretzmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2022-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.5.2.3
97
+ rubygems_version: 2.5.1
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Zaui.com zAPI interface gem