acquiring-sdk-ruby 0.1.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.
- checksums.yaml +7 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +22 -0
- data/README.md +140 -0
- data/Rakefile +34 -0
- data/acquiring-sdk-ruby.gemspec +30 -0
- data/lib/worldline/acquiring/sdk/api_resource.rb +53 -0
- data/lib/worldline/acquiring/sdk/authentication/authenticator.rb +21 -0
- data/lib/worldline/acquiring/sdk/authentication/authorization_type.rb +17 -0
- data/lib/worldline/acquiring/sdk/authentication/oauth2_authenticator.rb +142 -0
- data/lib/worldline/acquiring/sdk/authentication/oauth2_exception.rb +15 -0
- data/lib/worldline/acquiring/sdk/authentication.rb +1 -0
- data/lib/worldline/acquiring/sdk/call_context.rb +9 -0
- data/lib/worldline/acquiring/sdk/client.rb +69 -0
- data/lib/worldline/acquiring/sdk/communication/communication_exception.rb +21 -0
- data/lib/worldline/acquiring/sdk/communication/connection.rb +50 -0
- data/lib/worldline/acquiring/sdk/communication/default_connection.rb +429 -0
- data/lib/worldline/acquiring/sdk/communication/metadata_provider.rb +162 -0
- data/lib/worldline/acquiring/sdk/communication/multipart_form_data_object.rb +54 -0
- data/lib/worldline/acquiring/sdk/communication/multipart_form_data_request.rb +15 -0
- data/lib/worldline/acquiring/sdk/communication/not_found_exception.rb +21 -0
- data/lib/worldline/acquiring/sdk/communication/param_request.rb +16 -0
- data/lib/worldline/acquiring/sdk/communication/pooled_connection.rb +28 -0
- data/lib/worldline/acquiring/sdk/communication/request_header.rb +64 -0
- data/lib/worldline/acquiring/sdk/communication/request_param.rb +30 -0
- data/lib/worldline/acquiring/sdk/communication/response_exception.rb +58 -0
- data/lib/worldline/acquiring/sdk/communication/response_header.rb +80 -0
- data/lib/worldline/acquiring/sdk/communication.rb +1 -0
- data/lib/worldline/acquiring/sdk/communicator.rb +506 -0
- data/lib/worldline/acquiring/sdk/communicator_configuration.rb +197 -0
- data/lib/worldline/acquiring/sdk/domain/data_object.rb +34 -0
- data/lib/worldline/acquiring/sdk/domain/shopping_cart_extension.rb +62 -0
- data/lib/worldline/acquiring/sdk/domain/uploadable_file.rb +35 -0
- data/lib/worldline/acquiring/sdk/domain.rb +1 -0
- data/lib/worldline/acquiring/sdk/factory.rb +183 -0
- data/lib/worldline/acquiring/sdk/json/default_marshaller.rb +36 -0
- data/lib/worldline/acquiring/sdk/json/marshaller.rb +29 -0
- data/lib/worldline/acquiring/sdk/json/marshaller_syntax_exception.rb +11 -0
- data/lib/worldline/acquiring/sdk/json.rb +1 -0
- data/lib/worldline/acquiring/sdk/logging/communicator_logger.rb +26 -0
- data/lib/worldline/acquiring/sdk/logging/log_message_builder.rb +91 -0
- data/lib/worldline/acquiring/sdk/logging/logging_capable.rb +19 -0
- data/lib/worldline/acquiring/sdk/logging/obfuscation/body_obfuscator.rb +101 -0
- data/lib/worldline/acquiring/sdk/logging/obfuscation/header_obfuscator.rb +54 -0
- data/lib/worldline/acquiring/sdk/logging/obfuscation/obfuscation_capable.rb +23 -0
- data/lib/worldline/acquiring/sdk/logging/obfuscation/obfuscation_rule.rb +49 -0
- data/lib/worldline/acquiring/sdk/logging/obfuscation.rb +1 -0
- data/lib/worldline/acquiring/sdk/logging/request_log_message_builder.rb +52 -0
- data/lib/worldline/acquiring/sdk/logging/response_log_message_builder.rb +43 -0
- data/lib/worldline/acquiring/sdk/logging/ruby_communicator_logger.rb +63 -0
- data/lib/worldline/acquiring/sdk/logging/stdout_communicator_logger.rb +33 -0
- data/lib/worldline/acquiring/sdk/logging.rb +1 -0
- data/lib/worldline/acquiring/sdk/proxy_configuration.rb +76 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/acquirer_client.rb +35 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/accountverifications/account_verifications_client.rb +60 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/accountverifications.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion/dynamic_currency_conversion_client.rb +60 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/merchant_client.rb +66 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/payments/get_payment_status_params.rb +34 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/payments/payments_client.rb +224 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/payments.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/refunds/get_refund_params.rb +34 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/refunds/refunds_client.rb +157 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/refunds.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/technicalreversals/technical_reversals_client.rb +64 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/technicalreversals.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/api_exception.rb +63 -0
- data/lib/worldline/acquiring/sdk/v1/authorization_exception.rb +23 -0
- data/lib/worldline/acquiring/sdk/v1/domain/address_verification_data.rb +41 -0
- data/lib/worldline/acquiring/sdk/v1/domain/amount_data.rb +48 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_account_verification_request.rb +70 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_account_verification_response.rb +87 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_action_response.rb +71 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_action_response_for_refund.rb +71 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb +75 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_capture_request_for_refund.rb +43 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_increment_request.rb +61 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_increment_response.rb +43 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_error_response.rb +62 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb +77 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb +95 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_resource.rb +103 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb +126 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_reversal_request.rb +61 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_summary_for_response.rb +66 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_references_for_responses.rb +48 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_refund_request.rb +88 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_refund_resource.rb +110 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb +133 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_refund_summary_for_response.rb +66 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_reversal_response.rb +36 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_technical_reversal_request.rb +50 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_technical_reversal_response.rb +62 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_data_for_dcc.rb +48 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_on_file_data.rb +52 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data.rb +114 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_refund.rb +82 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb +43 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb +52 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_verification.rb +91 -0
- data/lib/worldline/acquiring/sdk/v1/domain/dcc_data.rb +55 -0
- data/lib/worldline/acquiring/sdk/v1/domain/dcc_proposal.rb +60 -0
- data/lib/worldline/acquiring/sdk/v1/domain/e_commerce_data.rb +52 -0
- data/lib/worldline/acquiring/sdk/v1/domain/e_commerce_data_for_account_verification.rb +45 -0
- data/lib/worldline/acquiring/sdk/v1/domain/e_commerce_data_for_response.rb +41 -0
- data/lib/worldline/acquiring/sdk/v1/domain/get_dcc_rate_request.rb +75 -0
- data/lib/worldline/acquiring/sdk/v1/domain/get_dcc_rate_response.rb +57 -0
- data/lib/worldline/acquiring/sdk/v1/domain/initial_card_on_file_data.rb +41 -0
- data/lib/worldline/acquiring/sdk/v1/domain/merchant_data.rb +76 -0
- data/lib/worldline/acquiring/sdk/v1/domain/network_token_data.rb +41 -0
- data/lib/worldline/acquiring/sdk/v1/domain/payment_references.rb +48 -0
- data/lib/worldline/acquiring/sdk/v1/domain/plain_card_data.rb +48 -0
- data/lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data.rb +34 -0
- data/lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_dcc.rb +41 -0
- data/lib/worldline/acquiring/sdk/v1/domain/rate_data.rb +64 -0
- data/lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb +94 -0
- data/lib/worldline/acquiring/sdk/v1/domain/sub_operation_for_refund.rb +87 -0
- data/lib/worldline/acquiring/sdk/v1/domain/subsequent_card_on_file_data.rb +48 -0
- data/lib/worldline/acquiring/sdk/v1/domain/three_d_secure.rb +62 -0
- data/lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb +52 -0
- data/lib/worldline/acquiring/sdk/v1/domain.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/exception_factory.rb +48 -0
- data/lib/worldline/acquiring/sdk/v1/ping/ping_client.rb +52 -0
- data/lib/worldline/acquiring/sdk/v1/ping.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/platform_exception.rb +23 -0
- data/lib/worldline/acquiring/sdk/v1/reference_exception.rb +23 -0
- data/lib/worldline/acquiring/sdk/v1/v1_client.rb +43 -0
- data/lib/worldline/acquiring/sdk/v1/validation_exception.rb +23 -0
- data/lib/worldline/acquiring/sdk/v1.rb +4 -0
- data/lib/worldline/acquiring/sdk.rb +1 -0
- data/spec/comparable_extension.rb +29 -0
- data/spec/fixtures/resources/authentication/oauth2AccessToken.expired.json +4 -0
- data/spec/fixtures/resources/authentication/oauth2AccessToken.invalidClient.json +4 -0
- data/spec/fixtures/resources/authentication/oauth2AccessToken.json +4 -0
- data/spec/fixtures/resources/communication/getWithQueryParams.json +3 -0
- data/spec/fixtures/resources/communication/getWithoutQueryParams.json +3 -0
- data/spec/fixtures/resources/communication/notFound.html +1 -0
- data/spec/fixtures/resources/communication/postWithBadRequestResponse.json +11 -0
- data/spec/fixtures/resources/communication/postWithCreatedResponse.json +6 -0
- data/spec/fixtures/resources/communication/unknownServerError.json +10 -0
- data/spec/fixtures/resources/logging/bodyNoObfuscation.json +7 -0
- data/spec/fixtures/resources/logging/bodyWithBinObfuscated.json +3 -0
- data/spec/fixtures/resources/logging/bodyWithBinOriginal.json +3 -0
- data/spec/fixtures/resources/logging/bodyWithCardCustomObfuscated.json +13 -0
- data/spec/fixtures/resources/logging/bodyWithCardObfuscated.json +13 -0
- data/spec/fixtures/resources/logging/bodyWithCardOriginal.json +13 -0
- data/spec/fixtures/resources/logging/bodyWithObjectObfuscated.json +5 -0
- data/spec/fixtures/resources/logging/bodyWithObjectOriginal.json +5 -0
- data/spec/fixtures/resources/properties.oauth2.yml +8 -0
- data/spec/fixtures/resources/properties.proxy.yml +14 -0
- data/spec/integration/connection_pooling_spec.rb +74 -0
- data/spec/integration/multipart_form_data_spec.rb +216 -0
- data/spec/integration/process_payment_spec.rb +43 -0
- data/spec/integration/request_dcc_rate_spec.rb +24 -0
- data/spec/integration/sdk_proxy_spec.rb +70 -0
- data/spec/integration_setup.rb +111 -0
- data/spec/lib/authentication/oauth2_authenticator_spec.rb +68 -0
- data/spec/lib/client_spec.rb +47 -0
- data/spec/lib/communication/default_connection_logger_spec.rb +484 -0
- data/spec/lib/communication/default_connection_spec.rb +352 -0
- data/spec/lib/communication/metadata_provider_spec.rb +93 -0
- data/spec/lib/communicator_configuration_spec.rb +181 -0
- data/spec/lib/communicator_spec.rb +34 -0
- data/spec/lib/factory_spec.rb +38 -0
- data/spec/lib/json/default_marshaller_spec.rb +39 -0
- data/spec/lib/logging/obfuscation/body_obfuscator_spec.rb +86 -0
- data/spec/lib/logging/obfuscation/header_obfuscator_spec.rb +100 -0
- data/spec/lib/logging/ruby_communicator_logger_spec.rb +92 -0
- data/spec/lib/logging/stdout_communicator_logger_spec.rb +64 -0
- data/spec/spec_helper.rb +32 -0
- metadata +375 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'worldline/acquiring/sdk/api_resource'
|
|
5
|
+
require 'worldline/acquiring/sdk/communication/response_exception'
|
|
6
|
+
require 'worldline/acquiring/sdk/v1/exception_factory'
|
|
7
|
+
require 'worldline/acquiring/sdk/v1/domain/api_action_response_for_refund'
|
|
8
|
+
require 'worldline/acquiring/sdk/v1/domain/api_payment_error_response'
|
|
9
|
+
require 'worldline/acquiring/sdk/v1/domain/api_refund_resource'
|
|
10
|
+
require 'worldline/acquiring/sdk/v1/domain/api_refund_response'
|
|
11
|
+
|
|
12
|
+
module Worldline
|
|
13
|
+
module Acquiring
|
|
14
|
+
module SDK
|
|
15
|
+
module V1
|
|
16
|
+
module Acquirer
|
|
17
|
+
module Merchant
|
|
18
|
+
module Refunds
|
|
19
|
+
# Refunds client. Thread-safe.
|
|
20
|
+
class RefundsClient < Worldline::Acquiring::SDK::ApiResource
|
|
21
|
+
|
|
22
|
+
# @param parent [Worldline::Acquiring::SDK::ApiResource]
|
|
23
|
+
# @param path_context [Hash, nil]
|
|
24
|
+
def initialize(parent, path_context)
|
|
25
|
+
super(parent: parent, path_context: path_context)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Resource /processing/v1/!{acquirerId}/!{merchantId}/refunds - {https://docs.acquiring.worldline-solutions.com/api-reference#tag/Refunds/operation/processStandaloneRefund Create standalone refund}
|
|
29
|
+
#
|
|
30
|
+
# @param body [Worldline::Acquiring::SDK::V1::Domain::ApiRefundRequest]
|
|
31
|
+
# @param context [Worldline::Acquiring::SDK::CallContext, nil]
|
|
32
|
+
# @return [Worldline::Acquiring::SDK::V1::Domain::ApiRefundResponse]
|
|
33
|
+
# @raise [Worldline::Acquiring::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
|
34
|
+
# @raise [Worldline::Acquiring::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
|
35
|
+
# @raise [Worldline::Acquiring::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
|
36
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
|
37
|
+
# @raise [Worldline::Acquiring::SDK::V1::PlatformException] if something went wrong at the Worldline Acquiring platform,
|
|
38
|
+
# the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
|
|
39
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
|
40
|
+
# @raise [Worldline::Acquiring::SDK::V1::ApiException] if the Worldline Acquiring platform returned any other error
|
|
41
|
+
def process_standalone_refund(body, context = nil)
|
|
42
|
+
uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/refunds', nil)
|
|
43
|
+
@communicator.post(
|
|
44
|
+
uri,
|
|
45
|
+
nil,
|
|
46
|
+
nil,
|
|
47
|
+
body,
|
|
48
|
+
Worldline::Acquiring::SDK::V1::Domain::ApiRefundResponse,
|
|
49
|
+
context)
|
|
50
|
+
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e
|
|
51
|
+
error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse
|
|
52
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
53
|
+
raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Resource /processing/v1/!{acquirerId}/!{merchantId}/refunds/!{refundId} - {https://docs.acquiring.worldline-solutions.com/api-reference#tag/Refunds/operation/getRefund Retrieve refund}
|
|
57
|
+
#
|
|
58
|
+
# @param refund_id [String]
|
|
59
|
+
# @param query [Worldline::Acquiring::SDK::V1::Acquirer::Merchant::Refunds::GetRefundParams]
|
|
60
|
+
# @param context [Worldline::Acquiring::SDK::CallContext, nil]
|
|
61
|
+
# @return [Worldline::Acquiring::SDK::V1::Domain::ApiRefundResource]
|
|
62
|
+
# @raise [Worldline::Acquiring::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
|
63
|
+
# @raise [Worldline::Acquiring::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
|
64
|
+
# @raise [Worldline::Acquiring::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
|
65
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
|
66
|
+
# @raise [Worldline::Acquiring::SDK::V1::PlatformException] if something went wrong at the Worldline Acquiring platform,
|
|
67
|
+
# the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
|
|
68
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
|
69
|
+
# @raise [Worldline::Acquiring::SDK::V1::ApiException] if the Worldline Acquiring platform returned any other error
|
|
70
|
+
def get_refund(refund_id, query, context = nil)
|
|
71
|
+
path_context = {
|
|
72
|
+
'refundId'.freeze => refund_id,
|
|
73
|
+
}
|
|
74
|
+
uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/refunds/{refundId}', path_context)
|
|
75
|
+
@communicator.get(
|
|
76
|
+
uri,
|
|
77
|
+
nil,
|
|
78
|
+
query,
|
|
79
|
+
Worldline::Acquiring::SDK::V1::Domain::ApiRefundResource,
|
|
80
|
+
context)
|
|
81
|
+
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e
|
|
82
|
+
error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse
|
|
83
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
84
|
+
raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Resource /processing/v1/!{acquirerId}/!{merchantId}/refunds/!{refundId}/captures - {https://docs.acquiring.worldline-solutions.com/api-reference#tag/Refunds/operation/captureRefund Capture refund}
|
|
88
|
+
#
|
|
89
|
+
# @param refund_id [String]
|
|
90
|
+
# @param body [Worldline::Acquiring::SDK::V1::Domain::ApiCaptureRequestForRefund]
|
|
91
|
+
# @param context [Worldline::Acquiring::SDK::CallContext, nil]
|
|
92
|
+
# @return [Worldline::Acquiring::SDK::V1::Domain::ApiActionResponseForRefund]
|
|
93
|
+
# @raise [Worldline::Acquiring::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
|
94
|
+
# @raise [Worldline::Acquiring::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
|
95
|
+
# @raise [Worldline::Acquiring::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
|
96
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
|
97
|
+
# @raise [Worldline::Acquiring::SDK::V1::PlatformException] if something went wrong at the Worldline Acquiring platform,
|
|
98
|
+
# the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
|
|
99
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
|
100
|
+
# @raise [Worldline::Acquiring::SDK::V1::ApiException] if the Worldline Acquiring platform returned any other error
|
|
101
|
+
def capture_refund(refund_id, body, context = nil)
|
|
102
|
+
path_context = {
|
|
103
|
+
'refundId'.freeze => refund_id,
|
|
104
|
+
}
|
|
105
|
+
uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/refunds/{refundId}/captures', path_context)
|
|
106
|
+
@communicator.post(
|
|
107
|
+
uri,
|
|
108
|
+
nil,
|
|
109
|
+
nil,
|
|
110
|
+
body,
|
|
111
|
+
Worldline::Acquiring::SDK::V1::Domain::ApiActionResponseForRefund,
|
|
112
|
+
context)
|
|
113
|
+
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e
|
|
114
|
+
error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse
|
|
115
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
116
|
+
raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Resource /processing/v1/!{acquirerId}/!{merchantId}/refunds/!{refundId}/authorization-reversals - {https://docs.acquiring.worldline-solutions.com/api-reference#tag/Refunds/operation/reverseRefundAuthorization Reverse refund authorization}
|
|
120
|
+
#
|
|
121
|
+
# @param refund_id [String]
|
|
122
|
+
# @param body [Worldline::Acquiring::SDK::V1::Domain::ApiPaymentReversalRequest]
|
|
123
|
+
# @param context [Worldline::Acquiring::SDK::CallContext, nil]
|
|
124
|
+
# @return [Worldline::Acquiring::SDK::V1::Domain::ApiActionResponseForRefund]
|
|
125
|
+
# @raise [Worldline::Acquiring::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
|
126
|
+
# @raise [Worldline::Acquiring::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
|
127
|
+
# @raise [Worldline::Acquiring::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
|
128
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
|
129
|
+
# @raise [Worldline::Acquiring::SDK::V1::PlatformException] if something went wrong at the Worldline Acquiring platform,
|
|
130
|
+
# the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
|
|
131
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
|
132
|
+
# @raise [Worldline::Acquiring::SDK::V1::ApiException] if the Worldline Acquiring platform returned any other error
|
|
133
|
+
def reverse_refund_authorization(refund_id, body, context = nil)
|
|
134
|
+
path_context = {
|
|
135
|
+
'refundId'.freeze => refund_id,
|
|
136
|
+
}
|
|
137
|
+
uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/refunds/{refundId}/authorization-reversals', path_context)
|
|
138
|
+
@communicator.post(
|
|
139
|
+
uri,
|
|
140
|
+
nil,
|
|
141
|
+
nil,
|
|
142
|
+
body,
|
|
143
|
+
Worldline::Acquiring::SDK::V1::Domain::ApiActionResponseForRefund,
|
|
144
|
+
context)
|
|
145
|
+
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e
|
|
146
|
+
error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse
|
|
147
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
148
|
+
raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'worldline/acquiring/sdk/api_resource'
|
|
5
|
+
require 'worldline/acquiring/sdk/communication/response_exception'
|
|
6
|
+
require 'worldline/acquiring/sdk/v1/exception_factory'
|
|
7
|
+
require 'worldline/acquiring/sdk/v1/domain/api_payment_error_response'
|
|
8
|
+
require 'worldline/acquiring/sdk/v1/domain/api_technical_reversal_response'
|
|
9
|
+
|
|
10
|
+
module Worldline
|
|
11
|
+
module Acquiring
|
|
12
|
+
module SDK
|
|
13
|
+
module V1
|
|
14
|
+
module Acquirer
|
|
15
|
+
module Merchant
|
|
16
|
+
module Technicalreversals
|
|
17
|
+
# TechnicalReversals client. Thread-safe.
|
|
18
|
+
class TechnicalReversalsClient < Worldline::Acquiring::SDK::ApiResource
|
|
19
|
+
|
|
20
|
+
# @param parent [Worldline::Acquiring::SDK::ApiResource]
|
|
21
|
+
# @param path_context [Hash, nil]
|
|
22
|
+
def initialize(parent, path_context)
|
|
23
|
+
super(parent: parent, path_context: path_context)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Resource /processing/v1/!{acquirerId}/!{merchantId}/operations/!{operationId}/reverse - {https://docs.acquiring.worldline-solutions.com/api-reference#tag/Technical-Reversals/operation/technicalReversal Technical reversal}
|
|
27
|
+
#
|
|
28
|
+
# @param operation_id [String]
|
|
29
|
+
# @param body [Worldline::Acquiring::SDK::V1::Domain::ApiTechnicalReversalRequest]
|
|
30
|
+
# @param context [Worldline::Acquiring::SDK::CallContext, nil]
|
|
31
|
+
# @return [Worldline::Acquiring::SDK::V1::Domain::ApiTechnicalReversalResponse]
|
|
32
|
+
# @raise [Worldline::Acquiring::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
|
33
|
+
# @raise [Worldline::Acquiring::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
|
34
|
+
# @raise [Worldline::Acquiring::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
|
35
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
|
36
|
+
# @raise [Worldline::Acquiring::SDK::V1::PlatformException] if something went wrong at the Worldline Acquiring platform,
|
|
37
|
+
# the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
|
|
38
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
|
39
|
+
# @raise [Worldline::Acquiring::SDK::V1::ApiException] if the Worldline Acquiring platform returned any other error
|
|
40
|
+
def technical_reversal(operation_id, body, context = nil)
|
|
41
|
+
path_context = {
|
|
42
|
+
'operationId'.freeze => operation_id,
|
|
43
|
+
}
|
|
44
|
+
uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/operations/{operationId}/reverse', path_context)
|
|
45
|
+
@communicator.post(
|
|
46
|
+
uri,
|
|
47
|
+
nil,
|
|
48
|
+
nil,
|
|
49
|
+
body,
|
|
50
|
+
Worldline::Acquiring::SDK::V1::Domain::ApiTechnicalReversalResponse,
|
|
51
|
+
context)
|
|
52
|
+
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e
|
|
53
|
+
error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse
|
|
54
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
|
55
|
+
raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
module Worldline
|
|
5
|
+
module Acquiring
|
|
6
|
+
module SDK
|
|
7
|
+
module V1
|
|
8
|
+
# Represents an error response from the Worldline Acquiring platform.
|
|
9
|
+
#
|
|
10
|
+
# @attr_reader [Integer] status_code HTTP status code of the returned response.
|
|
11
|
+
# @attr_reader [String] response_body Message body of the returned response.
|
|
12
|
+
# @attr_reader [String] type The _type_ received from the Worldline Acquiring platform if available.
|
|
13
|
+
# @attr_reader [String] title The _title_ received from the Worldline Acquiring platform if available.
|
|
14
|
+
# @attr_reader [Integer] status The _status_ received from the Worldline Acquiring platform if available.
|
|
15
|
+
# @attr_reader [String] detail The _detail_ received from the Worldline Acquiring platform if available.
|
|
16
|
+
# @attr_reader [String] instance The _instance_ received from the Worldline Acquiring platform if available.
|
|
17
|
+
class ApiException < RuntimeError
|
|
18
|
+
|
|
19
|
+
# Creates a new ApiException that reports an error response from the Worldline Acquiring platform.
|
|
20
|
+
#
|
|
21
|
+
# @param status_code (Integer) HTTP status code the response
|
|
22
|
+
# @param response_body (String) HTTP response body
|
|
23
|
+
# @param type (String) The _type_ received from the Worldline Acquiring platform
|
|
24
|
+
# @param title (String) The _title_ received from the Worldline Acquiring platform
|
|
25
|
+
# @param status (Integer) The _status_ received from the Worldline Acquiring platform
|
|
26
|
+
# @param detail (String) The _detail_ received from the Worldline Acquiring platform
|
|
27
|
+
# @param instance (String) The _instance_ received from the Worldline Acquiring platform
|
|
28
|
+
# @param message (String) error message to include
|
|
29
|
+
def initialize(status_code, response_body, type, title, status, detail, instance,
|
|
30
|
+
message='The Worldline Acquiring platform returned an error response')
|
|
31
|
+
super(message)
|
|
32
|
+
@status_code = status_code
|
|
33
|
+
@response_body = response_body
|
|
34
|
+
@type = type
|
|
35
|
+
@title = title
|
|
36
|
+
@status = status
|
|
37
|
+
@detail = detail
|
|
38
|
+
@instance = instance
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
attr_reader :status_code
|
|
42
|
+
attr_reader :response_body
|
|
43
|
+
attr_reader :type
|
|
44
|
+
attr_reader :title
|
|
45
|
+
attr_reader :status
|
|
46
|
+
attr_reader :detail
|
|
47
|
+
attr_reader :instance
|
|
48
|
+
|
|
49
|
+
def to_s
|
|
50
|
+
str = super.to_s
|
|
51
|
+
if @status_code > 0
|
|
52
|
+
str += '; status_code=' + @status_code.to_s
|
|
53
|
+
end
|
|
54
|
+
if !@response_body.nil? && @response_body.length > 0
|
|
55
|
+
str += "; response_body='" + @response_body + "'"
|
|
56
|
+
end
|
|
57
|
+
str.to_s
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require_relative 'api_exception'
|
|
5
|
+
|
|
6
|
+
module Worldline
|
|
7
|
+
module Acquiring
|
|
8
|
+
module SDK
|
|
9
|
+
module V1
|
|
10
|
+
# Represents an error response from the Worldline Acquiring platform when API authorization failed.
|
|
11
|
+
class AuthorizationException < ApiException
|
|
12
|
+
|
|
13
|
+
# Create a new AuthorizationException.
|
|
14
|
+
# @see ApiException#initialize
|
|
15
|
+
def initialize(status_code, response_body, type, title, status, detail, instance,
|
|
16
|
+
message='The Worldline Acquiring platform returned an API authorization error response')
|
|
17
|
+
super(status_code, response_body, type, title, status, detail, instance, message)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
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] cardholder_address
|
|
12
|
+
# @attr [String] cardholder_postal_code
|
|
13
|
+
class AddressVerificationData < Worldline::Acquiring::SDK::Domain::DataObject
|
|
14
|
+
|
|
15
|
+
attr_accessor :cardholder_address
|
|
16
|
+
|
|
17
|
+
attr_accessor :cardholder_postal_code
|
|
18
|
+
|
|
19
|
+
# @return (Hash)
|
|
20
|
+
def to_h
|
|
21
|
+
hash = super
|
|
22
|
+
hash['cardholderAddress'] = @cardholder_address unless @cardholder_address.nil?
|
|
23
|
+
hash['cardholderPostalCode'] = @cardholder_postal_code unless @cardholder_postal_code.nil?
|
|
24
|
+
hash
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def from_hash(hash)
|
|
28
|
+
super
|
|
29
|
+
if hash.has_key? 'cardholderAddress'
|
|
30
|
+
@cardholder_address = hash['cardholderAddress']
|
|
31
|
+
end
|
|
32
|
+
if hash.has_key? 'cardholderPostalCode'
|
|
33
|
+
@cardholder_postal_code = hash['cardholderPostalCode']
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
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 [String] currency_code
|
|
13
|
+
# @attr [Integer] number_of_decimals
|
|
14
|
+
class AmountData < Worldline::Acquiring::SDK::Domain::DataObject
|
|
15
|
+
|
|
16
|
+
attr_accessor :amount
|
|
17
|
+
|
|
18
|
+
attr_accessor :currency_code
|
|
19
|
+
|
|
20
|
+
attr_accessor :number_of_decimals
|
|
21
|
+
|
|
22
|
+
# @return (Hash)
|
|
23
|
+
def to_h
|
|
24
|
+
hash = super
|
|
25
|
+
hash['amount'] = @amount unless @amount.nil?
|
|
26
|
+
hash['currencyCode'] = @currency_code unless @currency_code.nil?
|
|
27
|
+
hash['numberOfDecimals'] = @number_of_decimals unless @number_of_decimals.nil?
|
|
28
|
+
hash
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def from_hash(hash)
|
|
32
|
+
super
|
|
33
|
+
if hash.has_key? 'amount'
|
|
34
|
+
@amount = hash['amount']
|
|
35
|
+
end
|
|
36
|
+
if hash.has_key? 'currencyCode'
|
|
37
|
+
@currency_code = hash['currencyCode']
|
|
38
|
+
end
|
|
39
|
+
if hash.has_key? 'numberOfDecimals'
|
|
40
|
+
@number_of_decimals = hash['numberOfDecimals']
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
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/card_payment_data_for_verification'
|
|
8
|
+
require 'worldline/acquiring/sdk/v1/domain/merchant_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::CardPaymentDataForVerification] card_payment_data
|
|
17
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::MerchantData] merchant
|
|
18
|
+
# @attr [String] operation_id
|
|
19
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
|
|
20
|
+
# @attr [DateTime] transaction_timestamp
|
|
21
|
+
class ApiAccountVerificationRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
|
22
|
+
|
|
23
|
+
attr_accessor :card_payment_data
|
|
24
|
+
|
|
25
|
+
attr_accessor :merchant
|
|
26
|
+
|
|
27
|
+
attr_accessor :operation_id
|
|
28
|
+
|
|
29
|
+
attr_accessor :references
|
|
30
|
+
|
|
31
|
+
attr_accessor :transaction_timestamp
|
|
32
|
+
|
|
33
|
+
# @return (Hash)
|
|
34
|
+
def to_h
|
|
35
|
+
hash = super
|
|
36
|
+
hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
|
|
37
|
+
hash['merchant'] = @merchant.to_h unless @merchant.nil?
|
|
38
|
+
hash['operationId'] = @operation_id unless @operation_id.nil?
|
|
39
|
+
hash['references'] = @references.to_h unless @references.nil?
|
|
40
|
+
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
|
41
|
+
hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def from_hash(hash)
|
|
45
|
+
super
|
|
46
|
+
if hash.has_key? 'cardPaymentData'
|
|
47
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
|
|
48
|
+
@card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForVerification.new_from_hash(hash['cardPaymentData'])
|
|
49
|
+
end
|
|
50
|
+
if hash.has_key? 'merchant'
|
|
51
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash
|
|
52
|
+
@merchant = Worldline::Acquiring::SDK::V1::Domain::MerchantData.new_from_hash(hash['merchant'])
|
|
53
|
+
end
|
|
54
|
+
if hash.has_key? 'operationId'
|
|
55
|
+
@operation_id = hash['operationId']
|
|
56
|
+
end
|
|
57
|
+
if hash.has_key? 'references'
|
|
58
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
|
59
|
+
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
|
|
60
|
+
end
|
|
61
|
+
if hash.has_key? 'transactionTimestamp'
|
|
62
|
+
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file was automatically generated.
|
|
3
|
+
#
|
|
4
|
+
require 'worldline/acquiring/sdk/domain/data_object'
|
|
5
|
+
require 'worldline/acquiring/sdk/v1/domain/api_references_for_responses'
|
|
6
|
+
require 'worldline/acquiring/sdk/v1/domain/card_payment_data_for_response'
|
|
7
|
+
|
|
8
|
+
module Worldline
|
|
9
|
+
module Acquiring
|
|
10
|
+
module SDK
|
|
11
|
+
module V1
|
|
12
|
+
module Domain
|
|
13
|
+
# @attr [String] authorization_code
|
|
14
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse] card_payment_data
|
|
15
|
+
# @attr [String] operation_id
|
|
16
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses] references
|
|
17
|
+
# @attr [String] responder
|
|
18
|
+
# @attr [String] response_code
|
|
19
|
+
# @attr [String] response_code_category
|
|
20
|
+
# @attr [String] response_code_description
|
|
21
|
+
class ApiAccountVerificationResponse < Worldline::Acquiring::SDK::Domain::DataObject
|
|
22
|
+
|
|
23
|
+
attr_accessor :authorization_code
|
|
24
|
+
|
|
25
|
+
attr_accessor :card_payment_data
|
|
26
|
+
|
|
27
|
+
attr_accessor :operation_id
|
|
28
|
+
|
|
29
|
+
attr_accessor :references
|
|
30
|
+
|
|
31
|
+
attr_accessor :responder
|
|
32
|
+
|
|
33
|
+
attr_accessor :response_code
|
|
34
|
+
|
|
35
|
+
attr_accessor :response_code_category
|
|
36
|
+
|
|
37
|
+
attr_accessor :response_code_description
|
|
38
|
+
|
|
39
|
+
# @return (Hash)
|
|
40
|
+
def to_h
|
|
41
|
+
hash = super
|
|
42
|
+
hash['authorizationCode'] = @authorization_code unless @authorization_code.nil?
|
|
43
|
+
hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
|
|
44
|
+
hash['operationId'] = @operation_id unless @operation_id.nil?
|
|
45
|
+
hash['references'] = @references.to_h unless @references.nil?
|
|
46
|
+
hash['responder'] = @responder unless @responder.nil?
|
|
47
|
+
hash['responseCode'] = @response_code unless @response_code.nil?
|
|
48
|
+
hash['responseCodeCategory'] = @response_code_category unless @response_code_category.nil?
|
|
49
|
+
hash['responseCodeDescription'] = @response_code_description unless @response_code_description.nil?
|
|
50
|
+
hash
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def from_hash(hash)
|
|
54
|
+
super
|
|
55
|
+
if hash.has_key? 'authorizationCode'
|
|
56
|
+
@authorization_code = hash['authorizationCode']
|
|
57
|
+
end
|
|
58
|
+
if hash.has_key? 'cardPaymentData'
|
|
59
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
|
|
60
|
+
@card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse.new_from_hash(hash['cardPaymentData'])
|
|
61
|
+
end
|
|
62
|
+
if hash.has_key? 'operationId'
|
|
63
|
+
@operation_id = hash['operationId']
|
|
64
|
+
end
|
|
65
|
+
if hash.has_key? 'references'
|
|
66
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
|
67
|
+
@references = Worldline::Acquiring::SDK::V1::Domain::ApiReferencesForResponses.new_from_hash(hash['references'])
|
|
68
|
+
end
|
|
69
|
+
if hash.has_key? 'responder'
|
|
70
|
+
@responder = hash['responder']
|
|
71
|
+
end
|
|
72
|
+
if hash.has_key? 'responseCode'
|
|
73
|
+
@response_code = hash['responseCode']
|
|
74
|
+
end
|
|
75
|
+
if hash.has_key? 'responseCodeCategory'
|
|
76
|
+
@response_code_category = hash['responseCodeCategory']
|
|
77
|
+
end
|
|
78
|
+
if hash.has_key? 'responseCodeDescription'
|
|
79
|
+
@response_code_description = hash['responseCodeDescription']
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -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_payment_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::ApiPaymentSummaryForResponse] payment
|
|
14
|
+
# @attr [String] responder
|
|
15
|
+
# @attr [String] response_code
|
|
16
|
+
# @attr [String] response_code_category
|
|
17
|
+
# @attr [String] response_code_description
|
|
18
|
+
class ApiActionResponse < Worldline::Acquiring::SDK::Domain::DataObject
|
|
19
|
+
|
|
20
|
+
attr_accessor :operation_id
|
|
21
|
+
|
|
22
|
+
attr_accessor :payment
|
|
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['payment'] = @payment.to_h unless @payment.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? 'payment'
|
|
50
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['payment']] unless hash['payment'].is_a? Hash
|
|
51
|
+
@payment = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentSummaryForResponse.new_from_hash(hash['payment'])
|
|
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
|