acquiring-sdk-ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +2 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +140 -0
  5. data/Rakefile +34 -0
  6. data/acquiring-sdk-ruby.gemspec +30 -0
  7. data/lib/worldline/acquiring/sdk/api_resource.rb +53 -0
  8. data/lib/worldline/acquiring/sdk/authentication/authenticator.rb +21 -0
  9. data/lib/worldline/acquiring/sdk/authentication/authorization_type.rb +17 -0
  10. data/lib/worldline/acquiring/sdk/authentication/oauth2_authenticator.rb +142 -0
  11. data/lib/worldline/acquiring/sdk/authentication/oauth2_exception.rb +15 -0
  12. data/lib/worldline/acquiring/sdk/authentication.rb +1 -0
  13. data/lib/worldline/acquiring/sdk/call_context.rb +9 -0
  14. data/lib/worldline/acquiring/sdk/client.rb +69 -0
  15. data/lib/worldline/acquiring/sdk/communication/communication_exception.rb +21 -0
  16. data/lib/worldline/acquiring/sdk/communication/connection.rb +50 -0
  17. data/lib/worldline/acquiring/sdk/communication/default_connection.rb +429 -0
  18. data/lib/worldline/acquiring/sdk/communication/metadata_provider.rb +162 -0
  19. data/lib/worldline/acquiring/sdk/communication/multipart_form_data_object.rb +54 -0
  20. data/lib/worldline/acquiring/sdk/communication/multipart_form_data_request.rb +15 -0
  21. data/lib/worldline/acquiring/sdk/communication/not_found_exception.rb +21 -0
  22. data/lib/worldline/acquiring/sdk/communication/param_request.rb +16 -0
  23. data/lib/worldline/acquiring/sdk/communication/pooled_connection.rb +28 -0
  24. data/lib/worldline/acquiring/sdk/communication/request_header.rb +64 -0
  25. data/lib/worldline/acquiring/sdk/communication/request_param.rb +30 -0
  26. data/lib/worldline/acquiring/sdk/communication/response_exception.rb +58 -0
  27. data/lib/worldline/acquiring/sdk/communication/response_header.rb +80 -0
  28. data/lib/worldline/acquiring/sdk/communication.rb +1 -0
  29. data/lib/worldline/acquiring/sdk/communicator.rb +506 -0
  30. data/lib/worldline/acquiring/sdk/communicator_configuration.rb +197 -0
  31. data/lib/worldline/acquiring/sdk/domain/data_object.rb +34 -0
  32. data/lib/worldline/acquiring/sdk/domain/shopping_cart_extension.rb +62 -0
  33. data/lib/worldline/acquiring/sdk/domain/uploadable_file.rb +35 -0
  34. data/lib/worldline/acquiring/sdk/domain.rb +1 -0
  35. data/lib/worldline/acquiring/sdk/factory.rb +183 -0
  36. data/lib/worldline/acquiring/sdk/json/default_marshaller.rb +36 -0
  37. data/lib/worldline/acquiring/sdk/json/marshaller.rb +29 -0
  38. data/lib/worldline/acquiring/sdk/json/marshaller_syntax_exception.rb +11 -0
  39. data/lib/worldline/acquiring/sdk/json.rb +1 -0
  40. data/lib/worldline/acquiring/sdk/logging/communicator_logger.rb +26 -0
  41. data/lib/worldline/acquiring/sdk/logging/log_message_builder.rb +91 -0
  42. data/lib/worldline/acquiring/sdk/logging/logging_capable.rb +19 -0
  43. data/lib/worldline/acquiring/sdk/logging/obfuscation/body_obfuscator.rb +101 -0
  44. data/lib/worldline/acquiring/sdk/logging/obfuscation/header_obfuscator.rb +54 -0
  45. data/lib/worldline/acquiring/sdk/logging/obfuscation/obfuscation_capable.rb +23 -0
  46. data/lib/worldline/acquiring/sdk/logging/obfuscation/obfuscation_rule.rb +49 -0
  47. data/lib/worldline/acquiring/sdk/logging/obfuscation.rb +1 -0
  48. data/lib/worldline/acquiring/sdk/logging/request_log_message_builder.rb +52 -0
  49. data/lib/worldline/acquiring/sdk/logging/response_log_message_builder.rb +43 -0
  50. data/lib/worldline/acquiring/sdk/logging/ruby_communicator_logger.rb +63 -0
  51. data/lib/worldline/acquiring/sdk/logging/stdout_communicator_logger.rb +33 -0
  52. data/lib/worldline/acquiring/sdk/logging.rb +1 -0
  53. data/lib/worldline/acquiring/sdk/proxy_configuration.rb +76 -0
  54. data/lib/worldline/acquiring/sdk/v1/acquirer/acquirer_client.rb +35 -0
  55. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/accountverifications/account_verifications_client.rb +60 -0
  56. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/accountverifications.rb +4 -0
  57. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion/dynamic_currency_conversion_client.rb +60 -0
  58. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion.rb +4 -0
  59. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/merchant_client.rb +66 -0
  60. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/payments/get_payment_status_params.rb +34 -0
  61. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/payments/payments_client.rb +224 -0
  62. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/payments.rb +4 -0
  63. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/refunds/get_refund_params.rb +34 -0
  64. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/refunds/refunds_client.rb +157 -0
  65. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/refunds.rb +4 -0
  66. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/technicalreversals/technical_reversals_client.rb +64 -0
  67. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/technicalreversals.rb +4 -0
  68. data/lib/worldline/acquiring/sdk/v1/acquirer/merchant.rb +4 -0
  69. data/lib/worldline/acquiring/sdk/v1/acquirer.rb +4 -0
  70. data/lib/worldline/acquiring/sdk/v1/api_exception.rb +63 -0
  71. data/lib/worldline/acquiring/sdk/v1/authorization_exception.rb +23 -0
  72. data/lib/worldline/acquiring/sdk/v1/domain/address_verification_data.rb +41 -0
  73. data/lib/worldline/acquiring/sdk/v1/domain/amount_data.rb +48 -0
  74. data/lib/worldline/acquiring/sdk/v1/domain/api_account_verification_request.rb +70 -0
  75. data/lib/worldline/acquiring/sdk/v1/domain/api_account_verification_response.rb +87 -0
  76. data/lib/worldline/acquiring/sdk/v1/domain/api_action_response.rb +71 -0
  77. data/lib/worldline/acquiring/sdk/v1/domain/api_action_response_for_refund.rb +71 -0
  78. data/lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb +75 -0
  79. data/lib/worldline/acquiring/sdk/v1/domain/api_capture_request_for_refund.rb +43 -0
  80. data/lib/worldline/acquiring/sdk/v1/domain/api_increment_request.rb +61 -0
  81. data/lib/worldline/acquiring/sdk/v1/domain/api_increment_response.rb +43 -0
  82. data/lib/worldline/acquiring/sdk/v1/domain/api_payment_error_response.rb +62 -0
  83. data/lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb +77 -0
  84. data/lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb +95 -0
  85. data/lib/worldline/acquiring/sdk/v1/domain/api_payment_resource.rb +103 -0
  86. data/lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb +126 -0
  87. data/lib/worldline/acquiring/sdk/v1/domain/api_payment_reversal_request.rb +61 -0
  88. data/lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb +66 -0
  89. data/lib/worldline/acquiring/sdk/v1/domain/api_references_for_responses.rb +48 -0
  90. data/lib/worldline/acquiring/sdk/v1/domain/api_refund_request.rb +88 -0
  91. data/lib/worldline/acquiring/sdk/v1/domain/api_refund_resource.rb +110 -0
  92. data/lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb +133 -0
  93. data/lib/worldline/acquiring/sdk/v1/domain/api_refund_summary_for_response.rb +66 -0
  94. data/lib/worldline/acquiring/sdk/v1/domain/api_reversal_response.rb +36 -0
  95. data/lib/worldline/acquiring/sdk/v1/domain/api_technical_reversal_request.rb +50 -0
  96. data/lib/worldline/acquiring/sdk/v1/domain/api_technical_reversal_response.rb +62 -0
  97. data/lib/worldline/acquiring/sdk/v1/domain/card_data_for_dcc.rb +48 -0
  98. data/lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb +52 -0
  99. data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data.rb +114 -0
  100. data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_refund.rb +82 -0
  101. data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb +43 -0
  102. data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb +52 -0
  103. data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_verification.rb +91 -0
  104. data/lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb +55 -0
  105. data/lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb +60 -0
  106. data/lib/worldline/acquiring/sdk/v1/domain/e_commerce_data.rb +52 -0
  107. data/lib/worldline/acquiring/sdk/v1/domain/e_commerce_data_for_account_verification.rb +45 -0
  108. data/lib/worldline/acquiring/sdk/v1/domain/e_commerce_data_for_response.rb +41 -0
  109. data/lib/worldline/acquiring/sdk/v1/domain/get_dcc_rate_request.rb +75 -0
  110. data/lib/worldline/acquiring/sdk/v1/domain/get_dcc_rate_response.rb +57 -0
  111. data/lib/worldline/acquiring/sdk/v1/domain/initial_card_on_file_data.rb +41 -0
  112. data/lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb +76 -0
  113. data/lib/worldline/acquiring/sdk/v1/domain/network_token_data.rb +41 -0
  114. data/lib/worldline/acquiring/sdk/v1/domain/payment_references.rb +48 -0
  115. data/lib/worldline/acquiring/sdk/v1/domain/plain_card_data.rb +48 -0
  116. data/lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data.rb +34 -0
  117. data/lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_dcc.rb +41 -0
  118. data/lib/worldline/acquiring/sdk/v1/domain/rate_data.rb +64 -0
  119. data/lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb +94 -0
  120. data/lib/worldline/acquiring/sdk/v1/domain/sub_operation_for_refund.rb +87 -0
  121. data/lib/worldline/acquiring/sdk/v1/domain/subsequent_card_on_file_data.rb +48 -0
  122. data/lib/worldline/acquiring/sdk/v1/domain/three_d_secure.rb +62 -0
  123. data/lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb +52 -0
  124. data/lib/worldline/acquiring/sdk/v1/domain.rb +4 -0
  125. data/lib/worldline/acquiring/sdk/v1/exception_factory.rb +48 -0
  126. data/lib/worldline/acquiring/sdk/v1/ping/ping_client.rb +52 -0
  127. data/lib/worldline/acquiring/sdk/v1/ping.rb +4 -0
  128. data/lib/worldline/acquiring/sdk/v1/platform_exception.rb +23 -0
  129. data/lib/worldline/acquiring/sdk/v1/reference_exception.rb +23 -0
  130. data/lib/worldline/acquiring/sdk/v1/v1_client.rb +43 -0
  131. data/lib/worldline/acquiring/sdk/v1/validation_exception.rb +23 -0
  132. data/lib/worldline/acquiring/sdk/v1.rb +4 -0
  133. data/lib/worldline/acquiring/sdk.rb +1 -0
  134. data/spec/comparable_extension.rb +29 -0
  135. data/spec/fixtures/resources/authentication/oauth2AccessToken.expired.json +4 -0
  136. data/spec/fixtures/resources/authentication/oauth2AccessToken.invalidClient.json +4 -0
  137. data/spec/fixtures/resources/authentication/oauth2AccessToken.json +4 -0
  138. data/spec/fixtures/resources/communication/getWithQueryParams.json +3 -0
  139. data/spec/fixtures/resources/communication/getWithoutQueryParams.json +3 -0
  140. data/spec/fixtures/resources/communication/notFound.html +1 -0
  141. data/spec/fixtures/resources/communication/postWithBadRequestResponse.json +11 -0
  142. data/spec/fixtures/resources/communication/postWithCreatedResponse.json +6 -0
  143. data/spec/fixtures/resources/communication/unknownServerError.json +10 -0
  144. data/spec/fixtures/resources/logging/bodyNoObfuscation.json +7 -0
  145. data/spec/fixtures/resources/logging/bodyWithBinObfuscated.json +3 -0
  146. data/spec/fixtures/resources/logging/bodyWithBinOriginal.json +3 -0
  147. data/spec/fixtures/resources/logging/bodyWithCardCustomObfuscated.json +13 -0
  148. data/spec/fixtures/resources/logging/bodyWithCardObfuscated.json +13 -0
  149. data/spec/fixtures/resources/logging/bodyWithCardOriginal.json +13 -0
  150. data/spec/fixtures/resources/logging/bodyWithObjectObfuscated.json +5 -0
  151. data/spec/fixtures/resources/logging/bodyWithObjectOriginal.json +5 -0
  152. data/spec/fixtures/resources/properties.oauth2.yml +8 -0
  153. data/spec/fixtures/resources/properties.proxy.yml +14 -0
  154. data/spec/integration/connection_pooling_spec.rb +74 -0
  155. data/spec/integration/multipart_form_data_spec.rb +216 -0
  156. data/spec/integration/process_payment_spec.rb +43 -0
  157. data/spec/integration/request_dcc_rate_spec.rb +24 -0
  158. data/spec/integration/sdk_proxy_spec.rb +70 -0
  159. data/spec/integration_setup.rb +111 -0
  160. data/spec/lib/authentication/oauth2_authenticator_spec.rb +68 -0
  161. data/spec/lib/client_spec.rb +47 -0
  162. data/spec/lib/communication/default_connection_logger_spec.rb +484 -0
  163. data/spec/lib/communication/default_connection_spec.rb +352 -0
  164. data/spec/lib/communication/metadata_provider_spec.rb +93 -0
  165. data/spec/lib/communicator_configuration_spec.rb +181 -0
  166. data/spec/lib/communicator_spec.rb +34 -0
  167. data/spec/lib/factory_spec.rb +38 -0
  168. data/spec/lib/json/default_marshaller_spec.rb +39 -0
  169. data/spec/lib/logging/obfuscation/body_obfuscator_spec.rb +86 -0
  170. data/spec/lib/logging/obfuscation/header_obfuscator_spec.rb +100 -0
  171. data/spec/lib/logging/ruby_communicator_logger_spec.rb +92 -0
  172. data/spec/lib/logging/stdout_communicator_logger_spec.rb +64 -0
  173. data/spec/spec_helper.rb +32 -0
  174. metadata +375 -0
