docdata-order 2.2.0 → 2.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34ae9ce960de0e17ed6fc95e4e0fac5a9fa526ce3a550f032f973b83824b58d1
4
- data.tar.gz: 659f0fad8ca085516928acf268fcc1e0b2a657ce85a3cd2499a6a565fa587f1a
3
+ metadata.gz: b9a63ec43c84dd6e9acb81e84b836268da56d7fbf632e333a600b0978c9d4fb2
4
+ data.tar.gz: b9c8c66792a7de46fe2bbc367e3d26d2b8bd90a5fb7b05cbcc58a6cc059bbbd8
5
5
  SHA512:
6
- metadata.gz: '080e269f61a06d81c2d4df917448a73cdf2e4d552d59bb111bc82775be96704ed035b220ad00c79283b87f7c289813f9b12b878361948769ea413aa49e6e9df6'
7
- data.tar.gz: 553ccb2bbdad009ef2da8408ef73a44daf19a5719d11e8c4b8701e1d7a1a0d48e662224e34870e90a55a3c62a1368135ffbc144018ba8ca9b2c7635f37230949
6
+ metadata.gz: d13d9151e9025a9c9e540e84281179f804190bbc0e99d5eddff65f117787ad14c28fc78fcc53da3d40f58bffea54ec4f7690fb5071e0b9ed8bc133d3a41b519f
7
+ data.tar.gz: f595a0273c6d4839aee1c2ee8c1cd56f7a76d7feff8402078941481cf899d4766b4553c965c0b029b6f74ea3a3c61605610d0ab374825e616f03b2350de0e3df
data/README.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/docdata-order.svg)](https://badge.fury.io/rb/docdata-order)
4
4
  [![Build Status](https://github.com/KentaaNL/docdata-order/actions/workflows/test.yml/badge.svg)](https://github.com/KentaaNL/docdata-order/actions)
5
- [![Code Climate](https://codeclimate.com/github/KentaaNL/docdata-order/badges/gpa.svg)](https://codeclimate.com/github/KentaaNL/docdata-order)
5
+ [![CodeQL](https://github.com/KentaaNL/docdata-order/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/KentaaNL/docdata-order/actions/workflows/github-code-scanning/codeql)
6
6
 
7
7
  Docdata::Order is a Ruby client for the Docdata Order API version 1.3.
8
8
 
9
9
  ## Table of Contents
10
10
 
11
11
  - [Installation](#installation)
12
+ - [Configuration](#configuration)
12
13
  - [Usage](#usage)
13
14
  - [Initialization](#initialization)
14
15
  - [Subject merchant](#subject-merchant)
@@ -41,6 +42,21 @@ Or install it yourself as:
41
42
 
42
43
  $ gem install docdata-order
43
44
 
45
+ ## Configuration
46
+
47
+ Docdata::Order provides a global configuration object that allows you to customize logger output and HTTP timeouts. You can set these options via the `Docdata::Order.configure` block:
48
+
49
+ ```ruby
50
+ Docdata::Order.configure do |config|
51
+ # Set a global logger for Docdata::Order output
52
+ config.logger = Logger.new($stdout)
53
+
54
+ # Set Net::HTTP timeout values (in seconds)
55
+ config.open_timeout = 30
56
+ config.read_timeout = 30
57
+ end
58
+ ```
59
+
44
60
  ## Usage
45
61
 
46
62
  ### Initialization
@@ -105,12 +121,11 @@ The `redirect_url` in the response will redirect the user to the Docdata Payment
105
121
  #### Redirecting directly to the payment page
106
122
 
107
123
  For some payment methods you can skip the Docdata One Page Checkout and redirect directly to the payment page of the specified payment method.
108
- This works for the payment methods iDEAL, Sofort and PayPal. For iDEAL, you also need to provide the issuer:
124
+ This works for the payment methods iDEAL, Sofort and PayPal.
109
125
 
110
126
  ```ruby
111
127
  response = client.create(options.merge(
112
128
  payment_method: Docdata::Order::PaymentMethod::IDEAL,
113
- issuer_id: "INGBNL2A",
114
129
  return_url: "http://yourwebshop.nl/payment_return"
115
130
  ))
116
131
  ```
@@ -218,4 +233,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Kentaa
218
233
  ## License
219
234
 
220
235
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
221
-
@@ -62,7 +62,9 @@ module Docdata
62
62
 
63
63
  params.merge!(log: true, log_level: :debug, pretty_print_xml: true) if @options[:debug]
64
64
 
65
- params[:logger] = Rails.logger if defined?(Rails)
65
+ params[:open_timeout] = Docdata::Order.config.open_timeout
66
+ params[:read_timeout] = Docdata::Order.config.read_timeout
67
+ params[:logger] = Docdata::Order.config.logger
66
68
 
67
69
  Savon.client(params)
68
70
  end
@@ -292,8 +292,10 @@ module Docdata
292
292
 
293
293
  case payment_method
294
294
  when PaymentMethod::IDEAL
295
- payment.iDealPaymentInput do |input|
296
- input.issuerId(issuer_id)
295
+ if issuer_id
296
+ payment.iDealPaymentInput do |input|
297
+ input.issuerId(issuer_id)
298
+ end
297
299
  end
298
300
  when PaymentMethod::SEPA_DIRECT_DEBIT
299
301
  payment.directDebitPaymentInput do |input|
@@ -319,7 +321,7 @@ module Docdata
319
321
  end
320
322
 
321
323
  def issuer_id
322
- options.fetch(:issuer_id)
324
+ options[:issuer_id]
323
325
  end
324
326
 
325
327
  def consumer_name
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Docdata
4
4
  module Order
5
- VERSION = '2.2.0'
5
+ VERSION = '2.4.0'
6
6
  end
7
7
  end
data/lib/docdata/order.rb CHANGED
@@ -9,3 +9,35 @@ require 'docdata/order/request'
9
9
  require 'docdata/order/response'
10
10
  require 'docdata/order/urls'
11
11
  require 'docdata/order/version'
12
+
13
+ require 'logger'
14
+
15
+ module Docdata
16
+ # :nodoc:
17
+ module Order
18
+ # Holds the global Docdata::Order configuration.
19
+ class Configuration
20
+ attr_accessor :logger, :open_timeout, :read_timeout
21
+
22
+ def initialize
23
+ @logger = Rails.logger if defined?(Rails)
24
+ @open_timeout = 30
25
+ @read_timeout = 30
26
+ end
27
+ end
28
+
29
+ @config = Configuration.new
30
+
31
+ class << self
32
+ attr_reader :config
33
+
34
+ def configure
35
+ yield(@config)
36
+ end
37
+
38
+ def reset!
39
+ @config = Configuration.new
40
+ end
41
+ end
42
+ end
43
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docdata-order
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-23 00:00:00.000000000 Z
11
+ date: 2025-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bigdecimal
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: savon
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -118,14 +132,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
132
  requirements:
119
133
  - - ">="
120
134
  - !ruby/object:Gem::Version
121
- version: 2.7.0
135
+ version: 3.2.0
122
136
  required_rubygems_version: !ruby/object:Gem::Requirement
123
137
  requirements:
124
138
  - - ">="
125
139
  - !ruby/object:Gem::Version
126
140
  version: '0'
127
141
  requirements: []
128
- rubygems_version: 3.1.6
142
+ rubygems_version: 3.4.19
129
143
  signing_key:
130
144
  specification_version: 4
131
145
  summary: Ruby client for the Docdata Order API