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,220 @@
|
|
|
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
|
+
# 'optin' Response - General Parameters
|
|
8
|
+
class OptinResponse < 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 request ID.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :merchant_request_id
|
|
19
|
+
|
|
20
|
+
# The 'result' element is defined in every response type. It is used to
|
|
21
|
+
# convey the outcome of an API request.
|
|
22
|
+
# @return [Result]
|
|
23
|
+
attr_accessor :result
|
|
24
|
+
|
|
25
|
+
# Provides information for proceeding with a hosted opt-in.
|
|
26
|
+
# @return [OptinResponseHosted]
|
|
27
|
+
attr_accessor :hosted
|
|
28
|
+
|
|
29
|
+
# Merchant-assigned unique opt-in ID.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :merchant_optin_id
|
|
32
|
+
|
|
33
|
+
# Boku-assigned unique opt-in ID.
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :optin_id
|
|
36
|
+
|
|
37
|
+
# Gives the state of the opt-in at the time this response was returned
|
|
38
|
+
# @return [OptinState]
|
|
39
|
+
attr_accessor :optin_state
|
|
40
|
+
|
|
41
|
+
# Specifies which method to use to perform the opt-in.
|
|
42
|
+
# @return [OptinTypeEnum]
|
|
43
|
+
attr_accessor :optin_type
|
|
44
|
+
|
|
45
|
+
# The payment method selected.
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_accessor :payment_method
|
|
48
|
+
|
|
49
|
+
# Optin and Charge Request API can be made for specific Seller of Record
|
|
50
|
+
# previously registered with Boku.
|
|
51
|
+
# @return [SellerOfRecord]
|
|
52
|
+
attr_accessor :seller_of_record
|
|
53
|
+
|
|
54
|
+
# Time request was received ("YYYY-MM-DD hh:mm:ss").
|
|
55
|
+
# All timestamps are in UTC.
|
|
56
|
+
# @return [String]
|
|
57
|
+
attr_accessor :timestamp
|
|
58
|
+
|
|
59
|
+
# A mapping from model property names to API property names.
|
|
60
|
+
def self.names
|
|
61
|
+
@_hash = {} if @_hash.nil?
|
|
62
|
+
@_hash['merchant_id'] = 'merchant-id'
|
|
63
|
+
@_hash['merchant_request_id'] = 'merchant-request-id'
|
|
64
|
+
@_hash['result'] = 'result'
|
|
65
|
+
@_hash['hosted'] = 'hosted'
|
|
66
|
+
@_hash['merchant_optin_id'] = 'merchant-optin-id'
|
|
67
|
+
@_hash['optin_id'] = 'optin-id'
|
|
68
|
+
@_hash['optin_state'] = 'optin-state'
|
|
69
|
+
@_hash['optin_type'] = 'optin-type'
|
|
70
|
+
@_hash['payment_method'] = 'payment-method'
|
|
71
|
+
@_hash['seller_of_record'] = 'seller-of-record'
|
|
72
|
+
@_hash['timestamp'] = 'timestamp'
|
|
73
|
+
@_hash
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# An array for optional fields
|
|
77
|
+
def self.optionals
|
|
78
|
+
%w[
|
|
79
|
+
hosted
|
|
80
|
+
merchant_optin_id
|
|
81
|
+
optin_id
|
|
82
|
+
optin_state
|
|
83
|
+
optin_type
|
|
84
|
+
payment_method
|
|
85
|
+
seller_of_record
|
|
86
|
+
timestamp
|
|
87
|
+
]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# An array for nullable fields
|
|
91
|
+
def self.nullables
|
|
92
|
+
[]
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def initialize(merchant_id = nil, merchant_request_id = nil, result = nil,
|
|
96
|
+
hosted = SKIP, merchant_optin_id = SKIP, optin_id = SKIP,
|
|
97
|
+
optin_state = SKIP, optin_type = SKIP, payment_method = SKIP,
|
|
98
|
+
seller_of_record = SKIP, timestamp = SKIP)
|
|
99
|
+
@merchant_id = merchant_id
|
|
100
|
+
@merchant_request_id = merchant_request_id
|
|
101
|
+
@result = result
|
|
102
|
+
@hosted = hosted unless hosted == SKIP
|
|
103
|
+
@merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
|
|
104
|
+
@optin_id = optin_id unless optin_id == SKIP
|
|
105
|
+
@optin_state = optin_state unless optin_state == SKIP
|
|
106
|
+
@optin_type = optin_type unless optin_type == SKIP
|
|
107
|
+
@payment_method = payment_method unless payment_method == SKIP
|
|
108
|
+
@seller_of_record = seller_of_record unless seller_of_record == SKIP
|
|
109
|
+
@timestamp = timestamp unless timestamp == SKIP
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Creates an instance of the object from a hash.
|
|
113
|
+
def self.from_hash(hash)
|
|
114
|
+
return nil unless hash
|
|
115
|
+
|
|
116
|
+
# Extract variables from the hash.
|
|
117
|
+
merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
|
|
118
|
+
merchant_request_id =
|
|
119
|
+
hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
|
|
120
|
+
result = Result.from_hash(hash['result']) if hash['result']
|
|
121
|
+
hosted = OptinResponseHosted.from_hash(hash['hosted']) if hash['hosted']
|
|
122
|
+
merchant_optin_id =
|
|
123
|
+
hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
|
|
124
|
+
optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
|
|
125
|
+
optin_state = OptinState.from_hash(hash['optin-state']) if hash['optin-state']
|
|
126
|
+
optin_type = hash.key?('optin-type') ? hash['optin-type'] : SKIP
|
|
127
|
+
payment_method =
|
|
128
|
+
hash.key?('payment-method') ? hash['payment-method'] : SKIP
|
|
129
|
+
seller_of_record = SellerOfRecord.from_hash(hash['seller-of-record']) if
|
|
130
|
+
hash['seller-of-record']
|
|
131
|
+
timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
|
|
132
|
+
|
|
133
|
+
# Create object from extracted values.
|
|
134
|
+
OptinResponse.new(merchant_id,
|
|
135
|
+
merchant_request_id,
|
|
136
|
+
result,
|
|
137
|
+
hosted,
|
|
138
|
+
merchant_optin_id,
|
|
139
|
+
optin_id,
|
|
140
|
+
optin_state,
|
|
141
|
+
optin_type,
|
|
142
|
+
payment_method,
|
|
143
|
+
seller_of_record,
|
|
144
|
+
timestamp)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def self.from_element(root)
|
|
148
|
+
merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
|
|
149
|
+
merchant_request_id = XmlUtilities.from_element(root,
|
|
150
|
+
'merchant-request-id',
|
|
151
|
+
String)
|
|
152
|
+
result = XmlUtilities.from_element(root, 'result', Result)
|
|
153
|
+
hosted = XmlUtilities.from_element(root, 'hosted', OptinResponseHosted)
|
|
154
|
+
merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
|
|
155
|
+
String)
|
|
156
|
+
optin_id = XmlUtilities.from_element(root, 'optin-id', String)
|
|
157
|
+
optin_state = XmlUtilities.from_element(root, 'optin-state', OptinState)
|
|
158
|
+
optin_type = XmlUtilities.from_element(root, 'optin-type', String)
|
|
159
|
+
payment_method = XmlUtilities.from_element(root, 'payment-method', String)
|
|
160
|
+
seller_of_record = XmlUtilities.from_element(root, 'seller-of-record',
|
|
161
|
+
SellerOfRecord)
|
|
162
|
+
timestamp = XmlUtilities.from_element(root, 'timestamp', String)
|
|
163
|
+
|
|
164
|
+
new(merchant_id,
|
|
165
|
+
merchant_request_id,
|
|
166
|
+
result,
|
|
167
|
+
hosted,
|
|
168
|
+
merchant_optin_id,
|
|
169
|
+
optin_id,
|
|
170
|
+
optin_state,
|
|
171
|
+
optin_type,
|
|
172
|
+
payment_method,
|
|
173
|
+
seller_of_record,
|
|
174
|
+
timestamp)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def to_xml_element(doc, root_name)
|
|
178
|
+
root = doc.create_element(root_name)
|
|
179
|
+
|
|
180
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
|
|
181
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
|
|
182
|
+
merchant_request_id)
|
|
183
|
+
XmlUtilities.add_as_subelement(doc, root, 'result', result)
|
|
184
|
+
XmlUtilities.add_as_subelement(doc, root, 'hosted', hosted)
|
|
185
|
+
XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
|
|
186
|
+
merchant_optin_id)
|
|
187
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
|
|
188
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-state', optin_state)
|
|
189
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-type', optin_type)
|
|
190
|
+
XmlUtilities.add_as_subelement(doc, root, 'payment-method',
|
|
191
|
+
payment_method)
|
|
192
|
+
XmlUtilities.add_as_subelement(doc, root, 'seller-of-record',
|
|
193
|
+
seller_of_record)
|
|
194
|
+
XmlUtilities.add_as_subelement(doc, root, 'timestamp', timestamp)
|
|
195
|
+
|
|
196
|
+
root
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Provides a human-readable string representation of the object.
|
|
200
|
+
def to_s
|
|
201
|
+
class_name = self.class.name.split('::').last
|
|
202
|
+
"<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
|
|
203
|
+
" result: #{@result}, hosted: #{@hosted}, merchant_optin_id: #{@merchant_optin_id},"\
|
|
204
|
+
" optin_id: #{@optin_id}, optin_state: #{@optin_state}, optin_type: #{@optin_type},"\
|
|
205
|
+
" payment_method: #{@payment_method}, seller_of_record: #{@seller_of_record}, timestamp:"\
|
|
206
|
+
" #{@timestamp}>"
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
210
|
+
def inspect
|
|
211
|
+
class_name = self.class.name.split('::').last
|
|
212
|
+
"<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
|
|
213
|
+
" #{@merchant_request_id.inspect}, result: #{@result.inspect}, hosted: #{@hosted.inspect},"\
|
|
214
|
+
" merchant_optin_id: #{@merchant_optin_id.inspect}, optin_id: #{@optin_id.inspect},"\
|
|
215
|
+
" optin_state: #{@optin_state.inspect}, optin_type: #{@optin_type.inspect}, payment_method:"\
|
|
216
|
+
" #{@payment_method.inspect}, seller_of_record: #{@seller_of_record.inspect}, timestamp:"\
|
|
217
|
+
" #{@timestamp.inspect}>"
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
# Provides information for proceeding with a hosted opt-in.
|
|
8
|
+
class OptinResponseHosted < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Boku-provided URL for the opt-in UI presented to the consumer.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :optin_url
|
|
15
|
+
|
|
16
|
+
# Boku-provided URL for the opt-in UI presented to the consumer.
|
|
17
|
+
# @return [OptinResponseQrInfo]
|
|
18
|
+
attr_accessor :qr_info
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['optin_url'] = 'optin-url'
|
|
24
|
+
@_hash['qr_info'] = 'qr-info'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
qr_info
|
|
32
|
+
]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# An array for nullable fields
|
|
36
|
+
def self.nullables
|
|
37
|
+
[]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def initialize(optin_url = nil, qr_info = SKIP)
|
|
41
|
+
@optin_url = optin_url
|
|
42
|
+
@qr_info = qr_info unless qr_info == SKIP
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Creates an instance of the object from a hash.
|
|
46
|
+
def self.from_hash(hash)
|
|
47
|
+
return nil unless hash
|
|
48
|
+
|
|
49
|
+
# Extract variables from the hash.
|
|
50
|
+
optin_url = hash.key?('optin-url') ? hash['optin-url'] : nil
|
|
51
|
+
qr_info = OptinResponseQrInfo.from_hash(hash['qr-info']) if hash['qr-info']
|
|
52
|
+
|
|
53
|
+
# Create object from extracted values.
|
|
54
|
+
OptinResponseHosted.new(optin_url,
|
|
55
|
+
qr_info)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.from_element(root)
|
|
59
|
+
optin_url = XmlUtilities.from_element(root, 'optin-url', String)
|
|
60
|
+
qr_info = XmlUtilities.from_element(root, 'qr-info', OptinResponseQrInfo)
|
|
61
|
+
|
|
62
|
+
new(optin_url,
|
|
63
|
+
qr_info)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def to_xml_element(doc, root_name)
|
|
67
|
+
root = doc.create_element(root_name)
|
|
68
|
+
|
|
69
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-url', optin_url)
|
|
70
|
+
XmlUtilities.add_as_subelement(doc, root, 'qr-info', qr_info)
|
|
71
|
+
|
|
72
|
+
root
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Provides a human-readable string representation of the object.
|
|
76
|
+
def to_s
|
|
77
|
+
class_name = self.class.name.split('::').last
|
|
78
|
+
"<#{class_name} optin_url: #{@optin_url}, qr_info: #{@qr_info}>"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
82
|
+
def inspect
|
|
83
|
+
class_name = self.class.name.split('::').last
|
|
84
|
+
"<#{class_name} optin_url: #{@optin_url.inspect}, qr_info: #{@qr_info.inspect}>"
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
# OptinResponseQrInfo Model.
|
|
8
|
+
class OptinResponseQrInfo < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :source
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [TypeEnum]
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['source'] = 'source'
|
|
24
|
+
@_hash['type'] = 'type'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(source = nil, type = nil)
|
|
39
|
+
@source = source
|
|
40
|
+
@type = type
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
source = hash.key?('source') ? hash['source'] : nil
|
|
49
|
+
type = hash.key?('type') ? hash['type'] : nil
|
|
50
|
+
|
|
51
|
+
# Create object from extracted values.
|
|
52
|
+
OptinResponseQrInfo.new(source,
|
|
53
|
+
type)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def self.from_element(root)
|
|
57
|
+
source = XmlUtilities.from_element(root, 'source', String)
|
|
58
|
+
type = XmlUtilities.from_element(root, 'type', String)
|
|
59
|
+
|
|
60
|
+
new(source,
|
|
61
|
+
type)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def to_xml_element(doc, root_name)
|
|
65
|
+
root = doc.create_element(root_name)
|
|
66
|
+
|
|
67
|
+
XmlUtilities.add_as_subelement(doc, root, 'source', source)
|
|
68
|
+
XmlUtilities.add_as_subelement(doc, root, 'type', type)
|
|
69
|
+
|
|
70
|
+
root
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Provides a human-readable string representation of the object.
|
|
74
|
+
def to_s
|
|
75
|
+
class_name = self.class.name.split('::').last
|
|
76
|
+
"<#{class_name} source: #{@source}, type: #{@type}>"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
80
|
+
def inspect
|
|
81
|
+
class_name = self.class.name.split('::').last
|
|
82
|
+
"<#{class_name} source: #{@source.inspect}, type: #{@type.inspect}>"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
# Gives the state of the opt-in at the time this response was returned
|
|
8
|
+
class OptinState < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# ISO 3166-1 alpha-2 country code.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :country
|
|
15
|
+
|
|
16
|
+
# Gives the status of the opt-in at the time this response was returned
|
|
17
|
+
# @return [OptinStatusEnum]
|
|
18
|
+
attr_accessor :optin_status
|
|
19
|
+
|
|
20
|
+
# Free-text consumer account identifier provided by the payment provider.
|
|
21
|
+
# This value will be recognizable to the user and might not be unique.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :account_identifier
|
|
24
|
+
|
|
25
|
+
# Unique user ID provided by the payment provider. This value could be an ID
|
|
26
|
+
# that is not recognizable to the user.
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :issuer_unique_user_id
|
|
29
|
+
|
|
30
|
+
# Consumer's mobile phone number.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :msisdn
|
|
33
|
+
|
|
34
|
+
# Trailing digits of the consumer's mobile phone number. Useful if carrier
|
|
35
|
+
# does not allow storage of full MSISDN
|
|
36
|
+
# @return [String]
|
|
37
|
+
attr_accessor :msisdn_tail
|
|
38
|
+
|
|
39
|
+
# The internal network ID of the user, as declared in `network-info` ->
|
|
40
|
+
# `network[id]`
|
|
41
|
+
# @return [String]
|
|
42
|
+
attr_accessor :network_id
|
|
43
|
+
|
|
44
|
+
# A mapping from model property names to API property names.
|
|
45
|
+
def self.names
|
|
46
|
+
@_hash = {} if @_hash.nil?
|
|
47
|
+
@_hash['country'] = 'country'
|
|
48
|
+
@_hash['optin_status'] = 'optin-status'
|
|
49
|
+
@_hash['account_identifier'] = 'account-identifier'
|
|
50
|
+
@_hash['issuer_unique_user_id'] = 'issuer-unique-user-id'
|
|
51
|
+
@_hash['msisdn'] = 'msisdn'
|
|
52
|
+
@_hash['msisdn_tail'] = 'msisdn-tail'
|
|
53
|
+
@_hash['network_id'] = 'network-id'
|
|
54
|
+
@_hash
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# An array for optional fields
|
|
58
|
+
def self.optionals
|
|
59
|
+
%w[
|
|
60
|
+
account_identifier
|
|
61
|
+
issuer_unique_user_id
|
|
62
|
+
msisdn
|
|
63
|
+
msisdn_tail
|
|
64
|
+
network_id
|
|
65
|
+
]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# An array for nullable fields
|
|
69
|
+
def self.nullables
|
|
70
|
+
[]
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def initialize(country = nil, optin_status = nil, account_identifier = SKIP,
|
|
74
|
+
issuer_unique_user_id = SKIP, msisdn = SKIP,
|
|
75
|
+
msisdn_tail = SKIP, network_id = SKIP)
|
|
76
|
+
@country = country
|
|
77
|
+
@optin_status = optin_status
|
|
78
|
+
@account_identifier = account_identifier unless account_identifier == SKIP
|
|
79
|
+
@issuer_unique_user_id = issuer_unique_user_id unless issuer_unique_user_id == SKIP
|
|
80
|
+
@msisdn = msisdn unless msisdn == SKIP
|
|
81
|
+
@msisdn_tail = msisdn_tail unless msisdn_tail == SKIP
|
|
82
|
+
@network_id = network_id unless network_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
|
+
country = hash.key?('country') ? hash['country'] : nil
|
|
91
|
+
optin_status = hash.key?('optin-status') ? hash['optin-status'] : nil
|
|
92
|
+
account_identifier =
|
|
93
|
+
hash.key?('account-identifier') ? hash['account-identifier'] : SKIP
|
|
94
|
+
issuer_unique_user_id =
|
|
95
|
+
hash.key?('issuer-unique-user-id') ? hash['issuer-unique-user-id'] : SKIP
|
|
96
|
+
msisdn = hash.key?('msisdn') ? hash['msisdn'] : SKIP
|
|
97
|
+
msisdn_tail = hash.key?('msisdn-tail') ? hash['msisdn-tail'] : SKIP
|
|
98
|
+
network_id = hash.key?('network-id') ? hash['network-id'] : SKIP
|
|
99
|
+
|
|
100
|
+
# Create object from extracted values.
|
|
101
|
+
OptinState.new(country,
|
|
102
|
+
optin_status,
|
|
103
|
+
account_identifier,
|
|
104
|
+
issuer_unique_user_id,
|
|
105
|
+
msisdn,
|
|
106
|
+
msisdn_tail,
|
|
107
|
+
network_id)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def self.from_element(root)
|
|
111
|
+
country = XmlUtilities.from_element(root, 'country', String)
|
|
112
|
+
optin_status = XmlUtilities.from_element(root, 'optin-status', String)
|
|
113
|
+
account_identifier = XmlUtilities.from_element(root, 'account-identifier',
|
|
114
|
+
String)
|
|
115
|
+
issuer_unique_user_id = XmlUtilities.from_element(root,
|
|
116
|
+
'issuer-unique-user-id',
|
|
117
|
+
String)
|
|
118
|
+
msisdn = XmlUtilities.from_element(root, 'msisdn', String)
|
|
119
|
+
msisdn_tail = XmlUtilities.from_element(root, 'msisdn-tail', String)
|
|
120
|
+
network_id = XmlUtilities.from_element(root, 'network-id', String)
|
|
121
|
+
|
|
122
|
+
new(country,
|
|
123
|
+
optin_status,
|
|
124
|
+
account_identifier,
|
|
125
|
+
issuer_unique_user_id,
|
|
126
|
+
msisdn,
|
|
127
|
+
msisdn_tail,
|
|
128
|
+
network_id)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def to_xml_element(doc, root_name)
|
|
132
|
+
root = doc.create_element(root_name)
|
|
133
|
+
|
|
134
|
+
XmlUtilities.add_as_subelement(doc, root, 'country', country)
|
|
135
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-status', optin_status)
|
|
136
|
+
XmlUtilities.add_as_subelement(doc, root, 'account-identifier',
|
|
137
|
+
account_identifier)
|
|
138
|
+
XmlUtilities.add_as_subelement(doc, root, 'issuer-unique-user-id',
|
|
139
|
+
issuer_unique_user_id)
|
|
140
|
+
XmlUtilities.add_as_subelement(doc, root, 'msisdn', msisdn)
|
|
141
|
+
XmlUtilities.add_as_subelement(doc, root, 'msisdn-tail', msisdn_tail)
|
|
142
|
+
XmlUtilities.add_as_subelement(doc, root, 'network-id', network_id)
|
|
143
|
+
|
|
144
|
+
root
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Provides a human-readable string representation of the object.
|
|
148
|
+
def to_s
|
|
149
|
+
class_name = self.class.name.split('::').last
|
|
150
|
+
"<#{class_name} country: #{@country}, optin_status: #{@optin_status}, account_identifier:"\
|
|
151
|
+
" #{@account_identifier}, issuer_unique_user_id: #{@issuer_unique_user_id}, msisdn:"\
|
|
152
|
+
" #{@msisdn}, msisdn_tail: #{@msisdn_tail}, network_id: #{@network_id}>"
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
156
|
+
def inspect
|
|
157
|
+
class_name = self.class.name.split('::').last
|
|
158
|
+
"<#{class_name} country: #{@country.inspect}, optin_status: #{@optin_status.inspect},"\
|
|
159
|
+
" account_identifier: #{@account_identifier.inspect}, issuer_unique_user_id:"\
|
|
160
|
+
" #{@issuer_unique_user_id.inspect}, msisdn: #{@msisdn.inspect}, msisdn_tail:"\
|
|
161
|
+
" #{@msisdn_tail.inspect}, network_id: #{@network_id.inspect}>"
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
# Gives the status of the opt-in at the time this response was returned
|
|
8
|
+
class OptinStatusEnum
|
|
9
|
+
OPTIN_STATUS_ENUM = [
|
|
10
|
+
# the consumer's opt-in details/authenticity is not yet been validated as
|
|
11
|
+
# being correct. For eg we have not yet verified if the user is
|
|
12
|
+
# authenticated to perform operations with the issuer by redirecting to
|
|
13
|
+
# the issuer provided UI
|
|
14
|
+
PENDINGVALIDATE = 'pending-validate'.freeze,
|
|
15
|
+
|
|
16
|
+
# all consumer and other opt-in details are validated at this point, we
|
|
17
|
+
# are simply awaiting confirmation from the caller that they wish this
|
|
18
|
+
# opt-in to be active for billing.
|
|
19
|
+
PENDINGCONFIRM = 'pending-confirm'.freeze,
|
|
20
|
+
|
|
21
|
+
# the opt-in completed as valid and available for billing.
|
|
22
|
+
ACTIVE = 'active'.freeze,
|
|
23
|
+
|
|
24
|
+
# the opt-in was closed (e.g. because of a cancel-optin call) and can no
|
|
25
|
+
# longer be used for charges, but may be used for refunds if it had
|
|
26
|
+
# previously been active.
|
|
27
|
+
CLOSED = 'closed'.freeze
|
|
28
|
+
].freeze
|
|
29
|
+
|
|
30
|
+
def self.validate(value)
|
|
31
|
+
return false if value.nil?
|
|
32
|
+
|
|
33
|
+
OPTIN_STATUS_ENUM.include?(value)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.from_value(value, default_value = PENDINGVALIDATE)
|
|
37
|
+
return default_value if value.nil?
|
|
38
|
+
|
|
39
|
+
str = value.to_s.strip
|
|
40
|
+
|
|
41
|
+
case str.downcase
|
|
42
|
+
when 'pendingvalidate' then PENDINGVALIDATE
|
|
43
|
+
when 'pendingconfirm' then PENDINGCONFIRM
|
|
44
|
+
when 'active' then ACTIVE
|
|
45
|
+
when 'closed' then CLOSED
|
|
46
|
+
else
|
|
47
|
+
default_value
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|