@@ -0,0 +1,91 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+ require 'worldline/acquiring/sdk/v1/domain/card_on_file_data'
6
+ require 'worldline/acquiring/sdk/v1/domain/e_commerce_data_for_account_verification'
7
+ require 'worldline/acquiring/sdk/v1/domain/network_token_data'
8
+ require 'worldline/acquiring/sdk/v1/domain/plain_card_data'
9
+
10
+ module Worldline
11
+ module Acquiring
12
+ module SDK
13
+ module V1
14
+ module Domain
15
+ # @attr [String] brand
16
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::PlainCardData] card_data
17
+ # @attr [String] card_entry_mode
18
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::CardOnFileData] card_on_file_data
19
+ # @attr [String] cardholder_verification_method
20
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::ECommerceDataForAccountVerification] ecommerce_data
21
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::NetworkTokenData] network_token_data
22
+ # @attr [String] wallet_id
23
+ class CardPaymentDataForVerification < Worldline::Acquiring::SDK::Domain::DataObject
24
+
25
+ attr_accessor :brand
26
+
27
+ attr_accessor :card_data
28
+
29
+ attr_accessor :card_entry_mode
30
+
31
+ attr_accessor :card_on_file_data
32
+
33
+ attr_accessor :cardholder_verification_method
34
+
35
+ attr_accessor :ecommerce_data
36
+
37
+ attr_accessor :network_token_data
38
+
39
+ attr_accessor :wallet_id
40
+
41
+ # @return (Hash)
42
+ def to_h
43
+ hash = super
44
+ hash['brand'] = @brand unless @brand.nil?
45
+ hash['cardData'] = @card_data.to_h unless @card_data.nil?
46
+ hash['cardEntryMode'] = @card_entry_mode unless @card_entry_mode.nil?
47
+ hash['cardOnFileData'] = @card_on_file_data.to_h unless @card_on_file_data.nil?
48
+ hash['cardholderVerificationMethod'] = @cardholder_verification_method unless @cardholder_verification_method.nil?
49
+ hash['ecommerceData'] = @ecommerce_data.to_h unless @ecommerce_data.nil?
50
+ hash['networkTokenData'] = @network_token_data.to_h unless @network_token_data.nil?
51
+ hash['walletId'] = @wallet_id unless @wallet_id.nil?
52
+ hash
53
+ end
54
+
55
+ def from_hash(hash)
56
+ super
57
+ if hash.has_key? 'brand'
58
+ @brand = hash['brand']
59
+ end
60
+ if hash.has_key? 'cardData'
61
+ raise TypeError, "value '%s' is not a Hash" % [hash['cardData']] unless hash['cardData'].is_a? Hash
62
+ @card_data = Worldline::Acquiring::SDK::V1::Domain::PlainCardData.new_from_hash(hash['cardData'])
63
+ end
64
+ if hash.has_key? 'cardEntryMode'
65
+ @card_entry_mode = hash['cardEntryMode']
66
+ end
67
+ if hash.has_key? 'cardOnFileData'
68
+ raise TypeError, "value '%s' is not a Hash" % [hash['cardOnFileData']] unless hash['cardOnFileData'].is_a? Hash
69
+ @card_on_file_data = Worldline::Acquiring::SDK::V1::Domain::CardOnFileData.new_from_hash(hash['cardOnFileData'])
70
+ end
71
+ if hash.has_key? 'cardholderVerificationMethod'
72
+ @cardholder_verification_method = hash['cardholderVerificationMethod']
73
+ end
74
+ if hash.has_key? 'ecommerceData'
75
+ raise TypeError, "value '%s' is not a Hash" % [hash['ecommerceData']] unless hash['ecommerceData'].is_a? Hash
76
+ @ecommerce_data = Worldline::Acquiring::SDK::V1::Domain::ECommerceDataForAccountVerification.new_from_hash(hash['ecommerceData'])
77
+ end
78
+ if hash.has_key? 'networkTokenData'
79
+ raise TypeError, "value '%s' is not a Hash" % [hash['networkTokenData']] unless hash['networkTokenData'].is_a? Hash
80
+ @network_token_data = Worldline::Acquiring::SDK::V1::Domain::NetworkTokenData.new_from_hash(hash['networkTokenData'])
81
+ end
82
+ if hash.has_key? 'walletId'
83
+ @wallet_id = hash['walletId']
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,55 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+
6
+ module Worldline
7
+ module Acquiring
8
+ module SDK
9
+ module V1
10
+ module Domain
11
+ # @attr [Integer] amount
12
+ # @attr [float] conversion_rate
13
+ # @attr [String] currency_code
14
+ # @attr [Integer] number_of_decimals
15
+ class DccData < Worldline::Acquiring::SDK::Domain::DataObject
16
+
17
+ attr_accessor :amount
18
+
19
+ attr_accessor :conversion_rate
20
+
21
+ attr_accessor :currency_code
22
+
23
+ attr_accessor :number_of_decimals
24
+
25
+ # @return (Hash)
26
+ def to_h
27
+ hash = super
28
+ hash['amount'] = @amount unless @amount.nil?
29
+ hash['conversionRate'] = @conversion_rate unless @conversion_rate.nil?
30
+ hash['currencyCode'] = @currency_code unless @currency_code.nil?
31
+ hash['numberOfDecimals'] = @number_of_decimals unless @number_of_decimals.nil?
32
+ hash
33
+ end
34
+
35
+ def from_hash(hash)
36
+ super
37
+ if hash.has_key? 'amount'
38
+ @amount = hash['amount']
39
+ end
40
+ if hash.has_key? 'conversionRate'
41
+ @conversion_rate = hash['conversionRate']
42
+ end
43
+ if hash.has_key? 'currencyCode'
44
+ @currency_code = hash['currencyCode']
45
+ end
46
+ if hash.has_key? 'numberOfDecimals'
47
+ @number_of_decimals = hash['numberOfDecimals']
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,60 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+ require 'worldline/acquiring/sdk/v1/domain/amount_data'
6
+ require 'worldline/acquiring/sdk/v1/domain/rate_data'
7
+
8
+ module Worldline
9
+ module Acquiring
10
+ module SDK
11
+ module V1
12
+ module Domain
13
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] original_amount
14
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::RateData] rate
15
+ # @attr [String] rate_reference_id
16
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] resulting_amount
17
+ class DccProposal < Worldline::Acquiring::SDK::Domain::DataObject
18
+
19
+ attr_accessor :original_amount
20
+
21
+ attr_accessor :rate
22
+
23
+ attr_accessor :rate_reference_id
24
+
25
+ attr_accessor :resulting_amount
26
+
27
+ # @return (Hash)
28
+ def to_h
29
+ hash = super
30
+ hash['originalAmount'] = @original_amount.to_h unless @original_amount.nil?
31
+ hash['rate'] = @rate.to_h unless @rate.nil?
32
+ hash['rateReferenceId'] = @rate_reference_id unless @rate_reference_id.nil?
33
+ hash['resultingAmount'] = @resulting_amount.to_h unless @resulting_amount.nil?
34
+ hash
35
+ end
36
+
37
+ def from_hash(hash)
38
+ super
39
+ if hash.has_key? 'originalAmount'
40
+ raise TypeError, "value '%s' is not a Hash" % [hash['originalAmount']] unless hash['originalAmount'].is_a? Hash
41
+ @original_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['originalAmount'])
42
+ end
43
+ if hash.has_key? 'rate'
44
+ raise TypeError, "value '%s' is not a Hash" % [hash['rate']] unless hash['rate'].is_a? Hash
45
+ @rate = Worldline::Acquiring::SDK::V1::Domain::RateData.new_from_hash(hash['rate'])
46
+ end
47
+ if hash.has_key? 'rateReferenceId'
48
+ @rate_reference_id = hash['rateReferenceId']
49
+ end
50
+ if hash.has_key? 'resultingAmount'
51
+ raise TypeError, "value '%s' is not a Hash" % [hash['resultingAmount']] unless hash['resultingAmount'].is_a? Hash
52
+ @resulting_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['resultingAmount'])
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,52 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+ require 'worldline/acquiring/sdk/v1/domain/address_verification_data'
6
+ require 'worldline/acquiring/sdk/v1/domain/three_d_secure'
7
+
8
+ module Worldline
9
+ module Acquiring
10
+ module SDK
11
+ module V1
12
+ module Domain
13
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AddressVerificationData] address_verification_data
14
+ # @attr [String] sca_exemption_request
15
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::ThreeDSecure] three_d_secure
16
+ class ECommerceData < Worldline::Acquiring::SDK::Domain::DataObject
17
+
18
+ attr_accessor :address_verification_data
19
+
20
+ attr_accessor :sca_exemption_request
21
+
22
+ attr_accessor :three_d_secure
23
+
24
+ # @return (Hash)
25
+ def to_h
26
+ hash = super
27
+ hash['addressVerificationData'] = @address_verification_data.to_h unless @address_verification_data.nil?
28
+ hash['scaExemptionRequest'] = @sca_exemption_request unless @sca_exemption_request.nil?
29
+ hash['threeDSecure'] = @three_d_secure.to_h unless @three_d_secure.nil?
30
+ hash
31
+ end
32
+
33
+ def from_hash(hash)
34
+ super
35
+ if hash.has_key? 'addressVerificationData'
36
+ raise TypeError, "value '%s' is not a Hash" % [hash['addressVerificationData']] unless hash['addressVerificationData'].is_a? Hash
37
+ @address_verification_data = Worldline::Acquiring::SDK::V1::Domain::AddressVerificationData.new_from_hash(hash['addressVerificationData'])
38
+ end
39
+ if hash.has_key? 'scaExemptionRequest'
40
+ @sca_exemption_request = hash['scaExemptionRequest']
41
+ end
42
+ if hash.has_key? 'threeDSecure'
43
+ raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecure']] unless hash['threeDSecure'].is_a? Hash
44
+ @three_d_secure = Worldline::Acquiring::SDK::V1::Domain::ThreeDSecure.new_from_hash(hash['threeDSecure'])
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,45 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+ require 'worldline/acquiring/sdk/v1/domain/address_verification_data'
6
+ require 'worldline/acquiring/sdk/v1/domain/three_d_secure'
7
+
8
+ module Worldline
9
+ module Acquiring
10
+ module SDK
11
+ module V1
12
+ module Domain
13
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AddressVerificationData] address_verification_data
14
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::ThreeDSecure] three_d_secure
15
+ class ECommerceDataForAccountVerification < Worldline::Acquiring::SDK::Domain::DataObject
16
+
17
+ attr_accessor :address_verification_data
18
+
19
+ attr_accessor :three_d_secure
20
+
21
+ # @return (Hash)
22
+ def to_h
23
+ hash = super
24
+ hash['addressVerificationData'] = @address_verification_data.to_h unless @address_verification_data.nil?
25
+ hash['threeDSecure'] = @three_d_secure.to_h unless @three_d_secure.nil?
26
+ hash
27
+ end
28
+
29
+ def from_hash(hash)
30
+ super
31
+ if hash.has_key? 'addressVerificationData'
32
+ raise TypeError, "value '%s' is not a Hash" % [hash['addressVerificationData']] unless hash['addressVerificationData'].is_a? Hash
33
+ @address_verification_data = Worldline::Acquiring::SDK::V1::Domain::AddressVerificationData.new_from_hash(hash['addressVerificationData'])
34
+ end
35
+ if hash.has_key? 'threeDSecure'
36
+ raise TypeError, "value '%s' is not a Hash" % [hash['threeDSecure']] unless hash['threeDSecure'].is_a? Hash
37
+ @three_d_secure = Worldline::Acquiring::SDK::V1::Domain::ThreeDSecure.new_from_hash(hash['threeDSecure'])
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,41 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+
6
+ module Worldline
7
+ module Acquiring
8
+ module SDK
9
+ module V1
10
+ module Domain
11
+ # @attr [String] address_verification_result
12
+ # @attr [String] card_security_code_result
13
+ class ECommerceDataForResponse < Worldline::Acquiring::SDK::Domain::DataObject
14
+
15
+ attr_accessor :address_verification_result
16
+
17
+ attr_accessor :card_security_code_result
18
+
19
+ # @return (Hash)
20
+ def to_h
21
+ hash = super
22
+ hash['addressVerificationResult'] = @address_verification_result unless @address_verification_result.nil?
23
+ hash['cardSecurityCodeResult'] = @card_security_code_result unless @card_security_code_result.nil?
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key? 'addressVerificationResult'
30
+ @address_verification_result = hash['addressVerificationResult']
31
+ end
32
+ if hash.has_key? 'cardSecurityCodeResult'
33
+ @card_security_code_result = hash['cardSecurityCodeResult']
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,75 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+ require 'worldline/acquiring/sdk/v1/domain/card_data_for_dcc'
6
+ require 'worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_dcc'
7
+ require 'worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc'
8
+
9
+ module Worldline
10
+ module Acquiring
11
+ module SDK
12
+ module V1
13
+ module Domain
14
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::CardDataForDcc] card_payment_data
15
+ # @attr [String] operation_id
16
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::PointOfSaleDataForDcc] point_of_sale_data
17
+ # @attr [String] rate_reference_id
18
+ # @attr [String] target_currency
19
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::TransactionDataForDcc] transaction
20
+ class GetDCCRateRequest < Worldline::Acquiring::SDK::Domain::DataObject
21
+
22
+ attr_accessor :card_payment_data
23
+
24
+ attr_accessor :operation_id
25
+
26
+ attr_accessor :point_of_sale_data
27
+
28
+ attr_accessor :rate_reference_id
29
+
30
+ attr_accessor :target_currency
31
+
32
+ attr_accessor :transaction
33
+
34
+ # @return (Hash)
35
+ def to_h
36
+ hash = super
37
+ hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
38
+ hash['operationId'] = @operation_id unless @operation_id.nil?
39
+ hash['pointOfSaleData'] = @point_of_sale_data.to_h unless @point_of_sale_data.nil?
40
+ hash['rateReferenceId'] = @rate_reference_id unless @rate_reference_id.nil?
41
+ hash['targetCurrency'] = @target_currency unless @target_currency.nil?
42
+ hash['transaction'] = @transaction.to_h unless @transaction.nil?
43
+ hash
44
+ end
45
+
46
+ def from_hash(hash)
47
+ super
48
+ if hash.has_key? 'cardPaymentData'
49
+ raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
50
+ @card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardDataForDcc.new_from_hash(hash['cardPaymentData'])
51
+ end
52
+ if hash.has_key? 'operationId'
53
+ @operation_id = hash['operationId']
54
+ end
55
+ if hash.has_key? 'pointOfSaleData'
56
+ raise TypeError, "value '%s' is not a Hash" % [hash['pointOfSaleData']] unless hash['pointOfSaleData'].is_a? Hash
57
+ @point_of_sale_data = Worldline::Acquiring::SDK::V1::Domain::PointOfSaleDataForDcc.new_from_hash(hash['pointOfSaleData'])
58
+ end
59
+ if hash.has_key? 'rateReferenceId'
60
+ @rate_reference_id = hash['rateReferenceId']
61
+ end
62
+ if hash.has_key? 'targetCurrency'
63
+ @target_currency = hash['targetCurrency']
64
+ end
65
+ if hash.has_key? 'transaction'
66
+ raise TypeError, "value '%s' is not a Hash" % [hash['transaction']] unless hash['transaction'].is_a? Hash
67
+ @transaction = Worldline::Acquiring::SDK::V1::Domain::TransactionDataForDcc.new_from_hash(hash['transaction'])
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,57 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+ require 'worldline/acquiring/sdk/v1/domain/dcc_proposal'
6
+
7
+ module Worldline
8
+ module Acquiring
9
+ module SDK
10
+ module V1
11
+ module Domain
12
+ # @attr [String] disclaimer_display
13
+ # @attr [String] disclaimer_receipt
14
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::DccProposal] proposal
15
+ # @attr [String] result
16
+ class GetDccRateResponse < Worldline::Acquiring::SDK::Domain::DataObject
17
+
18
+ attr_accessor :disclaimer_display
19
+
20
+ attr_accessor :disclaimer_receipt
21
+
22
+ attr_accessor :proposal
23
+
24
+ attr_accessor :result
25
+
26
+ # @return (Hash)
27
+ def to_h
28
+ hash = super
29
+ hash['disclaimerDisplay'] = @disclaimer_display unless @disclaimer_display.nil?
30
+ hash['disclaimerReceipt'] = @disclaimer_receipt unless @disclaimer_receipt.nil?
31
+ hash['proposal'] = @proposal.to_h unless @proposal.nil?
32
+ hash['result'] = @result unless @result.nil?
33
+ hash
34
+ end
35
+
36
+ def from_hash(hash)
37
+ super
38
+ if hash.has_key? 'disclaimerDisplay'
39
+ @disclaimer_display = hash['disclaimerDisplay']
40
+ end
41
+ if hash.has_key? 'disclaimerReceipt'
42
+ @disclaimer_receipt = hash['disclaimerReceipt']
43
+ end
44
+ if hash.has_key? 'proposal'
45
+ raise TypeError, "value '%s' is not a Hash" % [hash['proposal']] unless hash['proposal'].is_a? Hash
46
+ @proposal = Worldline::Acquiring::SDK::V1::Domain::DccProposal.new_from_hash(hash['proposal'])
47
+ end
48
+ if hash.has_key? 'result'
49
+ @result = hash['result']
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,41 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+
6
+ module Worldline
7
+ module Acquiring
8
+ module SDK
9
+ module V1
10
+ module Domain
11
+ # @attr [String] future_use
12
+ # @attr [String] transaction_type
13
+ class InitialCardOnFileData < Worldline::Acquiring::SDK::Domain::DataObject
14
+
15
+ attr_accessor :future_use
16
+
17
+ attr_accessor :transaction_type
18
+
19
+ # @return (Hash)
20
+ def to_h
21
+ hash = super
22
+ hash['futureUse'] = @future_use unless @future_use.nil?
23
+ hash['transactionType'] = @transaction_type unless @transaction_type.nil?
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key? 'futureUse'
30
+ @future_use = hash['futureUse']
31
+ end
32
+ if hash.has_key? 'transactionType'
33
+ @transaction_type = hash['transactionType']
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,76 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+
6
+ module Worldline
7
+ module Acquiring
8
+ module SDK
9
+ module V1
10
+ module Domain
11
+ # @attr [String] address
12
+ # @attr [String] city
13
+ # @attr [String] country_code
14
+ # @attr [Integer] merchant_category_code
15
+ # @attr [String] name
16
+ # @attr [String] postal_code
17
+ # @attr [String] state_code
18
+ class MerchantData < Worldline::Acquiring::SDK::Domain::DataObject
19
+
20
+ attr_accessor :address
21
+
22
+ attr_accessor :city
23
+
24
+ attr_accessor :country_code
25
+
26
+ attr_accessor :merchant_category_code
27
+
28
+ attr_accessor :name
29
+
30
+ attr_accessor :postal_code
31
+
32
+ attr_accessor :state_code
33
+
34
+ # @return (Hash)
35
+ def to_h
36
+ hash = super
37
+ hash['address'] = @address unless @address.nil?
38
+ hash['city'] = @city unless @city.nil?
39
+ hash['countryCode'] = @country_code unless @country_code.nil?
40
+ hash['merchantCategoryCode'] = @merchant_category_code unless @merchant_category_code.nil?
41
+ hash['name'] = @name unless @name.nil?
42
+ hash['postalCode'] = @postal_code unless @postal_code.nil?
43
+ hash['stateCode'] = @state_code unless @state_code.nil?
44
+ hash
45
+ end
46
+
47
+ def from_hash(hash)
48
+ super
49
+ if hash.has_key? 'address'
50
+ @address = hash['address']
51
+ end
52
+ if hash.has_key? 'city'
53
+ @city = hash['city']
54
+ end
55
+ if hash.has_key? 'countryCode'
56
+ @country_code = hash['countryCode']
57
+ end
58
+ if hash.has_key? 'merchantCategoryCode'
59
+ @merchant_category_code = hash['merchantCategoryCode']
60
+ end
61
+ if hash.has_key? 'name'
62
+ @name = hash['name']
63
+ end
64
+ if hash.has_key? 'postalCode'
65
+ @postal_code = hash['postalCode']
66
+ end
67
+ if hash.has_key? 'stateCode'
68
+ @state_code = hash['stateCode']
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,41 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+
6
+ module Worldline
7
+ module Acquiring
8
+ module SDK
9
+ module V1
10
+ module Domain
11
+ # @attr [String] cryptogram
12
+ # @attr [String] eci
13
+ class NetworkTokenData < Worldline::Acquiring::SDK::Domain::DataObject
14
+
15
+ attr_accessor :cryptogram
16
+
17
+ attr_accessor :eci
18
+
19
+ # @return (Hash)
20
+ def to_h
21
+ hash = super
22
+ hash['cryptogram'] = @cryptogram unless @cryptogram.nil?
23
+ hash['eci'] = @eci unless @eci.nil?
24
+ hash
25
+ end
26
+
27
+ def from_hash(hash)
28
+ super
29
+ if hash.has_key? 'cryptogram'
30
+ @cryptogram = hash['cryptogram']
31
+ end
32
+ if hash.has_key? 'eci'
33
+ @eci = hash['eci']
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end