connect-sdk-ruby 1.12.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/connect-sdk-ruby.gemspec +1 -1
  3. data/examples/merchant/mandates/block_mandate_example.rb +22 -0
  4. data/examples/merchant/mandates/create_mandate_example.rb +66 -0
  5. data/examples/merchant/mandates/get_mandate_example.rb +22 -0
  6. data/examples/merchant/mandates/revoke_mandate_example.rb +22 -0
  7. data/examples/merchant/mandates/unblock_mandate_example.rb +22 -0
  8. data/examples/merchant/products/get_customer_details_example.rb +1 -1
  9. data/lib/ingenico/connect/sdk/domain/definitions/redirect_data_base.rb +38 -0
  10. data/lib/ingenico/connect/sdk/domain/hostedcheckout/create_hosted_checkout_request.rb +22 -0
  11. data/lib/ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_input.rb +7 -0
  12. data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_base.rb +70 -0
  13. data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_request.rb +15 -0
  14. data/lib/ingenico/connect/sdk/domain/mandates/create_mandate_response.rb +46 -0
  15. data/lib/ingenico/connect/sdk/domain/mandates/get_mandate_response.rb +35 -0
  16. data/lib/ingenico/connect/sdk/domain/mandates/mandate_address.rb +59 -0
  17. data/lib/ingenico/connect/sdk/domain/mandates/mandate_contact_details.rb +38 -0
  18. data/lib/ingenico/connect/sdk/domain/mandates/mandate_customer.rb +75 -0
  19. data/lib/ingenico/connect/sdk/domain/mandates/mandate_merchant_action.rb +42 -0
  20. data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_information.rb +42 -0
  21. data/lib/ingenico/connect/sdk/domain/mandates/mandate_personal_name.rb +38 -0
  22. data/lib/ingenico/connect/sdk/domain/mandates/mandate_redirect_data.rb +15 -0
  23. data/lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb +63 -0
  24. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input.rb +2 -9
  25. data/lib/ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input_base.rb +31 -0
  26. data/lib/ingenico/connect/sdk/domain/payment/order.rb +11 -0
  27. data/lib/ingenico/connect/sdk/domain/payment/payment_product771_specific_output.rb +31 -0
  28. data/lib/ingenico/connect/sdk/domain/payment/redirect_data.rb +2 -25
  29. data/lib/ingenico/connect/sdk/domain/payment/seller.rb +91 -0
  30. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input.rb +2 -2
  31. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input_base.rb +35 -0
  32. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_output.rb +11 -0
  33. data/lib/ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_product771_specific_input.rb +42 -0
  34. data/lib/ingenico/connect/sdk/merchant/mandates/mandates_client.rb +221 -0
  35. data/lib/ingenico/connect/sdk/merchant/merchant_client.rb +9 -0
  36. data/lib/ingenico/connect/sdk/meta_data_provider.rb +1 -1
  37. data/lib/ingenico/connect/sdk/modules.rb +10 -0
  38. metadata +26 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 878a7c505429391350c874631ebae262a112539f
4
- data.tar.gz: 9049d2000576c76c1dce0928543cc76a78e20225
3
+ metadata.gz: 1abe70eaaa4ac1e61b2ce2e587502be22dedf77a
4
+ data.tar.gz: 85a46a7e57fdc34776c370bb03c7f414c448806d
5
5
  SHA512:
6
- metadata.gz: 2ebd749be5d4c3a3992ca605bff3156e7aca76e74bcf30dc12965890b035b738c089ea80aaabc0a412f22b803f44995d7f3fc0761cb12a92763891b2f633fb1c
7
- data.tar.gz: ff278fea60d81c48c82716ef7cc5b5c62b62ed7de80db81b4f9cf947d77c4e27456385ae277d1c4c9146fb3f535ce59c76f29037b6b189b5f54b2b07b05f83fc
6
+ metadata.gz: 47f4321bd49e3fc669628bd28577d0ff194986a5842821d5aa9eb0c29d891d1aa3c8de41657dd769ba6454b004a20f842faa1c7abcb6d0d8c63859cdc13f3ea6
7
+ data.tar.gz: 77b74154a76f5675db68a02ad7bae2f40fd5717c3f06ffb868e3c5aa172821a73fe0975222367075ff0c2a79c16d84e3653848e65b11644df93df83a5b66a5f6
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'connect-sdk-ruby'
3
- spec.version = '1.12.0'
3
+ spec.version = '1.13.0'
4
4
  spec.authors = ['Ingenico ePayments']
