swiss-crm-activemerchant 1.0.12 → 1.0.14

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afeb9da41404fe5632da620512f825f3d60455ed96db974e73cedcf65d5275a6
4
- data.tar.gz: 4d2b41b33e593bc2a579acc276e3450afaed25743a989762093379b0802374b3
3
+ metadata.gz: 44cb245a478bd4babafafac6b137b4881ff2773739bf0940e61cb085380adac3
4
+ data.tar.gz: ad81db1097bdca4d69d31efb3f8391d2b762d83e427b6e758139c1e06b2c80ad
5
5
  SHA512:
6
- metadata.gz: fad1f595b8d179bf973c630b79f9a557fec586f97172a810e9dd14a82302607cbe4447b68b482ba274a5044e4ea369878e94e7d777801da6c632195ded2735db
7
- data.tar.gz: deb8b415065bff4199631f8ffce3ecc81694303c94fad5d7339610b6c7c27e1b2766543c7b03e366ea5ed5c229e328e49a106cc1582395549e92494f86ff9fc5
6
+ metadata.gz: d906a4d5c2a697c847e7c913893e419c4c5144533a8929ae0b2eb76161900514be51a43be218ff433778d5016b26ef08e134a7e96bd89d9ab968fbe9cd31f7eb
7
+ data.tar.gz: ff13818e773f890fb742b6198cbbae3e29ddf14642ec3a4b72b4f54b0c810cef9276cb6efb6c04a080d4b40655e9235f768e0b44a05585f76f3ecbb077a271ee
data/README.md CHANGED
@@ -15,7 +15,7 @@ gem install swiss-activemerchant
15
15
  Or, if you're using Bundler, just add the following to your Gemfile:
16
16
 
17
17
  ```ruby
18
- gem 'swiss-activemerchant'
18
+ gem 'swiss-crm-activemerchant'
19
19
  ```
20
20
 
21
21
  ## Usage
@@ -234,13 +234,13 @@ gem build activemerchant.gemspec
234
234
  3. Push to RubyGems: Push the updated gem to RubyGems:
235
235
 
236
236
  ```console
237
- gem push swiss-activemerchant-x.x.x.gem
237
+ gem push swiss-crm-activemerchant-x.x.x.gem
238
238
  ```
239
239
 
240
240
  4. Yank Previous Version: If necessary, yank the previous version to prevent installations:
241
241
 
242
242
  ```console
243
- gem yank swiss-activemerchant -v x.x.x
243
+ gem yank swiss-crm-activemerchant -v x.x.x
244
244
  ```
245
245
 
246
246
  ## API stability policy
@@ -46,6 +46,7 @@ module ActiveMerchant #:nodoc:
46
46
  add_merchant_defined_fields(post, options)
47
47
  add_level3_fields(post, options)
48
48
  add_three_d_secure(post, options)
49
+ add_recurring_details(post, options)
49
50
 
50
51
  commit('sale', post)
51
52
  end
@@ -60,6 +61,7 @@ module ActiveMerchant #:nodoc:
60
61
  add_merchant_defined_fields(post, options)
61
62
  add_level3_fields(post, options)
62
63
  add_three_d_secure(post, options)
64
+ add_recurring_details(post, options)
63
65
  commit('auth', post)
64
66
  end
65
67
 
@@ -157,7 +159,6 @@ module ActiveMerchant #:nodoc:
157
159
  post[:orderid] = options[:order_id]
158
160
  post[:orderdescription] = options[:description]
159
161
  post[:currency] = options[:currency] || currency(money)
160
- post[:billing_method] = 'recurring' if options[:recurring]
161
162
  if (dup_seconds = (options[:dup_seconds] || self.class.duplicate_window))
162
163
  post[:dup_seconds] = dup_seconds
163
164
  end
@@ -283,6 +284,14 @@ module ActiveMerchant #:nodoc:
283
284
  post[:directory_server_id] = three_d_secure[:ds_transaction_id]
284
285
  end
285
286
 
287
+ def add_recurring_details(post, options)
288
+ return unless options[:recurring_reference_initial_transaction]
289
+
290
+ post[:billing_method] = 'recurring'
291
+ txn_id, = split_authorization(options[:nmi_initial_txn_id])
292
+ post[:initial_transaction_id] = txn_id
293
+ end
294
+
286
295
  def cardholder_auth(trans_status)
287
296
  return nil if trans_status.nil?
288
297
 
@@ -313,7 +313,8 @@ module ActiveMerchant #:nodoc:
313
313
  response_http_code: @response_http_code,
314
314
  request_endpoint: request_url(relative_url),
315
315
  request_method: :post,
316
- request_body:
316
+ request_body:,
317
+ auth_code: fetch_auth_code(parsed)
317
318
  }
318
319
 
319
320
  Response.new(parsed[:succeeded] == 'true', parsed[:message] || parsed[:error], parsed, options)
@@ -349,6 +350,10 @@ module ActiveMerchant #:nodoc:
349
350
  2
350
351
  end
351
352
  end
353
+
354
+ def fetch_auth_code(parsed)
355
+ parsed.dig(:gateway_specific_response_fields, 'nmi', 'authcode')
356
+ end
352
357
  end
353
358
  end
354
359
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.0.12'
2
+ VERSION = '1.0.14'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swiss-crm-activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-22 00:00:00.000000000 Z
11
+ date: 2025-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport