connect-sdk-ruby 1.33.0 → 1.34.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/connect-sdk-ruby.gemspec +1 -1
  3. data/examples/merchant/payments/create_payment_example.rb +64 -18
  4. data/examples/merchant/riskassessments/risk_assessment_cards_example.rb +1 -1
  5. data/lib/ingenico/connect/sdk/domain/definitions/airline_data.rb +2 -0
  6. data/lib/ingenico/connect/sdk/domain/definitions/company_information.rb +7 -0
  7. data/lib/ingenico/connect/sdk/domain/definitions/customer_base.rb +2 -0
  8. data/lib/ingenico/connect/sdk/domain/definitions/fraud_fields.rb +24 -0
  9. data/lib/ingenico/connect/sdk/domain/definitions/fraud_fields_shipping_details.rb +7 -0
  10. data/lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb +11 -0
  11. data/lib/ingenico/connect/sdk/domain/hostedcheckout/created_payment_output.rb +1 -1
  12. data/lib/ingenico/connect/sdk/domain/payment/abstract_card_payment_method_specific_input.rb +24 -0
  13. data/lib/ingenico/connect/sdk/domain/payment/abstract_sepa_direct_debit_payment_product771_specific_input.rb +1 -1
  14. data/lib/ingenico/connect/sdk/domain/payment/abstract_three_d_secure.rb +74 -0
  15. data/lib/ingenico/connect/sdk/domain/payment/additional_order_input.rb +1 -1
  16. data/lib/ingenico/connect/sdk/domain/payment/browser_data.rb +73 -0
  17. data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input.rb +15 -0
  18. data/lib/ingenico/connect/sdk/domain/payment/card_payment_method_specific_input_base.rb +20 -0
  19. data/lib/ingenico/connect/sdk/domain/payment/card_recurrence_details.rb +45 -0
  20. data/lib/ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input.rb +2 -0
  21. data/lib/ingenico/connect/sdk/domain/payment/cash_payment_product1503_specific_input.rb +3 -0
  22. data/lib/ingenico/connect/sdk/domain/payment/complete_payment_request.rb +11 -0
  23. data/lib/ingenico/connect/sdk/domain/payment/contact_details.rb +14 -0
  24. data/lib/ingenico/connect/sdk/domain/payment/create_payment_request.rb +11 -0
  25. data/lib/ingenico/connect/sdk/domain/payment/customer.rb +38 -0
  26. data/lib/ingenico/connect/sdk/domain/payment/customer_account.rb +120 -0
  27. data/lib/ingenico/connect/sdk/domain/payment/customer_account_authentication.rb +38 -0
  28. data/lib/ingenico/connect/sdk/domain/payment/customer_approve_payment.rb +31 -0
  29. data/lib/ingenico/connect/sdk/domain/payment/customer_device.rb +84 -0
  30. data/lib/ingenico/connect/sdk/domain/payment/customer_payment_activity.rb +45 -0
  31. data/lib/ingenico/connect/sdk/domain/payment/device_render_options.rb +38 -0
  32. data/lib/ingenico/connect/sdk/domain/payment/external_cardholder_authentication_data.rb +21 -0
  33. data/lib/ingenico/connect/sdk/domain/payment/gift_card_purchase.rb +42 -0
  34. data/lib/ingenico/connect/sdk/domain/payment/level3_summary_data.rb +4 -4
  35. data/lib/ingenico/connect/sdk/domain/payment/merchant.rb +49 -0
  36. data/lib/ingenico/connect/sdk/domain/payment/merchant_action.rb +11 -0
  37. data/lib/ingenico/connect/sdk/domain/payment/mobile_three_d_secure_challenge_parameters.rb +52 -0
  38. data/lib/ingenico/connect/sdk/domain/payment/order.rb +3 -1
  39. data/lib/ingenico/connect/sdk/domain/payment/order_approve_payment.rb +11 -0
  40. data/lib/ingenico/connect/sdk/domain/payment/order_type_information.rb +7 -0
  41. data/lib/ingenico/connect/sdk/domain/payment/payment_account_on_file.rb +38 -0
  42. data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input.rb +13 -0
  43. data/lib/ingenico/connect/sdk/domain/payment/redirect_payment_product840_specific_input.rb +1 -1
  44. data/lib/ingenico/connect/sdk/domain/payment/redirection_data.rb +38 -0
  45. data/lib/ingenico/connect/sdk/domain/payment/sdk_data_input.rb +84 -0
  46. data/lib/ingenico/connect/sdk/domain/payment/sdk_data_output.rb +31 -0
  47. data/lib/ingenico/connect/sdk/domain/payment/shipping.rb +53 -0
  48. data/lib/ingenico/connect/sdk/domain/payment/shopping_cart.rb +32 -0
  49. data/lib/ingenico/connect/sdk/domain/payment/three_d_secure.rb +46 -0
  50. data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_base.rb +15 -0
  51. data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_data.rb +45 -0
  52. data/lib/ingenico/connect/sdk/domain/payment/three_d_secure_results.rb +43 -0
  53. data/lib/ingenico/connect/sdk/domain/payout/create_payout_request.rb +6 -6
  54. data/lib/ingenico/connect/sdk/domain/product/value_mapping_element.rb +1 -1
  55. data/lib/ingenico/connect/sdk/domain/riskassessments/customer_account_risk_assessment.rb +38 -0
  56. data/lib/ingenico/connect/sdk/domain/riskassessments/customer_device_risk_assessment.rb +38 -0
  57. data/lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb +38 -0
  58. data/lib/ingenico/connect/sdk/domain/riskassessments/merchant_risk_assessment.rb +31 -0
  59. data/lib/ingenico/connect/sdk/domain/riskassessments/order_risk_assessment.rb +11 -0
  60. data/lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb +11 -0
  61. data/lib/ingenico/connect/sdk/domain/riskassessments/shipping_risk_assessment.rb +49 -0
  62. data/lib/ingenico/connect/sdk/meta_data_provider.rb +1 -1
  63. metadata +25 -2
@@ -12,7 +12,7 @@ module Ingenico::Connect::SDK
12
12
 
13
13
  # String
14
14
  #
15
- # Deprecated; Use existingUniqueMandateReference instead
15
+ # Deprecated; Use existingUniqueMandateReference or mandate.uniqueMandateReference instead
16
16
  attr_accessor :mandate_reference
17
17
 
18
18
  def to_h
@@ -0,0 +1,74 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+ require 'ingenico/connect/sdk/domain/payment/sdk_data_input'
7
+ require 'ingenico/connect/sdk/domain/payment/three_d_secure_data'
8
+
9
+ module Ingenico::Connect::SDK
10
+ module Domain
11
+ module Payment
12
+
13
+ class AbstractThreeDSecure < Ingenico::Connect::SDK::DataObject
14
+
15
+ # String
16
+ attr_accessor :authentication_flow
17
+
18
+ # String
19
+ attr_accessor :challenge_canvas_size
20
+
21
+ # String
22
+ attr_accessor :challenge_indicator
23
+
24
+ # {Ingenico::Connect::SDK::Domain::Payment::ThreeDSecureData}
25
+ attr_accessor :prior_three_d_secure_data
26
+
27
+ # {Ingenico::Connect::SDK::Domain::Payment::SdkDataInput}
28
+ attr_accessor :sdk_data
29
+
30
+ # true/false
31
+ attr_accessor :skip_authentication
32
+
33
+ def to_h
34
+ hash = super
35
+ add_to_hash(hash, 'authenticationFlow', @authentication_flow)
36
+ add_to_hash(hash, 'challengeCanvasSize', @challenge_canvas_size)
37
+ add_to_hash(hash, 'challengeIndicator', @challenge_indicator)
38
+ add_to_hash(hash, 'priorThreeDSecureData', @prior_three_d_secure_data)
39
+ add_to_hash(hash, 'sdkData', @sdk_data)
40
+ add_to_hash(hash, 'skipAuthentication', @skip_authentication)
41
+ hash
42
+ end
43
+
44
+ def from_hash(hash)
45
+ super
46
+ if hash.has_key?('authenticationFlow')
47
+ @authentication_flow = hash['authenticationFlow']
48
+ end
49
+ if hash.has_key?('challengeCanvasSize')
50
+ @challenge_canvas_size = hash['challengeCanvasSize']
51
+ end
52
+ if hash.has_key?('challengeIndicator')
53
+ @challenge_indicator = hash['challengeIndicator']
54
+ end
55
+ if hash.has_key?('priorThreeDSecureData')
56
+ if !(hash['priorThreeDSecureData'].is_a? Hash)
57
+ raise TypeError, "value '%s' is not a Hash" % [hash['priorThreeDSecureData']]
58
+ end
59
+ @prior_three_d_secure_data = Ingenico::Connect::SDK::Domain::Payment::ThreeDSecureData.new_from_hash(hash['priorThreeDSecureData'])
60
+ end
61
+ if hash.has_key?('sdkData')
62
+ if !(hash['sdkData'].is_a? Hash)
63
+ raise TypeError, "value '%s' is not a Hash" % [hash['sdkData']]
64
+ end
65
+ @sdk_data = Ingenico::Connect::SDK::Domain::Payment::SdkDataInput.new_from_hash(hash['sdkData'])
66
+ end
67
+ if hash.has_key?('skipAuthentication')
68
+ @skip_authentication = hash['skipAuthentication']
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -18,7 +18,7 @@ module Ingenico::Connect::SDK
18
18
 