5
5
  spec.email = ['github@epay.ingenico.com']
6
6
  spec.summary = %q{SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API}
@@ -0,0 +1,22 @@
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/factory'
6
+
7
+
8
+ def example
9
+ get_client do |client|
10
+ response = client.merchant('merchantId').mandates().block('42268d8067df43e18a50a2ebf4bdb729')
11
+ end
12
+ end
13
+
14
+ def get_client
15
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
16
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
17
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
18
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
19
+ ensure
20
+ # Free networking resources when done
21
+ client.close unless client.nil?
22
+ end
@@ -0,0 +1,66 @@
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/factory'
6
+ require 'ingenico/connect/sdk/domain/definitions/bank_account_iban'
7
+ require 'ingenico/connect/sdk/domain/mandates/create_mandate_request'
8
+ require 'ingenico/connect/sdk/domain/mandates/mandate_address'
9
+ require 'ingenico/connect/sdk/domain/mandates/mandate_contact_details'
10
+ require 'ingenico/connect/sdk/domain/mandates/mandate_customer'
11
+ require 'ingenico/connect/sdk/domain/mandates/mandate_personal_information'
12
+ require 'ingenico/connect/sdk/domain/mandates/mandate_personal_name'
13
+
14
+ Definitions = Ingenico::Connect::SDK::Domain::Definitions
15
+ Mandates = Ingenico::Connect::SDK::Domain::Mandates
16
+
17
+ def example
18
+ get_client do |client|
19
+ bank_account_iban = Definitions::BankAccountIban.new
20
+ bank_account_iban.iban = 'DE46940594210000012345'
21
+
22
+ contact_details = Mandates::MandateContactDetails.new
23
+ contact_details.email_address = 'wile.e.coyote@acmelabs.com'
24
+ contact_details.phone_number = '+1234567890'
25
+
26
+ mandate_address = Mandates::MandateAddress.new
27
+ mandate_address.city = 'Monumentenvallei'
28
+ mandate_address.country_code = 'NL'
29
+ mandate_address.street = 'Woestijnweg'
30
+ mandate_address.zip = '1337XD'
31
+
32
+ name = Mandates::MandatePersonalName.new
33
+ name.first_name = 'Wile'
34
+ name.surname = 'Coyote'
35
+
36
+ personal_information = Mandates::MandatePersonalInformation.new
37
+ personal_information.name = name
38
+ personal_information.title = 'Miss'
39
+
40
+ customer = Mandates::MandateCustomer.new
41
+ customer.bank_account_iban = bank_account_iban
42
+ customer.company_name = 'Acme labs'
43
+ customer.contact_details = contact_details
44
+ customer.mandate_address = mandate_address
45
+ customer.personal_information = personal_information
46
+
47
+ body = Mandates::CreateMandateRequest.new
48
+ body.customer = customer
49
+ body.customer_reference = 'idonthaveareference'
50
+ body.language = 'nl'
51
+ body.recurrence_type = 'UNIQUE'
52
+ body.signature_type = 'UNSIGNED'
53
+
54
+ response = client.merchant('merchantId').mandates().create_with_mandate_reference('42268d8067df43e18a50a2ebf4bdb729', body)
55
+ end
56
+ end
57
+
58
+ def get_client
59
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
60
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
61
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
62
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
63
+ ensure
64
+ # Free networking resources when done
65
+ client.close unless client.nil?
66
+ end
@@ -0,0 +1,22 @@
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/factory'
6
+
7
+
8
+ def example
9
+ get_client do |client|
10
+ response = client.merchant('merchantId').mandates().get('42268d8067df43e18a50a2ebf4bdb729')
11
+ end
12
+ end
13
+
14
+ def get_client
15
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
16
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
17
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
18
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
19
+ ensure
20
+ # Free networking resources when done
21
+ client.close unless client.nil?
22
+ end
@@ -0,0 +1,22 @@
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/factory'
6
+
7
+
8
+ def example
9
+ get_client do |client|
10
+ response = client.merchant('merchantId').mandates().revoke('42268d8067df43e18a50a2ebf4bdb729')
11
+ end
12
+ end
13
+
14
+ def get_client
15
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
16
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
17
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
18
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
19
+ ensure
20
+ # Free networking resources when done
21
+ client.close unless client.nil?
22
+ end
@@ -0,0 +1,22 @@
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/factory'
6
+
7
+
8
+ def example
9
+ get_client do |client|
10
+ response = client.merchant('merchantId').mandates().unblock('42268d8067df43e18a50a2ebf4bdb729')
11
+ end
12
+ end
13
+
14
+ def get_client
15
+ api_key_id = ENV.fetch('connect.api.apiKeyId', 'someKey')
16
+ secret_api_key = ENV.fetch('connect.api.secretApiKey', 'someSecret')
17
+ configuration_file_name = File.join(__FILE__, '..', '..', 'example_configuration.yml')
18
+ yield client = Ingenico::Connect::SDK::Factory.create_client_from_file(configuration_file_name, api_key_id, secret_api_key)
19
+ ensure
20
+ # Free networking resources when done
21
+ client.close unless client.nil?
22
+ end
@@ -23,7 +23,7 @@ def example
23
23
  body.country_code = 'SE'
24
24
  body.values = values
25
25
 
26
- response = client.merchant('merchantId').products().customer_details(1, body)
26
+ response = client.merchant('merchantId').products().customer_details(9000, body)
27
27
  end
28
28
  end
29
29
 
@@ -0,0 +1,38 @@
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 Definitions
10
+
11
+ class RedirectDataBase < Ingenico::Connect::SDK::DataObject
12
+
13
+ # String
14
+ attr_accessor :returnmac
15
+
16
+ # String
17
+ attr_accessor :redirect_url
18
+
19
+ def to_h
20
+ hash = super
21
+ add_to_hash(hash, 'RETURNMAC', @returnmac)
22
+ add_to_hash(hash, 'redirectURL', @redirect_url)
23
+ hash
24
+ end
25
+
26
+ def from_hash(hash)
27
+ super
28
+ if hash.has_key?('RETURNMAC')
29
+ @returnmac = hash['RETURNMAC']
30
+ end
31
+ if hash.has_key?('redirectURL')
32
+ @redirect_url = hash['redirectURL']
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -8,8 +8,10 @@ require 'ingenico/connect/sdk/domain/hostedcheckout/hosted_checkout_specific_inp
8
8
  require 'ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_input_base'
9
9
  require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_input_base'
10
10
  require 'ingenico/connect/sdk/domain/payment/cash_payment_method_specific_input_base'
11
+ require 'ingenico/connect/sdk/domain/payment/e_invoice_payment_method_specific_input_base'
11
12
  require 'ingenico/connect/sdk/domain/payment/order'
12
13
  require 'ingenico/connect/sdk/domain/payment/redirect_payment_method_specific_input_base'
14
+ require 'ingenico/connect/sdk/domain/payment/sepa_direct_debit_payment_method_specific_input_base'
13
15
 
14
16
  module Ingenico::Connect::SDK
15
17
  module Domain
@@ -26,6 +28,9 @@ module Ingenico::Connect::SDK
26
28
  # {Ingenico::Connect::SDK::Domain::Payment::CashPaymentMethodSpecificInputBase}
27
29
  attr_accessor :cash_payment_method_specific_input
28
30
 
31
+ # {Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificInputBase}
32
+ attr_accessor :e_invoice_payment_method_specific_input
33
+
29
34
  # {Ingenico::Connect::SDK::Domain::Definitions::FraudFields}
30
35
  attr_accessor :fraud_fields
31
36
 
@@ -38,15 +43,20 @@ module Ingenico::Connect::SDK
38
43
  # {Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentMethodSpecificInputBase}
39
44
  attr_accessor :redirect_payment_method_specific_input
40
45
 
46
+ # {Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentMethodSpecificInputBase}
47
+ attr_accessor :sepa_direct_debit_payment_method_specific_input
48
+
41
49
  def to_h
42
50
  hash = super
43
51
  add_to_hash(hash, 'bankTransferPaymentMethodSpecificInput', @bank_transfer_payment_method_specific_input)
