six_saferpay 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +4 -2
  4. data/Gemfile.lock +60 -69
  5. data/README.md +2 -1
  6. data/lib/six_saferpay/api.rb +1 -1
  7. data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +4 -0
  8. data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +11 -2
  9. data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +4 -0
  10. data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +4 -0
  11. data/lib/six_saferpay/api/six_transaction/requests/capture.rb +11 -2
  12. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +4 -0
  13. data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +11 -2
  14. data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +11 -3
  15. data/lib/six_saferpay/models/authentication.rb +36 -0
  16. data/lib/six_saferpay/models/authentication_result.rb +20 -0
  17. data/lib/six_saferpay/models/check_result.rb +6 -2
  18. data/lib/six_saferpay/models/chosen_plan.rb +62 -0
  19. data/lib/six_saferpay/models/custom_plan.rb +4 -0
  20. data/lib/six_saferpay/models/first_installment_amount.rb +4 -0
  21. data/lib/six_saferpay/models/installment_fee.rb +4 -0
  22. data/lib/six_saferpay/models/installment_plans.rb +73 -0
  23. data/lib/six_saferpay/models/mastercard_issuer_installments.rb +49 -0
  24. data/lib/six_saferpay/models/registration_result.rb +11 -2
  25. data/lib/six_saferpay/models/subsequent_installment_amount.rb +4 -0
  26. data/lib/six_saferpay/models/total_amont_due.rb +4 -0
  27. data/lib/six_saferpay/version.rb +1 -1
  28. data/six_saferpay.gemspec +7 -7
  29. metadata +31 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 857ccfdf26a35fe487b7532b5ea86ca0911520a050de48c6b6a9ce30849d23b4
4
- data.tar.gz: '08018cfbdb29d4aa3c36f8c3e82d67df2c5edcb9f78e51ec898d65c9629961b5'
3
+ metadata.gz: a080926b5bdf943166bbcd992d4d7a0225312de53b76dc531bd7647ec8a42f1c
4
+ data.tar.gz: dbcad29d4c52294fd934f2355176b0554c24db3696ac1e24cf64912fd6faff0b
5
5
  SHA512:
6
- metadata.gz: 6307d8f4a4f567df22de013e60614fcbb7bc1e313c0966677b2dd9c13c09f67889caa5f77caade78b58e5db2e03f65665c548aef5f33888bc6ebec40cd84468e
7
- data.tar.gz: 66605554ad285e62c4e783d05a8fd5caaf6a532dc751edf5c69e2ed338c910f58b96c79a346b7115e45fcec6e34ceb3d3de7b03bf6e88bae9c380ced4f263fb0
6
+ metadata.gz: 3e2633d3ddd558c1efb063dea3490d37c100abb9d7fa48672d14ecab55e53fc20e24c280b1d68b5a01780d6e59c472b8ce62d7b548ae3f8b01a26d26154b9574
7
+ data.tar.gz: b67ee84408caf95044891164d762bad9ad042401d982bda0d7265bcd9993934ee0e48b8345ac3b8f22a2e0e027521e48f39078997543c7274221d04274ab0469
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.7.2
data/.travis.yml CHANGED
@@ -3,8 +3,10 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5.0
7
- before_install: gem install bundler -v 2.0.1
6
+ - 2.7.2
7
+
8
+ before_install:
9
+ - gem install bundler:2.2.8
8
10
 
9
11
  notifications:
10
12
  slack: fadendaten:tWoet2mtObvbwSZSyUAY93jl
data/Gemfile.lock CHANGED
@@ -1,106 +1,97 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- six_saferpay (2.3.1)
5
- activesupport (~> 5.0, >= 5.0.0.0)
4
+ six_saferpay (1.16.2.4.0)
5
+ activesupport (~> 6.1, >= 6.1.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (5.2.4.1)
10
+ activesupport (6.1.3)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
12
+ i18n (>= 1.6, < 2)
13
+ minitest (>= 5.1)
14
+ tzinfo (~> 2.0)
15
+ zeitwerk (~> 2.3)
15
16
  addressable (2.7.0)
16
17
  public_suffix (>= 2.0.2, < 5.0)
17
- coderay (1.1.2)
18
- concurrent-ruby (1.1.6)
19
- crack (0.4.3)
20
- safe_yaml (~> 1.0.0)
21
- diff-lcs (1.3)
22
- docile (1.3.2)
23
- dotenv (2.7.5)
24
- equatable (0.6.1)
25
- ffi (1.12.2-java)
18
+ coderay (1.1.3)
19
+ concurrent-ruby (1.1.8)
20
+ crack (0.4.5)
21
+ rexml
22
+ diff-lcs (1.4.4)
23
+ docile (1.3.5)
24
+ dotenv (2.7.6)
26
25
  hashdiff (1.0.1)
27
- i18n (1.8.2)
26
+ i18n (1.8.9)
28
27
  concurrent-ruby (~> 1.0)
29
- method_source (0.9.2)
30
- minitest (5.14.0)
31
- necromancer (0.5.1)
32
- pastel (0.7.3)
33
- equatable (~> 0.6)
28
+ method_source (1.0.0)
29
+ minitest (5.14.3)
30
+ pastel (0.8.0)
34
31
  tty-color (~> 0.5)
35
- pry (0.12.2)
36
- coderay (~> 1.1.0)
37
- method_source (~> 0.9.0)
38
- pry (0.12.2-java)
39
- coderay (~> 1.1.0)
40
- method_source (~> 0.9.0)
41
- spoon (~> 0.0)
42
- public_suffix (4.0.3)
43
- rake (13.0.1)
44
- rspec (3.9.0)
45
- rspec-core (~> 3.9.0)
46
- rspec-expectations (~> 3.9.0)
47
- rspec-mocks (~> 3.9.0)
48
- rspec-core (3.9.1)
49
- rspec-support (~> 3.9.1)
50
- rspec-expectations (3.9.0)
32
+ pry (0.14.0)
33
+ coderay (~> 1.1)
34
+ method_source (~> 1.0)
35
+ public_suffix (4.0.6)
36
+ rake (13.0.3)
37
+ rexml (3.2.4)
38
+ rspec (3.10.0)
39
+ rspec-core (~> 3.10.0)
40
+ rspec-expectations (~> 3.10.0)
41
+ rspec-mocks (~> 3.10.0)
42
+ rspec-core (3.10.1)
43
+ rspec-support (~> 3.10.0)
44
+ rspec-expectations (3.10.1)
51
45
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.9.0)
53
- rspec-mocks (3.9.1)
46
+ rspec-support (~> 3.10.0)
47
+ rspec-mocks (3.10.2)
54
48
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.9.0)
56
- rspec-support (3.9.2)
57
- safe_yaml (1.0.5)
58
- simplecov (0.18.5)
49
+ rspec-support (~> 3.10.0)
50
+ rspec-support (3.10.2)
51
+ simplecov (0.21.2)
59
52
  docile (~> 1.1)
60
53
  simplecov-html (~> 0.11)
61
- simplecov-html (0.12.2)
62
- spinning_wheel (0.2.1)
63
- activesupport (~> 5.0, >= 5.0.0.0)
64
- spoon (0.0.6)
65
- ffi
66
- thread_safe (0.3.6)
67
- thread_safe (0.3.6-java)
68
- tty-color (0.5.1)
54
+ simplecov_json_formatter (~> 0.1)
55
+ simplecov-html (0.12.3)
56
+ simplecov_json_formatter (0.1.2)
57
+ spinning_wheel (0.2.2)
58
+ activesupport (>= 5.2.4.3)
59
+ tty-color (0.6.0)
69
60
  tty-cursor (0.7.1)
70
- tty-prompt (0.20.0)
71
- necromancer (~> 0.5.0)
72
- pastel (~> 0.7.0)
73
- tty-reader (~> 0.7.0)
74
- tty-reader (0.7.0)
61
+ tty-prompt (0.23.0)
62
+ pastel (~> 0.8)
63
+ tty-reader (~> 0.8)
64
+ tty-reader (0.9.0)
75
65
  tty-cursor (~> 0.7)
76
- tty-screen (~> 0.7)
77
- wisper (~> 2.0.0)
78
- tty-screen (0.7.1)
79
- tzinfo (1.2.6)
80
- thread_safe (~> 0.1)
66
+ tty-screen (~> 0.8)
67
+ wisper (~> 2.0)
68
+ tty-screen (0.8.1)
69
+ tzinfo (2.0.4)
70
+ concurrent-ruby (~> 1.0)
81
71
  vcr (4.0.0)
82
- webmock (3.8.2)
72
+ webmock (3.11.2)
83
73
  addressable (>= 2.3.6)
84
74
  crack (>= 0.3.2)
85
75
  hashdiff (>= 0.4.0, < 2.0.0)
86
76
  wisper (2.0.1)
77
+ zeitwerk (2.4.2)
87
78
 
88
79
  PLATFORMS
89
80
  java
90
81
  ruby
91
82
 
92
83
  DEPENDENCIES
93
- bundler (~> 2.0)
84
+ bundler (~> 2.1)
94
85
  dotenv (~> 2.7, >= 2.7)
95
- pry (~> 0.12.0)
86
+ pry (~> 0.13)
96
87
  rake (~> 13.0)
97
88
  rspec (~> 3.0)
98
- simplecov (~> 0.16)
89
+ simplecov (~> 0.19)
99
90
  six_saferpay!
100
- spinning_wheel (~> 0.1)
101
- tty-prompt (~> 0.18)
91
+ spinning_wheel (~> 0.2.2)
92
+ tty-prompt (~> 0.22)
102
93
  vcr (~> 4.0, >= 4.0.0)
103
- webmock (~> 3.5, >= 3.5.1)
94
+ webmock (~> 3.10, >= 3.10)
104
95
 
105
96
  BUNDLED WITH
106
- 2.0.1
97
+ 2.2.8
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## Current API Version
8
8
 
9
- This gem is compatible with the SIX API version: `1.15`
9
+ This gem is compatible with the SIX API version: `1.16`
10
10
 
11
11
  ## Installation
12
12
 
@@ -156,3 +156,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
156
156
  ## License
157
157
 
158
158
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
159
+
@@ -1,5 +1,5 @@
1
1
  module SixSaferpay
2
2
  module API
3
- VERSION = '1.15'
3
+ VERSION = '1.16'
4
4
  end
5
5
  end
@@ -9,6 +9,7 @@ module SixSaferpay
9
9
  :payment,
10
10
  :payment_methods,
11
11
  :payment_methods_options,
12
+ :authentication,
12
13
  :wallets,
13
14
  :payer,
14
15
  :register_alias,
@@ -27,6 +28,7 @@ module SixSaferpay
27
28
  payment:,
28
29
  payment_methods: nil,
29
30
  payment_methods_options: nil,
31
+ authentication: nil,
30
32
  wallets: nil,
31
33
  payer: nil,
32
34
  register_alias: nil,
@@ -44,6 +46,7 @@ module SixSaferpay
44
46
  @payment = SixSaferpay::Payment.new(payment.to_h) if payment
45
47
  @payment_methods = payment_methods
46
48
  @payment_methods_options = SixSaferpay::PaymentMethodsOptions.new(payment_methods_options.to_h) if payment_methods_options
49
+ @authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
47
50
  @wallets = wallets
48
51
  @payer = SixSaferpay::Payer.new(payer.to_h) if payer
49
52
  @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
@@ -64,6 +67,7 @@ module SixSaferpay
64
67
  hash.merge!(payment: @payment.to_h)
65
68
  hash.merge!(payment_methods: @payment_methods) if @payment_methods
66
69
  hash.merge!(payment_methods_options: @payment_methods_options.to_h) if @payment_methods_options
70
+ hash.merge!(authentication: @authentication.to_h) if @authentication
67
71
  hash.merge!(wallets: @wallets) if @wallets
68
72
  hash.merge!(payer: @payer.to_h) if @payer
69
73
  hash.merge!(register_alias: @register_alias.to_h) if @register_alias
@@ -8,7 +8,8 @@ module SixSaferpay
8
8
  :payer,
9
9
  :registration_result,
10
10
  :liability,
11
- :dcc
11
+ :dcc,
12
+ :mastercard_issuer_installments
12
13
  )
13
14
 
14
15
  def initialize(response_header:,
@@ -17,7 +18,8 @@ module SixSaferpay
17
18
  payer: nil,
18
19
  registration_result: nil,
19
20
  liability: nil,
20
- dcc: nil
21
+ dcc: nil,
22
+ mastercard_issuer_installments: nil
21
23
  )
22
24
  @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h)
23
25
  @transaction = SixSaferpay::Transaction.new(transaction.to_h)
@@ -26,6 +28,10 @@ module SixSaferpay
26
28
  @registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
27
29
  @liability = SixSaferpay::Liability.new(liability.to_h) if liability
28
30
  @dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
31
+ if mastercard_issuer_installments
32
+ @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
33
+ .new(mastercard_issuer_installments.to_h)
34
+ end
29
35
  end
30
36
 
31
37
  def to_hash
@@ -37,6 +43,9 @@ module SixSaferpay
37
43
  hash.merge!(registration_result: @registration_result.to_h) if @registration_result
38
44
  hash.merge!(liability: @liability.to_h) if @liability
39
45
  hash.merge!(dcc: @dcc.to_h) if @dcc
46
+ if @mastercard_issuer_installments
47
+ hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
48
+ end
40
49
  hash
41
50
  end
42
51
  alias_method :to_h, :to_hash
@@ -6,6 +6,7 @@ module SixSaferpay
6
6
  :terminal_id,
7
7
  :payment,
8
8
  :payment_means,
9
+ :authentication,
9
10
  :register_alias,
10
11
  :payer
11
12
  )
@@ -15,6 +16,7 @@ module SixSaferpay
15
16
  terminal_id: nil,
16
17
  payment:,
17
18
  payment_means:,
19
+ authentication: nil,
18
20
  register_alias: nil,
19
21
  payer: nil
20
22
  )
@@ -22,6 +24,7 @@ module SixSaferpay
22
24
  @terminal_id = SixSaferpay.config.terminal_id || terminal_id
23
25
  @payment = SixSaferpay::Payment.new(payment.to_h) if payment
24
26
  @payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
27
+ @authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
25
28
  @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
26
29
  @payer = SixSaferpay::Payer.new(payer.to_h) if payer
27
30
  end
@@ -32,6 +35,7 @@ module SixSaferpay
32
35
  hash.merge!(terminal_id: @terminal_id) if @terminal_id
33
36
  hash.merge!(payment: @payment.to_h) if @payment
34
37
  hash.merge!(payment_means: @payment_means.to_h) if @payment_means
38
+ hash.merge!(authentication: @authentication.to_h) if @authentication
35
39
  hash.merge!(register_alias: @register_alias.to_h) if @register_alias
36
40
  hash.merge!(payer: @payer.to_h) if @payer
37
41
  hash
@@ -6,6 +6,7 @@ module SixSaferpay
6
6
  :terminal_id,
7
7
  :payment,
8
8
  :transaction_reference,
9
+ :authentication,
9
10
  :suppress_dcc
10
11
  )
11
12
 
@@ -14,12 +15,14 @@ module SixSaferpay
14
15
  terminal_id: nil,
15
16
  payment:,
16
17
  transaction_reference:,
18
+ authentication: nil,
17
19
  suppress_dcc:
18
20
  )
19
21
  @request_header = request_header || SixSaferpay::RequestHeader.new()
20
22
  @terminal_id = terminal_id || SixSaferpay.config.terminal_id
21
23
  @payment = SixSaferpay::Payment.new(payment.to_h) if payment
22
24
  @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
25
+ @authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
23
26
  @suppress_dcc = suppress_dcc
24
27
  end
25
28
 
@@ -29,6 +32,7 @@ module SixSaferpay
29
32
  hash.merge!(terminal_id: @terminal_id) if @terminal_id
30
33
  hash.merge!(payment: @payment.to_h) if @payment
31
34
  hash.merge!(transaction_reference: @transaction_reference.to_h) if @transaction_reference
35
+ hash.merge!(authentication: @authentication.to_h) if @authentication
32
36
  hash.merge!(suppress_dcc: @suppress_dcc) if !@suppress_dcc.nil?
33
37
  hash
34
38
  end
@@ -7,7 +7,8 @@ module SixSaferpay
7
7
  :amount,
8
8
  :billpay,
9
9
  :pending_notification,
10
- :marketplace
10
+ :marketplace,
11
+ :mastercard_issuer_installments
11
12
  )
12
13
 
13
14
 
@@ -16,7 +17,8 @@ module SixSaferpay
16
17
  amount: nil,
17
18
  billpay: nil,
18
19
  pending_notification: nil,
19
- marketplace: nil
20
+ marketplace: nil,
21
+ mastercard_issuer_installments: nil
20
22
  )
21
23
  @request_header = request_header || SixSaferpay::RequestHeader.new()
22
24
  @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
@@ -24,6 +26,10 @@ module SixSaferpay
24
26
  @billpay = SixSaferpay::Billpay.new(billpay.to_h) if billpay
25
27
  @pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
26
28
  @marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
29
+ if mastercard_issuer_installments
30
+ @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
31
+ .new(mastercard_issuer_installments.to_h)
32
+ end
27
33
  end
28
34
 
29
35
  def to_hash
@@ -34,6 +40,9 @@ module SixSaferpay
34
40
  hash.merge!(billpay: @billpay.to_h) if @billpay
35
41
  hash.merge!(pending_notification: @pending_notification.to_h) if @pending_notification
36
42
  hash.merge!(marketplace: @marketplace.to_h) if @marketplace
43
+ if @mastercard_issuer_installments
44
+ hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
45
+ end
37
46
  hash
38
47
  end
39
48
  alias_method :to_h, :to_hash
@@ -8,6 +8,7 @@ module SixSaferpay
8
8
  :terminal_id,
9
9
  :payment,
10
10
  :payment_means,
11
+ :authentication,
11
12
  :payer,
12
13
  :return_urls,
13
14
  :styling,
@@ -22,6 +23,7 @@ module SixSaferpay
22
23
  terminal_id: nil,
23
24
  payment:,
24
25
  payment_means: nil,
26
+ authentication: nil,
25
27
  payer: nil,
26
28
  return_urls: nil,
27
29
  styling: nil,
@@ -34,6 +36,7 @@ module SixSaferpay
34
36
  @terminal_id = terminal_id || SixSaferpay.config.terminal_id
35
37
  @payment = SixSaferpay::Payment.new(payment.to_h) if payment
36
38
  @payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
39
+ @authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
37
40
  @payer = SixSaferpay::Payer.new(payer.to_h) if payer
38
41
  @return_urls = return_urls || SixSaferpay::ReturnUrls.new()
39
42
  @styling = SixSaferpay::Styling.new(styling.to_h) if styling
@@ -49,6 +52,7 @@ module SixSaferpay
49
52
  hash.merge!(terminal_id: @terminal_id) if @terminal_id
50
53
  hash.merge!(payment: @payment.to_h) if @payment
51
54
  hash.merge!(payment_means: @payment_means.to_h) if @payment_means
55
+ hash.merge!(authentication: @authentication.to_h) if @authentication
52
56
  hash.merge!(payer: @payer.to_h) if @payer
53
57
  hash.merge!(return_urls: @return_urls.to_h ) if @return_urls
54
58
  hash.merge!(styling: @styling.to_h) if @styling
@@ -6,7 +6,8 @@ module SixSaferpay
6
6
  :transaction,
7
7
  :payment_means,
8
8
  :payer,
9
- :registration_result
9
+ :registration_result,
10
+ :mastercard_issuer_installments
10
11
  )
11
12
 
12
13
 
@@ -14,13 +15,18 @@ module SixSaferpay
14
15
  transaction:,
15
16
  payment_means:,
16
17
  payer: nil,
17
- registration_result: nil
18
+ registration_result: nil,
19
+ mastercard_issuer_installments: nil
18
20
  )
19
21
  @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
20
22
  @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
21
23
  @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
22
24
  @payer = SixSaferpay::Payer.new(payer.to_h) if payer
23
25
  @registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
26
+ if mastercard_issuer_installments
27
+ @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
28
+ .new(mastercard_issuer_installments.to_h)
29
+ end
24
30
  end
25
31
 
26
32
  def to_hash
@@ -30,6 +36,9 @@ module SixSaferpay
30
36
  hash.merge!(payment_means: @payment_means.to_h) if @payment_means
31
37
  hash.merge!(payer: @payer.to_h) if @payer
32
38
  hash.merge!(registration_result: @registration_result.to_h) if @registration_result
39
+ if @mastercard_issuer_installments
40
+ hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
41
+ end
33
42
  hash
34
43
  end
35
44
  alias_method :to_h, :to_hash
@@ -8,7 +8,8 @@ module SixSaferpay
8
8
  :payer,
9
9
  :registration_result,
10
10
  :liability,
11
- :dcc
11
+ :dcc,
12
+ :mastercard_issuer_installments
12
13
  )
13
14
 
14
15
 
@@ -18,8 +19,8 @@ module SixSaferpay
18
19
  payer: nil,
19
20
  registration_result: nil,
20
21
  liability: nil,
21
- dcc: nil
22
-
22
+ dcc: nil,
23
+ mastercard_issuer_installments: nil
23
24
  )
24
25
  @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
25
26
  @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
@@ -28,6 +29,10 @@ module SixSaferpay
28
29
  @registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
29
30
  @liability = SixSaferpay::Liability.new(liability.to_h) if liability
30
31
  @dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
32
+ if mastercard_issuer_installments
33
+ @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
34
+ .new(mastercard_issuer_installments.to_h)
35
+ end
31
36
  end
32
37
 
33
38
  def to_hash
@@ -39,6 +44,9 @@ module SixSaferpay
39
44
  hash.merge!(registration_result: @registration_result.to_h) if @registration_result
40
45
  hash.merge!(liability: @liability.to_h) if @liability
41
46
  hash.merge!(dcc: @dcc.to_h) if @dcc
47
+ if @mastercard_issuer_installments
48
+ hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
49
+ end
42
50
  hash
43
51
  end
44
52
  alias_method :to_h, :to_hash
@@ -0,0 +1,36 @@
1
+ module SixSaferpay
2
+ class Authentication
3
+
4
+ attr_accessor(
5
+ :result,
6
+ :message,
7
+ :xid,
8
+ :exemption,
9
+ :three_ds_challenge
10
+ )
11
+
12
+ def initialize(result: nil, # ATTENTION: This is in some case mandatory
13
+ message: nil, # ATTENTION: This is in some case mandatory
14
+ xid: nil,
15
+ exemption: nil,
16
+ three_ds_challenge: nil)
17
+ @result = result
18
+ @message = message
19
+ @xid = xid
20
+ @exemption = exemption
21
+ @three_ds_challenge = three_ds_challenge
22
+ end
23
+
24
+ def to_hash
25
+ hash = Hash.new
26
+ hash.merge!(result: @result) if @result
27
+ hash.merge!(message: @message) if @message
28
+ hash.merge!(xid: @xid) if @xid
29
+ hash.merge!(exemption: @exemption) if @exemption
30
+ hash.merge!(three_ds_challenge: @three_ds_challenge) if @three_ds_challenge
31
+ hash
32
+ end
33
+ alias_method :to_h, :to_hash
34
+
35
+ end
36
+ end
@@ -0,0 +1,20 @@
1
+ module SixSaferpay
2
+ class AuthenticationResult
3
+
4
+ attr_accessor :result, :message
5
+
6
+ def initialize(result:, message:)
7
+ @result = result
8
+ @message = message
9
+ end
10
+
11
+ def to_hash
12
+ hash = Hash.new
13
+ hash.merge!(result: @result)
14
+ hash.merge!(message: @message)
15
+ hash
16
+ end
17
+ alias_method :to_h, :to_hash
18
+
19
+ end
20
+ end
@@ -2,19 +2,23 @@ module SixSaferpay
2
2
  class CheckResult
3
3
 
4
4
  attr_accessor(:result,
5
- :message
5
+ :message,
6
+ :authentication
6
7
  )
7
8
 
8
9
  def initialize(result:,
9
- message: )
10
+ message: ,
11
+ authentication: nil)
10
12
  @result = result
11
13
  @message = message
14
+ @authentication = authentication
12
15
  end
13
16
 
14
17
  def to_hash
15
18
  hash = Hash.new
16
19
  hash.merge!(result: @result) if @result
17
20
  hash.merge!(message: @message) if @message
21
+ hash.merge!(authentication: @authentication.to_h) if @authentication
18
22
  hash
19
23
  end
20
24
  alias_method :to_h, :to_hash
