connect-sdk-ruby 2.9.0 → 2.10.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 +4 -4
- data/README.md +2 -2
- data/connect-sdk-ruby.gemspec +2 -2
- data/examples/merchant/payments/create_payment_example.rb +5 -0
- data/lib/ingenico/connect/sdk/domain/payment/abstract_three_d_secure.rb +9 -0
- data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_results.rb +9 -0
- data/lib/ingenico/connect/sdk/logging/logging_util.rb +1 -1
- data/lib/ingenico/connect/sdk/meta_data_provider.rb +1 -1
- data/spec/fixtures/resources/logging/bodyWithObjectObfuscated.json +2 -2
- data/spec/fixtures/resources/logging/bodyWithObjectOriginal.json +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e52cb8fafc7d3041017f01004fbd6841896acca475a19c3dccb7eae56b2b03c
|
4
|
+
data.tar.gz: fcba87cb4825f44bfacc8fbbbc7a7d4e2722b803155a191605aff6093fa801a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 631dcac0a15694ab379d4cc458dd164b6b0374a9bccf96ecd91cc3c48f112b64296646788820faf867ecaafa1728c564c3cf1028e701569281b80c35240ee9cc
|
7
|
+
data.tar.gz: 4112d4d62df16def19fb7c74445953ba1e36310763ff319bf9e57e562dbf4e9e9b2423eba5028c681441a7010515a590440d92e21c9d5b9eb1121cc9a2d10e93
|
data/README.md
CHANGED
@@ -91,7 +91,7 @@ In addition, to run the proxy integration tests, the proxy URI, username and pas
|
|
91
91
|
|
92
92
|
In order to run the unit and integration tests, some additional dependencies are required:
|
93
93
|
|
94
|
-
* [rake](https://ruby.github.io/rake/)
|
94
|
+
* [rake](https://ruby.github.io/rake/) 12.3.3 or higher
|
95
95
|
* [rspec](https://github.com/rspec/rspec) 3.5 or higher
|
96
96
|
* [webmock](https://github.com/bblimke/webmock) 2.1 or higher
|
97
97
|
* [sinatra](https://github.com/sinatra/sinatra) 1.4 or higher
|
@@ -126,7 +126,7 @@ The following commands can now be executed from the root directory of the SDK fo
|
|
126
126
|
|
127
127
|
Documentation can be generated with YARD. YARD can be installed as a gem. The gems required to generate documentation are:
|
128
128
|
|
129
|
-
* [rake](https://ruby.github.io/rake/)
|
129
|
+
* [rake](https://ruby.github.io/rake/) 12.3.3 or higher
|
130
130
|
* [yard](https://github.com/lsegal/yard) 0.9.5 or higher
|
131
131
|
|
132
132
|
They can be installed using the following command:
|
data/connect-sdk-ruby.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'connect-sdk-ruby'
|
3
|
-
spec.version = '2.
|
3
|
+
spec.version = '2.10.0'
|
4
4
|
spec.authors = ['Ingenico ePayments']
|
5
5
|
spec.email = ['github@epay.ingenico.com']
|
6
6
|
spec.summary = %q{SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API}
|
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'rspec', '~> 3.5'
|
25
25
|
spec.add_development_dependency 'webmock', '~> 2.1'
|
26
26
|
spec.add_development_dependency 'sinatra', '~> 1.4'
|
27
|
-
spec.add_development_dependency 'rake', '~>
|
27
|
+
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
|
28
28
|
# spec.metadata['yard.run'] = 'yri' # compiles yard doc on install
|
29
29
|
end
|
@@ -39,10 +39,15 @@ def example
|
|
39
39
|
card.cvv = '123'
|
40
40
|
card.expiry_date = '1220'
|
41
41
|
|
42
|
+
authentication_amount = Definitions::AmountOfMoney.new
|
43
|
+
authentication_amount.amount = 2980
|
44
|
+
authentication_amount.currency_code = 'EUR'
|
45
|
+
|
42
46
|
redirection_data = Payment::RedirectionData.new
|
43
47
|
redirection_data.return_url = 'https://hostname.myownwebsite.url'
|
44
48
|
|
45
49
|
three_d_secure = Payment::ThreeDSecure.new
|
50
|
+
three_d_secure.authentication_amount = authentication_amount
|
46
51
|
three_d_secure.authentication_flow = 'browser'
|
47
52
|
three_d_secure.challenge_canvas_size = '600x400'
|
48
53
|
three_d_secure.challenge_indicator = 'challenge-requested'
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
|
4
4
|
#
|
5
5
|
require 'ingenico/connect/sdk/data_object'
|
6
|
+
require 'ingenico/connect/sdk/domain/definitions/amount_of_money'
|
6
7
|
require 'ingenico/connect/sdk/domain/payment/sdk_data_input'
|
7
8
|
require 'ingenico/connect/sdk/domain/payment/three_d_secure_data'
|
8
9
|
|
@@ -10,6 +11,7 @@ module Ingenico::Connect::SDK
|
|
10
11
|
module Domain
|
11
12
|
module Payment
|
12
13
|
|
14
|
+
# @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] authentication_amount
|
13
15
|
# @attr [String] authentication_flow
|
14
16
|
# @attr [String] challenge_canvas_size
|
15
17
|
# @attr [String] challenge_indicator
|
@@ -19,6 +21,8 @@ module Ingenico::Connect::SDK
|
|
19
21
|
# @attr [true/false] skip_authentication
|
20
22
|
class AbstractThreeDSecure < Ingenico::Connect::SDK::DataObject
|
21
23
|
|
24
|
+
attr_accessor :authentication_amount
|
25
|
+
|
22
26
|
attr_accessor :authentication_flow
|
23
27
|
|
24
28
|
attr_accessor :challenge_canvas_size
|
@@ -36,6 +40,7 @@ module Ingenico::Connect::SDK
|
|
36
40
|
# @return (Hash)
|
37
41
|
def to_h
|
38
42
|
hash = super
|
43
|
+
hash['authenticationAmount'] = @authentication_amount.to_h unless @authentication_amount.nil?
|
39
44
|
hash['authenticationFlow'] = @authentication_flow unless @authentication_flow.nil?
|
40
45
|
hash['challengeCanvasSize'] = @challenge_canvas_size unless @challenge_canvas_size.nil?
|
41
46
|
hash['challengeIndicator'] = @challenge_indicator unless @challenge_indicator.nil?
|
@@ -48,6 +53,10 @@ module Ingenico::Connect::SDK
|
|
48
53
|
|
49
54
|
def from_hash(hash)
|
50
55
|
super
|
56
|
+
if hash.has_key? 'authenticationAmount'
|
57
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['authenticationAmount']] unless hash['authenticationAmount'].is_a? Hash
|
58
|
+
@authentication_amount = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['authenticationAmount'])
|
59
|
+
end
|
51
60
|
if hash.has_key? 'authenticationFlow'
|
52
61
|
@authentication_flow = hash['authenticationFlow']
|
53
62
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
|
4
4
|
#
|
5
5
|
require 'ingenico/connect/sdk/data_object'
|
6
|
+
require 'ingenico/connect/sdk/domain/definitions/amount_of_money'
|
6
7
|
require 'ingenico/connect/sdk/domain/payment/sdk_data_output'
|
7
8
|
require 'ingenico/connect/sdk/domain/payment/three_d_secure_data'
|
8
9
|
|
@@ -12,6 +13,7 @@ module Ingenico::Connect::SDK
|
|
12
13
|
|
13
14
|
# @attr [String] acs_transaction_id
|
14
15
|
# @attr [String] applied_exemption
|
16
|
+
# @attr [Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney] authentication_amount
|
15
17
|
# @attr [String] cavv
|
16
18
|
# @attr [String] directory_server_transaction_id
|
17
19
|
# @attr [String] eci
|
@@ -27,6 +29,8 @@ module Ingenico::Connect::SDK
|
|
27
29
|
|
28
30
|
attr_accessor :applied_exemption
|
29
31
|
|
32
|
+
attr_accessor :authentication_amount
|
33
|
+
|
30
34
|
attr_accessor :cavv
|
31
35
|
|
32
36
|
attr_accessor :directory_server_transaction_id
|
@@ -50,6 +54,7 @@ module Ingenico::Connect::SDK
|
|
50
54
|
hash = super
|
51
55
|
hash['acsTransactionId'] = @acs_transaction_id unless @acs_transaction_id.nil?
|
52
56
|
hash['appliedExemption'] = @applied_exemption unless @applied_exemption.nil?
|
57
|
+
hash['authenticationAmount'] = @authentication_amount.to_h unless @authentication_amount.nil?
|
53
58
|
hash['cavv'] = @cavv unless @cavv.nil?
|
54
59
|
hash['directoryServerTransactionId'] = @directory_server_transaction_id unless @directory_server_transaction_id.nil?
|
55
60
|
hash['eci'] = @eci unless @eci.nil?
|
@@ -70,6 +75,10 @@ module Ingenico::Connect::SDK
|
|
70
75
|
if hash.has_key? 'appliedExemption'
|
71
76
|
@applied_exemption = hash['appliedExemption']
|
72
77
|
end
|
78
|
+
if hash.has_key? 'authenticationAmount'
|
79
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['authenticationAmount']] unless hash['authenticationAmount'].is_a? Hash
|
80
|
+
@authentication_amount = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['authenticationAmount'])
|
81
|
+
end
|
73
82
|
if hash.has_key? 'cavv'
|
74
83
|
@cavv = hash['cavv']
|
75
84
|
end
|
@@ -206,7 +206,7 @@ module Ingenico::Connect::SDK
|
|
206
206
|
# the value. What this does not allow currently is having values end
|
207
207
|
# with a \ (which would be escaped to \\).
|
208
208
|
regex = pn.inject("([\"'])(") { |r, p| "#{r}#{Regexp.quote(p)}|"}.chop <<
|
209
|
-
")\\1\\s*:\\s*(?:([\"'])(.*?)(?<!\\\\)\\3|([^\"'\\s\\[\\{]\\S*))"
|
209
|
+
")\\1\\s*:\\s*(?:([\"'])(.*?)(?<!\\\\)\\3|([^\"'\\s\\[\\{]((?!,)\\S)*))"
|
210
210
|
/#{regex}/m # dotall mode
|
211
211
|
end
|
212
212
|
|
@@ -7,7 +7,7 @@ module Ingenico::Connect::SDK
|
|
7
7
|
#
|
8
8
|
# @attr_reader [Array<Ingenico::Connect::SDK::RequestHeader>] meta_data_headers List of headers that should be used in all requests.
|
9
9
|
class MetaDataProvider
|
10
|
-
@@SDK_VERSION = '2.
|
10
|
+
@@SDK_VERSION = '2.10.0'
|
11
11
|
@@SERVER_META_INFO_HEADER = 'X-GCS-ServerMetaInfo'
|
12
12
|
@@PROHIBITED_HEADERS = [@@SERVER_META_INFO_HEADER, 'X-GCS-Idempotence-Key',
|
13
13
|
'Date', 'Content-Type', 'Authorization'].sort!.freeze
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: connect-sdk-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ingenico ePayments
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -100,14 +100,20 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '12.3'
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 12.3.3
|
104
107
|
type: :development
|
105
108
|
prerelease: false
|
106
109
|
version_requirements: !ruby/object:Gem::Requirement
|
107
110
|
requirements:
|
108
111
|
- - "~>"
|
109
112
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
113
|
+
version: '12.3'
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 12.3.3
|
111
117
|
description: SDK to communicate with the Ingenico ePayments platform using the Ingenico
|
112
118
|
Connect Server API
|
113
119
|
email:
|