19
19
  # {Ingenico::Connect::SDK::Domain::Payment::Level3SummaryData}
20
20
  #
21
- # Deprecated; Use Order.shoppingCart instead
21
+ # Deprecated; Use Order.shoppingCart.amountBreakdown instead
22
22
  attr_accessor :level3_summary_data
23
23
 
24
24
  # Integer
@@ -0,0 +1,73 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+
7
+ module Ingenico::Connect::SDK
8
+ module Domain
9
+ module Payment
10
+
11
+ class BrowserData < Ingenico::Connect::SDK::DataObject
12
+
13
+ # Integer
14
+ attr_accessor :color_depth
15
+
16
+ # String
17
+ attr_accessor :inner_height
18
+
19
+ # String
20
+ attr_accessor :inner_width
21
+
22
+ # true/false
23
+ attr_accessor :java_enabled
24
+
25
+ # true/false
26
+ attr_accessor :java_script_enabled
27
+
28
+ # String
29
+ attr_accessor :screen_height
30
+
31
+ # String
32
+ attr_accessor :screen_width
33
+
34
+ def to_h
35
+ hash = super
36
+ add_to_hash(hash, 'colorDepth', @color_depth)
37
+ add_to_hash(hash, 'innerHeight', @inner_height)
38
+ add_to_hash(hash, 'innerWidth', @inner_width)
39
+ add_to_hash(hash, 'javaEnabled', @java_enabled)
40
+ add_to_hash(hash, 'javaScriptEnabled', @java_script_enabled)
41
+ add_to_hash(hash, 'screenHeight', @screen_height)
42
+ add_to_hash(hash, 'screenWidth', @screen_width)
43
+ hash
44
+ end
45
+
46
+ def from_hash(hash)
47
+ super
48
+ if hash.has_key?('colorDepth')
49
+ @color_depth = hash['colorDepth']
50
+ end
51
+ if hash.has_key?('innerHeight')
52
+ @inner_height = hash['innerHeight']
53
+ end
54
+ if hash.has_key?('innerWidth')
55
+ @inner_width = hash['innerWidth']
56
+ end
57
+ if hash.has_key?('javaEnabled')
58
+ @java_enabled = hash['javaEnabled']
59
+ end
60
+ if hash.has_key?('javaScriptEnabled')
61
+ @java_script_enabled = hash['javaScriptEnabled']
62
+ end
63
+ if hash.has_key?('screenHeight')
64
+ @screen_height = hash['screenHeight']
65
+ end
66
+ if hash.has_key?('screenWidth')
67
+ @screen_width = hash['screenWidth']
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -5,6 +5,7 @@
5
5
  require 'ingenico/connect/sdk/domain/definitions/card'
6
6
  require 'ingenico/connect/sdk/domain/payment/abstract_card_payment_method_specific_input'
7
7
  require 'ingenico/connect/sdk/domain/payment/external_cardholder_authentication_data'
8
+ require 'ingenico/connect/sdk/domain/payment/three_d_secure'
8
9
 
9
10
  module Ingenico::Connect::SDK
10
11
  module Domain
@@ -16,20 +17,28 @@ module Ingenico::Connect::SDK
16
17
  attr_accessor :card
