acquiring-sdk-ruby 0.1.0 → 1.0.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 +4 -4
- data/acquiring-sdk-ruby.gemspec +1 -1
- data/lib/worldline/acquiring/sdk/communication/metadata_provider.rb +1 -1
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/balanceinquiries/balance_inquiries_client.rb +60 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/balanceinquiries.rb +4 -0
- data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/merchant_client.rb +8 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_account_verification_request.rb +9 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_balance_inquiry_request.rb +79 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_balance_inquiry_response.rb +87 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb +18 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_capture_request_for_refund.rb +18 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_increment_request.rb +9 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_refund_request.rb +9 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_request.rb +9 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_response.rb +12 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_payment_reversal_request.rb +9 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_refund_response.rb +12 -0
- data/lib/worldline/acquiring/sdk/v1/domain/api_technical_reversal_request.rb +9 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_data_for_dcc.rb +7 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data.rb +7 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_balance_inquiry.rb +89 -0
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_refund.rb +14 -9
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_resource.rb +0 -9
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_response.rb +3 -3
- data/lib/worldline/acquiring/sdk/v1/domain/card_payment_data_for_verification.rb +16 -0
- data/lib/worldline/acquiring/sdk/v1/domain/emv_data_item.rb +41 -0
- data/lib/worldline/acquiring/sdk/v1/domain/payment_references.rb +0 -7
- data/lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data.rb +45 -5
- data/lib/worldline/acquiring/sdk/v1/domain/point_of_sale_data_for_response.rb +41 -0
- data/lib/worldline/acquiring/sdk/v1/domain/terminal_data.rb +80 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0f4fc0d00fbf007c30eb86750c3abdaa09ddcd9d01283e60d7611ed8e0e6278
|
4
|
+
data.tar.gz: edd8f41bf89cd4b52bdb9b19097a7879c45a726dce3c5b9edf502aa2ca857adf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb89ff4b821fb3558b62f415e05a3bd3d4ee0f07c51637db0e41e29af8dfcb51e8749551ded00ea34c086572aa5f5c55f85c00c92f1f8694dcc6f31cb63994ef
|
7
|
+
data.tar.gz: 0d86389a380867e2352655cdd1d1cbf5c7cfa5147e5b65bc5e6f4b2fd72f99e5898a8671d7a6c69ea4d8f546168f9509e2a613b43cd84671c66c8b3bf9b286dc
|
data/acquiring-sdk-ruby.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'acquiring-sdk-ruby'
|
3
|
-
spec.version = '
|
3
|
+
spec.version = '1.0.0'
|
4
4
|
spec.authors = ['Worldline Acquiring']
|
5
5
|
spec.email = ['github.acquiring@worldline.com']
|
6
6
|
spec.summary = %q{SDK to communicate with the Worldline Acquiring platform using the Worldline Acquiring API}
|
@@ -14,7 +14,7 @@ module Worldline
|
|
14
14
|
class MetadataProvider
|
15
15
|
private
|
16
16
|
|
17
|
-
SDK_VERSION = '
|
17
|
+
SDK_VERSION = '1.0.0'.freeze
|
18
18
|
SERVER_META_INFO_HEADER = 'X-WL-ServerMetaInfo'.freeze
|
19
19
|
PROHIBITED_HEADERS = [SERVER_META_INFO_HEADER, 'Date', 'Content-Type', 'Authorization'].sort!.freeze
|
20
20
|
CHARSET = 'utf-8'.freeze
|
data/lib/worldline/acquiring/sdk/v1/acquirer/merchant/balanceinquiries/balance_inquiries_client.rb
ADDED
@@ -0,0 +1,60 @@
|
|
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_balance_inquiry_response'
|
8
|
+
require 'worldline/acquiring/sdk/v1/domain/api_payment_error_response'
|
9
|
+
|
10
|
+
module Worldline
|
11
|
+
module Acquiring
|
12
|
+
module SDK
|
13
|
+
module V1
|
14
|
+
module Acquirer
|
15
|
+
module Merchant
|
16
|
+
module Balanceinquiries
|
17
|
+
# BalanceInquiries client. Thread-safe.
|
18
|
+
class BalanceInquiriesClient < 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}/balance-inquiries - {https://docs.acquiring.worldline-solutions.com/api-reference#tag/Balance-Inquiries/operation/processBalanceInquiry Balance inquiry}
|
27
|
+
#
|
28
|
+
# @param body [Worldline::Acquiring::SDK::V1::Domain::ApiBalanceInquiryRequest]
|
29
|
+
# @param context [Worldline::Acquiring::SDK::CallContext, nil]
|
30
|
+
# @return [Worldline::Acquiring::SDK::V1::Domain::ApiBalanceInquiryResponse]
|
31
|
+
# @raise [Worldline::Acquiring::SDK::V1::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
|
32
|
+
# @raise [Worldline::Acquiring::SDK::V1::AuthorizationException] if the request was not allowed (HTTP status code 403)
|
33
|
+
# @raise [Worldline::Acquiring::SDK::V1::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
|
34
|
+
# or there was a conflict (HTTP status code 404, 409 or 410)
|
35
|
+
# @raise [Worldline::Acquiring::SDK::V1::PlatformException] if something went wrong at the Worldline Acquiring platform,
|
36
|
+
# the Worldline Acquiring platform was unable to process a message from a downstream partner/acquirer,
|
37
|
+
# or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
|
38
|
+
# @raise [Worldline::Acquiring::SDK::V1::ApiException] if the Worldline Acquiring platform returned any other error
|
39
|
+
def process_balance_inquiry(body, context = nil)
|
40
|
+
uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/balance-inquiries', nil)
|
41
|
+
@communicator.post(
|
42
|
+
uri,
|
43
|
+
nil,
|
44
|
+
nil,
|
45
|
+
body,
|
46
|
+
Worldline::Acquiring::SDK::V1::Domain::ApiBalanceInquiryResponse,
|
47
|
+
context)
|
48
|
+
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e
|
49
|
+
error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse
|
50
|
+
error_object = @communicator.marshaller.unmarshal(e.body, error_type)
|
51
|
+
raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
#
|
4
4
|
require 'worldline/acquiring/sdk/api_resource'
|
5
5
|
require 'worldline/acquiring/sdk/v1/acquirer/merchant/accountverifications/account_verifications_client'
|
6
|
+
require 'worldline/acquiring/sdk/v1/acquirer/merchant/balanceinquiries/balance_inquiries_client'
|
6
7
|
require 'worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion/dynamic_currency_conversion_client'
|
7
8
|
require 'worldline/acquiring/sdk/v1/acquirer/merchant/payments/payments_client'
|
8
9
|
require 'worldline/acquiring/sdk/v1/acquirer/merchant/refunds/refunds_client'
|
@@ -44,6 +45,13 @@ module Worldline
|
|
44
45
|
Worldline::Acquiring::SDK::V1::Acquirer::Merchant::Accountverifications::AccountVerificationsClient.new(self, nil)
|
45
46
|
end
|
46
47
|
|
48
|
+
# Resource /processing/v1/{acquirerId}/{merchantId}/balance-inquiries
|
49
|
+
#
|
50
|
+
# @return [Worldline::Acquiring::SDK::V1::Acquirer::Merchant::Balanceinquiries::BalanceInquiriesClient]
|
51
|
+
def balance_inquiries
|
52
|
+
Worldline::Acquiring::SDK::V1::Acquirer::Merchant::Balanceinquiries::BalanceInquiriesClient.new(self, nil)
|
53
|
+
end
|
54
|
+
|
47
55
|
# Resource /processing/v1/{acquirerId}/{merchantId}/operations/{operationId}/reverse
|
48
56
|
#
|
49
57
|
# @return [Worldline::Acquiring::SDK::V1::Acquirer::Merchant::Technicalreversals::TechnicalReversalsClient]
|
@@ -7,6 +7,7 @@ require 'worldline/acquiring/sdk/domain/data_object'
|
|
7
7
|
require 'worldline/acquiring/sdk/v1/domain/card_payment_data_for_verification'
|
8
8
|
require 'worldline/acquiring/sdk/v1/domain/merchant_data'
|
9
9
|
require 'worldline/acquiring/sdk/v1/domain/payment_references'
|
10
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
10
11
|
|
11
12
|
module Worldline
|
12
13
|
module Acquiring
|
@@ -17,6 +18,7 @@ module Worldline
|
|
17
18
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::MerchantData] merchant
|
18
19
|
# @attr [String] operation_id
|
19
20
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
|
21
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
20
22
|
# @attr [DateTime] transaction_timestamp
|
21
23
|
class ApiAccountVerificationRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
22
24
|
|
@@ -28,6 +30,8 @@ module Worldline
|
|
28
30
|
|
29
31
|
attr_accessor :references
|
30
32
|
|
33
|
+
attr_accessor :terminal_data
|
34
|
+
|
31
35
|
attr_accessor :transaction_timestamp
|
32
36
|
|
33
37
|
# @return (Hash)
|
@@ -37,6 +41,7 @@ module Worldline
|
|
37
41
|
hash['merchant'] = @merchant.to_h unless @merchant.nil?
|
38
42
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
39
43
|
hash['references'] = @references.to_h unless @references.nil?
|
44
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
40
45
|
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
41
46
|
hash
|
42
47
|
end
|
@@ -58,6 +63,10 @@ module Worldline
|
|
58
63
|
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
59
64
|
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
|
60
65
|
end
|
66
|
+
if hash.has_key? 'terminalData'
|
67
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
68
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
69
|
+
end
|
61
70
|
if hash.has_key? 'transactionTimestamp'
|
62
71
|
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
63
72
|
end
|
@@ -0,0 +1,79 @@
|
|
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_balance_inquiry'
|
8
|
+
require 'worldline/acquiring/sdk/v1/domain/merchant_data'
|
9
|
+
require 'worldline/acquiring/sdk/v1/domain/payment_references'
|
10
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
11
|
+
|
12
|
+
module Worldline
|
13
|
+
module Acquiring
|
14
|
+
module SDK
|
15
|
+
module V1
|
16
|
+
module Domain
|
17
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForBalanceInquiry] card_payment_data
|
18
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::MerchantData] merchant
|
19
|
+
# @attr [String] operation_id
|
20
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
|
21
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
22
|
+
# @attr [DateTime] transaction_timestamp
|
23
|
+
class ApiBalanceInquiryRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
24
|
+
|
25
|
+
attr_accessor :card_payment_data
|
26
|
+
|
27
|
+
attr_accessor :merchant
|
28
|
+
|
29
|
+
attr_accessor :operation_id
|
30
|
+
|
31
|
+
attr_accessor :references
|
32
|
+
|
33
|
+
attr_accessor :terminal_data
|
34
|
+
|
35
|
+
attr_accessor :transaction_timestamp
|
36
|
+
|
37
|
+
# @return (Hash)
|
38
|
+
def to_h
|
39
|
+
hash = super
|
40
|
+
hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
|
41
|
+
hash['merchant'] = @merchant.to_h unless @merchant.nil?
|
42
|
+
hash['operationId'] = @operation_id unless @operation_id.nil?
|
43
|
+
hash['references'] = @references.to_h unless @references.nil?
|
44
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
45
|
+
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
46
|
+
hash
|
47
|
+
end
|
48
|
+
|
49
|
+
def from_hash(hash)
|
50
|
+
super
|
51
|
+
if hash.has_key? 'cardPaymentData'
|
52
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
|
53
|
+
@card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForBalanceInquiry.new_from_hash(hash['cardPaymentData'])
|
54
|
+
end
|
55
|
+
if hash.has_key? 'merchant'
|
56
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash
|
57
|
+
@merchant = Worldline::Acquiring::SDK::V1::Domain::MerchantData.new_from_hash(hash['merchant'])
|
58
|
+
end
|
59
|
+
if hash.has_key? 'operationId'
|
60
|
+
@operation_id = hash['operationId']
|
61
|
+
end
|
62
|
+
if hash.has_key? 'references'
|
63
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
64
|
+
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
|
65
|
+
end
|
66
|
+
if hash.has_key? 'terminalData'
|
67
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
68
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
69
|
+
end
|
70
|
+
if hash.has_key? 'transactionTimestamp'
|
71
|
+
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
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/amount_data'
|
6
|
+
require 'worldline/acquiring/sdk/v1/domain/api_references_for_responses'
|
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::AmountData] available_amount
|
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 ApiBalanceInquiryResponse < Worldline::Acquiring::SDK::Domain::DataObject
|
22
|
+
|
23
|
+
attr_accessor :authorization_code
|
24
|
+
|
25
|
+
attr_accessor :available_amount
|
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['availableAmount'] = @available_amount.to_h unless @available_amount.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? 'availableAmount'
|
59
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['availableAmount']] unless hash['availableAmount'].is_a? Hash
|
60
|
+
@available_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['availableAmount'])
|
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
|
@@ -6,6 +6,8 @@ require 'date'
|
|
6
6
|
require 'worldline/acquiring/sdk/domain/data_object'
|
7
7
|
require 'worldline/acquiring/sdk/v1/domain/amount_data'
|
8
8
|
require 'worldline/acquiring/sdk/v1/domain/dcc_data'
|
9
|
+
require 'worldline/acquiring/sdk/v1/domain/payment_references'
|
10
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
9
11
|
|
10
12
|
module Worldline
|
11
13
|
module Acquiring
|
@@ -17,6 +19,8 @@ module Worldline
|
|
17
19
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
|
18
20
|
# @attr [true/false] is_final
|
19
21
|
# @attr [String] operation_id
|
22
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
|
23
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
20
24
|
# @attr [DateTime] transaction_timestamp
|
21
25
|
class ApiCaptureRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
22
26
|
|
@@ -30,6 +34,10 @@ module Worldline
|
|
30
34
|
|
31
35
|
attr_accessor :operation_id
|
32
36
|
|
37
|
+
attr_accessor :references
|
38
|
+
|
39
|
+
attr_accessor :terminal_data
|
40
|
+
|
33
41
|
attr_accessor :transaction_timestamp
|
34
42
|
|
35
43
|
# @return (Hash)
|
@@ -40,6 +48,8 @@ module Worldline
|
|
40
48
|
hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
|
41
49
|
hash['isFinal'] = @is_final unless @is_final.nil?
|
42
50
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
51
|
+
hash['references'] = @references.to_h unless @references.nil?
|
52
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
43
53
|
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
44
54
|
hash
|
45
55
|
end
|
@@ -63,6 +73,14 @@ module Worldline
|
|
63
73
|
if hash.has_key? 'operationId'
|
64
74
|
@operation_id = hash['operationId']
|
65
75
|
end
|
76
|
+
if hash.has_key? 'references'
|
77
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
78
|
+
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
|
79
|
+
end
|
80
|
+
if hash.has_key? 'terminalData'
|
81
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
82
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
83
|
+
end
|
66
84
|
if hash.has_key? 'transactionTimestamp'
|
67
85
|
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
68
86
|
end
|
@@ -4,6 +4,8 @@
|
|
4
4
|
require 'date'
|
5
5
|
|
6
6
|
require 'worldline/acquiring/sdk/domain/data_object'
|
7
|
+
require 'worldline/acquiring/sdk/v1/domain/payment_references'
|
8
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
7
9
|
|
8
10
|
module Worldline
|
9
11
|
module Acquiring
|
@@ -11,17 +13,25 @@ module Worldline
|
|
11
13
|
module V1
|
12
14
|
module Domain
|
13
15
|
# @attr [String] operation_id
|
16
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
|
17
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
14
18
|
# @attr [DateTime] transaction_timestamp
|
15
19
|
class ApiCaptureRequestForRefund < Worldline::Acquiring::SDK::Domain::DataObject
|
16
20
|
|
17
21
|
attr_accessor :operation_id
|
18
22
|
|
23
|
+
attr_accessor :references
|
24
|
+
|
25
|
+
attr_accessor :terminal_data
|
26
|
+
|
19
27
|
attr_accessor :transaction_timestamp
|
20
28
|
|
21
29
|
# @return (Hash)
|
22
30
|
def to_h
|
23
31
|
hash = super
|
24
32
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
33
|
+
hash['references'] = @references.to_h unless @references.nil?
|
34
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
25
35
|
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
26
36
|
hash
|
27
37
|
end
|
@@ -31,6 +41,14 @@ module Worldline
|
|
31
41
|
if hash.has_key? 'operationId'
|
32
42
|
@operation_id = hash['operationId']
|
33
43
|
end
|
44
|
+
if hash.has_key? 'references'
|
45
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
46
|
+
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
|
47
|
+
end
|
48
|
+
if hash.has_key? 'terminalData'
|
49
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
50
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
51
|
+
end
|
34
52
|
if hash.has_key? 'transactionTimestamp'
|
35
53
|
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
36
54
|
end
|
@@ -6,6 +6,7 @@ require 'date'
|
|
6
6
|
require 'worldline/acquiring/sdk/domain/data_object'
|
7
7
|
require 'worldline/acquiring/sdk/v1/domain/amount_data'
|
8
8
|
require 'worldline/acquiring/sdk/v1/domain/dcc_data'
|
9
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
9
10
|
|
10
11
|
module Worldline
|
11
12
|
module Acquiring
|
@@ -15,6 +16,7 @@ module Worldline
|
|
15
16
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
|
16
17
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] increment_amount
|
17
18
|
# @attr [String] operation_id
|
19
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
18
20
|
# @attr [DateTime] transaction_timestamp
|
19
21
|
class ApiIncrementRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
20
22
|
|
@@ -24,6 +26,8 @@ module Worldline
|
|
24
26
|
|
25
27
|
attr_accessor :operation_id
|
26
28
|
|
29
|
+
attr_accessor :terminal_data
|
30
|
+
|
27
31
|
attr_accessor :transaction_timestamp
|
28
32
|
|
29
33
|
# @return (Hash)
|
@@ -32,6 +36,7 @@ module Worldline
|
|
32
36
|
hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
|
33
37
|
hash['incrementAmount'] = @increment_amount.to_h unless @increment_amount.nil?
|
34
38
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
39
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
35
40
|
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
36
41
|
hash
|
37
42
|
end
|
@@ -49,6 +54,10 @@ module Worldline
|
|
49
54
|
if hash.has_key? 'operationId'
|
50
55
|
@operation_id = hash['operationId']
|
51
56
|
end
|
57
|
+
if hash.has_key? 'terminalData'
|
58
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
59
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
60
|
+
end
|
52
61
|
if hash.has_key? 'transactionTimestamp'
|
53
62
|
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
54
63
|
end
|
@@ -7,6 +7,7 @@ require 'worldline/acquiring/sdk/domain/data_object'
|
|
7
7
|
require 'worldline/acquiring/sdk/v1/domain/amount_data'
|
8
8
|
require 'worldline/acquiring/sdk/v1/domain/dcc_data'
|
9
9
|
require 'worldline/acquiring/sdk/v1/domain/payment_references'
|
10
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
10
11
|
|
11
12
|
module Worldline
|
12
13
|
module Acquiring
|
@@ -18,6 +19,7 @@ module Worldline
|
|
18
19
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
|
19
20
|
# @attr [String] operation_id
|
20
21
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
|
22
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
21
23
|
# @attr [DateTime] transaction_timestamp
|
22
24
|
class ApiPaymentRefundRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
23
25
|
|
@@ -31,6 +33,8 @@ module Worldline
|
|
31
33
|
|
32
34
|
attr_accessor :references
|
33
35
|
|
36
|
+
attr_accessor :terminal_data
|
37
|
+
|
34
38
|
attr_accessor :transaction_timestamp
|
35
39
|
|
36
40
|
# @return (Hash)
|
@@ -41,6 +45,7 @@ module Worldline
|
|
41
45
|
hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
|
42
46
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
43
47
|
hash['references'] = @references.to_h unless @references.nil?
|
48
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
44
49
|
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
45
50
|
hash
|
46
51
|
end
|
@@ -65,6 +70,10 @@ module Worldline
|
|
65
70
|
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
66
71
|
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
|
67
72
|
end
|
73
|
+
if hash.has_key? 'terminalData'
|
74
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
75
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
76
|
+
end
|
68
77
|
if hash.has_key? 'transactionTimestamp'
|
69
78
|
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
70
79
|
end
|
@@ -9,6 +9,7 @@ require 'worldline/acquiring/sdk/v1/domain/card_payment_data'
|
|
9
9
|
require 'worldline/acquiring/sdk/v1/domain/dcc_data'
|
10
10
|
require 'worldline/acquiring/sdk/v1/domain/merchant_data'
|
11
11
|
require 'worldline/acquiring/sdk/v1/domain/payment_references'
|
12
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
12
13
|
|
13
14
|
module Worldline
|
14
15
|
module Acquiring
|
@@ -22,6 +23,7 @@ module Worldline
|
|
22
23
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::MerchantData] merchant
|
23
24
|
# @attr [String] operation_id
|
24
25
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::PaymentReferences] references
|
26
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
25
27
|
# @attr [DateTime] transaction_timestamp
|
26
28
|
class ApiPaymentRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
27
29
|
|
@@ -39,6 +41,8 @@ module Worldline
|
|
39
41
|
|
40
42
|
attr_accessor :references
|
41
43
|
|
44
|
+
attr_accessor :terminal_data
|
45
|
+
|
42
46
|
attr_accessor :transaction_timestamp
|
43
47
|
|
44
48
|
# @return (Hash)
|
@@ -51,6 +55,7 @@ module Worldline
|
|
51
55
|
hash['merchant'] = @merchant.to_h unless @merchant.nil?
|
52
56
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
53
57
|
hash['references'] = @references.to_h unless @references.nil?
|
58
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
54
59
|
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
55
60
|
hash
|
56
61
|
end
|
@@ -83,6 +88,10 @@ module Worldline
|
|
83
88
|
raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash
|
84
89
|
@references = Worldline::Acquiring::SDK::V1::Domain::PaymentReferences.new_from_hash(hash['references'])
|
85
90
|
end
|
91
|
+
if hash.has_key? 'terminalData'
|
92
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
93
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
94
|
+
end
|
86
95
|
if hash.has_key? 'transactionTimestamp'
|
87
96
|
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
88
97
|
end
|
@@ -7,6 +7,7 @@ require 'worldline/acquiring/sdk/domain/data_object'
|
|
7
7
|
require 'worldline/acquiring/sdk/v1/domain/amount_data'
|
8
8
|
require 'worldline/acquiring/sdk/v1/domain/api_references_for_responses'
|
9
9
|
require 'worldline/acquiring/sdk/v1/domain/card_payment_data_for_response'
|
10
|
+
require 'worldline/acquiring/sdk/v1/domain/emv_data_item'
|
10
11
|
|
11
12
|
module Worldline
|
12
13
|
module Acquiring
|
@@ -14,6 +15,7 @@ module Worldline
|
|
14
15
|
module V1
|
15
16
|
module Domain
|
16
17
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse] card_payment_data
|
18
|
+
# @attr [Array<Worldline::Acquiring::SDK::V1::Domain::EmvDataItem>] emv_data
|
17
19
|
# @attr [String] initial_authorization_code
|
18
20
|
# @attr [String] operation_id
|
19
21
|
# @attr [String] payment_id
|
@@ -30,6 +32,8 @@ module Worldline
|
|
30
32
|
|
31
33
|
attr_accessor :card_payment_data
|
32
34
|
|
35
|
+
attr_accessor :emv_data
|
36
|
+
|
33
37
|
attr_accessor :initial_authorization_code
|
34
38
|
|
35
39
|
attr_accessor :operation_id
|
@@ -58,6 +62,7 @@ module Worldline
|
|
58
62
|
def to_h
|
59
63
|
hash = super
|
60
64
|
hash['cardPaymentData'] = @card_payment_data.to_h unless @card_payment_data.nil?
|
65
|
+
hash['emvData'] = @emv_data.collect{|val| val.to_h} unless @emv_data.nil?
|
61
66
|
hash['initialAuthorizationCode'] = @initial_authorization_code unless @initial_authorization_code.nil?
|
62
67
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
63
68
|
hash['paymentId'] = @payment_id unless @payment_id.nil?
|
@@ -79,6 +84,13 @@ module Worldline
|
|
79
84
|
raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentData']] unless hash['cardPaymentData'].is_a? Hash
|
80
85
|
@card_payment_data = Worldline::Acquiring::SDK::V1::Domain::CardPaymentDataForResponse.new_from_hash(hash['cardPaymentData'])
|
81
86
|
end
|
87
|
+
if hash.has_key? 'emvData'
|
88
|
+
raise TypeError, "value '%s' is not an Array" % [hash['emvData']] unless hash['emvData'].is_a? Array
|
89
|
+
@emv_data = []
|
90
|
+
hash['emvData'].each do |e|
|
91
|
+
@emv_data << Worldline::Acquiring::SDK::V1::Domain::EmvDataItem.new_from_hash(e)
|
92
|
+
end
|
93
|
+
end
|
82
94
|
if hash.has_key? 'initialAuthorizationCode'
|
83
95
|
@initial_authorization_code = hash['initialAuthorizationCode']
|
84
96
|
end
|
@@ -6,6 +6,7 @@ require 'date'
|
|
6
6
|
require 'worldline/acquiring/sdk/domain/data_object'
|
7
7
|
require 'worldline/acquiring/sdk/v1/domain/amount_data'
|
8
8
|
require 'worldline/acquiring/sdk/v1/domain/dcc_data'
|
9
|
+
require 'worldline/acquiring/sdk/v1/domain/terminal_data'
|
9
10
|
|
10
11
|
module Worldline
|
11
12
|
module Acquiring
|
@@ -15,6 +16,7 @@ module Worldline
|
|
15
16
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::DccData] dynamic_currency_conversion
|
16
17
|
# @attr [String] operation_id
|
17
18
|
# @attr [Worldline::Acquiring::SDK::V1::Domain::AmountData] reversal_amount
|
19
|
+
# @attr [Worldline::Acquiring::SDK::V1::Domain::TerminalData] terminal_data
|
18
20
|
# @attr [DateTime] transaction_timestamp
|
19
21
|
class ApiPaymentReversalRequest < Worldline::Acquiring::SDK::Domain::DataObject
|
20
22
|
|
@@ -24,6 +26,8 @@ module Worldline
|
|
24
26
|
|
25
27
|
attr_accessor :reversal_amount
|
26
28
|
|
29
|
+
attr_accessor :terminal_data
|
30
|
+
|
27
31
|
attr_accessor :transaction_timestamp
|
28
32
|
|
29
33
|
# @return (Hash)
|
@@ -32,6 +36,7 @@ module Worldline
|
|
32
36
|
hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil?
|
33
37
|
hash['operationId'] = @operation_id unless @operation_id.nil?
|
34
38
|
hash['reversalAmount'] = @reversal_amount.to_h unless @reversal_amount.nil?
|
39
|
+
hash['terminalData'] = @terminal_data.to_h unless @terminal_data.nil?
|
35
40
|
hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil?
|
36
41
|
hash
|
37
42
|
end
|
@@ -49,6 +54,10 @@ module Worldline
|
|
49
54
|
raise TypeError, "value '%s' is not a Hash" % [hash['reversalAmount']] unless hash['reversalAmount'].is_a? Hash
|
50
55
|
@reversal_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['reversalAmount'])
|
51
56
|
end
|
57
|
+
if hash.has_key? 'terminalData'
|
58
|
+
raise TypeError, "value '%s' is not a Hash" % [hash['terminalData']] unless hash['terminalData'].is_a? Hash
|
59
|
+
@terminal_data = Worldline::Acquiring::SDK::V1::Domain::TerminalData.new_from_hash(hash['terminalData'])
|
60
|
+
end
|
52
61
|
if hash.has_key? 'transactionTimestamp'
|
53
62
|
@transaction_timestamp = DateTime.parse(hash['transactionTimestamp'])
|
54
63
|
end
|