six_saferpay 2.5.0 → 2.6.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: ccc4e59b09497c4bd69e43e3c83f144e0b77ed3b5fa3ab3c1a9ece66540f4b07
4
- data.tar.gz: 5eb1be3135c3aa1eb253e8d0af0b0b5f9cda983466c5f861e3d4c01d05ad5b8a
3
+ metadata.gz: ad6ce329906e3637162ceec4bc1f5e4e332053f36c35062d9eb3022b9c5b01b0
4
+ data.tar.gz: 6aa4715cc53630b12bb69b8ab91300eb02011edf57fa5d856199c3a5474ac531
5
5
  SHA512:
6
- metadata.gz: 2dc5c3e36ea120537bd0340e8d1b5228b795cadde23f6bdcfc6ab1da0ec5377f4ba85ab6f2cf877bace1e5a40511150b66c7ddb54d6fbb9ec604486ba316eb98
7
- data.tar.gz: 20b80970bc27a450d1ecf2fb5569d11a68f0b9ae9e688c6c934d9cfa60c15379efe725d08f1555bbe43a0e76c8c275638ebeb3deaacb963e04ee091ef5481c59
6
+ metadata.gz: 15ff9f7bcbf264337275e4f2ee73a68d267c4e0e2bcfb0c1eaf58453bb9ae523a502d88a9c222979e04f743ea16614c8b66fe2a255fed9fdd510503f2e7f07e8
7
+ data.tar.gz: f9381e3c98e9d2ce9021873c19395cb3572c14f49e9c665cfe4dccb724059771f00bfa8b2c66cfbe9c0c1fc32a75111d97e2f0906c3334044a9d5d694b34cf1e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- six_saferpay (2.5.0)
4
+ six_saferpay (2.6.0)
5
5
  activesupport (~> 6.1, >= 6.1.3)
6
6
 
7
7
  GEM
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.17`
9
+ This gem is compatible with the SIX API version: `1.18`
10
10
 
11
11
  ## Installation
12
12
 
@@ -75,7 +75,11 @@ module SixSaferpay
75
75
  end
76
76
 
77
77
  def string?
78
- @type == "String"
78
+ @type.downcase == "string"
79
+ end
80
+
81
+ def boolean?
82
+ @type.downcase == "boolean"
79
83
  end
80
84
 
81
85
  def to_s
@@ -2,11 +2,9 @@ SpinningWheel.define do
2
2
  fabric name: '<%= file_name %>', class_name: 'SixSaferpay::<%= name %>' do
3
3
  <%- attributes.each do |attr| -%>
4
4
  <%- if attr.string? -%>
5
- <%- if attr.mandatory? -%>
6
5
  <%= "#{attr.name} { ' ' }" %>
7
- <%- else -%>
8
- <%= "#{attr.name} { nil }" %>
9
- <%- end -%>
6
+ <%- elsif attr.boolean? -%>
7
+ <%= "#{attr.name} { true }" %>
10
8
  <%- else -%>
11
9
  <%= "#{attr.name} { SpinningWheel.create('#{attr.name}') }" %>
12
10
  <%- end -%>
@@ -19,7 +19,7 @@ module SixSaferpay
19
19
  <%- end %>
20
20
  )
21
21
  <%- attributes.each_with_index do |attr, index| -%>
22
- <%- if attr.string? -%>
22
+ <%- if attr.string? || attr.boolean? -%>
23
23
  <%= "@#{attr.name} = "-%><%= "#{attr.name}" %>
24
24
  <%- else -%>
25
25
  <%- %>
@@ -36,11 +36,19 @@ module SixSaferpay
36
36
  <%- attributes.each do |attr| -%>
37
37
  <%- if attr.string? -%>
38
38
  <%- if attr.mandatory? -%>
39
+ <%= "hash.merge!(#{attr.name}: @#{attr.name})" %>
40
+ <%- else -%>
39
41
  <%= "if @#{attr.name}" %>
40
42
  <%= "hash.merge!(#{attr.name}: @#{attr.name})" %>
41
43
  <%= "end" %>
42
- <%- else -%>
44
+ <%- end -%>
45
+ <%- elsif attr.boolean? -%>
46
+ <%- if attr.mandatory? -%>
43
47
  <%= "hash.merge!(#{attr.name}: @#{attr.name})" %>
48
+ <%- else -%>
49
+ <%= "if !@#{attr.name}.nil?" %>
50
+ <%= "hash.merge!(#{attr.name}: @#{attr.name})" %>
51
+ <%= "end" %>
44
52
  <%- end -%>
45
53
  <%- else -%>
46
54
  <%= "if @#{attr.name}" %>
@@ -7,7 +7,7 @@ subject { SpinningWheel.create('<%= file_name %>') }
7
7
  let(:hash) {
8
8
  {
9
9
  <%- attributes.each do |attr| -%>
10
- <%- if attr.string? -%>
10
+ <%- if attr.string? || attr.boolean? -%>
11
11
  <%= attr.name %>: subject.<%= attr.name %>,
12
12
  <%- else -%>
13
13
  <%= attr.name %>: subject.<%= attr.name %>.to_h,
@@ -1,5 +1,5 @@
1
1
  module SixSaferpay
2
2
  module API
3
- VERSION = '1.17'
3
+ VERSION = '1.18'
4
4
  end
5
5
  end
@@ -19,7 +19,9 @@ module SixSaferpay
19
19
  :billing_address_form,
20
20
  :delivery_address_form,
21
21
  :card_form,
22
- :condition
22
+ :condition,
23
+ :order,
24
+ :risk_factors
23
25
  )
24
26
 
25
27
  def initialize(request_header: nil,
@@ -38,7 +40,9 @@ module SixSaferpay
38
40
  billing_address_form: nil,
39
41
  delivery_address_form: nil,
40
42
  card_form: nil,
41
- condition: nil
43
+ condition: nil,
44
+ order: nil,
45
+ risk_factors: nil
42
46
  )
43
47
  @request_header = request_header || SixSaferpay::RequestHeader.new()
44
48
  @config_set = config_set
@@ -57,6 +61,8 @@ module SixSaferpay
57
61
  @delivery_address_form = SixSaferpay::DeliveryAddressForm.new(delivery_address_form.to_h) if delivery_address_form
58
62
  @card_form = SixSaferpay::CardForm.new(card_form.to_h) if card_form
59
63
  @condition = condition
64
+ @order = SixSaferpay::Order.new(order.to_h) if order
65
+ @risk_factors = SixSaferpay::RiskFactors.new(risk_factors.to_h) if risk_factors
60
66
  end
61
67
 
62
68
  def to_hash
@@ -78,6 +84,8 @@ module SixSaferpay
78
84
  hash.merge!(delivery_address_form: @delivery_address_form.to_h) if @delivery_address_form
79
85
  hash.merge!(card_form: @card_form.to_h) if @card_form
80
86
  hash.merge!(condition: @condition) if @condition
87
+ hash.merge!(order: @order.to_h) if @order
88
+ hash.merge!(risk_factors: @risk_factors.to_h) if @risk_factors
81
89
  hash
82
90
  end
83
91
  alias_method :to_h, :to_hash
@@ -6,14 +6,16 @@ module SixSaferpay
6
6
  :expiration_date,
7
7
  :config_set,
8
8
  :payer,
9
- :billing_address_form
9
+ :billing_address_form,
10
+ :register_alias,
10
11
  )
11
12
 
12
13
  def initialize(payment: ,
13
14
  expiration_date: ,
14
15
  config_set: nil,
15
16
  payer: ,
16
- billing_address_form: nil
17
+ billing_address_form: nil,
18
+ register_alias: nil
17
19
  )
18
20
 
19
21
  @payment = SixSaferpay::Payment.new(payment.to_h) if payment
@@ -22,6 +24,7 @@ module SixSaferpay
22
24
  @payer = SixSaferpay::Payer.new(payer.to_h) if payer
23
25
  @billing_address_form =
24
26
  SixSaferpay::BillingAddressForm.new(billing_address_form) if billing_address_form
27
+ @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
25
28
  end
26
29
 
27
30
  def to_hash
@@ -31,6 +34,7 @@ module SixSaferpay
31
34
  hash.merge!(config_set: @config_set) if @config_set
32
35
  hash.merge!(payer: @payer.to_h) if @payer
33
36
  hash.merge!(billing_address_form: @billing_address_form.to_h) if @billing_address_form
37
+ hash.merge!(register_alias: @register_alias.to_h) if @register_alias
34
38
  hash
35
39
  end
36
40
  alias_method :to_h, :to_hash
@@ -14,7 +14,9 @@ module SixSaferpay
14
14
  :styling,
15
15
  :wallet,
16
16
  :payment_methods,
17
- :card_form
17
+ :card_form,
18
+ :order,
19
+ :risk_factors
18
20
  )
19
21
 
20
22
 
@@ -29,7 +31,9 @@ module SixSaferpay
29
31
  styling: nil,
30
32
  wallet: nil,
31
33
  payment_methods: nil,
32
- card_form: nil
34
+ card_form: nil,
35
+ order: nil,
36
+ risk_factors: nil
33
37
  )
34
38
  @request_header = request_header || SixSaferpay::RequestHeader.new()
35
39
  @config_set = config_set
@@ -43,6 +47,8 @@ module SixSaferpay
43
47
  @wallet = SixSaferpay::Wallet.new(wallet.to_h) if wallet
44
48
  @payment_methods = payment_methods
45
49
  @card_form = SixSaferpay::CardForm.new(card_form.to_h) if card_form
50
+ @order = SixSaferpay::Order.new(order.to_h) if order
51
+ @risk_factors = SixSaferpay::RiskFactors.new(risk_factors.to_h) if risk_factors
46
52
  end
47
53
 
48
54
  def to_hash
@@ -59,6 +65,8 @@ module SixSaferpay
59
65
  hash.merge!(wallet: @wallet.to_h) if @wallet
60
66
  hash.merge!(payment_methods: @payment_methods) if @payment_methods
61
67
  hash.merge!(card_form: @card_form.to_h) if @card_form
68
+ hash.merge!(order: @order.to_h) if @order
69
+ hash.merge!(risk_factors: @risk_factors.to_h) if @risk_factors
62
70
  hash
63
71
  end
64
72
  alias_method :to_h, :to_hash
@@ -0,0 +1,84 @@
1
+ module SixSaferpay
2
+ class Items
3
+
4
+ attr_accessor(
5
+ :type,
6
+ :id,
7
+ :variant_id,
8
+ :name,
9
+ :category_name,
10
+ :description,
11
+ :quantity,
12
+ :unit_price,
13
+ :is_pre_order,
14
+ :tax_amount,
15
+ :discount_amount,
16
+ )
17
+
18
+ def initialize(
19
+ type: nil,
20
+ id: nil,
21
+ variant_id: nil,
22
+ name: nil,
23
+ category_name: nil,
24
+ description: nil,
25
+ quantity: nil,
26
+ unit_price: nil,
27
+ is_pre_order: nil,
28
+ tax_amount: nil,
29
+ discount_amount: nil
30
+ )
31
+ @type = type
32
+ @id = id
33
+ @variant_id = variant_id
34
+ @name = name
35
+ @category_name = category_name
36
+ @description = description
37
+ @quantity = quantity
38
+ @unit_price = unit_price
39
+ @is_pre_order = is_pre_order
40
+ @tax_amount = tax_amount
41
+ @discount_amount = discount_amount
42
+ end
43
+
44
+ def to_hash
45
+ hash = Hash.new
46
+ if @type
47
+ hash.merge!(type: @type)
48
+ end
49
+ if @id
50
+ hash.merge!(id: @id)
51
+ end
52
+ if @variant_id
53
+ hash.merge!(variant_id: @variant_id)
54
+ end
55
+ if @name
56
+ hash.merge!(name: @name)
57
+ end
58
+ if @category_name
59
+ hash.merge!(category_name: @category_name)
60
+ end
61
+ if @description
62
+ hash.merge!(description: @description)
63
+ end
64
+ if @quantity
65
+ hash.merge!(quantity: @quantity)
66
+ end
67
+ if @unit_price
68
+ hash.merge!(unit_price: @unit_price)
69
+ end
70
+ if !@is_pre_order.nil?
71
+ hash.merge!(is_pre_order: @is_pre_order)
72
+ end
73
+ if @tax_amount
74
+ hash.merge!(tax_amount: @tax_amount)
75
+ end
76
+ if @discount_amount
77
+ hash.merge!(discount_amount: @discount_amount)
78
+ end
79
+ hash
80
+ end
81
+ alias_method :to_h, :to_hash
82
+
83
+ end
84
+ end
@@ -0,0 +1,27 @@
1
+ module SixSaferpay
2
+ class Order
3
+
4
+ attr_accessor(
5
+ :items,
6
+ )
7
+
8
+ def initialize(
9
+ items: nil
10
+ )
11
+
12
+ if items
13
+ @items = SixSaferpay::Items.new(items.to_h)
14
+ end
15
+ end
16
+
17
+ def to_hash
18
+ hash = Hash.new
19
+ if @items
20
+ hash.merge!(items: @items.to_h)
21
+ end
22
+ hash
23
+ end
24
+ alias_method :to_h, :to_hash
25
+
26
+ end
27
+ end
@@ -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.5.0"
2
+ VERSION = "2.6.0"
3
3
  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.5.0
4
+ version: 2.6.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: 2021-02-18 00:00:00.000000000 Z
12
+ date: 2021-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -326,19 +326,23 @@ files:
326
326
  - lib/six_saferpay/models/installment_fee.rb
327
327
  - lib/six_saferpay/models/installment_plans.rb
328
328
  - lib/six_saferpay/models/invoice.rb
329
+ - lib/six_saferpay/models/items.rb
329
330
  - lib/six_saferpay/models/liability.rb
330
331
  - lib/six_saferpay/models/marketplace.rb
331
332
  - lib/six_saferpay/models/mastercard_issuer_installments.rb
332
333
  - lib/six_saferpay/models/notification.rb
333
334
  - lib/six_saferpay/models/options.rb
335
+ - lib/six_saferpay/models/order.rb
334
336
  - lib/six_saferpay/models/payee.rb
335
337
  - lib/six_saferpay/models/payer.rb
336
338
  - lib/six_saferpay/models/payer_amount.rb
339
+ - lib/six_saferpay/models/payer_profile.rb
337
340
  - lib/six_saferpay/models/payment.rb
338
341
  - lib/six_saferpay/models/payment_means_alias.rb
339
342
  - lib/six_saferpay/models/payment_method_options.rb
340
343
  - lib/six_saferpay/models/payment_methods_options.rb
341
344
  - lib/six_saferpay/models/pending_notification.rb
345
+ - lib/six_saferpay/models/phone.rb
342
346
  - lib/six_saferpay/models/processing_data.rb
343
347
  - lib/six_saferpay/models/recurring.rb
344
348
  - lib/six_saferpay/models/redirect.rb
@@ -354,6 +358,7 @@ files:
354
358
  - lib/six_saferpay/models/response_header.rb
355
359
  - lib/six_saferpay/models/response_payment_means.rb
356
360
  - lib/six_saferpay/models/return_urls.rb
361
+ - lib/six_saferpay/models/risk_factors.rb
357
362
  - lib/six_saferpay/models/saferpay_fields.rb
358
363
  - lib/six_saferpay/models/six_transaction.rb
359
364
  - lib/six_saferpay/models/styling.rb