17
18
 
18
19
  # {Ingenico::Connect::SDK::Domain::Payment::ExternalCardholderAuthenticationData}
20
+ #
21
+ # Deprecated; Use threeDSecure.externalCardholderAuthenticationData instead
19
22
  attr_accessor :external_cardholder_authentication_data
20
23
 
21
24
  # true/false
22
25
  attr_accessor :is_recurring
23
26
 
24
27
  # String
28
+ #
29
+ # Deprecated; Use threeDSecure.redirectionData.returnUrl instead
25
30
  attr_accessor :return_url
26
31
 
32
+ # {Ingenico::Connect::SDK::Domain::Payment::ThreeDSecure}
33
+ attr_accessor :three_d_secure
34
+
27
35
  def to_h
28
36
  hash = super
29
37
  add_to_hash(hash, 'card', @card)
30
38
  add_to_hash(hash, 'externalCardholderAuthenticationData', @external_cardholder_authentication_data)
31
39
  add_to_hash(hash, 'isRecurring', @is_recurring)
32
40
  add_to_hash(hash, 'returnUrl', @return_url)
41
+ add_to_hash(hash, 'threeDSecure', @three_d_secure)
33
42
  hash
34
43
  end
35
44
 
@@ -53,6 +62,12 @@ module Ingenico::Connect::SDK
53
62
  if hash.has_key?('returnUrl')
54
63
  @return_url = hash['returnUrl']
55
64
  end
65
+ if hash.has_key?('threeDSecure')
66
+ if !(hash['threeDSecure'].is_a? Hash)
67
+ raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecure']]
68
+ end
69
+ @three_d_secure = Ingenico::Connect::SDK::Domain::Payment::ThreeDSecure.new_from_hash(hash['threeDSecure'])
70
+ end
56
71
  end
57
72
  end
58
73
  end
@@ -3,12 +3,32 @@
3
3
  # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
4
  #
5
5
  require 'ingenico/connect/sdk/domain/payment/abstract_card_payment_method_specific_input'
6
+ require 'ingenico/connect/sdk/domain/payment/three_d_secure_base'
6
7
 
7
8
  module Ingenico::Connect::SDK
8
9
  module Domain
9
10
  module Payment
10
11
 
11
12
  class CardPaymentMethodSpecificInputBase < Ingenico::Connect::SDK::Domain::Payment::AbstractCardPaymentMethodSpecificInput
13
+
14
+ # {Ingenico::Connect::SDK::Domain::Payment::ThreeDSecureBase}
15
+ attr_accessor :three_d_secure
16
+
17
+ def to_h
18
+ hash = super
19
+ add_to_hash(hash, 'threeDSecure', @three_d_secure)
20
+ hash
21
+ end
22
+
23
+ def from_hash(hash)
24
+ super
25
+ if hash.has_key?('threeDSecure')
26
+ if !(hash['threeDSecure'].is_a? Hash)
27
+ raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecure']]
28
+ end
29
+ @three_d_secure = Ingenico::Connect::SDK::Domain::Payment::ThreeDSecureBase.new_from_hash(hash['threeDSecure'])
30
+ end
31
+ end
12
32
  end
13
33
  end
14
34
  end
@@ -0,0 +1,45 @@
1
+ #
2
+ # This class was auto-generated from the API references found at
3
+ # https://epayments-api.developer-ingenico.com/s2sapi/v1/
4
+ #
5
+ require 'ingenico/connect/sdk/data_object'
6
+
7
+ module Ingenico::Connect::SDK
8
+ module Domain
9
+ module Payment
10
+
11
+ class CardRecurrenceDetails < Ingenico::Connect::SDK::DataObject
12
+
13
+ # String
14
+ attr_accessor :end_date
15
+
16
+ # Integer
17
+ attr_accessor :min_frequency
18
+
19
+ # String
20
+ attr_accessor :recurring_payment_sequence_indicator
21
+
22
+ def to_h
23
+ hash = super
24
+ add_to_hash(hash, 'endDate', @end_date)
25
+ add_to_hash(hash, 'minFrequency', @min_frequency)
26
+ add_to_hash(hash, 'recurringPaymentSequenceIndicator', @recurring_payment_sequence_indicator)
27
+ hash
28
+ end
29
+
30
+ def from_hash(hash)
31
+ super
32
+ if hash.has_key?('endDate')
33
+ @end_date = hash['endDate']
34
+ end
35
+ if hash.has_key?('minFrequency')
36
+ @min_frequency = hash['minFrequency']
37
+ end
38
+ if hash.has_key?('recurringPaymentSequenceIndicator')
39
+ @recurring_payment_sequence_indicator = hash['recurringPaymentSequenceIndicator']
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -13,6 +13,8 @@ module Ingenico::Connect::SDK
13
13
  class CashPaymentMethodSpecificInput < Ingenico::Connect::SDK::Domain::Payment::AbstractCashPaymentMethodSpecificInput
