six_saferpay 2.7.0 → 2.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/Gemfile.lock +28 -28
  4. data/README.md +1 -1
  5. data/lib/generators/templates/model.erb +1 -1
  6. data/lib/six_saferpay/api/six_batch/responses/close_response.rb +1 -1
  7. data/lib/six_saferpay/api/six_omni_channel/requests/insert_alias.rb +1 -1
  8. data/lib/six_saferpay/api/six_omni_channel/responses/acquire_transaction_response.rb +4 -4
  9. data/lib/six_saferpay/api/six_omni_channel/responses/insert_alias_response.rb +4 -4
  10. data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +12 -12
  11. data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +9 -9
  12. data/lib/six_saferpay/api/six_payment_page/responses/initialize_response.rb +1 -1
  13. data/lib/six_saferpay/api/six_secure_card_data/requests/insert.rb +6 -6
  14. data/lib/six_saferpay/api/six_secure_card_data/requests/insert_direct.rb +3 -3
  15. data/lib/six_saferpay/api/six_secure_card_data/requests/update.rb +2 -2
  16. data/lib/six_saferpay/api/six_secure_card_data/responses/assert_insert_response.rb +4 -4
  17. data/lib/six_saferpay/api/six_secure_card_data/responses/delete_response.rb +1 -1
  18. data/lib/six_saferpay/api/six_secure_card_data/responses/insert_direct_response.rb +4 -4
  19. data/lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb +2 -2
  20. data/lib/six_saferpay/api/six_secure_card_data/responses/update_response.rb +3 -3
  21. data/lib/six_saferpay/api/six_secure_pay_gate_offer/requests/create_offer.rb +4 -4
  22. data/lib/six_saferpay/api/six_transaction/requests/adjust_amount.rb +1 -1
  23. data/lib/six_saferpay/api/six_transaction/requests/alternative_payment.rb +6 -6
  24. data/lib/six_saferpay/api/six_transaction/requests/assert_capture.rb +1 -1
  25. data/lib/six_saferpay/api/six_transaction/requests/assert_refund.rb +1 -1
  26. data/lib/six_saferpay/api/six_transaction/requests/authorize.rb +1 -1
  27. data/lib/six_saferpay/api/six_transaction/requests/authorize_direct.rb +15 -7
  28. data/lib/six_saferpay/api/six_transaction/requests/authorize_referenced.rb +3 -3
  29. data/lib/six_saferpay/api/six_transaction/requests/cancel.rb +1 -1
  30. data/lib/six_saferpay/api/six_transaction/requests/capture.rb +6 -6
  31. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +9 -9
  32. data/lib/six_saferpay/api/six_transaction/requests/inquire.rb +1 -1
  33. data/lib/six_saferpay/api/six_transaction/requests/multipart_capture.rb +3 -3
  34. data/lib/six_saferpay/api/six_transaction/requests/multipart_finalize.rb +1 -1
  35. data/lib/six_saferpay/api/six_transaction/requests/query_payment_means.rb +1 -1
  36. data/lib/six_saferpay/api/six_transaction/requests/refund.rb +3 -3
  37. data/lib/six_saferpay/api/six_transaction/requests/refund_direct.rb +2 -2
  38. data/lib/six_saferpay/api/six_transaction/responses/adjust_amount_response.rb +1 -1
  39. data/lib/six_saferpay/api/six_transaction/responses/alternative_payment_response.rb +2 -2
  40. data/lib/six_saferpay/api/six_transaction/responses/assert_capture_response.rb +1 -1
  41. data/lib/six_saferpay/api/six_transaction/responses/assert_refund_response.rb +1 -1
  42. data/lib/six_saferpay/api/six_transaction/responses/authorize_direct_response.rb +16 -8
  43. data/lib/six_saferpay/api/six_transaction/responses/authorize_response.rb +9 -9
  44. data/lib/six_saferpay/api/six_transaction/responses/authorized_referenced_response.rb +5 -5
  45. data/lib/six_saferpay/api/six_transaction/responses/cancel_response.rb +1 -1
  46. data/lib/six_saferpay/api/six_transaction/responses/capture_response.rb +2 -2
  47. data/lib/six_saferpay/api/six_transaction/responses/initialize_response.rb +2 -2
  48. data/lib/six_saferpay/api/six_transaction/responses/inquire_response.rb +6 -6
  49. data/lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb +1 -1
  50. data/lib/six_saferpay/api/six_transaction/responses/multipart_finalize_response.rb +1 -1
  51. data/lib/six_saferpay/api/six_transaction/responses/query_alternative_payment_response.rb +16 -7
  52. data/lib/six_saferpay/api/six_transaction/responses/query_payment_means_response.rb +3 -3
  53. data/lib/six_saferpay/api/six_transaction/responses/refund_direct_response.rb +4 -4
  54. data/lib/six_saferpay/api/six_transaction/responses/refund_response.rb +4 -4
  55. data/lib/six_saferpay/api.rb +1 -1
  56. data/lib/six_saferpay/client.rb +2 -2
  57. data/lib/six_saferpay/errors/error.rb +1 -1
  58. data/lib/six_saferpay/models/chosen_plan.rb +2 -2
  59. data/lib/six_saferpay/models/dcc.rb +1 -1
  60. data/lib/six_saferpay/models/installment_plans.rb +4 -4
  61. data/lib/six_saferpay/models/invoice.rb +1 -1
  62. data/lib/six_saferpay/models/{items.rb → item.rb} +17 -34
  63. data/lib/six_saferpay/models/liability.rb +2 -2
  64. data/lib/six_saferpay/models/marketplace.rb +2 -2
  65. data/lib/six_saferpay/models/mastercard_issuer_installments.rb +3 -3
  66. data/lib/six_saferpay/models/options.rb +15 -3
  67. data/lib/six_saferpay/models/order.rb +3 -3
  68. data/lib/six_saferpay/models/payer.rb +2 -2
  69. data/lib/six_saferpay/models/payer_profile.rb +1 -1
  70. data/lib/six_saferpay/models/payment.rb +4 -4
  71. data/lib/six_saferpay/models/payment_method_options.rb +1 -1
  72. data/lib/six_saferpay/models/payment_methods_options.rb +2 -2
  73. data/lib/six_saferpay/models/processing_data.rb +1 -1
  74. data/lib/six_saferpay/models/refund.rb +2 -2
  75. data/lib/six_saferpay/models/registration_result.rb +3 -3
  76. data/lib/six_saferpay/models/request_header.rb +1 -1
  77. data/lib/six_saferpay/models/request_payment_means.rb +4 -4
  78. data/lib/six_saferpay/models/response_payment_means.rb +4 -4
  79. data/lib/six_saferpay/models/risk_factors.rb +1 -1
  80. data/lib/six_saferpay/models/transaction.rb +3 -3
  81. data/lib/six_saferpay/models/update_payment_means.rb +1 -1
  82. data/lib/six_saferpay/version.rb +1 -1
  83. data/six_saferpay.gemspec +11 -9
  84. metadata +20 -44
@@ -10,7 +10,7 @@ module SixSaferpay
10
10
  def initialize(request_header: nil,
11
11
  capture_reference: )
12
12
  @request_header = request_header || SixSaferpay::RequestHeader.new()
13
- @capture_reference = SixSaferpay::CaptureReference.new(capture_reference.to_h) if capture_reference
13
+ @capture_reference = SixSaferpay::CaptureReference.new(**capture_reference.to_h) if capture_reference
14
14
  end
15
15
 
16
16
  def to_hash
@@ -9,7 +9,7 @@ module SixSaferpay
9
9
  def initialize(request_header: nil,
10
10
  transaction_reference: )
11
11
  @request_header = request_header || SixSaferpay::RequestHeader.new()
12
- @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
12
+ @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
13
13
  end
14
14
 
15
15
  def to_hash
@@ -20,7 +20,7 @@ module SixSaferpay
20
20
  @token = token
21
21
  @condition = condition
22
22
  @verification_code = verification_code
23
- @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
23
+ @register_alias = SixSaferpay::RegisterAlias.new(**register_alias.to_h) if register_alias
24
24
  end
25
25
 
26
26
  def to_hash
@@ -8,7 +8,9 @@ module SixSaferpay
8
8
  :payment_means,
9
9
  :authentication,
10
10
  :register_alias,
11
- :payer
11
+ :payer,
12
+ :order,
13
+ :risk_factors
12
14
  )
13
15
 
14
16
 
@@ -18,15 +20,19 @@ module SixSaferpay
18
20
  payment_means:,
19
21
  authentication: nil,
20
22
  register_alias: nil,
21
- payer: nil
23
+ payer: nil,
24
+ order: nil,
25
+ risk_factors: nil
22
26
  )
23
27
  @request_header = request_header || SixSaferpay::RequestHeader.new()
24
28
  @terminal_id = SixSaferpay.config.terminal_id || terminal_id
25
- @payment = SixSaferpay::Payment.new(payment.to_h) if payment
26
- @payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
27
- @authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
28
- @register_alias = SixSaferpay::RegisterAlias.new(register_alias.to_h) if register_alias
29
- @payer = SixSaferpay::Payer.new(payer.to_h) if payer
29
+ @payment = SixSaferpay::Payment.new(**payment.to_h) if payment
30
+ @payment_means = SixSaferpay::RequestPaymentMeans.new(**payment_means.to_h) if payment_means
31
+ @authentication = SixSaferpay::Authentication.new(**authentication.to_h) if authentication
32
+ @register_alias = SixSaferpay::RegisterAlias.new(**register_alias.to_h) if register_alias
33
+ @payer = SixSaferpay::Payer.new(**payer.to_h) if payer
34
+ @order = SixSaferpay::Order.new(**order.to_h) if order
35
+ @risk_factors = SixSaferpay::RiskFactors.new(**risk_factors.to_h) if risk_factors
30
36
  end
31
37
 
32
38
  def to_hash
@@ -38,6 +44,8 @@ module SixSaferpay
38
44
  hash.merge!(authentication: @authentication.to_h) if @authentication
39
45
  hash.merge!(register_alias: @register_alias.to_h) if @register_alias
40
46
  hash.merge!(payer: @payer.to_h) if @payer
47
+ hash.merge!(order: @order.to_h) if @order
48
+ hash.merge!(risk_factors: @risk_factors.to_h) if @risk_factors
41
49
  hash
42
50
  end
43
51
  alias_method :to_h, :to_hash
@@ -20,9 +20,9 @@ module SixSaferpay
20
20
  )
21
21
  @request_header = request_header || SixSaferpay::RequestHeader.new()
22
22
  @terminal_id = terminal_id || SixSaferpay.config.terminal_id
23
- @payment = SixSaferpay::Payment.new(payment.to_h) if payment
24
- @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
25
- @authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
23
+ @payment = SixSaferpay::Payment.new(**payment.to_h) if payment
24
+ @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
25
+ @authentication = SixSaferpay::Authentication.new(**authentication.to_h) if authentication
26
26
  @suppress_dcc = suppress_dcc
27
27
  end
28
28
 
@@ -8,7 +8,7 @@ module SixSaferpay
8
8
 
9
9
  def initialize(request_header: nil, transaction_reference:)
10
10
  @request_header = request_header || SixSaferpay::RequestHeader.new()
11
- @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
11
+ @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
12
12
  end
13
13
 
14
14
  def to_hash
@@ -21,14 +21,14 @@ module SixSaferpay
21
21
  mastercard_issuer_installments: nil
22
22
  )
23
23
  @request_header = request_header || SixSaferpay::RequestHeader.new()
24
- @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
25
- @amount = SixSaferpay::Amount.new(amount.to_h) if amount
26
- @billpay = SixSaferpay::Billpay.new(billpay.to_h) if billpay
27
- @pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
28
- @marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
24
+ @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
25
+ @amount = SixSaferpay::Amount.new(**amount.to_h) if amount
26
+ @billpay = SixSaferpay::Billpay.new(**billpay.to_h) if billpay
27
+ @pending_notification = SixSaferpay::PendingNotification.new(**pending_notification.to_h) if pending_notification
28
+ @marketplace = SixSaferpay::Marketplace.new(**marketplace.to_h) if marketplace
29
29
  if mastercard_issuer_installments
30
30
  @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
31
- .new(mastercard_issuer_installments.to_h)
31
+ .new(**mastercard_issuer_installments.to_h)
32
32
  end
33
33
  end
34
34
 
@@ -38,17 +38,17 @@ module SixSaferpay
38
38
  @request_header = request_header || SixSaferpay::RequestHeader.new()
39
39
  @config_set = config_set
40
40
  @terminal_id = terminal_id || SixSaferpay.config.terminal_id
41
- @payment = SixSaferpay::Payment.new(payment.to_h) if payment
42
- @payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
43
- @authentication = SixSaferpay::Authentication.new(authentication.to_h) if authentication
44
- @payer = SixSaferpay::Payer.new(payer.to_h) if payer
41
+ @payment = SixSaferpay::Payment.new(**payment.to_h) if payment
42
+ @payment_means = SixSaferpay::RequestPaymentMeans.new(**payment_means.to_h) if payment_means
43
+ @authentication = SixSaferpay::Authentication.new(**authentication.to_h) if authentication
44
+ @payer = SixSaferpay::Payer.new(**payer.to_h) if payer
45
45
  @return_urls = return_urls || SixSaferpay::ReturnUrls.new()
46
- @styling = SixSaferpay::Styling.new(styling.to_h) if styling
47
- @wallet = SixSaferpay::Wallet.new(wallet.to_h) if wallet
46
+ @styling = SixSaferpay::Styling.new(**styling.to_h) if styling
47
+ @wallet = SixSaferpay::Wallet.new(**wallet.to_h) if wallet
48
48
  @payment_methods = payment_methods
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
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
52
52
  end
53
53
 
54
54
  def to_hash
@@ -9,7 +9,7 @@ module SixSaferpay
9
9
  def initialize(request_header: nil,
10
10
  transaction_reference: )
11
11
  @request_header = request_header || SixSaferpay::RequestHeader.new()
12
- @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
12
+ @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
13
13
  end
14
14
 
15
15
  def to_hash
@@ -19,11 +19,11 @@ module SixSaferpay
19
19
  marketplace: nil
20
20
  )
21
21
  @request_header = request_header || SixSaferpay::RequestHeader.new()
22
- @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
23
- @amount = SixSaferpay::Amount.new(amount.to_h) if amount
22
+ @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
23
+ @amount = SixSaferpay::Amount.new(**amount.to_h) if amount
24
24
  @type = type
25
25
  @order_part_id = order_part_id
26
- @marketplace = SixSaferpay::Marketplace.new(marketplace.to_h) if marketplace
26
+ @marketplace = SixSaferpay::Marketplace.new(**marketplace.to_h) if marketplace
27
27
  end
28
28
 
29
29
  def to_hash
@@ -10,7 +10,7 @@ module SixSaferpay
10
10
  def initialize(request_header: nil,
11
11
  transaction_reference: )
12
12
  @request_header = request_header || SixSaferpay::RequestHeader.new()
13
- @transaction_reference = SixSaferpay::TransactionReference.new(transaction_reference.to_h) if transaction_reference
13
+ @transaction_reference = SixSaferpay::TransactionReference.new(**transaction_reference.to_h) if transaction_reference
14
14
  end
15
15
 
16
16
  def to_hash
@@ -11,7 +11,7 @@ module SixSaferpay
11
11
  return_urls: nil)
12
12
  @request_header = request_header || SixSaferpay::RequestHeader.new()
13
13
  @token = token
14
- @return_urls = SixSaferpay::ReturnUrls.new(return_urls.to_h) if return_urls
14
+ @return_urls = SixSaferpay::ReturnUrls.new(**return_urls.to_h) if return_urls
15
15
  end
16
16
 
17
17
  def to_hash
@@ -14,9 +14,9 @@ module SixSaferpay
14
14
  capture_reference: ,
15
15
  pending_notification: nil)
16
16
  @request_header = request_header || SixSaferpay::RequestHeader.new()
17
- @refund = SixSaferpay::Refund.new(refund.to_h) if refund
18
- @capture_reference = SixSaferpay::CaptureReference.new(capture_reference.to_h) if capture_reference
19
- @pending_notification = SixSaferpay::PendingNotification.new(pending_notification.to_h) if pending_notification
17
+ @refund = SixSaferpay::Refund.new(**refund.to_h) if refund
18
+ @capture_reference = SixSaferpay::CaptureReference.new(**capture_reference.to_h) if capture_reference
19
+ @pending_notification = SixSaferpay::PendingNotification.new(**pending_notification.to_h) if pending_notification
20
20
  end
21
21
 
22
22
  def to_hash
@@ -16,8 +16,8 @@ module SixSaferpay
16
16
  )
17
17
  @request_header = request_header || SixSaferpay::RequestHeader.new()
18
18
  @terminal_id = terminal_id
19
- @refund = SixSaferpay::Refund.new(refund.to_h) if refund
20
- @payment_means = SixSaferpay::RequestPaymentMeans.new(payment_means.to_h) if payment_means
19
+ @refund = SixSaferpay::Refund.new(**refund.to_h) if refund
20
+ @payment_means = SixSaferpay::RequestPaymentMeans.new(**payment_means.to_h) if payment_means
21
21
  end
22
22
 
23
23
  def to_hash
@@ -5,7 +5,7 @@ module SixSaferpay
5
5
  attr_accessor(:response_header)
6
6
 
7
7
  def initialize(response_header: )
8
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
8
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
9
9
  end
10
10
 
11
11
  def to_hash
@@ -14,10 +14,10 @@ module SixSaferpay
14
14
  token:,
15
15
  expiration:,
16
16
  processing_data: nil)
17
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
17
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
18
18
  @token = token
19
19
  @expiration = expiration
20
- @processing_data = SixSaferpay::ProcessingData.new(@processing_data.to_h) if processing_data
20
+ @processing_data = SixSaferpay::ProcessingData.new(**@processing_data.to_h) if processing_data
21
21
  end
22
22
 
23
23
  def to_hash
@@ -14,7 +14,7 @@ module SixSaferpay
14
14
  order_id: nil,
15
15
  status: ,
16
16
  date: )
17
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
17
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
18
18
  @transaction_id = transaction_id
19
19
  @order_id = order_id
20
20
  @status = status
@@ -16,7 +16,7 @@ module SixSaferpay
16
16
  order_id: nil,
17
17
  status: ,
18
18
  date: )
19
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
19
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
20
20
  @transaction_id = transaction_id
21
21
  @order_id = order_id
22
22
  @status = status
@@ -7,7 +7,8 @@ module SixSaferpay
7
7
  :payment_means,
8
8
  :payer,
9
9
  :registration_result,
10
- :mastercard_issuer_installments
10
+ :mastercard_issuer_installments,
11
+ :fraud_prevention
11
12
  )
12
13
 
13
14
 
@@ -16,16 +17,20 @@ module SixSaferpay
16
17
  payment_means:,
17
18
  payer: nil,
18
19
  registration_result: nil,
19
- mastercard_issuer_installments: nil
20
+ mastercard_issuer_installments: nil,
21
+ fraud_prevention: nil
20
22
  )
21
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
22
- @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
23
- @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
24
- @payer = SixSaferpay::Payer.new(payer.to_h) if payer
25
- @registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
23
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
24
+ @transaction = SixSaferpay::Transaction.new(**transaction.to_h) if transaction
25
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(**payment_means.to_h) if payment_means
26
+ @payer = SixSaferpay::Payer.new(**payer.to_h) if payer
27
+ @registration_result = SixSaferpay::RegistrationResult.new(**registration_result.to_h) if registration_result
26
28
  if mastercard_issuer_installments
27
29
  @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
28
- .new(mastercard_issuer_installments.to_h)
30
+ .new(**mastercard_issuer_installments.to_h)
31
+ end
32
+ if fraud_prevention
33
+ @fraud_prevention = SixSaferpay::FraudPrevention.new(**fraud_prevention.to_h)
29
34
  end
30
35
  end
31
36
 
@@ -39,6 +44,9 @@ module SixSaferpay
39
44
  if @mastercard_issuer_installments
40
45
  hash.merge!(mastercard_issuer_installments: mastercard_issuer_installments.to_h)
41
46
  end
47
+ if @fraud_prevention
48
+ hash.merge!(fraud_prevention: fraud_prevention.to_h)
49
+ end
42
50
  hash
43
51
  end
44
52
  alias_method :to_h, :to_hash
@@ -24,18 +24,18 @@ module SixSaferpay
24
24
  mastercard_issuer_installments: nil,
25
25
  fraud_prevention: nil
26
26
  )
27
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
28
- @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
29
- @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
30
- @payer = SixSaferpay::Payer.new(payer.to_h) if payer
31
- @registration_result = SixSaferpay::RegistrationResult.new(registration_result.to_h) if registration_result
32
- @liability = SixSaferpay::Liability.new(liability.to_h) if liability
33
- @dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
27
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
28
+ @transaction = SixSaferpay::Transaction.new(**transaction.to_h) if transaction
29
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(**payment_means.to_h) if payment_means
30
+ @payer = SixSaferpay::Payer.new(**payer.to_h) if payer
31
+ @registration_result = SixSaferpay::RegistrationResult.new(**registration_result.to_h) if registration_result
32
+ @liability = SixSaferpay::Liability.new(**liability.to_h) if liability
33
+ @dcc = SixSaferpay::Dcc.new(**dcc.to_h) if dcc
34
34
  if mastercard_issuer_installments
35
35
  @mastercard_issuer_installments = SixSaferpay::MastercardIssuerInstallments
36
- .new(mastercard_issuer_installments.to_h)
36
+ .new(**mastercard_issuer_installments.to_h)
37
37
  end
38
- @fraud_prevention = SixSaferpay::FraudPrevention.new(fraud_prevention.to_h) if fraud_prevention
38
+ @fraud_prevention = SixSaferpay::FraudPrevention.new(**fraud_prevention.to_h) if fraud_prevention
39
39
  end
40
40
 
41
41
  def to_hash
@@ -17,11 +17,11 @@ module SixSaferpay
17
17
  dcc: nil
18
18
 
19
19
  )
20
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
21
- @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
22
- @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
23
- @payer = SixSaferpay::Payer.new(payer.to_h) if payer
24
- @dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
20
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
21
+ @transaction = SixSaferpay::Transaction.new(**transaction.to_h) if transaction
22
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(**payment_means.to_h) if payment_means
23
+ @payer = SixSaferpay::Payer.new(**payer.to_h) if payer
24
+ @dcc = SixSaferpay::Dcc.new(**dcc.to_h) if dcc
25
25
  end
26
26
 
27
27
  def to_hash
@@ -13,7 +13,7 @@ module SixSaferpay
13
13
  order_id: nil,
14
14
  date: nil
15
15
  )
16
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
16
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
17
17
  @transaction_id = transaction_id
18
18
  @order_id = order_id
19
19
  @date = date
@@ -14,11 +14,11 @@ module SixSaferpay
14
14
  status: ,
15
15
  date: ,
16
16
  invoice: nil)
17
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
17
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
18
18
  @capture_id = capture_id
19
19
  @status = status
20
20
  @date = date
21
- @invoice = SixSaferpay::Invoice.new(invoice.to_h) if invoice
21
+ @invoice = SixSaferpay::Invoice.new(**invoice.to_h) if invoice
22
22
  end
23
23
 
24
24
  def to_hash
@@ -16,12 +16,12 @@ module SixSaferpay
16
16
  liability_shift: nil,
17
17
  redirect_required:,
18
18
  redirect: )
19
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
19
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
20
20
  @token = token
21
21
  @expiration = expiration
22
22
  @liability_shift = liability_shift
23
23
  @redirect_required = redirect_required
24
- @redirect = SixSaferpay::Redirect.new(redirect.to_h) if redirect
24
+ @redirect = SixSaferpay::Redirect.new(**redirect.to_h) if redirect
25
25
  end
26
26
 
27
27
  def to_hash
@@ -19,12 +19,12 @@ module SixSaferpay
19
19
  dcc: nil
20
20
 
21
21
  )
22
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
23
- @transaction = SixSaferpay::Transaction.new(transaction.to_h) if transaction
24
- @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h) if payment_means
25
- @payer = SixSaferpay::Payer.new(payer.to_h) if payer
26
- @liability = SixSaferpay::Liability.new(liability.to_h) if liability
27
- @dcc = SixSaferpay::Dcc.new(dcc.to_h) if dcc
22
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
23
+ @transaction = SixSaferpay::Transaction.new(**transaction.to_h) if transaction
24
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(**payment_means.to_h) if payment_means
25
+ @payer = SixSaferpay::Payer.new(**payer.to_h) if payer
26
+ @liability = SixSaferpay::Liability.new(**liability.to_h) if liability
27
+ @dcc = SixSaferpay::Dcc.new(**dcc.to_h) if dcc
28
28
  end
29
29
 
30
30
  def to_hash
@@ -12,7 +12,7 @@ module SixSaferpay
12
12
  capture_id: nil,
13
13
  status: ,
14
14
  date: )
15
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
15
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
16
16
  @capture_id = capture_id
17
17
  @status = status
18
18
  @date = date
@@ -5,7 +5,7 @@ module SixSaferpay
5
5
  attr_accessor(:response_header)
6
6
 
7
7
  def initialize(response_header:)
8
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
8
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
9
9
  end
10
10
 
11
11
  def to_hash
@@ -6,21 +6,27 @@ module SixSaferpay
6
6
  :transaction,
7
7
  :payment_means,
8
8
  :payer,
9
- :liability
9
+ :liability,
10
+ :fraud_prevention
10
11
  )
11
12
 
12
13
  def initialize(response_header: ,
13
14
  transaction: ,
14
15
  payment_means: ,
15
16
  payer: nil,
16
- liability: nil)
17
+ liability: nil,
18
+ fraud_prevention: nil
19
+ )
17
20
 
18
21
 
19
- @response_header = SixSaferpay::ResponseHeader.new(response_header.to_h) if response_header
20
- @transaction = SixSaferpay::Transaction.new(transaction.to_h)
21
- @payment_means = SixSaferpay::ResponsePaymentMeans.new(payment_means.to_h)
22
- @payer = SixSaferpay::Payer.new(payer.to_h) if payer
23
- @liability = SixSaferpay::Liability.new(liability.to_h) if liability
22
+ @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
23
+ @transaction = SixSaferpay::Transaction.new(**transaction.to_h)
24
+ @payment_means = SixSaferpay::ResponsePaymentMeans.new(**payment_means.to_h)
25
+ @payer = SixSaferpay::Payer.new(**payer.to_h) if payer
26
+ @liability = SixSaferpay::Liability.new(**liability.to_h) if liability
27
+ if fraud_prevention
28
+ @fraud_prevention = SixSaferpay::FraudPrevention.new(**fraud_prevention.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!(liability: @liability.to_h) if @liability
39
+ if @fraud_prevention
40
+ hash.merge!(fraud_prevention: fraud_prevention.to_h)
41
+ end
33
42
  hash
34
43
  end
35
44
  alias_method :to_h, :to_hash