44
52
  add_to_hash(hash, 'cardPaymentMethodSpecificInput', @card_payment_method_specific_input)
45
53
  add_to_hash(hash, 'cashPaymentMethodSpecificInput', @cash_payment_method_specific_input)
54
+ add_to_hash(hash, 'eInvoicePaymentMethodSpecificInput', @e_invoice_payment_method_specific_input)
46
55
  add_to_hash(hash, 'fraudFields', @fraud_fields)
47
56
  add_to_hash(hash, 'hostedCheckoutSpecificInput', @hosted_checkout_specific_input)
48
57
  add_to_hash(hash, 'order', @order)
49
58
  add_to_hash(hash, 'redirectPaymentMethodSpecificInput', @redirect_payment_method_specific_input)
59
+ add_to_hash(hash, 'sepaDirectDebitPaymentMethodSpecificInput', @sepa_direct_debit_payment_method_specific_input)
50
60
  hash
51
61
  end
52
62
 
@@ -70,6 +80,12 @@ module Ingenico::Connect::SDK
70
80
  end
71
81
  @cash_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::CashPaymentMethodSpecificInputBase.new_from_hash(hash['cashPaymentMethodSpecificInput'])
72
82
  end
83
+ if hash.has_key?('eInvoicePaymentMethodSpecificInput')
84
+ if !(hash['eInvoicePaymentMethodSpecificInput'].is_a? Hash)
85
+ raise TypeError, "value '%s' is not a Hash" % [hash['eInvoicePaymentMethodSpecificInput']]
86
+ end
87
+ @e_invoice_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::EInvoicePaymentMethodSpecificInputBase.new_from_hash(hash['eInvoicePaymentMethodSpecificInput'])
88
+ end
73
89
  if hash.has_key?('fraudFields')
74
90
  if !(hash['fraudFields'].is_a? Hash)
75
91
  raise TypeError, "value '%s' is not a Hash" % [hash['fraudFields']]
@@ -94,6 +110,12 @@ module Ingenico::Connect::SDK
94
110
  end
95
111
  @redirect_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::RedirectPaymentMethodSpecificInputBase.new_from_hash(hash['redirectPaymentMethodSpecificInput'])
96
112
  end
113
+ if hash.has_key?('sepaDirectDebitPaymentMethodSpecificInput')
114
+ if !(hash['sepaDirectDebitPaymentMethodSpecificInput'].is_a? Hash)
115
+ raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebitPaymentMethodSpecificInput']]
116
+ end
117
+ @sepa_direct_debit_payment_method_specific_input = Ingenico::Connect::SDK::Domain::Payment::SepaDirectDebitPaymentMethodSpecificInputBase.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificInput'])
118
+ end
97
119
  end
98
120
  end
99
121
  end
@@ -20,6 +20,9 @@ module Ingenico::Connect::SDK
20
20
  # {Ingenico::Connect::SDK::Domain::Hostedcheckout::PaymentProductFiltersHostedCheckout}
21
21
  attr_accessor :payment_product_filters
22
22
 
23
+ # true/false
24
+ attr_accessor :return_cancel_state
25
+
23
26
  # String
24
27
  attr_accessor :return_url
25
28
 
@@ -37,6 +40,7 @@ module Ingenico::Connect::SDK
37
40
  add_to_hash(hash, 'isRecurring', @is_recurring)
38
41
  add_to_hash(hash, 'locale', @locale)
39
42
  add_to_hash(hash, 'paymentProductFilters', @payment_product_filters)
43
+ add_to_hash(hash, 'returnCancelState', @return_cancel_state)
40
44
  add_to_hash(hash, 'returnUrl', @return_url)
41
45
  add_to_hash(hash, 'showResultPage', @show_result_page)
42
46
  add_to_hash(hash, 'tokens', @tokens)
@@ -58,6 +62,9 @@ module Ingenico::Connect::SDK
58
62
  end
59
63
  @payment_product_filters = Ingenico::Connect::SDK::Domain::Hostedcheckout::PaymentProductFiltersHostedCheckout.new_from_hash(hash['paymentProductFilters'])
60
64
  end
65
+ if hash.has_key?('returnCancelState')
66
+ @return_cancel_state = hash['returnCancelState']
67
+ end
61
68
  if hash.has_key?('returnUrl')
62
69
  @return_url = hash['returnUrl']
63
70
  end
@@ -0,0 +1,70 @@
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/mandates/mandate_customer'
7
+
8
+ module Ingenico::Connect::SDK
9
+ module Domain
10
+ module Mandates
11
+
12
+ class CreateMandateBase < Ingenico::Connect::SDK::DataObject
13
+
14
+ # {Ingenico::Connect::SDK::Domain::Mandates::MandateCustomer}
15
+ attr_accessor :customer
16
+
17
+ # String
18
+ attr_accessor :customer_reference
19
+
20
+ # String
21
+ attr_accessor :language
22
+
23
+ # String
24
+ attr_accessor :recurrence_type
25
+
26
+ # String
27
+ attr_accessor :return_url
28
+
29
+ # String
30
+ attr_accessor :signature_type
31
+
32
+ def to_h
33
+ hash = super
34
+ add_to_hash(hash, 'customer', @customer)
35
+ add_to_hash(hash, 'customerReference', @customer_reference)
36
+ add_to_hash(hash, 'language', @language)
37
+ add_to_hash(hash, 'recurrenceType', @recurrence_type)
38
+ add_to_hash(hash, 'returnUrl', @return_url)
39
+ add_to_hash(hash, 'signatureType', @signature_type)
40
+ hash
41
+ end
42
+
43
+ def from_hash(hash)
44
+ super
45
+ if hash.has_key?('customer')
46
+ if !(hash['customer'].is_a? Hash)
47
+ raise TypeError, "value '%s' is not a Hash" % [hash['customer']]
48
+ end
49
+ @customer = Ingenico::Connect::SDK::Domain::Mandates::MandateCustomer.new_from_hash(hash['customer'])
50
+ end
51
+ if hash.has_key?('customerReference')
52
+ @customer_reference = hash['customerReference']
53
+ end
54
+ if hash.has_key?('language')
55
+ @language = hash['language']
56
+ end
57
+ if hash.has_key?('recurrenceType')
58
+ @recurrence_type = hash['recurrenceType']
59
+ end
60
+ if hash.has_key?('returnUrl')
61
+ @return_url = hash['returnUrl']
62
+ end
63
+ if hash.has_key?('signatureType')
64
+ @signature_type = hash['signatureType']
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,15 @@
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/domain/mandates/create_mandate_base'
6
+
7
+ module Ingenico::Connect::SDK
8
+ module Domain
9
+ module Mandates
10
+
11
+ class CreateMandateRequest < Ingenico::Connect::SDK::Domain::Mandates::CreateMandateBase
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,46 @@
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/mandates/mandate_merchant_action'
7
+ require 'ingenico/connect/sdk/domain/mandates/mandate_response'
8
+
9
+ module Ingenico::Connect::SDK
10
+ module Domain
11
+ module Mandates
12
+
13
+ class CreateMandateResponse < Ingenico::Connect::SDK::DataObject
14
+
15
+ # {Ingenico::Connect::SDK::Domain::Mandates::MandateResponse}
16
+ attr_accessor :mandate
17
+
18
+ # {Ingenico::Connect::SDK::Domain::Mandates::MandateMerchantAction}
19
+ attr_accessor :merchant_action
20
+
21
+ def to_h
22
+ hash = super
23
+ add_to_hash(hash, 'mandate', @mandate)
24
+ add_to_hash(hash, 'merchantAction', @merchant_action)
25
+ hash
26
+ end
27
+
28
+ def from_hash(hash)
29
+ super
30
+ if hash.has_key?('mandate')
31
+ if !(hash['mandate'].is_a? Hash)
32
+ raise TypeError, "value '%s' is not a Hash" % [hash['mandate']]
33
+ end
34
+ @mandate = Ingenico::Connect::SDK::Domain::Mandates::MandateResponse.new_from_hash(hash['mandate'])
35
+ end
36
+ if hash.has_key?('merchantAction')
37
+ if !(hash['merchantAction'].is_a? Hash)
38
+ raise TypeError, "value '%s' is not a Hash" % [hash['merchantAction']]
39
+ end
40
+ @merchant_action = Ingenico::Connect::SDK::Domain::Mandates::MandateMerchantAction.new_from_hash(hash['merchantAction'])
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end