14
14
 
15
15
  # {Ingenico::Connect::SDK::Domain::Payment::CashPaymentProduct1503SpecificInput}
16
+ #
17
+ # Deprecated; No replacement
16
18
  attr_accessor :payment_product1503_specific_input
17
19
 
18
20
  # {Ingenico::Connect::SDK::Domain::Payment::CashPaymentProduct1504SpecificInput}
@@ -8,9 +8,12 @@ module Ingenico::Connect::SDK
8
8
  module Domain
9
9
  module Payment
10
10
 
11
+ # Deprecated; No replacement
11
12
  class CashPaymentProduct1503SpecificInput < Ingenico::Connect::SDK::DataObject
12
13
 
13
14
  # String
15
+ #
16
+ # Deprecated; No replacement, since Boleto Bancario no longer needs a return URL
14
17
  attr_accessor :return_url
15
18
 
16
19
  def to_h
@@ -4,6 +4,7 @@
4
4
  #
5
5
  require 'ingenico/connect/sdk/data_object'
6
6
  require 'ingenico/connect/sdk/domain/payment/complete_payment_card_payment_method_specific_input'
7
+ require 'ingenico/connect/sdk/domain/payment/merchant'
7
8
  require 'ingenico/connect/sdk/domain/payment/order'
8
9
 
9
10
  module Ingenico::Connect::SDK
@@ -15,12 +16,16 @@ module Ingenico::Connect::SDK
15
16
  # {Ingenico::Connect::SDK::Domain::Payment::CompletePaymentCardPaymentMethodSpecificInput}
16
17
  attr_accessor :card_payment_method_specific_input
17
18
 
19
+ # {Ingenico::Connect::SDK::Domain::Payment::Merchant}
20
+ attr_accessor :merchant
21
+
18
22
  # {Ingenico::Connect::SDK::Domain::Payment::Order}
19
23
  attr_accessor :order
20
24
 
21
25
  def to_h
22
26
  hash = super
23
27
  add_to_hash(hash, 'cardPaymentMethodSpecificInput', @card_payment_method_specific_input)
28
+ add_to_hash(hash, 'merchant', @merchant)
24
29
  add_to_hash(hash, 'order', @order)
25
30
  hash
26
31
  end
@@ -33,6 +38,12 @@ module Ingenico::Connect::SDK
33
38
  end
34
39
  @card_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::CompletePaymentCardPaymentMethodSpecificInput.new_from_hash(hash['cardPaymentMethodSpecificInput'])
35
40
  end
41
+ if hash.has_key?('merchant')
42
+ if !(hash['merchant'].is_a? Hash)
43
+ raise TypeError, "value '%s' is not a Hash" % [hash['merchant']]
44
+ end
45
+ @merchant = Ingenico::Connect::SDK::Domain::Payment::Merchant.new_from_hash(hash['merchant'])
46
+ end
36
47
  if hash.has_key?('order')
37
48
  if !(hash['order'].is_a? Hash)
38
49
  raise TypeError, "value '%s' is not a Hash" % [hash['order']]
@@ -13,13 +13,21 @@ module Ingenico::Connect::SDK
13
13
  # String
14
14
  attr_accessor :fax_number
15
15
 
16
+ # String
17
+ attr_accessor :mobile_phone_number
18
+
16
19
  # String
17
20
  attr_accessor :phone_number
18
21
 
22
+ # String
23
+ attr_accessor :work_phone_number
24
+
19
25
  def to_h
20
26
  hash = super
