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,203 @@
|
|
|
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
|
+
# 'refund-charge' Response - General Elements
|
|
8
|
+
class RefundChargeResponse < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# ID of the charge being refunded
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :charge_id
|
|
15
|
+
|
|
16
|
+
# Boku-assigned merchant ID.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :merchant_id
|
|
19
|
+
|
|
20
|
+
# Merchant-assigned request ID.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :merchant_request_id
|
|
23
|
+
|
|
24
|
+
# The 'result' element is defined in every response type. It is used to
|
|
25
|
+
# convey the outcome of an API request.
|
|
26
|
+
# @return [Result]
|
|
27
|
+
attr_accessor :result
|
|
28
|
+
|
|
29
|
+
# ISO 3166-1 alpha-2 country code.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :country
|
|
32
|
+
|
|
33
|
+
# Issuer's Network ID.
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :network_id
|
|
36
|
+
|
|
37
|
+
# Boku-assigned refund ID
|
|
38
|
+
# If null, no refund was created, e.g. because the request was rejected.
|
|
39
|
+
# @return [String]
|
|
40
|
+
attr_accessor :refund_id
|
|
41
|
+
|
|
42
|
+
# Status of the refund at the time this response was returned.
|
|
43
|
+
# If 'in-progress' is returned, the refund call should be re-issued with the
|
|
44
|
+
# same request ID until a final status is reached.
|
|
45
|
+
# If null, no refund was created, e.g. because the request was rejected.
|
|
46
|
+
# @return [RefundStatusEnum]
|
|
47
|
+
attr_accessor :refund_status
|
|
48
|
+
|
|
49
|
+
# **DISCLAIMER: This API or element is use-case specific and not needed for
|
|
50
|
+
# generic usage of our payment product. Please disregard unless otherwise
|
|
51
|
+
# directed to include in your integration.**
|
|
52
|
+
# Element containing settlement information about the original charge.
|
|
53
|
+
# @return [Settlement]
|
|
54
|
+
attr_accessor :settlement
|
|
55
|
+
|
|
56
|
+
# Time request was received ("YYYY-MM-DD hh:mm:ss").
|
|
57
|
+
# All timestamps are in UTC.
|
|
58
|
+
# @return [String]
|
|
59
|
+
attr_accessor :timestamp
|
|
60
|
+
|
|
61
|
+
# A mapping from model property names to API property names.
|
|
62
|
+
def self.names
|
|
63
|
+
@_hash = {} if @_hash.nil?
|
|
64
|
+
@_hash['charge_id'] = 'charge-id'
|
|
65
|
+
@_hash['merchant_id'] = 'merchant-id'
|
|
66
|
+
@_hash['merchant_request_id'] = 'merchant-request-id'
|
|
67
|
+
@_hash['result'] = 'result'
|
|
68
|
+
@_hash['country'] = 'country'
|
|
69
|
+
@_hash['network_id'] = 'network-id'
|
|
70
|
+
@_hash['refund_id'] = 'refund-id'
|
|
71
|
+
@_hash['refund_status'] = 'refund-status'
|
|
72
|
+
@_hash['settlement'] = 'settlement'
|
|
73
|
+
@_hash['timestamp'] = 'timestamp'
|
|
74
|
+
@_hash
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# An array for optional fields
|
|
78
|
+
def self.optionals
|
|
79
|
+
%w[
|
|
80
|
+
country
|
|
81
|
+
network_id
|
|
82
|
+
refund_id
|
|
83
|
+
refund_status
|
|
84
|
+
settlement
|
|
85
|
+
timestamp
|
|
86
|
+
]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# An array for nullable fields
|
|
90
|
+
def self.nullables
|
|
91
|
+
[]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def initialize(charge_id = nil, merchant_id = nil,
|
|
95
|
+
merchant_request_id = nil, result = nil, country = SKIP,
|
|
96
|
+
network_id = SKIP, refund_id = SKIP, refund_status = SKIP,
|
|
97
|
+
settlement = SKIP, timestamp = SKIP)
|
|
98
|
+
@charge_id = charge_id
|
|
99
|
+
@merchant_id = merchant_id
|
|
100
|
+
@merchant_request_id = merchant_request_id
|
|
101
|
+
@result = result
|
|
102
|
+
@country = country unless country == SKIP
|
|
103
|
+
@network_id = network_id unless network_id == SKIP
|
|
104
|
+
@refund_id = refund_id unless refund_id == SKIP
|
|
105
|
+
@refund_status = refund_status unless refund_status == SKIP
|
|
106
|
+
@settlement = settlement unless settlement == SKIP
|
|
107
|
+
@timestamp = timestamp unless timestamp == SKIP
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Creates an instance of the object from a hash.
|
|
111
|
+
def self.from_hash(hash)
|
|
112
|
+
return nil unless hash
|
|
113
|
+
|
|
114
|
+
# Extract variables from the hash.
|
|
115
|
+
charge_id = hash.key?('charge-id') ? hash['charge-id'] : nil
|
|
116
|
+
merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
|
|
117
|
+
merchant_request_id =
|
|
118
|
+
hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
|
|
119
|
+
result = Result.from_hash(hash['result']) if hash['result']
|
|
120
|
+
country = hash.key?('country') ? hash['country'] : SKIP
|
|
121
|
+
network_id = hash.key?('network-id') ? hash['network-id'] : SKIP
|
|
122
|
+
refund_id = hash.key?('refund-id') ? hash['refund-id'] : SKIP
|
|
123
|
+
refund_status = hash.key?('refund-status') ? hash['refund-status'] : SKIP
|
|
124
|
+
settlement = Settlement.from_hash(hash['settlement']) if hash['settlement']
|
|
125
|
+
timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
|
|
126
|
+
|
|
127
|
+
# Create object from extracted values.
|
|
128
|
+
RefundChargeResponse.new(charge_id,
|
|
129
|
+
merchant_id,
|
|
130
|
+
merchant_request_id,
|
|
131
|
+
result,
|
|
132
|
+
country,
|
|
133
|
+
network_id,
|
|
134
|
+
refund_id,
|
|
135
|
+
refund_status,
|
|
136
|
+
settlement,
|
|
137
|
+
timestamp)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def self.from_element(root)
|
|
141
|
+
charge_id = XmlUtilities.from_element(root, 'charge-id', String)
|
|
142
|
+
merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
|
|
143
|
+
merchant_request_id = XmlUtilities.from_element(root,
|
|
144
|
+
'merchant-request-id',
|
|
145
|
+
String)
|
|
146
|
+
result = XmlUtilities.from_element(root, 'result', Result)
|
|
147
|
+
country = XmlUtilities.from_element(root, 'country', String)
|
|
148
|
+
network_id = XmlUtilities.from_element(root, 'network-id', String)
|
|
149
|
+
refund_id = XmlUtilities.from_element(root, 'refund-id', String)
|
|
150
|
+
refund_status = XmlUtilities.from_element(root, 'refund-status', String)
|
|
151
|
+
settlement = XmlUtilities.from_element(root, 'Settlement', Settlement)
|
|
152
|
+
timestamp = XmlUtilities.from_element(root, 'timestamp', String)
|
|
153
|
+
|
|
154
|
+
new(charge_id,
|
|
155
|
+
merchant_id,
|
|
156
|
+
merchant_request_id,
|
|
157
|
+
result,
|
|
158
|
+
country,
|
|
159
|
+
network_id,
|
|
160
|
+
refund_id,
|
|
161
|
+
refund_status,
|
|
162
|
+
settlement,
|
|
163
|
+
timestamp)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def to_xml_element(doc, root_name)
|
|
167
|
+
root = doc.create_element(root_name)
|
|
168
|
+
|
|
169
|
+
XmlUtilities.add_as_subelement(doc, root, 'charge-id', charge_id)
|
|
170
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
|
|
171
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
|
|
172
|
+
merchant_request_id)
|
|
173
|
+
XmlUtilities.add_as_subelement(doc, root, 'result', result)
|
|
174
|
+
XmlUtilities.add_as_subelement(doc, root, 'country', country)
|
|
175
|
+
XmlUtilities.add_as_subelement(doc, root, 'network-id', network_id)
|
|
176
|
+
XmlUtilities.add_as_subelement(doc, root, 'refund-id', refund_id)
|
|
177
|
+
XmlUtilities.add_as_subelement(doc, root, 'refund-status', refund_status)
|
|
178
|
+
XmlUtilities.add_as_subelement(doc, root, 'Settlement', settlement)
|
|
179
|
+
XmlUtilities.add_as_subelement(doc, root, 'timestamp', timestamp)
|
|
180
|
+
|
|
181
|
+
root
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Provides a human-readable string representation of the object.
|
|
185
|
+
def to_s
|
|
186
|
+
class_name = self.class.name.split('::').last
|
|
187
|
+
"<#{class_name} charge_id: #{@charge_id}, merchant_id: #{@merchant_id},"\
|
|
188
|
+
" merchant_request_id: #{@merchant_request_id}, result: #{@result}, country: #{@country},"\
|
|
189
|
+
" network_id: #{@network_id}, refund_id: #{@refund_id}, refund_status: #{@refund_status},"\
|
|
190
|
+
" settlement: #{@settlement}, timestamp: #{@timestamp}>"
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
194
|
+
def inspect
|
|
195
|
+
class_name = self.class.name.split('::').last
|
|
196
|
+
"<#{class_name} charge_id: #{@charge_id.inspect}, merchant_id: #{@merchant_id.inspect},"\
|
|
197
|
+
" merchant_request_id: #{@merchant_request_id.inspect}, result: #{@result.inspect}, country:"\
|
|
198
|
+
" #{@country.inspect}, network_id: #{@network_id.inspect}, refund_id: #{@refund_id.inspect},"\
|
|
199
|
+
" refund_status: #{@refund_status.inspect}, settlement: #{@settlement.inspect}, timestamp:"\
|
|
200
|
+
" #{@timestamp.inspect}>"
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
# Status of the refund at the time this response was returned. If
|
|
8
|
+
# 'in-progress' is returned, the refund call should be re-issued with the same
|
|
9
|
+
# request ID until a final status is reached. If null, no refund was created,
|
|
10
|
+
# e.g. because the request was rejected.
|
|
11
|
+
class RefundStatusEnum
|
|
12
|
+
REFUND_STATUS_ENUM = [
|
|
13
|
+
# TODO: Write general description for SUCCESS
|
|
14
|
+
SUCCESS = 'success'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for FAILED
|
|
17
|
+
FAILED = 'failed'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for INPROGRESS
|
|
20
|
+
INPROGRESS = 'in-progress'.freeze
|
|
21
|
+
].freeze
|
|
22
|
+
|
|
23
|
+
def self.validate(value)
|
|
24
|
+
return false if value.nil?
|
|
25
|
+
|
|
26
|
+
REFUND_STATUS_ENUM.include?(value)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = SUCCESS)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'success' then SUCCESS
|
|
36
|
+
when 'failed' then FAILED
|
|
37
|
+
when 'inprogress' then INPROGRESS
|
|
38
|
+
else
|
|
39
|
+
default_value
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
# Indicates whether refund is a regular refund or chargeback
|
|
8
|
+
class RefundTypeEnum
|
|
9
|
+
REFUND_TYPE_ENUM = [
|
|
10
|
+
# TODO: Write general description for REFUND
|
|
11
|
+
REFUND = 'refund'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CHARGEBACK
|
|
14
|
+
CHARGEBACK = 'chargeback'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
REFUND_TYPE_ENUM.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = REFUND)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'refund' then REFUND
|
|
30
|
+
when 'chargeback' then CHARGEBACK
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
# RegisterPaymentMethodRequest Model.
|
|
8
|
+
class RegisterPaymentMethodRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# ISO 3166-1 alpha-2 country code where the payment method should be
|
|
13
|
+
# registered
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :country
|
|
16
|
+
|
|
17
|
+
# Boku-assigned merchant ID.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :merchant_id
|
|
20
|
+
|
|
21
|
+
# Merchant-assigned unique request ID.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :merchant_request_id
|
|
24
|
+
|
|
25
|
+
# Optin and Charge Request API can be made for specific Seller of Record
|
|
26
|
+
# previously registered with Boku.
|
|
27
|
+
# @return [SellerOfRecord]
|
|
28
|
+
attr_accessor :seller_of_record
|
|
29
|
+
|
|
30
|
+
# Issuer's network ID.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :network_id
|
|
33
|
+
|
|
34
|
+
# The payment method to be registered. Each Local Payment Method provider
|
|
35
|
+
# will be its own payment method. A list of available values will be
|
|
36
|
+
# provided on demand.
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :payment_method
|
|
39
|
+
|
|
40
|
+
# A mapping from model property names to API property names.
|
|
41
|
+
def self.names
|
|
42
|
+
@_hash = {} if @_hash.nil?
|
|
43
|
+
@_hash['country'] = 'country'
|
|
44
|
+
@_hash['merchant_id'] = 'merchant-id'
|
|
45
|
+
@_hash['merchant_request_id'] = 'merchant-request-id'
|
|
46
|
+
@_hash['seller_of_record'] = 'seller-of-record'
|
|
47
|
+
@_hash['network_id'] = 'network-id'
|
|
48
|
+
@_hash['payment_method'] = 'payment-method'
|
|
49
|
+
@_hash
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# An array for optional fields
|
|
53
|
+
def self.optionals
|
|
54
|
+
%w[
|
|
55
|
+
network_id
|
|
56
|
+
payment_method
|
|
57
|
+
]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# An array for nullable fields
|
|
61
|
+
def self.nullables
|
|
62
|
+
[]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def initialize(country = nil, merchant_id = nil, merchant_request_id = nil,
|
|
66
|
+
seller_of_record = nil, network_id = SKIP,
|
|
67
|
+
payment_method = SKIP)
|
|
68
|
+
@country = country
|
|
69
|
+
@merchant_id = merchant_id
|
|
70
|
+
@merchant_request_id = merchant_request_id
|
|
71
|
+
@seller_of_record = seller_of_record
|
|
72
|
+
@network_id = network_id unless network_id == SKIP
|
|
73
|
+
@payment_method = payment_method unless payment_method == SKIP
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Creates an instance of the object from a hash.
|
|
77
|
+
def self.from_hash(hash)
|
|
78
|
+
return nil unless hash
|
|
79
|
+
|
|
80
|
+
# Extract variables from the hash.
|
|
81
|
+
country = hash.key?('country') ? hash['country'] : nil
|
|
82
|
+
merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
|
|
83
|
+
merchant_request_id =
|
|
84
|
+
hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
|
|
85
|
+
seller_of_record = SellerOfRecord.from_hash(hash['seller-of-record']) if
|
|
86
|
+
hash['seller-of-record']
|
|
87
|
+
network_id = hash.key?('network-id') ? hash['network-id'] : SKIP
|
|
88
|
+
payment_method =
|
|
89
|
+
hash.key?('payment-method') ? hash['payment-method'] : SKIP
|
|
90
|
+
|
|
91
|
+
# Create object from extracted values.
|
|
92
|
+
RegisterPaymentMethodRequest.new(country,
|
|
93
|
+
merchant_id,
|
|
94
|
+
merchant_request_id,
|
|
95
|
+
seller_of_record,
|
|
96
|
+
network_id,
|
|
97
|
+
payment_method)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def self.from_element(root)
|
|
101
|
+
country = XmlUtilities.from_element(root, 'country', String)
|
|
102
|
+
merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
|
|
103
|
+
merchant_request_id = XmlUtilities.from_element(root,
|
|
104
|
+
'merchant-request-id',
|
|
105
|
+
String)
|
|
106
|
+
seller_of_record = XmlUtilities.from_element(root, 'seller-of-record',
|
|
107
|
+
SellerOfRecord)
|
|
108
|
+
network_id = XmlUtilities.from_element(root, 'network-id', String)
|
|
109
|
+
payment_method = XmlUtilities.from_element(root, 'payment-method', String)
|
|
110
|
+
|
|
111
|
+
new(country,
|
|
112
|
+
merchant_id,
|
|
113
|
+
merchant_request_id,
|
|
114
|
+
seller_of_record,
|
|
115
|
+
network_id,
|
|
116
|
+
payment_method)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def to_xml_element(doc, root_name)
|
|
120
|
+
root = doc.create_element(root_name)
|
|
121
|
+
|
|
122
|
+
XmlUtilities.add_as_subelement(doc, root, 'country', country)
|
|
123
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
|
|
124
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
|
|
125
|
+
merchant_request_id)
|
|
126
|
+
XmlUtilities.add_as_subelement(doc, root, 'seller-of-record',
|
|
127
|
+
seller_of_record)
|
|
128
|
+
XmlUtilities.add_as_subelement(doc, root, 'network-id', network_id)
|
|
129
|
+
XmlUtilities.add_as_subelement(doc, root, 'payment-method',
|
|
130
|
+
payment_method)
|
|
131
|
+
|
|
132
|
+
root
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Provides a human-readable string representation of the object.
|
|
136
|
+
def to_s
|
|
137
|
+
class_name = self.class.name.split('::').last
|
|
138
|
+
"<#{class_name} country: #{@country}, merchant_id: #{@merchant_id}, merchant_request_id:"\
|
|
139
|
+
" #{@merchant_request_id}, seller_of_record: #{@seller_of_record}, network_id:"\
|
|
140
|
+
" #{@network_id}, payment_method: #{@payment_method}>"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
144
|
+
def inspect
|
|
145
|
+
class_name = self.class.name.split('::').last
|
|
146
|
+
"<#{class_name} country: #{@country.inspect}, merchant_id: #{@merchant_id.inspect},"\
|
|
147
|
+
" merchant_request_id: #{@merchant_request_id.inspect}, seller_of_record:"\
|
|
148
|
+
" #{@seller_of_record.inspect}, network_id: #{@network_id.inspect}, payment_method:"\
|
|
149
|
+
" #{@payment_method.inspect}>"
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
@@ -0,0 +1,172 @@
|
|
|
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
|
+
# RegisterPaymentMethodResponse Model.
|
|
8
|
+
class RegisterPaymentMethodResponse < 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
|
+
# ISO 3166-1 alpha-2 country code.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :country
|
|
20
|
+
|
|
21
|
+
# Boku-assigned merchant ID.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :merchant_id
|
|
24
|
+
|
|
25
|
+
# Merchant-assigned unique request ID.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :merchant_request_id
|
|
28
|
+
|
|
29
|
+
# The payment method to be registered. Each Local Payment Method provider
|
|
30
|
+
# will be its own payment method. A list of available values will be
|
|
31
|
+
# provided on demand.
|
|
32
|
+
# @return [String]
|
|
33
|
+
attr_accessor :payment_method
|
|
34
|
+
|
|
35
|
+
# The status of Payment Method
|
|
36
|
+
# @return [PaymentMethodStatusEnum]
|
|
37
|
+
attr_accessor :payment_method_status
|
|
38
|
+
|
|
39
|
+
# Boku-generated ID associated with seller of record.
|
|
40
|
+
# @return [String]
|
|
41
|
+
attr_accessor :seller_of_record_id
|
|
42
|
+
|
|
43
|
+
# A mapping from model property names to API property names.
|
|
44
|
+
def self.names
|
|
45
|
+
@_hash = {} if @_hash.nil?
|
|
46
|
+
@_hash['result'] = 'result'
|
|
47
|
+
@_hash['country'] = 'country'
|
|
48
|
+
@_hash['merchant_id'] = 'merchant-id'
|
|
49
|
+
@_hash['merchant_request_id'] = 'merchant-request-id'
|
|
50
|
+
@_hash['payment_method'] = 'payment-method'
|
|
51
|
+
@_hash['payment_method_status'] = 'payment-method-status'
|
|
52
|
+
@_hash['seller_of_record_id'] = 'seller-of-record-id'
|
|
53
|
+
@_hash
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# An array for optional fields
|
|
57
|
+
def self.optionals
|
|
58
|
+
%w[
|
|
59
|
+
country
|
|
60
|
+
merchant_id
|
|
61
|
+
merchant_request_id
|
|
62
|
+
payment_method
|
|
63
|
+
payment_method_status
|
|
64
|
+
seller_of_record_id
|
|
65
|
+
]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# An array for nullable fields
|
|
69
|
+
def self.nullables
|
|
70
|
+
[]
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def initialize(result = nil, country = SKIP, merchant_id = SKIP,
|
|
74
|
+
merchant_request_id = SKIP, payment_method = SKIP,
|
|
75
|
+
payment_method_status = SKIP, seller_of_record_id = SKIP)
|
|
76
|
+
@result = result
|
|
77
|
+
@country = country unless country == SKIP
|
|
78
|
+
@merchant_id = merchant_id unless merchant_id == SKIP
|
|
79
|
+
@merchant_request_id = merchant_request_id unless merchant_request_id == SKIP
|
|
80
|
+
@payment_method = payment_method unless payment_method == SKIP
|
|
81
|
+
@payment_method_status = payment_method_status unless payment_method_status == SKIP
|
|
82
|
+
@seller_of_record_id = seller_of_record_id unless seller_of_record_id == SKIP
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Creates an instance of the object from a hash.
|
|
86
|
+
def self.from_hash(hash)
|
|
87
|
+
return nil unless hash
|
|
88
|
+
|
|
89
|
+
# Extract variables from the hash.
|
|
90
|
+
result = Result.from_hash(hash['result']) if hash['result']
|
|
91
|
+
country = hash.key?('country') ? hash['country'] : SKIP
|
|
92
|
+
merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : SKIP
|
|
93
|
+
merchant_request_id =
|
|
94
|
+
hash.key?('merchant-request-id') ? hash['merchant-request-id'] : SKIP
|
|
95
|
+
payment_method =
|
|
96
|
+
hash.key?('payment-method') ? hash['payment-method'] : SKIP
|
|
97
|
+
payment_method_status =
|
|
98
|
+
hash.key?('payment-method-status') ? hash['payment-method-status'] : SKIP
|
|
99
|
+
seller_of_record_id =
|
|
100
|
+
hash.key?('seller-of-record-id') ? hash['seller-of-record-id'] : SKIP
|
|
101
|
+
|
|
102
|
+
# Create object from extracted values.
|
|
103
|
+
RegisterPaymentMethodResponse.new(result,
|
|
104
|
+
country,
|
|
105
|
+
merchant_id,
|
|
106
|
+
merchant_request_id,
|
|
107
|
+
payment_method,
|
|
108
|
+
payment_method_status,
|
|
109
|
+
seller_of_record_id)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def self.from_element(root)
|
|
113
|
+
result = XmlUtilities.from_element(root, 'result', Result)
|
|
114
|
+
country = XmlUtilities.from_element(root, 'country', String)
|
|
115
|
+
merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
|
|
116
|
+
merchant_request_id = XmlUtilities.from_element(root,
|
|
117
|
+
'merchant-request-id',
|
|
118
|
+
String)
|
|
119
|
+
payment_method = XmlUtilities.from_element(root, 'payment-method', String)
|
|
120
|
+
payment_method_status = XmlUtilities.from_element(root,
|
|
121
|
+
'payment-method-status',
|
|
122
|
+
String)
|
|
123
|
+
seller_of_record_id = XmlUtilities.from_element(root,
|
|
124
|
+
'seller-of-record-id',
|
|
125
|
+
String)
|
|
126
|
+
|
|
127
|
+
new(result,
|
|
128
|
+
country,
|
|
129
|
+
merchant_id,
|
|
130
|
+
merchant_request_id,
|
|
131
|
+
payment_method,
|
|
132
|
+
payment_method_status,
|
|
133
|
+
seller_of_record_id)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def to_xml_element(doc, root_name)
|
|
137
|
+
root = doc.create_element(root_name)
|
|
138
|
+
|
|
139
|
+
XmlUtilities.add_as_subelement(doc, root, 'result', result)
|
|
140
|
+
XmlUtilities.add_as_subelement(doc, root, 'country', country)
|
|
141
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
|
|
142
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
|
|
143
|
+
merchant_request_id)
|
|
144
|
+
XmlUtilities.add_as_subelement(doc, root, 'payment-method',
|
|
145
|
+
payment_method)
|
|
146
|
+
XmlUtilities.add_as_subelement(doc, root, 'payment-method-status',
|
|
147
|
+
payment_method_status)
|
|
148
|
+
XmlUtilities.add_as_subelement(doc, root, 'seller-of-record-id',
|
|
149
|
+
seller_of_record_id)
|
|
150
|
+
|
|
151
|
+
root
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Provides a human-readable string representation of the object.
|
|
155
|
+
def to_s
|
|
156
|
+
class_name = self.class.name.split('::').last
|
|
157
|
+
"<#{class_name} result: #{@result}, country: #{@country}, merchant_id: #{@merchant_id},"\
|
|
158
|
+
" merchant_request_id: #{@merchant_request_id}, payment_method: #{@payment_method},"\
|
|
159
|
+
" payment_method_status: #{@payment_method_status}, seller_of_record_id:"\
|
|
160
|
+
" #{@seller_of_record_id}>"
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
164
|
+
def inspect
|
|
165
|
+
class_name = self.class.name.split('::').last
|
|
166
|
+
"<#{class_name} result: #{@result.inspect}, country: #{@country.inspect}, merchant_id:"\
|
|
167
|
+
" #{@merchant_id.inspect}, merchant_request_id: #{@merchant_request_id.inspect},"\
|
|
168
|
+
" payment_method: #{@payment_method.inspect}, payment_method_status:"\
|
|
169
|
+
" #{@payment_method_status.inspect}, seller_of_record_id: #{@seller_of_record_id.inspect}>"
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|