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,71 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/domain/data_object'
5
+ require 'worldline/acquiring/sdk/v1/domain/api_refund_summary_for_response'
6
+
7
+ module Worldline
8
+ module Acquiring
9
+ module SDK
10
+ module V1
11
+ module Domain
12
+ # @attr [String] operation_id
13
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::ApiRefundSummaryForResponse] refund
14
+ # @attr [String] responder
15
+ # @attr [String] response_code
16
+ # @attr [String] response_code_category
17
+ # @attr [String] response_code_description
18
+ class ApiActionResponseForRefund < Worldline::Acquiring::SDK::Domain::DataObject
19
+
20
+ attr_accessor :operation_id
21
+
22
+ attr_accessor :refund
23
+
24
+ attr_accessor :responder
25
+
26
+ attr_accessor :response_code
27
+
28
+ attr_accessor :response_code_category
29
+
30
+ attr_accessor :response_code_description
31
+
32
+ # @return (Hash)
33
+ def to_h
34
+ hash = super
35
+ hash['operationId'] = @operation_id unless @operation_id.nil?
36
+ hash['refund'] = @refund.to_h unless @refund.nil?
37
+ hash['responder'] = @responder unless @responder.nil?
38
+ hash['responseCode'] = @response_code unless @response_code.nil?
39
+ hash['responseCodeCategory'] = @response_code_category unless @response_code_category.nil?
40
+ hash['responseCodeDescription'] = @response_code_description unless @response_code_description.nil?
41
+ hash
42
+ end
43
+
44
+ def from_hash(hash)
45
+ super
46
+ if hash.has_key? 'operationId'
47
+ @operation_id = hash['operationId']
48
+ end
49
+ if hash.has_key? 'refund'
50
+ raise TypeError, "value '%s' is not a Hash" % [hash['refund']] unless hash['refund'].is_a? Hash
51
+ @refund = Worldline::Acquiring::SDK::V1::Domain::ApiRefundSummaryForResponse.new_from_hash(hash['refund'])
52
+ end
53
+ if hash.has_key? 'responder'
54
+ @responder = hash['responder']
55
+ end
56
+ if hash.has_key? 'responseCode'
57
+ @response_code = hash['responseCode']
58
+ end
59
+ if hash.has_key? 'responseCodeCategory'
60
+ @response_code_category = hash['responseCodeCategory']
61
+ end
62
+ if hash.has_key? 'responseCodeDescription'
63
+ @response_code_description = hash['responseCodeDescription']
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,75 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'date'
5
+
6
+ require 'worldline/acquiring/sdk/domain/data_object'
7
+ require 'worldline/acquiring/sdk/v1/domain/amount_data'
8
+ require 'worldline/acquiring/sdk/v1/domain/dcc_data'
9
+
10
+ module Worldline
11
+ module Acquiring
12
+ module SDK
13
+ module V1
14
+ module Domain
15
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] amount
16
+ # @attr [Integer] capture_sequence_number
17
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
18
+ # @attr [true/false] is_final
19
+ # @attr [String] operation_id
20
+ # @attr [DateTime] transaction_timestamp
21
+ class ApiCaptureRequest < Worldline::Acquiring::SDK::Domain::DataObject
22
+
23
+ attr_accessor :amount
24
+
25
+ attr_accessor :capture_sequence_number
26
+
27
+ attr_accessor :dynamic_currency_conversion
28
+
29
+ attr_accessor :is_final
30
+
31
+ attr_accessor :operation_id
32
+
33
+ attr_accessor :transaction_timestamp
34
+
35
+ # @return (Hash)
36
+ def to_h
37
+ hash = super
38
+ hash['amount'] = @amount.to_h unless @amount.nil?
39
+ hash['captureSequenceNumber'] = @capture_sequence_number unless @capture_sequence_number.nil?
40
+ hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
41
+ hash['isFinal'] = @is_final unless @is_final.nil?
42
+ hash['operationId'] = @operation_id unless @operation_id.nil?
43
+ hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
44
+ hash
45
+ end
46
+
47
+ def from_hash(hash)
48
+ super
49
+ if hash.has_key? 'amount'
50
+ raise TypeError, "value '%s' is not a Hash" % [hash['amount']] unless hash['amount'].is_a? Hash
51
+ @amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['amount'])
52
+ end
53
+ if hash.has_key? 'captureSequenceNumber'
54
+ @capture_sequence_number = hash['captureSequenceNumber']
55
+ end
56
+ if hash.has_key? 'dynamicCurrencyConversion'
57
+ raise TypeError, "value '%s' is not a Hash" % [hash['dynamicCurrencyConversion']] unless hash['dynamicCurrencyConversion'].is_a? Hash
58
+ @dynamic_currency_conversion = Worldline::Acquiring::SDK::V1::Domain::DccData.new_from_hash(hash['dynamicCurrencyConversion'])
59
+ end
60
+ if hash.has_key? 'isFinal'
61
+ @is_final = hash['isFinal']
62
+ end
63
+ if hash.has_key? 'operationId'
64
+ @operation_id = hash['operationId']
65
+ end
66
+ if hash.has_key? 'transactionTimestamp'
67
+ @transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,43 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'date'
5
+
6
+ require 'worldline/acquiring/sdk/domain/data_object'
7
+
8
+ module Worldline
9
+ module Acquiring
10
+ module SDK
11
+ module V1
12
+ module Domain
13
+ # @attr [String] operation_id
14
+ # @attr [DateTime] transaction_timestamp
15
+ class ApiCaptureRequestForRefund < Worldline::Acquiring::SDK::Domain::DataObject
16
+
17
+ attr_accessor :operation_id
18
+
19
+ attr_accessor :transaction_timestamp
20
+
21
+ # @return (Hash)
22
+ def to_h
23
+ hash = super
24
+ hash['operationId'] = @operation_id unless @operation_id.nil?
25
+ hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
26
+ hash
27
+ end
28
+
29
+ def from_hash(hash)
30
+ super
31
+ if hash.has_key? 'operationId'
32
+ @operation_id = hash['operationId']
33
+ end
34
+ if hash.has_key? 'transactionTimestamp'
35
+ @transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,61 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'date'
5
+
6
+ require 'worldline/acquiring/sdk/domain/data_object'
7
+ require 'worldline/acquiring/sdk/v1/domain/amount_data'
8
+ require 'worldline/acquiring/sdk/v1/domain/dcc_data'
9
+
10
+ module Worldline
11
+ module Acquiring
12
+ module SDK
13
+ module V1
14
+ module Domain
15
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
16
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] increment_amount
17
+ # @attr [String] operation_id
18
+ # @attr [DateTime] transaction_timestamp
19
+ class ApiIncrementRequest < Worldline::Acquiring::SDK::Domain::DataObject
20
+
21
+ attr_accessor :dynamic_currency_conversion
22
+
23
+ attr_accessor :increment_amount
24
+
25
+ attr_accessor :operation_id
26
+
27
+ attr_accessor :transaction_timestamp
28
+
29
+ # @return (Hash)
30
+ def to_h
31
+ hash = super
32
+ hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
33
+ hash['incrementAmount'] = @increment_amount.to_h unless @increment_amount.nil?
34
+ hash['operationId'] = @operation_id unless @operation_id.nil?
35
+ hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
36
+ hash
37
+ end
38
+
39
+ def from_hash(hash)
40
+ super
41
+ if hash.has_key? 'dynamicCurrencyConversion'
42
+ raise TypeError, "value '%s' is not a Hash" % [hash['dynamicCurrencyConversion']] unless hash['dynamicCurrencyConversion'].is_a? Hash
43
+ @dynamic_currency_conversion = Worldline::Acquiring::SDK::V1::Domain::DccData.new_from_hash(hash['dynamicCurrencyConversion'])
44
+ end
45
+ if hash.has_key? 'incrementAmount'
46
+ raise TypeError, "value '%s' is not a Hash" % [hash['incrementAmount']] unless hash['incrementAmount'].is_a? Hash
47
+ @increment_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['incrementAmount'])
48
+ end
49
+ if hash.has_key? 'operationId'
50
+ @operation_id = hash['operationId']
51
+ end
52
+ if hash.has_key? 'transactionTimestamp'
53
+ @transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,43 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'worldline/acquiring/sdk/v1/domain/amount_data'
5
+ require 'worldline/acquiring/sdk/v1/domain/api_action_response'
6
+
7
+ module Worldline
8
+ module Acquiring
9
+ module SDK
10
+ module V1
11
+ module Domain
12
+ # @attr [String] authorization_code
13
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] total_authorized_amount
14
+ class ApiIncrementResponse < Worldline::Acquiring::SDK::V1::Domain::ApiActionResponse
15
+
16
+ attr_accessor :authorization_code
17
+
18
+ attr_accessor :total_authorized_amount
19
+
20
+ # @return (Hash)
21
+ def to_h
22
+ hash = super
23
+ hash['authorizationCode'] = @authorization_code unless @authorization_code.nil?
24
+ hash['totalAuthorizedAmount'] = @total_authorized_amount.to_h unless @total_authorized_amount.nil?
25
+ hash
26
+ end
27
+
28
+ def from_hash(hash)
29
+ super
30
+ if hash.has_key? 'authorizationCode'
31
+ @authorization_code = hash['authorizationCode']
32
+ end
33
+ if hash.has_key? 'totalAuthorizedAmount'
34
+ raise TypeError, "value '%s' is not a Hash" % [hash['totalAuthorizedAmount']] unless hash['totalAuthorizedAmount'].is_a? Hash
35
+ @total_authorized_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['totalAuthorizedAmount'])
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,62 @@
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] detail
12
+ # @attr [String] instance
13
+ # @attr [Integer] status
14
+ # @attr [String] title
15
+ # @attr [String] type
16
+ class ApiPaymentErrorResponse < Worldline::Acquiring::SDK::Domain::DataObject
17
+
18
+ attr_accessor :detail
19
+
20
+ attr_accessor :instance
21
+
22
+ attr_accessor :status
23
+
24
+ attr_accessor :title
25
+
26
+ attr_accessor :type
27
+
28
+ # @return (Hash)
29
+ def to_h
30
+ hash = super
31
+ hash['detail'] = @detail unless @detail.nil?
32
+ hash['instance'] = @instance unless @instance.nil?
33
+ hash['status'] = @status unless @status.nil?
34
+ hash['title'] = @title unless @title.nil?
35
+ hash['type'] = @type unless @type.nil?
36
+ hash
37
+ end
38
+
39
+ def from_hash(hash)
40
+ super
41
+ if hash.has_key? 'detail'
42
+ @detail = hash['detail']
43
+ end
44
+ if hash.has_key? 'instance'
45
+ @instance = hash['instance']
46
+ end
47
+ if hash.has_key? 'status'
48
+ @status = hash['status']
49
+ end
50
+ if hash.has_key? 'title'
51
+ @title = hash['title']
52
+ end
53
+ if hash.has_key? 'type'
54
+ @type = hash['type']
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,77 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'date'
5
+
6
+ require 'worldline/acquiring/sdk/domain/data_object'
7
+ require 'worldline/acquiring/sdk/v1/domain/amount_data'
8
+ require 'worldline/acquiring/sdk/v1/domain/dcc_data'
9
+ require 'worldline/acquiring/sdk/v1/domain/payment_references'
10
+
11
+ module Worldline
12
+ module Acquiring
13
+ module SDK
14
+ module V1
15
+ module Domain
16
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] amount
17
+ # @attr [true/false] capture_immediately
18
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
19
+ # @attr [String] operation_id
20
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
21
+ # @attr [DateTime] transaction_timestamp
22
+ class ApiPaymentRefundRequest < Worldline::Acquiring::SDK::Domain::DataObject
23
+
24
+ attr_accessor :amount
25
+
26
+ attr_accessor :capture_immediately
27
+
28
+ attr_accessor :dynamic_currency_conversion
29
+
30
+ attr_accessor :operation_id
31
+
32
+ attr_accessor :references
33
+
34
+ attr_accessor :transaction_timestamp
35
+
36
+ # @return (Hash)
37
+ def to_h
38
+ hash = super
39
+ hash['amount'] = @amount.to_h unless @amount.nil?
40
+ hash['captureImmediately'] = @capture_immediately unless @capture_immediately.nil?
41
+ hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
42
+ hash['operationId'] = @operation_id unless @operation_id.nil?
43
+ hash['references'] = @references.to_h unless @references.nil?
44
+ hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
45
+ hash
46
+ end
47
+
48
+ def from_hash(hash)
49
+ super
50
+ if hash.has_key? 'amount'
51
+ raise TypeError, "value '%s' is not a Hash" % [hash['amount']] unless hash['amount'].is_a? Hash
52
+ @amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['amount'])
53
+ end
54
+ if hash.has_key? 'captureImmediately'
55
+ @capture_immediately = hash['captureImmediately']
56
+ end
57
+ if hash.has_key? 'dynamicCurrencyConversion'
58
+ raise TypeError, "value '%s' is not a Hash" % [hash['dynamicCurrencyConversion']] unless hash['dynamicCurrencyConversion'].is_a? Hash
59
+ @dynamic_currency_conversion = Worldline::Acquiring::SDK::V1::Domain::DccData.new_from_hash(hash['dynamicCurrencyConversion'])
60
+ end
61
+ if hash.has_key? 'operationId'
62
+ @operation_id = hash['operationId']
63
+ end
64
+ if hash.has_key? 'references'
65
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
66
+ @references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
67
+ end
68
+ if hash.has_key? 'transactionTimestamp'
69
+ @transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,95 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'date'
5
+
6
+ require 'worldline/acquiring/sdk/domain/data_object'
7
+ require 'worldline/acquiring/sdk/v1/domain/amount_data'
8
+ require 'worldline/acquiring/sdk/v1/domain/card_payment_data'
9
+ require 'worldline/acquiring/sdk/v1/domain/dcc_data'
10
+ require 'worldline/acquiring/sdk/v1/domain/merchant_data'
11
+ require 'worldline/acquiring/sdk/v1/domain/payment_references'
12
+
13
+ module Worldline
14
+ module Acquiring
15
+ module SDK
16
+ module V1
17
+ module Domain
18
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] amount
19
+ # @attr [String] authorization_type
20
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::CardPaymentData] card_payment_data
21
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
22
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::MerchantData] merchant
23
+ # @attr [String] operation_id
24
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
25
+ # @attr [DateTime] transaction_timestamp
26
+ class ApiPaymentRequest < Worldline::Acquiring::SDK::Domain::DataObject
27
+
28
+ attr_accessor :amount
29
+
30
+ attr_accessor :authorization_type
31
+
32
+ attr_accessor :card_payment_data
33
+
34
+ attr_accessor :dynamic_currency_conversion
35
+
36
+ attr_accessor :merchant
37
+
38
+ attr_accessor :operation_id
39
+
40
+ attr_accessor :references
41
+
42
+ attr_accessor :transaction_timestamp
43
+
44
+ # @return (Hash)
45
+ def to_h
46
+ hash = super
47
+ hash['amount'] = @amount.to_h unless @amount.nil?
48
+ hash['authorizationType'] = @authorization_type unless @authorization_type.nil?
49
+ hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
50
+ hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
51
+ hash['merchant'] = @merchant.to_h unless @merchant.nil?
52
+ hash['operationId'] = @operation_id unless @operation_id.nil?
53
+ hash['references'] = @references.to_h unless @references.nil?
54
+ hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
55
+ hash
56
+ end
57
+
58
+ def from_hash(hash)
59
+ super
60
+ if hash.has_key? 'amount'
61
+ raise TypeError, "value '%s' is not a Hash" % [hash['amount']] unless hash['amount'].is_a? Hash
62
+ @amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['amount'])
63
+ end
64
+ if hash.has_key? 'authorizationType'
65
+ @authorization_type = hash['authorizationType']
66
+ end
67
+ if hash.has_key? 'cardPaymentData'
68
+ raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
69
+ @card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentData.new_from_hash(hash['cardPaymentData'])
70
+ end
71
+ if hash.has_key? 'dynamicCurrencyConversion'
72
+ raise TypeError, "value '%s' is not a Hash" % [hash['dynamicCurrencyConversion']] unless hash['dynamicCurrencyConversion'].is_a? Hash
73
+ @dynamic_currency_conversion = Worldline::Acquiring::SDK::V1::Domain::DccData.new_from_hash(hash['dynamicCurrencyConversion'])
74
+ end
75
+ if hash.has_key? 'merchant'
76
+ raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash
77
+ @merchant = Worldline::Acquiring::SDK::V1::Domain::MerchantData.new_from_hash(hash['merchant'])
78
+ end
79
+ if hash.has_key? 'operationId'
80
+ @operation_id = hash['operationId']
81
+ end
82
+ if hash.has_key? 'references'
83
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
84
+ @references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
85
+ end
86
+ if hash.has_key? 'transactionTimestamp'
87
+ @transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,103 @@
1
+ #
2
+ # This file was automatically generated.
3
+ #
4
+ require 'date'
5
+
6
+ require 'worldline/acquiring/sdk/domain/data_object'
7
+ require 'worldline/acquiring/sdk/v1/domain/amount_data'
8
+ require 'worldline/acquiring/sdk/v1/domain/api_references_for_responses'
9
+ require 'worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource'
10
+ require 'worldline/acquiring/sdk/v1/domain/sub_operation'
11
+
12
+ module Worldline
13
+ module Acquiring
14
+ module SDK
15
+ module V1
16
+ module Domain
17
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResource] card_payment_data
18
+ # @attr [String] initial_authorization_code
19
+ # @attr [Array<Worldline::Acquiring::SDK::V1::Domain::SubOperation>] operations
20
+ # @attr [String] payment_id
21
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses] references
22
+ # @attr [String] retry_after
23
+ # @attr [String] status
24
+ # @attr [DateTime] status_timestamp
25
+ # @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] total_authorized_amount
26
+ class ApiPaymentResource < Worldline::Acquiring::SDK::Domain::DataObject
27
+
28
+ attr_accessor :card_payment_data
29
+
30
+ attr_accessor :initial_authorization_code
31
+
32
+ attr_accessor :operations
33
+
34
+ attr_accessor :payment_id
35
+
36
+ attr_accessor :references
37
+
38
+ attr_accessor :retry_after
39
+
40
+ attr_accessor :status
41
+
42
+ attr_accessor :status_timestamp
43
+
44
+ attr_accessor :total_authorized_amount
45
+
46
+ # @return (Hash)
47
+ def to_h
48
+ hash = super
49
+ hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
50
+ hash['initialAuthorizationCode'] = @initial_authorization_code unless @initial_authorization_code.nil?
51
+ hash['operations'] = @operations.collect{|val| val.to_h} unless @operations.nil?
52
+ hash['paymentId'] = @payment_id unless @payment_id.nil?
53
+ hash['references'] = @references.to_h unless @references.nil?
54
+ hash['retryAfter'] = @retry_after unless @retry_after.nil?
55
+ hash['status'] = @status unless @status.nil?
56
+ hash['statusTimestamp'] = @status_timestamp.iso8601(3) unless @status_timestamp.nil?
57
+ hash['totalAuthorizedAmount'] = @total_authorized_amount.to_h unless @total_authorized_amount.nil?
58
+ hash
59
+ end
60
+
61
+ def from_hash(hash)
62
+ super
63
+ if hash.has_key? 'cardPaymentData'
64
+ raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
65
+ @card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResource.new_from_hash(hash['cardPaymentData'])
66
+ end
67
+ if hash.has_key? 'initialAuthorizationCode'
68
+ @initial_authorization_code = hash['initialAuthorizationCode']
69
+ end
70
+ if hash.has_key? 'operations'
71
+ raise TypeError, "value '%s' is not an Array" % [hash['operations']] unless hash['operations'].is_a? Array
72
+ @operations = []
73
+ hash['operations'].each do |e|
74
+ @operations << Worldline::Acquiring::SDK::V1::Domain::SubOperation.new_from_hash(e)
75
+ end
76
+ end
77
+ if hash.has_key? 'paymentId'
78
+ @payment_id = hash['paymentId']
79
+ end
80
+ if hash.has_key? 'references'
81
+ raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
82
+ @references = Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses.new_from_hash(hash['references'])
83
+ end
84
+ if hash.has_key? 'retryAfter'
85
+ @retry_after = hash['retryAfter']
86
+ end
87
+ if hash.has_key? 'status'
88
+ @status = hash['status']
89
+ end
90
+ if hash.has_key? 'statusTimestamp'
91
+ @status_timestamp = DateTime.parse(hash['statusTimestamp'])
92
+ end
93
+ if hash.has_key? 'totalAuthorizedAmount'
94
+ raise TypeError, "value '%s' is not a Hash" % [hash['totalAuthorizedAmount']] unless hash['totalAuthorizedAmount'].is_a? Hash
95
+ @total_authorized_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['totalAuthorizedAmount'])
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end