21
27
  add_to_hash(hash, 'faxNumber', @fax_number)
28
+ add_to_hash(hash, 'mobilePhoneNumber', @mobile_phone_number)
22
29
  add_to_hash(hash, 'phoneNumber', @phone_number)
30
+ add_to_hash(hash, 'workPhoneNumber', @work_phone_number)
23
31
  hash
24
32
  end
25
33
 
@@ -28,9 +36,15 @@ module Ingenico::Connect::SDK
28
36
  if hash.has_key?('faxNumber')
29
37
  @fax_number = hash['faxNumber']
30
38
  end
39
+ if hash.has_key?('mobilePhoneNumber')
40
+ @mobile_phone_number = hash['mobilePhoneNumber']
41
+ end
31
42
  if hash.has_key?('phoneNumber')
32
43
  @phone_number = hash['phoneNumber']
33
44
  end
45
+ if hash.has_key?('workPhoneNumber')
46
+ @work_phone_number = hash['workPhoneNumber']
47
+ end
34
48
  end
35
49
  end
36
50
  end
@@ -9,6 +9,7 @@ require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_input'
9
9
  require 'ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input'
10
10
  require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input'
11
11
  require 'ingenico/connect/sdk/domain/payment/invoice_payment_method_specific_input'
12
+ require 'ingenico/connect/sdk/domain/payment/merchant'
12
13
  require 'ingenico/connect/sdk/domain/payment/mobile_payment_method_specific_input'
13
14
  require 'ingenico/connect/sdk/domain/payment/non_sepa_direct_debit_payment_method_specific_input'
14
15
  require 'ingenico/connect/sdk/domain/payment/order'
@@ -45,6 +46,9 @@ module Ingenico::Connect::SDK
45
46
  # {Ingenico::Connect::SDK::Domain::Payment::InvoicePaymentMethodSpecificInput}
46
47
  attr_accessor :invoice_payment_method_specific_input
47
48
 
49
+ # {Ingenico::Connect::SDK::Domain::Payment::Merchant}
50
+ attr_accessor :merchant
51
+
48
52
  # {Ingenico::Connect::SDK::Domain::Payment::MobilePaymentMethodSpecificInput}
49
53
  attr_accessor :mobile_payment_method_specific_input
50
54
 
@@ -67,6 +71,7 @@ module Ingenico::Connect::SDK
67
71
  add_to_hash(hash, 'encryptedCustomerInput', @encrypted_customer_input)
68
72
  add_to_hash(hash, 'fraudFields', @fraud_fields)
69
73
  add_to_hash(hash, 'invoicePaymentMethodSpecificInput', @invoice_payment_method_specific_input)
74
+ add_to_hash(hash, 'merchant', @merchant)
70
75
  add_to_hash(hash, 'mobilePaymentMethodSpecificInput', @mobile_payment_method_specific_input)
71
76
  add_to_hash(hash, 'order', @order)
72
77
  add_to_hash(hash, 'redirectPaymentMethodSpecificInput', @redirect_payment_method_specific_input)
@@ -121,6 +126,12 @@ module Ingenico::Connect::SDK
121
126
  end
122
127
  @invoice_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::InvoicePaymentMethodSpecificInput.new_from_hash(hash['invoicePaymentMethodSpecificInput'])
123
128
  end
129
+ if hash.has_key?('merchant')
130
+ if !(hash['merchant'].is_a? Hash)
131
+ raise TypeError, "value '%s' is not a Hash" % [hash['merchant']]
132
+ end
133
+ @merchant = Ingenico::Connect::SDK::Domain::Payment::Merchant.new_from_hash(hash['merchant'])
134
+ end
124
135
  if hash.has_key?('mobilePaymentMethodSpecificInput')
125
136
  if !(hash['mobilePaymentMethodSpecificInput'].is_a? Hash)
126
137
  raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificInput']]
@@ -6,6 +6,8 @@ require 'ingenico/connect/sdk/domain/definitions/address'
6
6
  require 'ingenico/connect/sdk/domain/definitions/customer_base'
7
7
  require 'ingenico/connect/sdk/domain/payment/address_personal'
8
8
  require 'ingenico/connect/sdk/domain/payment/contact_details'
9
+ require 'ingenico/connect/sdk/domain/payment/customer_account'
10
+ require 'ingenico/connect/sdk/domain/payment/customer_device'
9
11
  require 'ingenico/connect/sdk/domain/payment/personal_information'
10
12
 
11
13
  module Ingenico::Connect::SDK
@@ -14,15 +16,27 @@ module Ingenico::Connect::SDK
14
16
 
15
17
  class Customer < Ingenico::Connect::SDK::Domain::Definitions::CustomerBase
16
18
 
19
+ # {Ingenico::Connect::SDK::Domain::Payment::CustomerAccount}
20
+ attr_accessor :account
21
+
22
+ # String
23
+ attr_accessor :account_type
24
+
17
25
  # {Ingenico::Connect::SDK::Domain::Definitions::Address}
18
26
  attr_accessor :billing_address
19
27
 
20
28
  # {Ingenico::Connect::SDK::Domain::Payment::ContactDetails}
21
29
  attr_accessor :contact_details
22
30
 
31
+ # {Ingenico::Connect::SDK::Domain::Payment::CustomerDevice}
32
+ attr_accessor :device
33
+
23
34
  # String
24
35
  attr_accessor :fiscal_number
25
36
 
37
+ # true/false
38
+ attr_accessor :is_previous_customer
39
+
26
40
  # String
27
41
  attr_accessor :locale
28
42
 
@@ -30,13 +44,19 @@ module Ingenico::Connect::SDK
30
44
  attr_accessor :personal_information
31
45
 
32
46
  # {Ingenico::Connect::SDK::Domain::Payment::AddressPersonal}
47
+ #
48
+ # Deprecated; Use Order.shipping.address instead
33
49
  attr_accessor :shipping_address
34
50
 
35
51
  def to_h
36
52
  hash = super
53
+ add_to_hash(hash, 'account', @account)
54
+ add_to_hash(hash, 'accountType', @account_type)
37
55
  add_to_hash(hash, 'billingAddress', @billing_address)
38
56
  add_to_hash(hash, 'contactDetails', @contact_details)
57
+ add_to_hash(hash, 'device', @device)
39
58
  add_to_hash(hash, 'fiscalNumber', @fiscal_number)
59
+ add_to_hash(hash, 'isPreviousCustomer', @is_previous_customer)
40
60
  add_to_hash(hash, 'locale', @locale)
41
61
  add_to_hash(hash, 'personalInformation', @personal_information)
42
62
  add_to_hash(hash, 'shippingAddress', @shipping_address)
@@ -45,6 +65,15 @@ module Ingenico::Connect::SDK
45
65
 
46
66
  def from_hash(hash)
47
67
  super
68
+ if hash.has_key?('account')
69
+ if !(hash['account'].is_a? Hash)
70
+ raise TypeError, "value '%s' is not a Hash" % [hash['account']]
71
+ end
72
+ @account = Ingenico::Connect::SDK::Domain::Payment::CustomerAccount.new_from_hash(hash['account'])
73
+ end
74
+ if hash.has_key?('accountType')
75
+ @account_type = hash['accountType']
76
+ end
48
77
  if hash.has_key?('billingAddress')
49
78
  if !(hash['billingAddress'].is_a? Hash)
50
79
  raise TypeError, "value '%s' is not a Hash" % [hash['billingAddress']]
@@ -57,9 +86,18 @@ module Ingenico::Connect::SDK
57
86
  end
58
87
  @contact_details = Ingenico::Connect::SDK::Domain::Payment::ContactDetails.new_from_hash(hash['contactDetails'])
59
88
  end
89
+ if hash.has_key?('device')
90
+ if !(hash['device'].is_a? Hash)
91
+ raise TypeError, "value '%s' is not a Hash" % [hash['device']]
92
+ end
93
+ @device = Ingenico::Connect::SDK::Domain::Payment::CustomerDevice.new_from_hash(hash['device'])
94
+ end
60
95
  if hash.has_key?('fiscalNumber')
61
96
  @fiscal_number = hash['fiscalNumber']
62
97
  end
98
+ if hash.has_key?('isPreviousCustomer')
99
+ @is_previous_customer = hash['isPreviousCustomer']
100
+ end
63
101
  if hash.has_key?('locale')
64
102
  @locale = hash['locale']
65
103
  end