nexio_activemerchant 0.2.4 → 0.2.8

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
  SHA256:
3
- metadata.gz: 75aed4f978138206f5c7fc033bb0e0a81faf69dac593a26a68661a265de059b5
4
- data.tar.gz: 97fc92fe19530378d0d86d9dc625310ac1de2db40dca87264a806c97facc0116
3
+ metadata.gz: b4be2109f95bb02681d52e4eba82df056b917147789135cddd63a9c824305e20
4
+ data.tar.gz: d12fb306b4071d6b6edace569875566da64a4aee4e639e8d8bca21ea80656f7f
5
5
  SHA512:
6
- metadata.gz: 8f2ab0d0573a9311d7f3753839f39fe9581aab93cf9e30711472edce47f8569365262dec46a09375607ea99f0d9fdbae287a42635bcf748885e836a8353830d3
7
- data.tar.gz: 870d45d255eeb17b8ab5d84f80f06e8f05950fb32671ced3a14aa35d816131d85209b531c45a1d3e7523a9f649433d589de81344a74bd289510b0576e392623b
6
+ metadata.gz: bc116a66f2c7365cbcd784fd81219b33566356bd558746048d47a5edad75f15467530eb80ed8052b7d601e629400a2740b5321a4c77570620918bc9b0cbf6e47
7
+ data.tar.gz: e96a8b271d7a9d95dc545e91cd03a09b7cf91f3e242840236ae5dd1bd54a8f3dc945de117b02fe5bf3f59fcf0bd4cad34dab683e8500d7ee54841c4ab3dd35db
@@ -172,15 +172,12 @@ module ActiveMerchant
172
172
  def add_address(post, data, prefix)
173
173
  return post if data.blank?
174
174
 
175
- post[:data][:customer].merge!({
176
- "#{prefix}AddressOne": data[:address1],
177
- "#{prefix}AddressTwo": data[:address2],
178
- "#{prefix}City": data[:city],
179
- "#{prefix}Country": data[:country],
180
- "#{prefix}Phone": data[:phone],
181
- "#{prefix}Postal": data[:zip],
182
- "#{prefix}State": data[:state]
183
- })
175
+ {
176
+ AddressOne: :address1, AddressTwo: :address2, City: :city,
177
+ Country: :country, Phone: :phone, Postal: :zip, State: :state
178
+ }.each do |suffix, key|
179
+ post[:data][:customer]["#{prefix}#{suffix}"] = data[key].to_s
180
+ end
184
181
  end
185
182
 
186
183
  def add_payment(post, payment, options)
@@ -189,7 +186,7 @@ module ActiveMerchant
189
186
  post[:card] = {
190
187
  cardHolderName: payment.name,
191
188
  cardType: payment.brand
192
- }
189
+ }.merge!(post.fetch(:card, {}))
193
190
  end
194
191
  post[:processingOptions] ||= {}
195
192
  post[:processingOptions][:merchantId] = self.options[:merchant_id].to_s
@@ -254,6 +251,7 @@ module ActiveMerchant
254
251
  network_transaction_id: payload['id']
255
252
  )
256
253
  rescue ResponseError => e
254
+ logger&.error e.response.body
257
255
  error_payload = parse(e.response.body)
258
256
  Response.new(
259
257
  false,
@@ -277,7 +275,7 @@ module ActiveMerchant
277
275
  end
278
276
 
279
277
  def post_data(_action, parameters = {})
280
- parameters.to_json
278
+ { merchantId: options[:merchant_id] }.merge(parameters).to_json
281
279
  end
282
280
 
283
281
  def commit_action_url(action, _parameters)
@@ -306,8 +304,8 @@ module ActiveMerchant
306
304
  CVVResult.new(data.fetch('gatewayMessage', {}).fetch('cvvresponse', nil))
307
305
  end
308
306
 
309
- def build_payload(options)
310
- { data: { customer: {} } }.merge!(options.fetch(:payload, {}))
307
+ def build_payload(params)
308
+ { data: { customer: {} } }.merge!(params.fetch(:payload, {}))
311
309
  end
312
310
 
313
311
  def base_headers(custom = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NexioActivemerchant
4
- VERSION = '0.2.4'
4
+ VERSION = '0.2.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexio_activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Whitespectre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-03 00:00:00.000000000 Z
11
+ date: 2021-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant