six_saferpay 2.1.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.test.env +1 -1
  4. data/.travis.yml +4 -2
  5. data/Gemfile.lock +70 -85
  6. data/README.md +18 -0
  7. data/lib/six_saferpay/api.rb +1 -1
  8. data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +4 -0
  9. data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +11 -2
  10. data/lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb +61 -0
  11. data/lib/six_saferpay/api/six_secure_pay_gate_offer/responses/create_offer_response.rb +26 -0
  12. data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +4 -0
  13. data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +4 -0
  14. data/lib/six_saferpay/api/six_transaction/requests/capture.rb +11 -2
  15. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +4 -0
  16. data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +11 -2
  17. data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +11 -3
  18. data/lib/six_saferpay/client.rb +8 -2
  19. data/lib/six_saferpay/clients/secure_pay_gate_api/client.rb +23 -0
  20. data/lib/six_saferpay/models/address.rb +4 -4
  21. data/lib/six_saferpay/models/authentication.rb +36 -0
  22. data/lib/six_saferpay/models/authentication_result.rb +20 -0
  23. data/lib/six_saferpay/models/check_result.rb +6 -2
  24. data/lib/six_saferpay/models/chosen_plan.rb +62 -0
  25. data/lib/six_saferpay/models/custom_plan.rb +4 -0
  26. data/lib/six_saferpay/models/first_installment_amount.rb +4 -0
  27. data/lib/six_saferpay/models/ideal.rb +18 -0
  28. data/lib/six_saferpay/models/installment_fee.rb +4 -0
  29. data/lib/six_saferpay/models/installment_plans.rb +73 -0
  30. data/lib/six_saferpay/models/mastercard_issuer_installments.rb +49 -0
  31. data/lib/six_saferpay/models/payment_methods_options.rb +4 -2
  32. data/lib/six_saferpay/models/registration_result.rb +11 -2
  33. data/lib/six_saferpay/models/request_payment_means.rb +6 -2
  34. data/lib/six_saferpay/models/saferpay_fields.rb +18 -0
  35. data/lib/six_saferpay/models/subsequent_installment_amount.rb +4 -0
  36. data/lib/six_saferpay/models/total_amont_due.rb +4 -0
  37. data/lib/six_saferpay/version.rb +1 -1
  38. data/six_saferpay.gemspec +8 -8
  39. metadata +38 -24
@@ -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
@@ -1,15 +1,17 @@
1
1
  module SixSaferpay
2
2
  class PaymentMethodsOptions
3
3
 
4
- attr_accessor(:alipay)
4
+ attr_accessor(:alipay, :ideal)
5
5
 
6
- def initialize(alipay: nil)
6
+ def initialize(alipay: nil, ideal: nil)
7
7
  @alipay = SixSaferpay::Alipay.new(alipay.to_h) if alipay
8
+ @ideal = SixSaferpay::Ideal.new(ideal.to_h) if ideal
8
9
  end
9
10
 
10
11
  def to_hash
11
12
  hash = Hash.new
12
13
  hash.merge!(alipay: @alipay.to_h) if @alipay
14
+ hash.merge!(ideal: @ideal.to_h) if @ideal
13
15
  hash
14
16
  end
15
17
  alias_method :to_h, :to_hash
@@ -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
@@ -3,16 +3,19 @@ module SixSaferpay
3
3
 
4
4
  attr_accessor(:card,
5
5
  :bank_account,
6
- :fd_alias
6
+ :fd_alias,
7
+ :saferpay_fields
7
8
  )
8
9
 
9
10
  def initialize(card: nil,
10
11
  bank_account: nil,
11
- fd_alias: nil
12
+ fd_alias: nil,
13
+ saferpay_fields: nil
12
14
  )
13
15
  @card = SixSaferpay::RequestCard.new(card.to_h) if card
14
16
  @bank_account = SixSaferpay::BankAccount.new(bank_account.to_h) if bank_account
15
17
  @fd_alias = SixSaferpay::PaymentMeansAlias.new(fd_alias.to_h) if fd_alias
18
+ @saferpay_fields = SixSaferpay::SaferpayFields.new(saferpay_fields.to_h) if saferpay_fields
16
19
  end
17
20
 
18
21
  def to_hash
@@ -20,6 +23,7 @@ module SixSaferpay
20
23
  hash.merge!(card: @card.to_h) if @card
21
24
  hash.merge!(bank_account: @bank_account.to_h) if @bank_account
22
25
  hash.merge!(fd_alias: @fd_alias.to_h) if @fd_alias
26
+ hash.merge!(saferpay_fields: @saferpay_fields.to_h) if @saferpay_fields
23
27
  hash
24
28
  end
25
29
  alias_method :to_h, :to_hash
@@ -0,0 +1,18 @@
1
+ module SixSaferpay
2
+ class SaferpayFields
3
+
4
+ attr_accessor :token
5
+
6
+ def initialize(token: )
7
+ @token = token
8
+ end
9
+
10
+ def to_hash
11
+ hash = Hash.new
12
+ hash.merge!(token: @token) if @token
13
+ hash
14
+ end
15
+ alias_method :to_h, :to_hash
16
+
17
+ end
18
+ end
@@ -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.1.0"
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'
29
- spec.add_development_dependency 'rake', '~> 10.0'
28
+ spec.add_development_dependency 'bundler', '~> 2.1'
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.1.0
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: 2019-11-12 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,48 +17,48 @@ 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
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.0'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: rspec
64
64
  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.
@@ -232,6 +232,8 @@ files:
232
232
  - lib/six_saferpay/api/six_secure_card_data/responses/insert_direct_response.rb
233
233
  - lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb
234
234
  - lib/six_saferpay/api/six_secure_card_data/responses/update_response.rb
235
+ - lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb
236
+ - lib/six_saferpay/api/six_secure_pay_gate_offer/responses/create_offer_response.rb
235
237
  - lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb
236
238
  - lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb
237
239
  - lib/six_saferpay/api/six_transaction/requests/assert_capture.rb
@@ -267,6 +269,7 @@ files:
267
269
  - lib/six_saferpay/api/six_transaction/responses/refund_direct_response.rb
268
270
  - lib/six_saferpay/api/six_transaction/responses/refund_response.rb
269
271
  - lib/six_saferpay/client.rb
272
+ - lib/six_saferpay/clients/secure_pay_gate_api/client.rb
270
273
  - lib/six_saferpay/errors/error.rb
271
274
  - lib/six_saferpay/models/address.rb
272
275
  - lib/six_saferpay/models/address_form.rb
@@ -274,6 +277,8 @@ files:
274
277
  - lib/six_saferpay/models/alias_card.rb
275
278
  - lib/six_saferpay/models/alipay.rb
276
279
  - lib/six_saferpay/models/amount.rb
280
+ - lib/six_saferpay/models/authentication.rb
281
+ - lib/six_saferpay/models/authentication_result.rb
277
282
  - lib/six_saferpay/models/bancontact.rb
278
283
  - lib/six_saferpay/models/bank_account.rb
279
284
  - lib/six_saferpay/models/bankcontact.rb
@@ -285,7 +290,9 @@ files:
285
290
  - lib/six_saferpay/models/card_form.rb
286
291
  - lib/six_saferpay/models/check.rb
287
292
  - lib/six_saferpay/models/check_result.rb
293
+ - lib/six_saferpay/models/chosen_plan.rb
288
294
  - lib/six_saferpay/models/client_info.rb
295
+ - lib/six_saferpay/models/custom_plan.rb
289
296
  - lib/six_saferpay/models/dcc.rb
290
297
  - lib/six_saferpay/models/delivery_address.rb
291
298
  - lib/six_saferpay/models/delivery_address_form.rb
@@ -293,11 +300,16 @@ files:
293
300
  - lib/six_saferpay/models/error.rb
294
301
  - lib/six_saferpay/models/fee.rb
295
302
  - lib/six_saferpay/models/fee_refund.rb
303
+ - lib/six_saferpay/models/first_installment_amount.rb
296
304
  - lib/six_saferpay/models/fraud_free.rb
305
+ - lib/six_saferpay/models/ideal.rb
297
306
  - lib/six_saferpay/models/installment.rb
307
+ - lib/six_saferpay/models/installment_fee.rb
308
+ - lib/six_saferpay/models/installment_plans.rb
298
309
  - lib/six_saferpay/models/invoice.rb
299
310
  - lib/six_saferpay/models/liability.rb
300
311
  - lib/six_saferpay/models/marketplace.rb
312
+ - lib/six_saferpay/models/mastercard_issuer_installments.rb
301
313
  - lib/six_saferpay/models/notification.rb
302
314
  - lib/six_saferpay/models/options.rb
303
315
  - lib/six_saferpay/models/payee.rb
@@ -323,9 +335,12 @@ files:
323
335
  - lib/six_saferpay/models/response_header.rb
324
336
  - lib/six_saferpay/models/response_payment_means.rb
325
337
  - lib/six_saferpay/models/return_urls.rb
338
+ - lib/six_saferpay/models/saferpay_fields.rb
326
339
  - lib/six_saferpay/models/six_transaction.rb
327
340
  - lib/six_saferpay/models/styling.rb
341
+ - lib/six_saferpay/models/subsequent_installment_amount.rb
328
342
  - lib/six_saferpay/models/three_ds.rb
343
+ - lib/six_saferpay/models/total_amont_due.rb
329
344
  - lib/six_saferpay/models/transaction.rb
330
345
  - lib/six_saferpay/models/transaction_reference.rb
331
346
  - lib/six_saferpay/models/twint.rb
@@ -353,8 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
368
  - !ruby/object:Gem::Version
354
369
  version: '0'
355
370
  requirements: []
356
- rubyforge_project:
357
- rubygems_version: 2.7.6
371
+ rubygems_version: 3.1.4
358
372
  signing_key:
359
373
  specification_version: 4
360
374
  summary: Gem for the SIX Saferpay API