@@ -0,0 +1,62 @@
1
+ module SixSaferpay
2
+ class ChosenPlan
3
+
4
+ attr_accessor(
5
+ :minimum_number_of_installments,
6
+ :maximum_number_of_installments,
7
+ :interest_rate,
8
+ :installment_fee,
9
+ :annual_percentage_rate,
10
+ :total_amount_due,
11
+ )
12
+
13
+ def initialize(
14
+ minimum_number_of_installments: ,
15
+ maximum_number_of_installments: ,
16
+ interest_rate: nil,
17
+ installment_fee: nil,
18
+ annual_percentage_rate: nil,
19
+ total_amount_due: nil
20
+ )
21
+ @minimum_number_of_installments =
22
+ minimum_number_of_installments
23
+ @maximum_number_of_installments =
24
+ maximum_number_of_installments
25
+ @interest_rate = interest_rate
26
+ if installment_fee
27
+ @installment_fee = SixSaferpay::InstallmentFee
28
+ .new(installment_fee.to_h)
29
+ end
30
+ if annual_percentage_rate
31
+ @annual_percentage_rate = annual_percentage_rate
32
+ end
33
+ if total_amount_due
34
+ @total_amount_due = SixSaferpay::TotalAmountDue
35
+ .new(total_amount_due.to_h)
36
+ end
37
+ end
38
+
39
+ def to_hash
40
+ hash = Hash.new
41
+ hash.merge!(minimum_number_of_installments:
42
+ @minimum_number_of_installments)
43
+ hash.merge!(maximum_number_of_installments:
44
+ @maximum_number_of_installments)
45
+ if @interest_rate
46
+ hash.merge!(interest_rate: @interest_rate)
47
+ end
48
+ if @installment_fee
49
+ hash.merge!(installment_fee: @installment_fee.to_h)
50
+ end
51
+ if @annual_percentage_rate
52
+ hash.merge!(annual_percentage_rate: @annual_percentage_rate)
53
+ end
54
+ if @total_amount_due
55
+ hash.merge!(total_amount_due: @total_amount_due.to_h)
56
+ end
57
+ hash
58
+ end
59
+ alias_method :to_h, :to_hash
60
+
61
+ end
62
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class CustomPlan < ChosenPlan
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class FirstInstallmentAmount < Amount
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class InstallmentFee < Amount
3
+ end
4
+ end
@@ -0,0 +1,73 @@
1
+ module SixSaferpay
2
+ class InstallmentPlans
3
+
4
+ attr_accessor(
5
+ :number_of_installments,
6
+ :interest_rate,
7
+ :installment_fee,
8
+ :annual_percentage_rate,
9
+ :first_installment_amount,
10
+ :subsequent_installment_amount,
11
+ :total_amount_due
12
+ )
13
+
14
+ def initialize(
15
+ number_of_installments: ,
16
+ interest_rate: nil,
17
+ installment_fee: nil,
18
+ annual_percentage_rate: nil,
19
+ first_installment_amount: nil,
20
+ subsequent_installment_amount: nil,
21
+ total_amount_due: nil
22
+ )
23
+ @number_of_installments = number_of_installments
24
+ @interest_rate = interest_rate
25
+ if installment_fee
26
+ @installment_fee = SixSaferpay::InstallmentFee
27
+ .new(installment_fee.to_h)
28
+ end
29
+ if annual_percentage_rate
30
+ @annual_percentage_rate = annual_percentage_rate
31
+ end
32
+ if first_installment_amount
33
+ @first_installment_amount = SixSaferpay::FirstInstallmentAmount
34
+ .new(first_installment_amount.to_h)
35
+ end
36
+ if subsequent_installment_amount
37
+ @subsequent_installment_amount = SixSaferpay::SubsequentInstallmentAmount
38
+ .new(subsequent_installment_amount.to_h)
39
+ end
40
+ if total_amount_due
41
+ @total_amount_due = SixSaferpay::TotalAmountDue
42
+ .new(total_amount_due.to_h)
43
+ end
44
+ end
45
+
46
+ def to_hash
47
+ hash = Hash.new
48
+ hash.merge!(number_of_installments: @number_of_installments)
49
+ if @interest_rate
50
+ hash.merge!(interest_rate: @interest_rate)
51
+ end
52
+ if @installment_fee
53
+ hash.merge!(installment_fee: @installment_fee.to_h)
54
+ end
55
+ if @annual_percentage_rate
56
+ hash.merge!(annual_percentage_rate: @annual_percentage_rate)
57
+ end
58
+ if @first_installment_amount
59
+ hash.merge!(first_installment_amount: @first_installment_amount.to_h)
60
+ end
61
+ if @subsequent_installment_amount
62
+ hash.merge!(subsequent_installment_amount: @subsequent_installment_amount.to_h)
63
+ end
64
+ if @total_amount_due
65
+ hash.merge!(total_amount_due: @total_amount_due.to_h)
66
+ end
67
+ hash
68
+ end
69
+ alias_method :to_h, :to_hash
70
+
71
+ end
72
+ end
73
+
@@ -0,0 +1,49 @@
1
+ module SixSaferpay
2
+ class MastercardIssuerInstallments
3
+
4
+ attr_accessor(
5
+ :installment_plans,
6
+ :custom_plan,
7
+ :chosen_plan,
8
+ :receipt_free_text
9
+ )
10
+
11
+ def initialize(
12
+ installment_plans: nil,
13
+ custom_plan: nil,
14
+ chosen_plan: nil,
15
+ receipt_free_text: nil
16
+ )
17
+ if installment_plans
18
+ @installment_plans = SixSaferpay::InstallmentPlans
19
+ .new(installment_plans.to_h)
20
+ end
21
+ if custom_plan
22
+ @custom_plan = SixSaferpay::CustomPlan
23
+ .new(custom_plan)
24
+ end
25
+ if chosen_plan
26
+ @chosen_plan = SixSaferpay::ChosenPlan
27
+ .new(chosen_plan.to_h)
28
+ end
29
+ @receipt_free_text = receipt_free_text
30
+ end
31
+
32
+ def to_hash
33
+ hash = Hash.new
34
+ if @installment_plans
35
+ hash.merge!(installment_plans: @installment_plans.to_h)
36
+ end
37
+ if @custom_plan
38
+ hash.merge!(custom_plan: @custom_plan.to_h)
39
+ end
40
+ if @chosen_plan
41
+ hash.merge!(chosen_plan: @chosen_plan.to_h)
42
+ end
43
+ hash.merge!(receipt_free_text: @receipt_free_text)
44
+ hash
45
+ end
46
+ alias_method :to_h, :to_hash
47
+
48
+ end
49
+ end
@@ -3,17 +3,23 @@ module SixSaferpay
3
3
 
4
4
  attr_accessor(:success,
5
5
  :fd_alias,
6
- :error
6
+ :error,
7
+ :authentication_result
7
8
  )
8
9
 
9
10
 
10
11
  def initialize(success:,
11
12
  fd_alias: nil,
12
- error: nil)
13
+ error: nil,
14
+ authentication_result: nil)
13
15
 
14
16
  @success = success
15
17
  @fd_alias = SixSaferpay::RegistrationAlias.new(fd_alias.to_h) if fd_alias
16
18
  @error = SixSaferpay::RegistrationError.new(error.to_h) if error
19
+ if authentication_result
20
+ @authentication_result = SixSaferpay::AuthenticationResult
21
+ .new(authentication_result.to_h)
22
+ end
17
23
  end
18
24
 
19
25
  def to_hash
@@ -21,6 +27,9 @@ module SixSaferpay
21
27
  hash.merge!(success: @success) if !@success.nil?
22
28
  hash.merge!(fd_alias: @fd_alias.to_h) if @fd_alias
23
29
  hash.merge!(error: @error.to_h) if @error
30
+ if authentication_result
31
+ hash.merge!(authentication_result: @authentication_result.to_h)
32
+ end
24
33
  hash
25
34
  end
26
35
  alias_method :to_h, :to_hash
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class SubsequentInstallmentAmount < Amount
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class TotalAmountDue < Amount
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module SixSaferpay
2
- VERSION = "2.3.1"
2
+ VERSION = "2.4.0"
3
3
  end
data/six_saferpay.gemspec CHANGED
@@ -23,16 +23,16 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_runtime_dependency 'activesupport', '~> 5.0', '>= 5.0.0.0'
26
+ spec.add_runtime_dependency 'activesupport', '~> 6.1', '>= 6.1.3'
27
27
 
28
- spec.add_development_dependency 'bundler', '~> 2.0'
28
+ spec.add_development_dependency 'bundler', '~> 2.1'
29
29
  spec.add_development_dependency 'rake', '~> 13.0'
30
30
  spec.add_development_dependency 'rspec', '~> 3.0'
31
31
  spec.add_development_dependency 'vcr', '~> 4.0', '>= 4.0.0'
32
- spec.add_development_dependency 'webmock', '~> 3.5', '>= 3.5.1'
32
+ spec.add_development_dependency 'webmock', '~> 3.10', '>= 3.10'
33
33
  spec.add_development_dependency 'dotenv', '~> 2.7', '>= 2.7'
34
- spec.add_development_dependency 'pry', '~> 0.12.0'
35
- spec.add_development_dependency 'tty-prompt', '~> 0.18'
36
- spec.add_development_dependency 'simplecov', '~> 0.16'
37
- spec.add_development_dependency 'spinning_wheel', '~> 0.1'
34
+ spec.add_development_dependency 'pry', '~> 0.13'
35
+ spec.add_development_dependency 'tty-prompt', '~> 0.22'
36
+ spec.add_development_dependency 'simplecov', '~> 0.19'
37
+ spec.add_development_dependency 'spinning_wheel', '~> 0.2.2'
38
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six_saferpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fadendaten GmbH
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-03-04 00:00:00.000000000 Z
12
+ date: 2021-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -17,34 +17,34 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '5.0'
20
+ version: '6.1'
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 5.0.0.0
23
+ version: 6.1.3
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - "~>"
29
29
  - !ruby/object:Gem::Version
30
- version: '5.0'
30
+ version: '6.1'
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.0.0.0
33
+ version: 6.1.3
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: bundler
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.0'
40
+ version: '2.1'
41
41
  type: :development
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '2.1'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rake
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -99,20 +99,20 @@ dependencies:
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '3.5'
102
+ version: '3.10'
103
103
  - - ">="
104
104
  - !ruby/object:Gem::Version
105
- version: 3.5.1
105
+ version: '3.10'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: '3.5'
112
+ version: '3.10'
113
113
  - - ">="
114
114
  - !ruby/object:Gem::Version
115
- version: 3.5.1
115
+ version: '3.10'
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: dotenv
118
118
  requirement: !ruby/object:Gem::Requirement
@@ -139,56 +139,56 @@ dependencies:
139
139
  requirements:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
- version: 0.12.0
142
+ version: '0.13'
143
143
  type: :development
144
144
  prerelease: false
145
145
  version_requirements: !ruby/object:Gem::Requirement
146
146
  requirements:
147
147
  - - "~>"
148
148
  - !ruby/object:Gem::Version
149
- version: 0.12.0
149
+ version: '0.13'
150
150
  - !ruby/object:Gem::Dependency
151
151
  name: tty-prompt
152
152
  requirement: !ruby/object:Gem::Requirement
153
153
  requirements:
154
154
  - - "~>"
155
155
  - !ruby/object:Gem::Version
156
- version: '0.18'
156
+ version: '0.22'
157
157
  type: :development
158
158
  prerelease: false
159
159
  version_requirements: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - "~>"
162
162
  - !ruby/object:Gem::Version
163
- version: '0.18'
163
+ version: '0.22'
164
164
  - !ruby/object:Gem::Dependency
165
165
  name: simplecov
166
166
  requirement: !ruby/object:Gem::Requirement
167
167
  requirements:
168
168
  - - "~>"
169
169
  - !ruby/object:Gem::Version
170
- version: '0.16'
170
+ version: '0.19'
171
171
  type: :development
172
172
  prerelease: false
173
173
  version_requirements: !ruby/object:Gem::Requirement
174
174
  requirements:
175
175
  - - "~>"
176
176
  - !ruby/object:Gem::Version
177
- version: '0.16'
177
+ version: '0.19'
178
178
  - !ruby/object:Gem::Dependency
179
179
  name: spinning_wheel
180
180
  requirement: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - "~>"
183
183
  - !ruby/object:Gem::Version
184
- version: '0.1'
184
+ version: 0.2.2
185
185
  type: :development
186
186
  prerelease: false
187
187
  version_requirements: !ruby/object:Gem::Requirement
188
188
  requirements:
189
189
  - - "~>"
190
190
  - !ruby/object:Gem::Version
191
- version: '0.1'
191
+ version: 0.2.2
192
192
  description: This Gem helps you consume the SIX Saferpay API. Accoring the documentation
193
193
  of API of SIX Saferpay you can define your request models and get a response object
194
194
  back.
@@ -277,6 +277,8 @@ files:
277
277
  - lib/six_saferpay/models/alias_card.rb
278
278
  - lib/six_saferpay/models/alipay.rb
279
279
  - lib/six_saferpay/models/amount.rb
280
+ - lib/six_saferpay/models/authentication.rb
281
+ - lib/six_saferpay/models/authentication_result.rb
280
282
  - lib/six_saferpay/models/bancontact.rb
281
283
  - lib/six_saferpay/models/bank_account.rb
282
284
  - lib/six_saferpay/models/bankcontact.rb
@@ -288,7 +290,9 @@ files:
288
290
  - lib/six_saferpay/models/card_form.rb
289
291
  - lib/six_saferpay/models/check.rb
290
292
  - lib/six_saferpay/models/check_result.rb
293
+ - lib/six_saferpay/models/chosen_plan.rb
291
294
  - lib/six_saferpay/models/client_info.rb
295
+ - lib/six_saferpay/models/custom_plan.rb
292
296
  - lib/six_saferpay/models/dcc.rb
293
297
  - lib/six_saferpay/models/delivery_address.rb
294
298
  - lib/six_saferpay/models/delivery_address_form.rb
@@ -296,12 +300,16 @@ files:
296
300
  - lib/six_saferpay/models/error.rb
297
301
  - lib/six_saferpay/models/fee.rb
298
302
  - lib/six_saferpay/models/fee_refund.rb
303
+ - lib/six_saferpay/models/first_installment_amount.rb
299
304
  - lib/six_saferpay/models/fraud_free.rb
300
305
  - lib/six_saferpay/models/ideal.rb
301
306
  - lib/six_saferpay/models/installment.rb
307
+ - lib/six_saferpay/models/installment_fee.rb
308
+ - lib/six_saferpay/models/installment_plans.rb
302
309
  - lib/six_saferpay/models/invoice.rb
303
310
  - lib/six_saferpay/models/liability.rb
304
311
  - lib/six_saferpay/models/marketplace.rb
312
+ - lib/six_saferpay/models/mastercard_issuer_installments.rb
305
313
  - lib/six_saferpay/models/notification.rb
306
314
  - lib/six_saferpay/models/options.rb
307
315
  - lib/six_saferpay/models/payee.rb
@@ -330,7 +338,9 @@ files:
330
338
  - lib/six_saferpay/models/saferpay_fields.rb
331
339
  - lib/six_saferpay/models/six_transaction.rb
332
340
  - lib/six_saferpay/models/styling.rb
341
+ - lib/six_saferpay/models/subsequent_installment_amount.rb
333
342
  - lib/six_saferpay/models/three_ds.rb
343
+ - lib/six_saferpay/models/total_amont_due.rb
334
344
  - lib/six_saferpay/models/transaction.rb
335
345
  - lib/six_saferpay/models/transaction_reference.rb
336
346
  - lib/six_saferpay/models/twint.rb
@@ -358,8 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
358
368
  - !ruby/object:Gem::Version
359
369
  version: '0'
360
370
  requirements: []
361
- rubyforge_project:
362
- rubygems_version: 2.7.6
371
+ rubygems_version: 3.1.4
363
372
  signing_key:
364
373
  specification_version: 4
365
374
  summary: Gem for the SIX Saferpay API