zaui_zapi 0.2.8 → 0.3.0

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 +2 -2
  4. data/lib/zaui.rb +15 -9
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63e39dcd2c8dc9946d6a0a4dbb64b4ff63436ac2
4
- data.tar.gz: 70df99b590f4008f3daf1ae4816c58b331bbdf77
3
+ metadata.gz: cba204364fcee1842b430552d3197106ebc62555
4
+ data.tar.gz: d6e34db8a91f7efa0f823470e334a2f2440527be
5
5
  SHA512:
6
- metadata.gz: 297b10692caa58b7374ae0948dfee95ad013ee0ecc3e3230a718bda921de1754b6efde1724d1fe97c23d2f4781b26ecc5c9510a780035261fe70d0448561fbb4
7
- data.tar.gz: 16112b36409a04fa428b3bb4427b19d1f70e3553a4880802d4ab0d4e5013d7a2f0c567183f1ec5c9fb6f651f386cb6c827bc3e70df2c4ae3734e7798ae60d22d
6
+ metadata.gz: 29409baf9fa3d7f68397cf66536f5a69cfe25ebe835e6a665392985a180af0eaa42b415d3f1ac701a113885e7babe6568416bc48cb7d73f6fe08b5fef35406d4
7
+ data.tar.gz: d22ffacad53ff19134513d2f60b14131f044b28bd3511df093b41923e78edf1541360880b7d9e03ee7d1d2cbf1ac176ae703edee660978b4fb01b22d014642b0
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION = '0.2.8' #started at 0.2.7
1
+ VERSION = '0.3.0'
data/lib/zapi_xml.rb CHANGED
@@ -271,12 +271,12 @@ class ZapiXML
271
271
  })
272
272
  end
273
273
 
274
- def process_cart_with_payment hash:
274
+ def process_cart_with_payment hash:, paymentMethodType:
275
275
  _wrap_xml_request({
276
276
  "methodName" => 'zapiProcessCartWithPayment',
277
277
  "cartId" => session.cart_id,
278
278
  "paymentMethod" => {
279
- "paymentMethodType" => 2000
279
+ "paymentMethodType" => paymentMethodType
280
280
  },
281
281
  "paymentGatewayId" => nil,
282
282
  "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.0
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: 2018-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest