six_saferpay 2.4.0 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -2
  3. data/README.md +2 -2
  4. data/Thorfile +1 -0
  5. data/lib/generators/models.rb +100 -0
  6. data/lib/generators/templates/fabric.erb +13 -0
  7. data/lib/generators/templates/model.erb +64 -0
  8. data/lib/generators/templates/spec.erb +24 -0
  9. data/lib/six_saferpay.rb +5 -0
  10. data/lib/six_saferpay/api.rb +1 -1
  11. data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +10 -2
  12. data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +8 -2
  13. data/lib/six_saferpay/api/six_secure_card_data/requests/insert.rb +6 -2
  14. data/lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb +9 -4
  15. data/lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb +6 -2
  16. data/lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb +11 -2
  17. data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +10 -2
  18. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +10 -2
  19. data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +10 -2
  20. data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +8 -2
  21. data/lib/six_saferpay/api/six_transaction/responses/query_alternative_payment_response.rb +11 -2
  22. data/lib/six_saferpay/models/card_form.rb +11 -2
  23. data/lib/six_saferpay/models/fraud_prevention.rb +24 -0
  24. data/lib/six_saferpay/models/items.rb +84 -0
  25. data/lib/six_saferpay/models/options.rb +15 -3
  26. data/lib/six_saferpay/models/order.rb +27 -0
  27. data/lib/six_saferpay/models/payer.rb +8 -2
  28. data/lib/six_saferpay/models/payer_profile.rb +105 -0
  29. data/lib/six_saferpay/models/phone.rb +36 -0
  30. data/lib/six_saferpay/models/risk_factors.rb +39 -0
  31. data/lib/six_saferpay/version.rb +1 -1
  32. data/six_saferpay.gemspec +3 -2
  33. metadata +31 -12
@@ -1,7 +1,9 @@
1
1
  module SixSaferpay
2
2
  class Payer
3
3
 
4
- attr_accessor(:ip_address,
4
+ attr_accessor(
5
+ :id,
6
+ :ip_address,
5
7
  :ip_location,
6
8
  :language_code,
7
9
  :delivery_address,
@@ -9,12 +11,15 @@ module SixSaferpay
9
11
  )
10
12
 
11
13
 
12
- def initialize(ip_address: nil,
14
+ def initialize(
15
+ id: nil,
16
+ ip_address: nil,
13
17
  ip_location: nil,
14
18
  language_code: nil,
15
19
  delivery_address: nil,
16
20
  billing_address: nil
17
21
  )
22
+ @id = id
18
23
  @ip_address = ip_address
19
24
  @ip_location = ip_location
20
25
  @language_code = language_code
@@ -24,6 +29,7 @@ module SixSaferpay
24
29
 
25
30
  def to_hash
26
31
  hash = Hash.new
32
+ hash.merge!(id: @id) if @id
27
33
  hash.merge!(ip_address: @ip_address) if @ip_address
28
34
  hash.merge!(ip_location: @ip_location) if @ip_location
29
35
  hash.merge!(language_code: @language_code) if @language_code
@@ -0,0 +1,105 @@
1
+ module SixSaferpay
2
+ class PayerProfile
3
+
4
+ attr_accessor(
5
+ :has_account,
6
+ :has_password,
7
+ :password_forgotten,
8
+ :first_name,
9
+ :last_name,
10
+ :company,
11
+ :date_of_birth,
12
+ :last_login_date,
13
+ :gender,
14
+ :creation_date,
15
+ :password_last_change_date,
16
+ :email,
17
+ :secondary_email,
18
+ :phone,
19
+ )
20
+
21
+ def initialize(
22
+ has_account: nil,
23
+ has_password: nil,
24
+ password_forgotten: nil,
25
+ first_name: nil,
26
+ last_name: nil,
27
+ company: nil,
28
+ date_of_birth: nil,
29
+ last_login_date: nil,
30
+ gender: nil,
31
+ creation_date: nil,
32
+ password_last_change_date: nil,
33
+ email: nil,
34
+ secondary_email: nil,
35
+ phone: nil
36
+ )
37
+ @has_account = has_account
38
+ @has_password = has_password
39
+ @password_forgotten = password_forgotten
40
+ @first_name = first_name
41
+ @last_name = last_name
42
+ @company = company
43
+ @date_of_birth = date_of_birth
44
+ @last_login_date = last_login_date
45
+ @gender = gender
46
+ @creation_date = creation_date
47
+ @password_last_change_date = password_last_change_date
48
+ @email = email
49
+ @secondary_email = secondary_email
50
+
51
+ if phone
52
+ @phone = SixSaferpay::Phone.new(phone.to_h)
53
+ end
54
+ end
55
+
56
+ def to_hash
57
+ hash = Hash.new
58
+ if !@has_account.nil?
59
+ hash.merge!(has_account: @has_account)
60
+ end
61
+ if !@has_password.nil?
62
+ hash.merge!(has_password: @has_password)
63
+ end
64
+ if !@password_forgotten.nil?
65
+ hash.merge!(password_forgotten: @password_forgotten)
66
+ end
67
+ if @first_name
68
+ hash.merge!(first_name: @first_name)
69
+ end
70
+ if @last_name
71
+ hash.merge!(last_name: @last_name)
72
+ end
73
+ if @company
74
+ hash.merge!(company: @company)
75
+ end
76
+ if @date_of_birth
77
+ hash.merge!(date_of_birth: @date_of_birth)
78
+ end
79
+ if @last_login_date
80
+ hash.merge!(last_login_date: @last_login_date)
81
+ end
82
+ if @gender
83
+ hash.merge!(gender: @gender)
84
+ end
85
+ if @creation_date
86
+ hash.merge!(creation_date: @creation_date)
87
+ end
88
+ if @password_last_change_date
89
+ hash.merge!(password_last_change_date: @password_last_change_date)
90
+ end
91
+ if @email
92
+ hash.merge!(email: @email)
93
+ end
94
+ if @secondary_email
95
+ hash.merge!(secondary_email: @secondary_email)
96
+ end
97
+ if @phone
98
+ hash.merge!(phone: @phone.to_h)
99
+ end
100
+ hash
101
+ end
102
+ alias_method :to_h, :to_hash
103
+
104
+ end
105
+ end
@@ -0,0 +1,36 @@
1
+ module SixSaferpay
2
+ class Phone
3
+
4
+ attr_accessor(
5
+ :main,
6
+ :mobile,
7
+ :work,
8
+ )
9
+
10
+ def initialize(
11
+ main: nil,
12
+ mobile: nil,
13
+ work: nil
14
+ )
15
+ @main = main
16
+ @mobile = mobile
17
+ @work = work
18
+ end
19
+
20
+ def to_hash
21
+ hash = Hash.new
22
+ if @main
23
+ hash.merge!(main: @main)
24
+ end
25
+ if @mobile
26
+ hash.merge!(mobile: @mobile)
27
+ end
28
+ if @work
29
+ hash.merge!(work: @work)
30
+ end
31
+ hash
32
+ end
33
+ alias_method :to_h, :to_hash
34
+
35
+ end
36
+ end
@@ -0,0 +1,39 @@
1
+ module SixSaferpay
2
+ class RiskFactors
3
+
4
+ attr_accessor(
5
+ :delivery_type,
6
+ :payer_profile,
7
+ :is_b2b,
8
+ )
9
+
10
+ def initialize(
11
+ delivery_type: nil,
12
+ payer_profile: nil,
13
+ is_b2b: nil
14
+ )
15
+ @delivery_type = delivery_type
16
+
17
+ if payer_profile
18
+ @payer_profile = SixSaferpay::PayerProfile.new(payer_profile.to_h)
19
+ end
20
+ @is_b2b = is_b2b
21
+ end
22
+
23
+ def to_hash
24
+ hash = Hash.new
25
+ if @delivery_type
26
+ hash.merge!(delivery_type: @delivery_type)
27
+ end
28
+ if @payer_profile
29
+ hash.merge!(payer_profile: @payer_profile.to_h)
30
+ end
31
+ if !@is_b2b.nil?
32
+ hash.merge!(is_b2b: @is_b2b)
33
+ end
34
+ hash
35
+ end
36
+ alias_method :to_h, :to_hash
37
+
38
+ end
39
+ end
@@ -1,3 +1,3 @@
1
1
  module SixSaferpay
2
- VERSION = "2.4.0"
2
+ VERSION = "2.8.1"
3
3
  end
data/six_saferpay.gemspec CHANGED
@@ -23,7 +23,7 @@ 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', '~> 6.1', '>= 6.1.3'
26
+ spec.add_runtime_dependency 'activesupport', '~> 5.2'
27
27
 
28
28
  spec.add_development_dependency 'bundler', '~> 2.1'
29
29
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -31,8 +31,9 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'vcr', '~> 4.0', '>= 4.0.0'
32
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.13'
34
+ spec.add_development_dependency 'pry', '~> 0.14'
35
35
  spec.add_development_dependency 'tty-prompt', '~> 0.22'
36
36
  spec.add_development_dependency 'simplecov', '~> 0.19'
37
37
  spec.add_development_dependency 'spinning_wheel', '~> 0.2.2'
38
+ spec.add_development_dependency 'thor', '~> 1.1.0'
38
39
  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.4.0
4
+ version: 2.8.1
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: 2021-02-17 00:00:00.000000000 Z
12
+ date: 2021-03-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -17,20 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '6.1'
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 6.1.3
20
+ version: '5.2'
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
25
  - - "~>"
29
26
  - !ruby/object:Gem::Version
30
- version: '6.1'
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 6.1.3
27
+ version: '5.2'
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: bundler
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -139,14 +133,14 @@ dependencies:
139
133
  requirements:
140
134
  - - "~>"
141
135
  - !ruby/object:Gem::Version
142
- version: '0.13'
136
+ version: '0.14'
143
137
  type: :development
144
138
  prerelease: false
145
139
  version_requirements: !ruby/object:Gem::Requirement
146
140
  requirements:
147
141
  - - "~>"
148
142
  - !ruby/object:Gem::Version
149
- version: '0.13'
143
+ version: '0.14'
150
144
  - !ruby/object:Gem::Dependency
151
145
  name: tty-prompt
152
146
  requirement: !ruby/object:Gem::Requirement
@@ -189,6 +183,20 @@ dependencies:
189
183
  - - "~>"
190
184
  - !ruby/object:Gem::Version
191
185
  version: 0.2.2
186
+ - !ruby/object:Gem::Dependency
187
+ name: thor
188
+ requirement: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - "~>"
191
+ - !ruby/object:Gem::Version
192
+ version: 1.1.0
193
+ type: :development
194
+ prerelease: false
195
+ version_requirements: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - "~>"
198
+ - !ruby/object:Gem::Version
199
+ version: 1.1.0
192
200
  description: This Gem helps you consume the SIX Saferpay API. Accoring the documentation
193
201
  of API of SIX Saferpay you can define your request models and get a response object
194
202
  back.
@@ -208,8 +216,13 @@ files:
208
216
  - LICENSE.txt
209
217
  - README.md
210
218
  - Rakefile
219
+ - Thorfile
211
220
  - bin/console
212
221
  - bin/setup
222
+ - lib/generators/models.rb
223
+ - lib/generators/templates/fabric.erb
224
+ - lib/generators/templates/model.erb
225
+ - lib/generators/templates/spec.erb
213
226
  - lib/six_saferpay.rb
214
227
  - lib/six_saferpay/api.rb
215
228
  - lib/six_saferpay/api/six_batch/requests/close.rb
@@ -302,24 +315,29 @@ files:
302
315
  - lib/six_saferpay/models/fee_refund.rb
303
316
  - lib/six_saferpay/models/first_installment_amount.rb
304
317
  - lib/six_saferpay/models/fraud_free.rb
318
+ - lib/six_saferpay/models/fraud_prevention.rb
305
319
  - lib/six_saferpay/models/ideal.rb
306
320
  - lib/six_saferpay/models/installment.rb
307
321
  - lib/six_saferpay/models/installment_fee.rb
308
322
  - lib/six_saferpay/models/installment_plans.rb
309
323
  - lib/six_saferpay/models/invoice.rb
324
+ - lib/six_saferpay/models/items.rb
310
325
  - lib/six_saferpay/models/liability.rb
311
326
  - lib/six_saferpay/models/marketplace.rb
312
327
  - lib/six_saferpay/models/mastercard_issuer_installments.rb
313
328
  - lib/six_saferpay/models/notification.rb
314
329
  - lib/six_saferpay/models/options.rb
330
+ - lib/six_saferpay/models/order.rb
315
331
  - lib/six_saferpay/models/payee.rb
316
332
  - lib/six_saferpay/models/payer.rb
317
333
  - lib/six_saferpay/models/payer_amount.rb
334
+ - lib/six_saferpay/models/payer_profile.rb
318
335
  - lib/six_saferpay/models/payment.rb
319
336
  - lib/six_saferpay/models/payment_means_alias.rb
320
337
  - lib/six_saferpay/models/payment_method_options.rb
321
338
  - lib/six_saferpay/models/payment_methods_options.rb
322
339
  - lib/six_saferpay/models/pending_notification.rb
340
+ - lib/six_saferpay/models/phone.rb
323
341
  - lib/six_saferpay/models/processing_data.rb
324
342
  - lib/six_saferpay/models/recurring.rb
325
343
  - lib/six_saferpay/models/redirect.rb
@@ -335,6 +353,7 @@ files:
335
353
  - lib/six_saferpay/models/response_header.rb
336
354
  - lib/six_saferpay/models/response_payment_means.rb
337
355
  - lib/six_saferpay/models/return_urls.rb
356
+ - lib/six_saferpay/models/risk_factors.rb
338
357
  - lib/six_saferpay/models/saferpay_fields.rb
339
358
  - lib/six_saferpay/models/six_transaction.rb
340
359
  - lib/six_saferpay/models/styling.rb