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,99 @@
|
|
|
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-info' Response
|
|
8
|
+
class OptinInfo < 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
|
+
# A list of all supported opt-in methods on a per-network basis.
|
|
18
|
+
# @return [Array[OptinInfoOptinNetwork]]
|
|
19
|
+
attr_accessor :optin_networks
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['result'] = 'result'
|
|
25
|
+
@_hash['optin_networks'] = 'optin-networks'
|
|
26
|
+
@_hash
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# An array for optional fields
|
|
30
|
+
def self.optionals
|
|
31
|
+
%w[
|
|
32
|
+
optin_networks
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(result = nil, optin_networks = SKIP)
|
|
42
|
+
@result = result
|
|
43
|
+
@optin_networks = optin_networks unless optin_networks == SKIP
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Creates an instance of the object from a hash.
|
|
47
|
+
def self.from_hash(hash)
|
|
48
|
+
return nil unless hash
|
|
49
|
+
|
|
50
|
+
# Extract variables from the hash.
|
|
51
|
+
result = Result.from_hash(hash['result']) if hash['result']
|
|
52
|
+
# Parameter is an array, so we need to iterate through it
|
|
53
|
+
optin_networks = nil
|
|
54
|
+
unless hash['optin-networks'].nil?
|
|
55
|
+
optin_networks = []
|
|
56
|
+
hash['optin-networks'].each do |structure|
|
|
57
|
+
optin_networks << (OptinInfoOptinNetwork.from_hash(structure) if structure)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
optin_networks = SKIP unless hash.key?('optin-networks')
|
|
62
|
+
|
|
63
|
+
# Create object from extracted values.
|
|
64
|
+
OptinInfo.new(result,
|
|
65
|
+
optin_networks)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.from_element(root)
|
|
69
|
+
result = XmlUtilities.from_element(root, 'result', Result)
|
|
70
|
+
optin_networks = XmlUtilities.from_element_to_array(root, 'optin-network',
|
|
71
|
+
OptinInfoOptinNetwork)
|
|
72
|
+
|
|
73
|
+
new(result,
|
|
74
|
+
optin_networks)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def to_xml_element(doc, root_name)
|
|
78
|
+
root = doc.create_element(root_name)
|
|
79
|
+
|
|
80
|
+
XmlUtilities.add_as_subelement(doc, root, 'result', result)
|
|
81
|
+
XmlUtilities.add_array_as_subelement(doc, root, 'optin-network',
|
|
82
|
+
optin_networks)
|
|
83
|
+
|
|
84
|
+
root
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Provides a human-readable string representation of the object.
|
|
88
|
+
def to_s
|
|
89
|
+
class_name = self.class.name.split('::').last
|
|
90
|
+
"<#{class_name} result: #{@result}, optin_networks: #{@optin_networks}>"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
94
|
+
def inspect
|
|
95
|
+
class_name = self.class.name.split('::').last
|
|
96
|
+
"<#{class_name} result: #{@result.inspect}, optin_networks: #{@optin_networks.inspect}>"
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
@@ -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
|
+
# An opt-in method
|
|
8
|
+
class OptinInfoOptinNetwork < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Container element for each of the individual optin-type specific elements
|
|
13
|
+
# @return [OptinInfoOptinTypes]
|
|
14
|
+
attr_accessor :optin_types
|
|
15
|
+
|
|
16
|
+
# Container element for each of the individual optin-type specific elements
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# Container element for each of the individual optin-type specific elements
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :payment_method
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['optin_types'] = 'optin-types'
|
|
28
|
+
@_hash['id'] = 'id'
|
|
29
|
+
@_hash['payment_method'] = 'payment-method'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
id
|
|
37
|
+
payment_method
|
|
38
|
+
]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# An array for nullable fields
|
|
42
|
+
def self.nullables
|
|
43
|
+
[]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(optin_types = nil, id = SKIP, payment_method = SKIP)
|
|
47
|
+
@optin_types = optin_types
|
|
48
|
+
@id = id unless id == SKIP
|
|
49
|
+
@payment_method = payment_method unless payment_method == 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
|
+
optin_types = OptinInfoOptinTypes.from_hash(hash['optin-types']) if hash['optin-types']
|
|
58
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
59
|
+
payment_method =
|
|
60
|
+
hash.key?('payment-method') ? hash['payment-method'] : SKIP
|
|
61
|
+
|
|
62
|
+
# Create object from extracted values.
|
|
63
|
+
OptinInfoOptinNetwork.new(optin_types,
|
|
64
|
+
id,
|
|
65
|
+
payment_method)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.from_element(root)
|
|
69
|
+
optin_types = XmlUtilities.from_element(root, 'optin-types',
|
|
70
|
+
OptinInfoOptinTypes)
|
|
71
|
+
id = XmlUtilities.from_attribute(root, 'id', String)
|
|
72
|
+
payment_method = XmlUtilities.from_attribute(root, 'payment-method',
|
|
73
|
+
String)
|
|
74
|
+
|
|
75
|
+
new(optin_types,
|
|
76
|
+
id,
|
|
77
|
+
payment_method)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def to_xml_element(doc, root_name)
|
|
81
|
+
root = doc.create_element(root_name)
|
|
82
|
+
|
|
83
|
+
XmlUtilities.add_as_subelement(doc, root, 'optin-types', optin_types)
|
|
84
|
+
XmlUtilities.add_as_attribute(root, 'id', id)
|
|
85
|
+
XmlUtilities.add_as_attribute(root, 'payment-method', payment_method)
|
|
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} optin_types: #{@optin_types}, id: #{@id}, payment_method:"\
|
|
94
|
+
" #{@payment_method}>"
|
|
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} optin_types: #{@optin_types.inspect}, id: #{@id.inspect}, payment_method:"\
|
|
101
|
+
" #{@payment_method.inspect}>"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
# Container element for each of the individual optin-type specific elements
|
|
8
|
+
class OptinInfoOptinTypes < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# **DISCLAIMER: This API or element is use-case specific and not needed for
|
|
13
|
+
# generic usage of our payment product. Please disregard unless otherwise
|
|
14
|
+
# directed to include in your integration.**
|
|
15
|
+
# Indicates that this network supports some kind of "carrier gateway" based
|
|
16
|
+
# opt-in verification, and gives instructions on how to do so.
|
|
17
|
+
# @return [CarrierGw]
|
|
18
|
+
attr_accessor :carrier_gw
|
|
19
|
+
|
|
20
|
+
# Indicates that this network supports hosted opt-in verification.
|
|
21
|
+
# @return [Object]
|
|
22
|
+
attr_accessor :hosted
|
|
23
|
+
|
|
24
|
+
# Indicates that this network supports OTP based opt-in verification.
|
|
25
|
+
# Element contents reserved for future metadata relating to this opt-in
|
|
26
|
+
# method.
|
|
27
|
+
# @return [Object]
|
|
28
|
+
attr_accessor :otp
|
|
29
|
+
|
|
30
|
+
# **DISCLAIMER: This API or element is use-case specific and not needed for
|
|
31
|
+
# generic usage of our payment product. Please disregard unless otherwise
|
|
32
|
+
# directed to include in your integration.**
|
|
33
|
+
# Indicates that this network supports "silent MO" based opt-in
|
|
34
|
+
# verification, and gives instructions on the MO to send.
|
|
35
|
+
# @return [SilentMo]
|
|
36
|
+
attr_accessor :silent_mo
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['carrier_gw'] = 'carrier-gw'
|
|
42
|
+
@_hash['hosted'] = 'hosted'
|
|
43
|
+
@_hash['otp'] = 'otp'
|
|
44
|
+
@_hash['silent_mo'] = 'silent-mo'
|
|
45
|
+
@_hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for optional fields
|
|
49
|
+
def self.optionals
|
|
50
|
+
%w[
|
|
51
|
+
carrier_gw
|
|
52
|
+
hosted
|
|
53
|
+
otp
|
|
54
|
+
silent_mo
|
|
55
|
+
]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# An array for nullable fields
|
|
59
|
+
def self.nullables
|
|
60
|
+
%w[
|
|
61
|
+
hosted
|
|
62
|
+
otp
|
|
63
|
+
]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def initialize(carrier_gw = SKIP, hosted = SKIP, otp = SKIP,
|
|
67
|
+
silent_mo = SKIP)
|
|
68
|
+
@carrier_gw = carrier_gw unless carrier_gw == SKIP
|
|
69
|
+
@hosted = hosted unless hosted == SKIP
|
|
70
|
+
@otp = otp unless otp == SKIP
|
|
71
|
+
@silent_mo = silent_mo unless silent_mo == SKIP
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Creates an instance of the object from a hash.
|
|
75
|
+
def self.from_hash(hash)
|
|
76
|
+
return nil unless hash
|
|
77
|
+
|
|
78
|
+
# Extract variables from the hash.
|
|
79
|
+
carrier_gw = CarrierGw.from_hash(hash['carrier-gw']) if hash['carrier-gw']
|
|
80
|
+
hosted = hash.key?('hosted') ? hash['hosted'] : SKIP
|
|
81
|
+
otp = hash.key?('otp') ? hash['otp'] : SKIP
|
|
82
|
+
silent_mo = SilentMo.from_hash(hash['silent-mo']) if hash['silent-mo']
|
|
83
|
+
|
|
84
|
+
# Create object from extracted values.
|
|
85
|
+
OptinInfoOptinTypes.new(carrier_gw,
|
|
86
|
+
hosted,
|
|
87
|
+
otp,
|
|
88
|
+
silent_mo)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def self.from_element(root)
|
|
92
|
+
carrier_gw = XmlUtilities.from_element(root, 'CarrierGw', CarrierGw)
|
|
93
|
+
hosted = XmlUtilities.from_element(root, 'hosted', String)
|
|
94
|
+
otp = XmlUtilities.from_element(root, 'otp', String)
|
|
95
|
+
silent_mo = XmlUtilities.from_element(root, 'SilentMo', SilentMo)
|
|
96
|
+
|
|
97
|
+
new(carrier_gw,
|
|
98
|
+
hosted,
|
|
99
|
+
otp,
|
|
100
|
+
silent_mo)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def to_xml_element(doc, root_name)
|
|
104
|
+
root = doc.create_element(root_name)
|
|
105
|
+
|
|
106
|
+
XmlUtilities.add_as_subelement(doc, root, 'CarrierGw', carrier_gw)
|
|
107
|
+
XmlUtilities.add_as_subelement(doc, root, 'hosted', hosted)
|
|
108
|
+
XmlUtilities.add_as_subelement(doc, root, 'otp', otp)
|
|
109
|
+
XmlUtilities.add_as_subelement(doc, root, 'SilentMo', silent_mo)
|
|
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} carrier_gw: #{@carrier_gw}, hosted: #{@hosted}, otp: #{@otp}, silent_mo:"\
|
|
118
|
+
" #{@silent_mo}>"
|
|
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} carrier_gw: #{@carrier_gw.inspect}, hosted: #{@hosted.inspect}, otp:"\
|
|
125
|
+
" #{@otp.inspect}, silent_mo: #{@silent_mo.inspect}>"
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
# Specifies the set of networks to which the opt-in request is restricted.
|
|
8
|
+
class OptinNetwork < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Unique identifier for the network.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :id
|
|
15
|
+
|
|
16
|
+
# Mobile country code (MCC) of the device, as defined by [ITU
|
|
17
|
+
# standards](http://en.wikipedia.org/wiki/Mobile_country_code).
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :mcc
|
|
20
|
+
|
|
21
|
+
# Mobile network code (MNC) of the device.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :mnc
|
|
24
|
+
|
|
25
|
+
# Optional name for the network. Used only for debugging purposes; not
|
|
26
|
+
# stored or validated.
|
|
27
|
+
# @return [String]
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# A mapping from model property names to API property names.
|
|
31
|
+
def self.names
|
|
32
|
+
@_hash = {} if @_hash.nil?
|
|
33
|
+
@_hash['id'] = 'id'
|
|
34
|
+
@_hash['mcc'] = 'mcc'
|
|
35
|
+
@_hash['mnc'] = 'mnc'
|
|
36
|
+
@_hash['name'] = 'name'
|
|
37
|
+
@_hash
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for optional fields
|
|
41
|
+
def self.optionals
|
|
42
|
+
%w[
|
|
43
|
+
id
|
|
44
|
+
mcc
|
|
45
|
+
mnc
|
|
46
|
+
name
|
|
47
|
+
]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for nullable fields
|
|
51
|
+
def self.nullables
|
|
52
|
+
[]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def initialize(id = SKIP, mcc = SKIP, mnc = SKIP, name = SKIP)
|
|
56
|
+
@id = id unless id == SKIP
|
|
57
|
+
@mcc = mcc unless mcc == SKIP
|
|
58
|
+
@mnc = mnc unless mnc == SKIP
|
|
59
|
+
@name = name unless name == SKIP
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Creates an instance of the object from a hash.
|
|
63
|
+
def self.from_hash(hash)
|
|
64
|
+
return nil unless hash
|
|
65
|
+
|
|
66
|
+
# Extract variables from the hash.
|
|
67
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
68
|
+
mcc = hash.key?('mcc') ? hash['mcc'] : SKIP
|
|
69
|
+
mnc = hash.key?('mnc') ? hash['mnc'] : SKIP
|
|
70
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
71
|
+
|
|
72
|
+
# Create object from extracted values.
|
|
73
|
+
OptinNetwork.new(id,
|
|
74
|
+
mcc,
|
|
75
|
+
mnc,
|
|
76
|
+
name)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def self.from_element(root)
|
|
80
|
+
id = XmlUtilities.from_attribute(root, 'id', String)
|
|
81
|
+
mcc = XmlUtilities.from_attribute(root, 'mcc', String)
|
|
82
|
+
mnc = XmlUtilities.from_attribute(root, 'mnc', String)
|
|
83
|
+
name = XmlUtilities.from_attribute(root, 'name', String)
|
|
84
|
+
|
|
85
|
+
new(id,
|
|
86
|
+
mcc,
|
|
87
|
+
mnc,
|
|
88
|
+
name)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def to_xml_element(doc, root_name)
|
|
92
|
+
root = doc.create_element(root_name)
|
|
93
|
+
|
|
94
|
+
XmlUtilities.add_as_attribute(root, 'id', id)
|
|
95
|
+
XmlUtilities.add_as_attribute(root, 'mcc', mcc)
|
|
96
|
+
XmlUtilities.add_as_attribute(root, 'mnc', mnc)
|
|
97
|
+
XmlUtilities.add_as_attribute(root, 'name', name)
|
|
98
|
+
|
|
99
|
+
root
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Provides a human-readable string representation of the object.
|
|
103
|
+
def to_s
|
|
104
|
+
class_name = self.class.name.split('::').last
|
|
105
|
+
"<#{class_name} id: #{@id}, mcc: #{@mcc}, mnc: #{@mnc}, name: #{@name}>"
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
109
|
+
def inspect
|
|
110
|
+
class_name = self.class.name.split('::').last
|
|
111
|
+
"<#{class_name} id: #{@id.inspect}, mcc: #{@mcc.inspect}, mnc: #{@mnc.inspect}, name:"\
|
|
112
|
+
" #{@name.inspect}>"
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
# Purpose of the Opt-In Defines the behavioral scope and validity of an
|
|
8
|
+
# opt-in. The value determines how long the user’s authorization remains valid
|
|
9
|
+
# and under what conditions it may be reused. Supported Values: -
|
|
10
|
+
# standing-approval: Default opt-in behavior. Valid for subsequent charges
|
|
11
|
+
# until explicitly revoked by the user. - single-transaction: Valid for a
|
|
12
|
+
# single charge only. Any attempt to reuse this opt-in will result in an
|
|
13
|
+
# error. - subscription: Valid for recurring charges as part of a single
|
|
14
|
+
# subscription. Remains valid until revoked. - standing-approval-mandate:
|
|
15
|
+
# Valid for transaction behaviors defined by the user for a specific
|
|
16
|
+
# processing bank and merchant. Must be used in conjunction with
|
|
17
|
+
# mandate-constraints. - subscription-mandate: Valid for subsequent charges
|
|
18
|
+
# until revoked. It indicates that the mandate will be used for recurring
|
|
19
|
+
# charges as part of a single subscription. Must be used with Mandate
|
|
20
|
+
# Constraints and requires a Product SKU, which must match between opt-in and
|
|
21
|
+
# charge.
|
|
22
|
+
class OptinPurposeEnum
|
|
23
|
+
OPTIN_PURPOSE_ENUM = [
|
|
24
|
+
# TODO: Write general description for STANDINGAPPROVAL
|
|
25
|
+
STANDINGAPPROVAL = 'standing-approval'.freeze,
|
|
26
|
+
|
|
27
|
+
# TODO: Write general description for SINGLETRANSACTION
|
|
28
|
+
SINGLETRANSACTION = 'single-transaction'.freeze,
|
|
29
|
+
|
|
30
|
+
# TODO: Write general description for SUBSCRIPTION
|
|
31
|
+
SUBSCRIPTION = 'subscription'.freeze,
|
|
32
|
+
|
|
33
|
+
# TODO: Write general description for STANDINGAPPROVALMANDATE
|
|
34
|
+
STANDINGAPPROVALMANDATE = 'standing-approval-mandate'.freeze,
|
|
35
|
+
|
|
36
|
+
# TODO: Write general description for SUBSCRIPTIONMANDATE
|
|
37
|
+
SUBSCRIPTIONMANDATE = 'subscription-mandate'.freeze
|
|
38
|
+
].freeze
|
|
39
|
+
|
|
40
|
+
def self.validate(value)
|
|
41
|
+
return false if value.nil?
|
|
42
|
+
|
|
43
|
+
OPTIN_PURPOSE_ENUM.include?(value)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def self.from_value(value, default_value = STANDINGAPPROVAL)
|
|
47
|
+
return default_value if value.nil?
|
|
48
|
+
|
|
49
|
+
str = value.to_s.strip
|
|
50
|
+
|
|
51
|
+
case str.downcase
|
|
52
|
+
when 'standingapproval' then STANDINGAPPROVAL
|
|
53
|
+
when 'singletransaction' then SINGLETRANSACTION
|
|
54
|
+
when 'subscription' then SUBSCRIPTION
|
|
55
|
+
when 'standingapprovalmandate' then STANDINGAPPROVALMANDATE
|
|
56
|
+
when 'subscriptionmandate' then SUBSCRIPTIONMANDATE
|
|
57
|
+
else
|
|
58
|
+
default_value
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|