bk-apimatic-sdk 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 +7 -0
- data/LICENSE +28 -0
- data/README.md +203 -0
- data/bin/console +15 -0
- data/lib/boku_direct_payments_api/api_helper.rb +10 -0
- data/lib/boku_direct_payments_api/client.rb +99 -0
- data/lib/boku_direct_payments_api/configuration.rb +168 -0
- data/lib/boku_direct_payments_api/controllers/account_resources_controller.rb +45 -0
- data/lib/boku_direct_payments_api/controllers/base_controller.rb +60 -0
- data/lib/boku_direct_payments_api/controllers/charge_controller.rb +247 -0
- data/lib/boku_direct_payments_api/controllers/config_resources_controller.rb +50 -0
- data/lib/boku_direct_payments_api/controllers/consumer_registration_controller.rb +428 -0
- data/lib/boku_direct_payments_api/controllers/forex_controller.rb +38 -0
- data/lib/boku_direct_payments_api/controllers/fund_check_controller.rb +39 -0
- data/lib/boku_direct_payments_api/controllers/refund_controller.rb +80 -0
- data/lib/boku_direct_payments_api/controllers/seller_of_record_controller.rb +69 -0
- data/lib/boku_direct_payments_api/exceptions/api_exception.rb +21 -0
- data/lib/boku_direct_payments_api/http/http_call_back.rb +10 -0
- data/lib/boku_direct_payments_api/http/http_method_enum.rb +10 -0
- data/lib/boku_direct_payments_api/http/http_request.rb +10 -0
- data/lib/boku_direct_payments_api/http/http_response.rb +10 -0
- data/lib/boku_direct_payments_api/http/proxy_settings.rb +22 -0
- data/lib/boku_direct_payments_api/models/account_profile.rb +122 -0
- data/lib/boku_direct_payments_api/models/account_profile_attribute.rb +90 -0
- data/lib/boku_direct_payments_api/models/account_profile_request.rb +131 -0
- data/lib/boku_direct_payments_api/models/account_profile_response.rb +104 -0
- data/lib/boku_direct_payments_api/models/account_profile_response_record.rb +142 -0
- data/lib/boku_direct_payments_api/models/account_profile_result_status_enum.rb +47 -0
- data/lib/boku_direct_payments_api/models/account_profile_selector.rb +132 -0
- data/lib/boku_direct_payments_api/models/base_model.rb +110 -0
- data/lib/boku_direct_payments_api/models/begin_single_charge_request.rb +360 -0
- data/lib/boku_direct_payments_api/models/begin_single_charge_request_hosted.rb +110 -0
- data/lib/boku_direct_payments_api/models/begin_single_charge_request_qr_info.rb +74 -0
- data/lib/boku_direct_payments_api/models/begin_single_charge_response.rb +254 -0
- data/lib/boku_direct_payments_api/models/begin_single_charge_response_hosted.rb +90 -0
- data/lib/boku_direct_payments_api/models/begin_single_charge_response_qr_info.rb +85 -0
- data/lib/boku_direct_payments_api/models/business_details.rb +209 -0
- data/lib/boku_direct_payments_api/models/cancel_optin_request.rb +123 -0
- data/lib/boku_direct_payments_api/models/cancel_optin_response.rb +143 -0
- data/lib/boku_direct_payments_api/models/carrier_gw.rb +82 -0
- data/lib/boku_direct_payments_api/models/charge.rb +288 -0
- data/lib/boku_direct_payments_api/models/charge_msisdn_request.rb +233 -0
- data/lib/boku_direct_payments_api/models/charge_plus_optin_request.rb +390 -0
- data/lib/boku_direct_payments_api/models/charge_plus_optin_request_hosted.rb +96 -0
- data/lib/boku_direct_payments_api/models/charge_plus_optin_response.rb +278 -0
- data/lib/boku_direct_payments_api/models/charge_plus_optin_response_hosted.rb +75 -0
- data/lib/boku_direct_payments_api/models/charge_request.rb +332 -0
- data/lib/boku_direct_payments_api/models/charge_response.rb +253 -0
- data/lib/boku_direct_payments_api/models/charge_status_enum.rb +43 -0
- data/lib/boku_direct_payments_api/models/check_eligibility_request.rb +117 -0
- data/lib/boku_direct_payments_api/models/check_eligibility_response.rb +116 -0
- data/lib/boku_direct_payments_api/models/client_call.rb +91 -0
- data/lib/boku_direct_payments_api/models/confirm_optin_request.rb +141 -0
- data/lib/boku_direct_payments_api/models/confirm_optin_response.rb +211 -0
- data/lib/boku_direct_payments_api/models/confirm_verify_device_request.rb +161 -0
- data/lib/boku_direct_payments_api/models/confirm_verify_device_response.rb +137 -0
- data/lib/boku_direct_payments_api/models/eligibility_status_enum.rb +40 -0
- data/lib/boku_direct_payments_api/models/forex_request.rb +97 -0
- data/lib/boku_direct_payments_api/models/forex_response.rb +127 -0
- data/lib/boku_direct_payments_api/models/fund_check_request.rb +132 -0
- data/lib/boku_direct_payments_api/models/fund_check_response.rb +89 -0
- data/lib/boku_direct_payments_api/models/invalid_request_field.rb +93 -0
- data/lib/boku_direct_payments_api/models/mandate_constraint.rb +92 -0
- data/lib/boku_direct_payments_api/models/mandate_period_enum.rb +48 -0
- data/lib/boku_direct_payments_api/models/mcc_mnc_mapping.rb +85 -0
- data/lib/boku_direct_payments_api/models/method_enum.rb +36 -0
- data/lib/boku_direct_payments_api/models/msisdn_network_request.rb +97 -0
- data/lib/boku_direct_payments_api/models/msisdn_network_response.rb +116 -0
- data/lib/boku_direct_payments_api/models/network_info.rb +84 -0
- data/lib/boku_direct_payments_api/models/network_info_network.rb +168 -0
- data/lib/boku_direct_payments_api/models/optin_accept_networks.rb +87 -0
- data/lib/boku_direct_payments_api/models/optin_info.rb +99 -0
- data/lib/boku_direct_payments_api/models/optin_info_optin_network.rb +104 -0
- data/lib/boku_direct_payments_api/models/optin_info_optin_types.rb +128 -0
- data/lib/boku_direct_payments_api/models/optin_network.rb +115 -0
- data/lib/boku_direct_payments_api/models/optin_purpose_enum.rb +62 -0
- data/lib/boku_direct_payments_api/models/optin_request.rb +338 -0
- data/lib/boku_direct_payments_api/models/optin_request_hosted.rb +110 -0
- data/lib/boku_direct_payments_api/models/optin_request_qr_info.rb +75 -0
- data/lib/boku_direct_payments_api/models/optin_response.rb +220 -0
- data/lib/boku_direct_payments_api/models/optin_response_hosted.rb +87 -0
- data/lib/boku_direct_payments_api/models/optin_response_qr_info.rb +85 -0
- data/lib/boku_direct_payments_api/models/optin_state.rb +164 -0
- data/lib/boku_direct_payments_api/models/optin_status_enum.rb +51 -0
- data/lib/boku_direct_payments_api/models/optin_terms.rb +214 -0
- data/lib/boku_direct_payments_api/models/optin_type_enum.rb +45 -0
- data/lib/boku_direct_payments_api/models/payment_method_status_enum.rb +44 -0
- data/lib/boku_direct_payments_api/models/period.rb +89 -0
- data/lib/boku_direct_payments_api/models/period_unit_enum.rb +46 -0
- data/lib/boku_direct_payments_api/models/query_charge_request.rb +149 -0
- data/lib/boku_direct_payments_api/models/query_charge_response.rb +101 -0
- data/lib/boku_direct_payments_api/models/query_optin_request.rb +104 -0
- data/lib/boku_direct_payments_api/models/query_optin_response.rb +129 -0
- data/lib/boku_direct_payments_api/models/query_refund_request.rb +122 -0
- data/lib/boku_direct_payments_api/models/query_refund_response.rb +101 -0
- data/lib/boku_direct_payments_api/models/refund.rb +249 -0
- data/lib/boku_direct_payments_api/models/refund_charge_notification.rb +88 -0
- data/lib/boku_direct_payments_api/models/refund_charge_request.rb +231 -0
- data/lib/boku_direct_payments_api/models/refund_charge_response.rb +203 -0
- data/lib/boku_direct_payments_api/models/refund_status_enum.rb +43 -0
- data/lib/boku_direct_payments_api/models/refund_type_enum.rb +36 -0
- data/lib/boku_direct_payments_api/models/register_payment_method_request.rb +152 -0
- data/lib/boku_direct_payments_api/models/register_payment_method_response.rb +172 -0
- data/lib/boku_direct_payments_api/models/register_seller_of_record_request.rb +118 -0
- data/lib/boku_direct_payments_api/models/register_seller_of_record_response.rb +156 -0
- data/lib/boku_direct_payments_api/models/resend_otp_request.rb +167 -0
- data/lib/boku_direct_payments_api/models/resend_otp_response.rb +118 -0
- data/lib/boku_direct_payments_api/models/result.rb +154 -0
- data/lib/boku_direct_payments_api/models/result_status_enum.rb +36 -0
- data/lib/boku_direct_payments_api/models/reversal.rb +89 -0
- data/lib/boku_direct_payments_api/models/reverse_charge_request.rb +104 -0
- data/lib/boku_direct_payments_api/models/reverse_charge_response.rb +157 -0
- data/lib/boku_direct_payments_api/models/seller_of_record.rb +76 -0
- data/lib/boku_direct_payments_api/models/seller_of_record_status_enum.rb +44 -0
- data/lib/boku_direct_payments_api/models/send_sms.rb +89 -0
- data/lib/boku_direct_payments_api/models/settlement.rb +126 -0
- data/lib/boku_direct_payments_api/models/silent_mo.rb +78 -0
- data/lib/boku_direct_payments_api/models/status_enum.rb +40 -0
- data/lib/boku_direct_payments_api/models/subscription.rb +105 -0
- data/lib/boku_direct_payments_api/models/timeout.rb +75 -0
- data/lib/boku_direct_payments_api/models/type_enum.rb +36 -0
- data/lib/boku_direct_payments_api/models/validate_optin_request.rb +179 -0
- data/lib/boku_direct_payments_api/models/validate_optin_response.rb +195 -0
- data/lib/boku_direct_payments_api/models/verify_device_request.rb +135 -0
- data/lib/boku_direct_payments_api/models/verify_device_response.rb +137 -0
- data/lib/boku_direct_payments_api/utilities/date_time_helper.rb +11 -0
- data/lib/boku_direct_payments_api/utilities/file_wrapper.rb +28 -0
- data/lib/boku_direct_payments_api/utilities/xml_utilities.rb +12 -0
- data/lib/boku_direct_payments_api.rb +166 -0
- data/test/controllers/controller_test_base.rb +23 -0
- data/test/controllers/test_account_resources_controller.rb +44 -0
- data/test/controllers/test_charge_controller.rb +159 -0
- data/test/controllers/test_config_resources_controller.rb +47 -0
- data/test/controllers/test_consumer_registration_controller.rb +262 -0
- data/test/controllers/test_forex_controller.rb +40 -0
- data/test/controllers/test_fund_check_controller.rb +41 -0
- data/test/controllers/test_refund_controller.rb +76 -0
- data/test/controllers/test_seller_of_record_controller.rb +72 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +255 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# boku_direct_payments_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BokuDirectPaymentsApi
|
|
7
|
+
# 'query-optin' Request - General Elements
|
|
8
|
+
class QueryOptinRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Boku-assigned merchant ID.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :merchant_id
|
|
15
|
+
|
|
16
|
+
# Merchant-assigned unique opt-in ID.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :merchant_optin_id
|
|
19
|
+
|
|
20
|
+
# Boku-assigned unique opt-in ID.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :optin_id
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['merchant_id'] = 'merchant-id'
|
|
28
|
+
@_hash['merchant_optin_id'] = 'merchant-optin-id'
|
|
29
|
+
@_hash['optin_id'] = 'optin-id'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
merchant_optin_id
|
|
37
|
+
optin_id
|
|
38
|
+
]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# An array for nullable fields
|
|
42
|
+
def self.nullables
|
|
43
|
+
[]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(merchant_id = nil, merchant_optin_id = SKIP, optin_id = SKIP)
|
|
47
|
+
@merchant_id = merchant_id
|
|
48
|
+
@merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
|
|
49
|
+
@optin_id = optin_id unless optin_id == SKIP
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Creates an instance of the object from a hash.
|
|
53
|
+
def self.from_hash(hash)
|
|
54
|
+
return nil unless hash
|
|
55
|
+
|
|
56
|
+
# Extract variables from the hash.
|
|
57
|
+
merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
|
|
58
|
+
merchant_optin_id =
|
|
59
|
+
hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
|
|
60
|
+
optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
|
|
61
|
+
|
|
62
|
+
# Create object from extracted values.
|
|
63
|
+
QueryOptinRequest.new(merchant_id,
|
|
64
|
+
merchant_optin_id,
|
|
65
|
+
optin_id)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.from_element(root)
|
|
69
|
+
merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
|
|
70
|
+
merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
|
|
71
|
+
String)
|
|
72
|
+
optin_id = XmlUtilities.from_element(root, 'optin-id', String)
|
|
73
|
+
|
|
74
|
+
new(merchant_id,
|
|
75
|
+
merchant_optin_id,
|
|
76
|
+
optin_id)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def to_xml_element(doc, root_name)
|
|
80
|
+
root = doc.create_element(root_name)
|
|
81
|
+
|
|
82
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
|
|
83
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
|
|
84
|
+
merchant_optin_id)
|
|
85
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
|
|
86
|
+
|
|
87
|
+
root
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a human-readable string representation of the object.
|
|
91
|
+
def to_s
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} merchant_id: #{@merchant_id}, merchant_optin_id: #{@merchant_optin_id},"\
|
|
94
|
+
" optin_id: #{@optin_id}>"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
98
|
+
def inspect
|
|
99
|
+
class_name = self.class.name.split('::').last
|
|
100
|
+
"<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_optin_id:"\
|
|
101
|
+
" #{@merchant_optin_id.inspect}, optin_id: #{@optin_id.inspect}>"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# boku_direct_payments_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BokuDirectPaymentsApi
|
|
7
|
+
# 'query-optin' Response - General Elements
|
|
8
|
+
class QueryOptinResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The 'result' element is defined in every response type. It is used to
|
|
13
|
+
# convey the outcome of an API request.
|
|
14
|
+
# @return [Result]
|
|
15
|
+
attr_accessor :result
|
|
16
|
+
|
|
17
|
+
# Boku-assigned merchant ID.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :merchant_id
|
|
20
|
+
|
|
21
|
+
# Boku-assigned consumer opt-in ID.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :optin_id
|
|
24
|
+
|
|
25
|
+
# Gives the state of the opt-in at the time this response was returned
|
|
26
|
+
# @return [OptinState]
|
|
27
|
+
attr_accessor :optin_state
|
|
28
|
+
|
|
29
|
+
# Time original optin request was received ("YYYY-MM-DD hh:mm:ss").
|
|
30
|
+
# All timestamps are in UTC.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :timestamp
|
|
33
|
+
|
|
34
|
+
# A mapping from model property names to API property names.
|
|
35
|
+
def self.names
|
|
36
|
+
@_hash = {} if @_hash.nil?
|
|
37
|
+
@_hash['result'] = 'result'
|
|
38
|
+
@_hash['merchant_id'] = 'merchant-id'
|
|
39
|
+
@_hash['optin_id'] = 'optin-id'
|
|
40
|
+
@_hash['optin_state'] = 'optin-state'
|
|
41
|
+
@_hash['timestamp'] = 'timestamp'
|
|
42
|
+
@_hash
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# An array for optional fields
|
|
46
|
+
def self.optionals
|
|
47
|
+
%w[
|
|
48
|
+
merchant_id
|
|
49
|
+
optin_id
|
|
50
|
+
optin_state
|
|
51
|
+
timestamp
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# An array for nullable fields
|
|
56
|
+
def self.nullables
|
|
57
|
+
[]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def initialize(result = nil, merchant_id = SKIP, optin_id = SKIP,
|
|
61
|
+
optin_state = SKIP, timestamp = SKIP)
|
|
62
|
+
@result = result
|
|
63
|
+
@merchant_id = merchant_id unless merchant_id == SKIP
|
|
64
|
+
@optin_id = optin_id unless optin_id == SKIP
|
|
65
|
+
@optin_state = optin_state unless optin_state == SKIP
|
|
66
|
+
@timestamp = timestamp unless timestamp == SKIP
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Creates an instance of the object from a hash.
|
|
70
|
+
def self.from_hash(hash)
|
|
71
|
+
return nil unless hash
|
|
72
|
+
|
|
73
|
+
# Extract variables from the hash.
|
|
74
|
+
result = Result.from_hash(hash['result']) if hash['result']
|
|
75
|
+
merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : SKIP
|
|
76
|
+
optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
|
|
77
|
+
optin_state = OptinState.from_hash(hash['optin-state']) if hash['optin-state']
|
|
78
|
+
timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
|
|
79
|
+
|
|
80
|
+
# Create object from extracted values.
|
|
81
|
+
QueryOptinResponse.new(result,
|
|
82
|
+
merchant_id,
|
|
83
|
+
optin_id,
|
|
84
|
+
optin_state,
|
|
85
|
+
timestamp)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def self.from_element(root)
|
|
89
|
+
result = XmlUtilities.from_element(root, 'result', Result)
|
|
90
|
+
merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
|
|
91
|
+
optin_id = XmlUtilities.from_element(root, 'optin-id', String)
|
|
92
|
+
optin_state = XmlUtilities.from_element(root, 'optin-state', OptinState)
|
|
93
|
+
timestamp = XmlUtilities.from_element(root, 'timestamp', String)
|
|
94
|
+
|
|
95
|
+
new(result,
|
|
96
|
+
merchant_id,
|
|
97
|
+
optin_id,
|
|
98
|
+
optin_state,
|
|
99
|
+
timestamp)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def to_xml_element(doc, root_name)
|
|
103
|
+
root = doc.create_element(root_name)
|
|
104
|
+
|
|
105
|
+
XmlUtilities.add_as_subelement(doc, root, 'result', result)
|
|
106
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
|
|
107
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
|
|
108
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-state', optin_state)
|
|
109
|
+
XmlUtilities.add_as_subelement(doc, root, 'timestamp', timestamp)
|
|
110
|
+
|
|
111
|
+
root
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Provides a human-readable string representation of the object.
|
|
115
|
+
def to_s
|
|
116
|
+
class_name = self.class.name.split('::').last
|
|
117
|
+
"<#{class_name} result: #{@result}, merchant_id: #{@merchant_id}, optin_id: #{@optin_id},"\
|
|
118
|
+
" optin_state: #{@optin_state}, timestamp: #{@timestamp}>"
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
122
|
+
def inspect
|
|
123
|
+
class_name = self.class.name.split('::').last
|
|
124
|
+
"<#{class_name} result: #{@result.inspect}, merchant_id: #{@merchant_id.inspect}, optin_id:"\
|
|
125
|
+
" #{@optin_id.inspect}, optin_state: #{@optin_state.inspect}, timestamp:"\
|
|
126
|
+
" #{@timestamp.inspect}>"
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# boku_direct_payments_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BokuDirectPaymentsApi
|
|
7
|
+
# 'query-refund' Request
|
|
8
|
+
class QueryRefundRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# ISO 3166-1 alpha-2 country code within which to search for refunds.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :country
|
|
15
|
+
|
|
16
|
+
# Boku-assigned merchant ID.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :merchant_id
|
|
19
|
+
|
|
20
|
+
# The merchant-refund-id of the original refund-charge-request.
|
|
21
|
+
# Can match multiple transactions
|
|
22
|
+
# Required if refund-id is not provided. Do not include if refund-id is
|
|
23
|
+
# provided.
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :merchant_refund_id
|
|
26
|
+
|
|
27
|
+
# The refund-id returned from the original refund-charge-response.
|
|
28
|
+
# Will match only a single transaction.
|
|
29
|
+
# Required if merchant-refund-id is not provided. Do not include if
|
|
30
|
+
# merchant-refund-id is provided.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :refund_id
|
|
33
|
+
|
|
34
|
+
# A mapping from model property names to API property names.
|
|
35
|
+
def self.names
|
|
36
|
+
@_hash = {} if @_hash.nil?
|
|
37
|
+
@_hash['country'] = 'country'
|
|
38
|
+
@_hash['merchant_id'] = 'merchant-id'
|
|
39
|
+
@_hash['merchant_refund_id'] = 'merchant-refund-id'
|
|
40
|
+
@_hash['refund_id'] = 'refund-id'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
%w[
|
|
47
|
+
merchant_refund_id
|
|
48
|
+
refund_id
|
|
49
|
+
]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# An array for nullable fields
|
|
53
|
+
def self.nullables
|
|
54
|
+
[]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def initialize(country = nil, merchant_id = nil, merchant_refund_id = SKIP,
|
|
58
|
+
refund_id = SKIP)
|
|
59
|
+
@country = country
|
|
60
|
+
@merchant_id = merchant_id
|
|
61
|
+
@merchant_refund_id = merchant_refund_id unless merchant_refund_id == SKIP
|
|
62
|
+
@refund_id = refund_id unless refund_id == SKIP
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Creates an instance of the object from a hash.
|
|
66
|
+
def self.from_hash(hash)
|
|
67
|
+
return nil unless hash
|
|
68
|
+
|
|
69
|
+
# Extract variables from the hash.
|
|
70
|
+
country = hash.key?('country') ? hash['country'] : nil
|
|
71
|
+
merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
|
|
72
|
+
merchant_refund_id =
|
|
73
|
+
hash.key?('merchant-refund-id') ? hash['merchant-refund-id'] : SKIP
|
|
74
|
+
refund_id = hash.key?('refund-id') ? hash['refund-id'] : SKIP
|
|
75
|
+
|
|
76
|
+
# Create object from extracted values.
|
|
77
|
+
QueryRefundRequest.new(country,
|
|
78
|
+
merchant_id,
|
|
79
|
+
merchant_refund_id,
|
|
80
|
+
refund_id)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def self.from_element(root)
|
|
84
|
+
country = XmlUtilities.from_element(root, 'country', String)
|
|
85
|
+
merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
|
|
86
|
+
merchant_refund_id = XmlUtilities.from_element(root, 'merchant-refund-id',
|
|
87
|
+
String)
|
|
88
|
+
refund_id = XmlUtilities.from_element(root, 'refund-id', String)
|
|
89
|
+
|
|
90
|
+
new(country,
|
|
91
|
+
merchant_id,
|
|
92
|
+
merchant_refund_id,
|
|
93
|
+
refund_id)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def to_xml_element(doc, root_name)
|
|
97
|
+
root = doc.create_element(root_name)
|
|
98
|
+
|
|
99
|
+
XmlUtilities.add_as_subelement(doc, root, 'country', country)
|
|
100
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
|
|
101
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-refund-id',
|
|
102
|
+
merchant_refund_id)
|
|
103
|
+
XmlUtilities.add_as_subelement(doc, root, 'refund-id', refund_id)
|
|
104
|
+
|
|
105
|
+
root
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Provides a human-readable string representation of the object.
|
|
109
|
+
def to_s
|
|
110
|
+
class_name = self.class.name.split('::').last
|
|
111
|
+
"<#{class_name} country: #{@country}, merchant_id: #{@merchant_id}, merchant_refund_id:"\
|
|
112
|
+
" #{@merchant_refund_id}, refund_id: #{@refund_id}>"
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
116
|
+
def inspect
|
|
117
|
+
class_name = self.class.name.split('::').last
|
|
118
|
+
"<#{class_name} country: #{@country.inspect}, merchant_id: #{@merchant_id.inspect},"\
|
|
119
|
+
" merchant_refund_id: #{@merchant_refund_id.inspect}, refund_id: #{@refund_id.inspect}>"
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# boku_direct_payments_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BokuDirectPaymentsApi
|
|
7
|
+
# QueryRefundResponse Model.
|
|
8
|
+
class QueryRefundResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The 'result' element is defined in every response type. It is used to
|
|
13
|
+
# convey the outcome of an API request.
|
|
14
|
+
# @return [Result]
|
|
15
|
+
attr_accessor :result
|
|
16
|
+
|
|
17
|
+
# The 'result' element is defined in every response type. It is used to
|
|
18
|
+
# convey the outcome of an API request.
|
|
19
|
+
# @return [Array[Refund]]
|
|
20
|
+
attr_accessor :refunds
|
|
21
|
+
|
|
22
|
+
# A mapping from model property names to API property names.
|
|
23
|
+
def self.names
|
|
24
|
+
@_hash = {} if @_hash.nil?
|
|
25
|
+
@_hash['result'] = 'result'
|
|
26
|
+
@_hash['refunds'] = 'refunds'
|
|
27
|
+
@_hash
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for optional fields
|
|
31
|
+
def self.optionals
|
|
32
|
+
%w[
|
|
33
|
+
refunds
|
|
34
|
+
]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# An array for nullable fields
|
|
38
|
+
def self.nullables
|
|
39
|
+
[]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def initialize(result = nil, refunds = SKIP)
|
|
43
|
+
@result = result
|
|
44
|
+
@refunds = refunds unless refunds == SKIP
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Creates an instance of the object from a hash.
|
|
48
|
+
def self.from_hash(hash)
|
|
49
|
+
return nil unless hash
|
|
50
|
+
|
|
51
|
+
# Extract variables from the hash.
|
|
52
|
+
result = Result.from_hash(hash['result']) if hash['result']
|
|
53
|
+
# Parameter is an array, so we need to iterate through it
|
|
54
|
+
refunds = nil
|
|
55
|
+
unless hash['refunds'].nil?
|
|
56
|
+
refunds = []
|
|
57
|
+
hash['refunds'].each do |structure|
|
|
58
|
+
refunds << (Refund.from_hash(structure) if structure)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
refunds = SKIP unless hash.key?('refunds')
|
|
63
|
+
|
|
64
|
+
# Create object from extracted values.
|
|
65
|
+
QueryRefundResponse.new(result,
|
|
66
|
+
refunds)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.from_element(root)
|
|
70
|
+
result = XmlUtilities.from_element(root, 'result', Result)
|
|
71
|
+
refunds = XmlUtilities.from_element_to_array(
|
|
72
|
+
root, 'refund', Refund, wrapping_element_name: 'refunds'
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
new(result,
|
|
76
|
+
refunds)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def to_xml_element(doc, root_name)
|
|
80
|
+
root = doc.create_element(root_name)
|
|
81
|
+
|
|
82
|
+
XmlUtilities.add_as_subelement(doc, root, 'result', result)
|
|
83
|
+
XmlUtilities.add_array_as_subelement(doc, root, 'refund', refunds,
|
|
84
|
+
wrapping_element_name: 'refunds')
|
|
85
|
+
|
|
86
|
+
root
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Provides a human-readable string representation of the object.
|
|
90
|
+
def to_s
|
|
91
|
+
class_name = self.class.name.split('::').last
|
|
92
|
+
"<#{class_name} result: #{@result}, refunds: #{@refunds}>"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
96
|
+
def inspect
|
|
97
|
+
class_name = self.class.name.split('::').last
|
|
98
|
+
"<#{class_name} result: #{@result.inspect}, refunds: #{@refunds.inspect}>"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|