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.
Files changed (140) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +203 -0
  4. data/bin/console +15 -0
  5. data/lib/boku_direct_payments_api/api_helper.rb +10 -0
  6. data/lib/boku_direct_payments_api/client.rb +99 -0
  7. data/lib/boku_direct_payments_api/configuration.rb +168 -0
  8. data/lib/boku_direct_payments_api/controllers/account_resources_controller.rb +45 -0
  9. data/lib/boku_direct_payments_api/controllers/base_controller.rb +60 -0
  10. data/lib/boku_direct_payments_api/controllers/charge_controller.rb +247 -0
  11. data/lib/boku_direct_payments_api/controllers/config_resources_controller.rb +50 -0
  12. data/lib/boku_direct_payments_api/controllers/consumer_registration_controller.rb +428 -0
  13. data/lib/boku_direct_payments_api/controllers/forex_controller.rb +38 -0
  14. data/lib/boku_direct_payments_api/controllers/fund_check_controller.rb +39 -0
  15. data/lib/boku_direct_payments_api/controllers/refund_controller.rb +80 -0
  16. data/lib/boku_direct_payments_api/controllers/seller_of_record_controller.rb +69 -0
  17. data/lib/boku_direct_payments_api/exceptions/api_exception.rb +21 -0
  18. data/lib/boku_direct_payments_api/http/http_call_back.rb +10 -0
  19. data/lib/boku_direct_payments_api/http/http_method_enum.rb +10 -0
  20. data/lib/boku_direct_payments_api/http/http_request.rb +10 -0
  21. data/lib/boku_direct_payments_api/http/http_response.rb +10 -0
  22. data/lib/boku_direct_payments_api/http/proxy_settings.rb +22 -0
  23. data/lib/boku_direct_payments_api/models/account_profile.rb +122 -0
  24. data/lib/boku_direct_payments_api/models/account_profile_attribute.rb +90 -0
  25. data/lib/boku_direct_payments_api/models/account_profile_request.rb +131 -0
  26. data/lib/boku_direct_payments_api/models/account_profile_response.rb +104 -0
  27. data/lib/boku_direct_payments_api/models/account_profile_response_record.rb +142 -0
  28. data/lib/boku_direct_payments_api/models/account_profile_result_status_enum.rb +47 -0
  29. data/lib/boku_direct_payments_api/models/account_profile_selector.rb +132 -0
  30. data/lib/boku_direct_payments_api/models/base_model.rb +110 -0
  31. data/lib/boku_direct_payments_api/models/begin_single_charge_request.rb +360 -0
  32. data/lib/boku_direct_payments_api/models/begin_single_charge_request_hosted.rb +110 -0
  33. data/lib/boku_direct_payments_api/models/begin_single_charge_request_qr_info.rb +74 -0
  34. data/lib/boku_direct_payments_api/models/begin_single_charge_response.rb +254 -0
  35. data/lib/boku_direct_payments_api/models/begin_single_charge_response_hosted.rb +90 -0
  36. data/lib/boku_direct_payments_api/models/begin_single_charge_response_qr_info.rb +85 -0
  37. data/lib/boku_direct_payments_api/models/business_details.rb +209 -0
  38. data/lib/boku_direct_payments_api/models/cancel_optin_request.rb +123 -0
  39. data/lib/boku_direct_payments_api/models/cancel_optin_response.rb +143 -0
  40. data/lib/boku_direct_payments_api/models/carrier_gw.rb +82 -0
  41. data/lib/boku_direct_payments_api/models/charge.rb +288 -0
  42. data/lib/boku_direct_payments_api/models/charge_msisdn_request.rb +233 -0
  43. data/lib/boku_direct_payments_api/models/charge_plus_optin_request.rb +390 -0
  44. data/lib/boku_direct_payments_api/models/charge_plus_optin_request_hosted.rb +96 -0
  45. data/lib/boku_direct_payments_api/models/charge_plus_optin_response.rb +278 -0
  46. data/lib/boku_direct_payments_api/models/charge_plus_optin_response_hosted.rb +75 -0
  47. data/lib/boku_direct_payments_api/models/charge_request.rb +332 -0
  48. data/lib/boku_direct_payments_api/models/charge_response.rb +253 -0
  49. data/lib/boku_direct_payments_api/models/charge_status_enum.rb +43 -0
  50. data/lib/boku_direct_payments_api/models/check_eligibility_request.rb +117 -0
  51. data/lib/boku_direct_payments_api/models/check_eligibility_response.rb +116 -0
  52. data/lib/boku_direct_payments_api/models/client_call.rb +91 -0
  53. data/lib/boku_direct_payments_api/models/confirm_optin_request.rb +141 -0
  54. data/lib/boku_direct_payments_api/models/confirm_optin_response.rb +211 -0
  55. data/lib/boku_direct_payments_api/models/confirm_verify_device_request.rb +161 -0
  56. data/lib/boku_direct_payments_api/models/confirm_verify_device_response.rb +137 -0
  57. data/lib/boku_direct_payments_api/models/eligibility_status_enum.rb +40 -0
  58. data/lib/boku_direct_payments_api/models/forex_request.rb +97 -0
  59. data/lib/boku_direct_payments_api/models/forex_response.rb +127 -0
  60. data/lib/boku_direct_payments_api/models/fund_check_request.rb +132 -0
  61. data/lib/boku_direct_payments_api/models/fund_check_response.rb +89 -0
  62. data/lib/boku_direct_payments_api/models/invalid_request_field.rb +93 -0
  63. data/lib/boku_direct_payments_api/models/mandate_constraint.rb +92 -0
  64. data/lib/boku_direct_payments_api/models/mandate_period_enum.rb +48 -0
  65. data/lib/boku_direct_payments_api/models/mcc_mnc_mapping.rb +85 -0
  66. data/lib/boku_direct_payments_api/models/method_enum.rb +36 -0
  67. data/lib/boku_direct_payments_api/models/msisdn_network_request.rb +97 -0
  68. data/lib/boku_direct_payments_api/models/msisdn_network_response.rb +116 -0
  69. data/lib/boku_direct_payments_api/models/network_info.rb +84 -0
  70. data/lib/boku_direct_payments_api/models/network_info_network.rb +168 -0
  71. data/lib/boku_direct_payments_api/models/optin_accept_networks.rb +87 -0
  72. data/lib/boku_direct_payments_api/models/optin_info.rb +99 -0
  73. data/lib/boku_direct_payments_api/models/optin_info_optin_network.rb +104 -0
  74. data/lib/boku_direct_payments_api/models/optin_info_optin_types.rb +128 -0
  75. data/lib/boku_direct_payments_api/models/optin_network.rb +115 -0
  76. data/lib/boku_direct_payments_api/models/optin_purpose_enum.rb +62 -0
  77. data/lib/boku_direct_payments_api/models/optin_request.rb +338 -0
  78. data/lib/boku_direct_payments_api/models/optin_request_hosted.rb +110 -0
  79. data/lib/boku_direct_payments_api/models/optin_request_qr_info.rb +75 -0
  80. data/lib/boku_direct_payments_api/models/optin_response.rb +220 -0
  81. data/lib/boku_direct_payments_api/models/optin_response_hosted.rb +87 -0
  82. data/lib/boku_direct_payments_api/models/optin_response_qr_info.rb +85 -0
  83. data/lib/boku_direct_payments_api/models/optin_state.rb +164 -0
  84. data/lib/boku_direct_payments_api/models/optin_status_enum.rb +51 -0
  85. data/lib/boku_direct_payments_api/models/optin_terms.rb +214 -0
  86. data/lib/boku_direct_payments_api/models/optin_type_enum.rb +45 -0
  87. data/lib/boku_direct_payments_api/models/payment_method_status_enum.rb +44 -0
  88. data/lib/boku_direct_payments_api/models/period.rb +89 -0
  89. data/lib/boku_direct_payments_api/models/period_unit_enum.rb +46 -0
  90. data/lib/boku_direct_payments_api/models/query_charge_request.rb +149 -0
  91. data/lib/boku_direct_payments_api/models/query_charge_response.rb +101 -0
  92. data/lib/boku_direct_payments_api/models/query_optin_request.rb +104 -0
  93. data/lib/boku_direct_payments_api/models/query_optin_response.rb +129 -0
  94. data/lib/boku_direct_payments_api/models/query_refund_request.rb +122 -0
  95. data/lib/boku_direct_payments_api/models/query_refund_response.rb +101 -0
  96. data/lib/boku_direct_payments_api/models/refund.rb +249 -0
  97. data/lib/boku_direct_payments_api/models/refund_charge_notification.rb +88 -0
  98. data/lib/boku_direct_payments_api/models/refund_charge_request.rb +231 -0
  99. data/lib/boku_direct_payments_api/models/refund_charge_response.rb +203 -0
  100. data/lib/boku_direct_payments_api/models/refund_status_enum.rb +43 -0
  101. data/lib/boku_direct_payments_api/models/refund_type_enum.rb +36 -0
  102. data/lib/boku_direct_payments_api/models/register_payment_method_request.rb +152 -0
  103. data/lib/boku_direct_payments_api/models/register_payment_method_response.rb +172 -0
  104. data/lib/boku_direct_payments_api/models/register_seller_of_record_request.rb +118 -0
  105. data/lib/boku_direct_payments_api/models/register_seller_of_record_response.rb +156 -0
  106. data/lib/boku_direct_payments_api/models/resend_otp_request.rb +167 -0
  107. data/lib/boku_direct_payments_api/models/resend_otp_response.rb +118 -0
  108. data/lib/boku_direct_payments_api/models/result.rb +154 -0
  109. data/lib/boku_direct_payments_api/models/result_status_enum.rb +36 -0
  110. data/lib/boku_direct_payments_api/models/reversal.rb +89 -0
  111. data/lib/boku_direct_payments_api/models/reverse_charge_request.rb +104 -0
  112. data/lib/boku_direct_payments_api/models/reverse_charge_response.rb +157 -0
  113. data/lib/boku_direct_payments_api/models/seller_of_record.rb +76 -0
  114. data/lib/boku_direct_payments_api/models/seller_of_record_status_enum.rb +44 -0
  115. data/lib/boku_direct_payments_api/models/send_sms.rb +89 -0
  116. data/lib/boku_direct_payments_api/models/settlement.rb +126 -0
  117. data/lib/boku_direct_payments_api/models/silent_mo.rb +78 -0
  118. data/lib/boku_direct_payments_api/models/status_enum.rb +40 -0
  119. data/lib/boku_direct_payments_api/models/subscription.rb +105 -0
  120. data/lib/boku_direct_payments_api/models/timeout.rb +75 -0
  121. data/lib/boku_direct_payments_api/models/type_enum.rb +36 -0
  122. data/lib/boku_direct_payments_api/models/validate_optin_request.rb +179 -0
  123. data/lib/boku_direct_payments_api/models/validate_optin_response.rb +195 -0
  124. data/lib/boku_direct_payments_api/models/verify_device_request.rb +135 -0
  125. data/lib/boku_direct_payments_api/models/verify_device_response.rb +137 -0
  126. data/lib/boku_direct_payments_api/utilities/date_time_helper.rb +11 -0
  127. data/lib/boku_direct_payments_api/utilities/file_wrapper.rb +28 -0
  128. data/lib/boku_direct_payments_api/utilities/xml_utilities.rb +12 -0
  129. data/lib/boku_direct_payments_api.rb +166 -0
  130. data/test/controllers/controller_test_base.rb +23 -0
  131. data/test/controllers/test_account_resources_controller.rb +44 -0
  132. data/test/controllers/test_charge_controller.rb +159 -0
  133. data/test/controllers/test_config_resources_controller.rb +47 -0
  134. data/test/controllers/test_consumer_registration_controller.rb +262 -0
  135. data/test/controllers/test_forex_controller.rb +40 -0
  136. data/test/controllers/test_fund_check_controller.rb +41 -0
  137. data/test/controllers/test_refund_controller.rb +76 -0
  138. data/test/controllers/test_seller_of_record_controller.rb +72 -0
  139. data/test/http_response_catcher.rb +19 -0
  140. metadata +255 -0
@@ -0,0 +1,179 @@
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
+ # 'validate-optin' Request - General Parameters
8
+ class ValidateOptinRequest < 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
+ # Multiple requests received with the same merchant-request-id will be
18
+ # handled idempotently within the idempotency window.
19
+ # @return [String]
20
+ attr_accessor :merchant_request_id
21
+
22
+ # Specifies which method to use to perform the opt-in.
23
+ # @return [OptinTypeEnum]
24
+ attr_accessor :optin_type
25
+
26
+ # Merchant-assigned unique opt-in ID.
27
+ # @return [String]
28
+ attr_accessor :merchant_optin_id
29
+
30
+ # Boku-assigned unique opt-in ID.
31
+ # @return [String]
32
+ attr_accessor :optin_id
33
+
34
+ # The merchant-assigned ID used as `merchant-request-id` in the original
35
+ # opt-in request.
36
+ # @return [String]
37
+ attr_accessor :optin_request_id
38
+
39
+ # **Required if optin-type == OTP**.
40
+ # One-time PIN entered by consumer. This parameter has a minimum size of 4
41
+ # characters.
42
+ # @return [String]
43
+ attr_accessor :otp
44
+
45
+ # Specifies how long to block waiting for a response
46
+ # @return [Timeout]
47
+ attr_accessor :timeout
48
+
49
+ # A mapping from model property names to API property names.
50
+ def self.names
51
+ @_hash = {} if @_hash.nil?
52
+ @_hash['merchant_id'] = 'merchant-id'
53
+ @_hash['merchant_request_id'] = 'merchant-request-id'
54
+ @_hash['optin_type'] = 'optin-type'
55
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
56
+ @_hash['optin_id'] = 'optin-id'
57
+ @_hash['optin_request_id'] = 'optin-request-id'
58
+ @_hash['otp'] = 'otp'
59
+ @_hash['timeout'] = 'timeout'
60
+ @_hash
61
+ end
62
+
63
+ # An array for optional fields
64
+ def self.optionals
65
+ %w[
66
+ merchant_optin_id
67
+ optin_id
68
+ optin_request_id
69
+ otp
70
+ timeout
71
+ ]
72
+ end
73
+
74
+ # An array for nullable fields
75
+ def self.nullables
76
+ []
77
+ end
78
+
79
+ def initialize(merchant_id = nil, merchant_request_id = nil,
80
+ optin_type = nil, merchant_optin_id = SKIP, optin_id = SKIP,
81
+ optin_request_id = SKIP, otp = SKIP, timeout = SKIP)
82
+ @merchant_id = merchant_id
83
+ @merchant_request_id = merchant_request_id
84
+ @optin_type = optin_type
85
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
86
+ @optin_id = optin_id unless optin_id == SKIP
87
+ @optin_request_id = optin_request_id unless optin_request_id == SKIP
88
+ @otp = otp unless otp == SKIP
89
+ @timeout = timeout unless timeout == SKIP
90
+ end
91
+
92
+ # Creates an instance of the object from a hash.
93
+ def self.from_hash(hash)
94
+ return nil unless hash
95
+
96
+ # Extract variables from the hash.
97
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
98
+ merchant_request_id =
99
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
100
+ optin_type = hash.key?('optin-type') ? hash['optin-type'] : nil
101
+ merchant_optin_id =
102
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
103
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
104
+ optin_request_id =
105
+ hash.key?('optin-request-id') ? hash['optin-request-id'] : SKIP
106
+ otp = hash.key?('otp') ? hash['otp'] : SKIP
107
+ timeout = Timeout.from_hash(hash['timeout']) if hash['timeout']
108
+
109
+ # Create object from extracted values.
110
+ ValidateOptinRequest.new(merchant_id,
111
+ merchant_request_id,
112
+ optin_type,
113
+ merchant_optin_id,
114
+ optin_id,
115
+ optin_request_id,
116
+ otp,
117
+ timeout)
118
+ end
119
+
120
+ def self.from_element(root)
121
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
122
+ merchant_request_id = XmlUtilities.from_element(root,
123
+ 'merchant-request-id',
124
+ String)
125
+ optin_type = XmlUtilities.from_element(root, 'optin-type', String)
126
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
127
+ String)
128
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
129
+ optin_request_id = XmlUtilities.from_element(root, 'optin-request-id',
130
+ String)
131
+ otp = XmlUtilities.from_element(root, 'otp', String)
132
+ timeout = XmlUtilities.from_element(root, 'timeout', Timeout)
133
+
134
+ new(merchant_id,
135
+ merchant_request_id,
136
+ optin_type,
137
+ merchant_optin_id,
138
+ optin_id,
139
+ optin_request_id,
140
+ otp,
141
+ timeout)
142
+ end
143
+
144
+ def to_xml_element(doc, root_name)
145
+ root = doc.create_element(root_name)
146
+
147
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
148
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
149
+ merchant_request_id)
150
+ XmlUtilities.add_as_subelement(doc, root, 'optin-type', optin_type)
151
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
152
+ merchant_optin_id)
153
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
154
+ XmlUtilities.add_as_subelement(doc, root, 'optin-request-id',
155
+ optin_request_id)
156
+ XmlUtilities.add_as_subelement(doc, root, 'otp', otp)
157
+ XmlUtilities.add_as_subelement(doc, root, 'timeout', timeout)
158
+
159
+ root
160
+ end
161
+
162
+ # Provides a human-readable string representation of the object.
163
+ def to_s
164
+ class_name = self.class.name.split('::').last
165
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
166
+ " optin_type: #{@optin_type}, merchant_optin_id: #{@merchant_optin_id}, optin_id:"\
167
+ " #{@optin_id}, optin_request_id: #{@optin_request_id}, otp: #{@otp}, timeout: #{@timeout}>"
168
+ end
169
+
170
+ # Provides a debugging-friendly string with detailed object information.
171
+ def inspect
172
+ class_name = self.class.name.split('::').last
173
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
174
+ " #{@merchant_request_id.inspect}, optin_type: #{@optin_type.inspect}, merchant_optin_id:"\
175
+ " #{@merchant_optin_id.inspect}, optin_id: #{@optin_id.inspect}, optin_request_id:"\
176
+ " #{@optin_request_id.inspect}, otp: #{@otp.inspect}, timeout: #{@timeout.inspect}>"
177
+ end
178
+ end
179
+ end
@@ -0,0 +1,195 @@
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
+ # 'validate-optin' Response - General Elements
8
+ class ValidateOptinResponse < 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
+ # Boku-assigned unique opt-in ID.
26
+ # @return [String]
27
+ attr_accessor :optin_id
28
+
29
+ # The merchant-assigned ID used as `merchant-request-id` in the original
30
+ # opt-in call.
31
+ # @return [String]
32
+ attr_accessor :optin_request_id
33
+
34
+ # Gives the state of the opt-in at the time this response was returned
35
+ # @return [OptinState]
36
+ attr_accessor :optin_state
37
+
38
+ # Specifies which method to use to perform the opt-in.
39
+ # @return [OptinTypeEnum]
40
+ attr_accessor :optin_type
41
+
42
+ # The payment method selected
43
+ # @return [String]
44
+ attr_accessor :payment_method
45
+
46
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
47
+ # generic usage of our payment product. Please disregard unless otherwise
48
+ # directed to include in your integration.**
49
+ # Indicates whether the user associated with the optinId has completed an
50
+ # optin within the past 3 months. Returned only when the merchant feature is
51
+ # enabled. When enabled, issuer-user-unique-identifier is omitted from the
52
+ # response.
53
+ # @return [TrueClass | FalseClass]
54
+ attr_accessor :prior_optin
55
+
56
+ # A mapping from model property names to API property names.
57
+ def self.names
58
+ @_hash = {} if @_hash.nil?
59
+ @_hash['merchant_id'] = 'merchant-id'
60
+ @_hash['merchant_request_id'] = 'merchant-request-id'
61
+ @_hash['result'] = 'result'
62
+ @_hash['optin_id'] = 'optin-id'
63
+ @_hash['optin_request_id'] = 'optin-request-id'
64
+ @_hash['optin_state'] = 'optin-state'
65
+ @_hash['optin_type'] = 'optin-type'
66
+ @_hash['payment_method'] = 'payment-method'
67
+ @_hash['prior_optin'] = 'prior-optin'
68
+ @_hash
69
+ end
70
+
71
+ # An array for optional fields
72
+ def self.optionals
73
+ %w[
74
+ optin_id
75
+ optin_request_id
76
+ optin_state
77
+ optin_type
78
+ payment_method
79
+ prior_optin
80
+ ]
81
+ end
82
+
83
+ # An array for nullable fields
84
+ def self.nullables
85
+ []
86
+ end
87
+
88
+ def initialize(merchant_id = nil, merchant_request_id = nil, result = nil,
89
+ optin_id = SKIP, optin_request_id = SKIP, optin_state = SKIP,
90
+ optin_type = SKIP, payment_method = SKIP, prior_optin = SKIP)
91
+ @merchant_id = merchant_id
92
+ @merchant_request_id = merchant_request_id
93
+ @result = result
94
+ @optin_id = optin_id unless optin_id == SKIP
95
+ @optin_request_id = optin_request_id unless optin_request_id == SKIP
96
+ @optin_state = optin_state unless optin_state == SKIP
97
+ @optin_type = optin_type unless optin_type == SKIP
98
+ @payment_method = payment_method unless payment_method == SKIP
99
+ @prior_optin = prior_optin unless prior_optin == SKIP
100
+ end
101
+
102
+ # Creates an instance of the object from a hash.
103
+ def self.from_hash(hash)
104
+ return nil unless hash
105
+
106
+ # Extract variables from the hash.
107
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
108
+ merchant_request_id =
109
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
110
+ result = Result.from_hash(hash['result']) if hash['result']
111
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
112
+ optin_request_id =
113
+ hash.key?('optin-request-id') ? hash['optin-request-id'] : SKIP
114
+ optin_state = OptinState.from_hash(hash['optin-state']) if hash['optin-state']
115
+ optin_type = hash.key?('optin-type') ? hash['optin-type'] : SKIP
116
+ payment_method =
117
+ hash.key?('payment-method') ? hash['payment-method'] : SKIP
118
+ prior_optin = hash.key?('prior-optin') ? hash['prior-optin'] : SKIP
119
+
120
+ # Create object from extracted values.
121
+ ValidateOptinResponse.new(merchant_id,
122
+ merchant_request_id,
123
+ result,
124
+ optin_id,
125
+ optin_request_id,
126
+ optin_state,
127
+ optin_type,
128
+ payment_method,
129
+ prior_optin)
130
+ end
131
+
132
+ def self.from_element(root)
133
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
134
+ merchant_request_id = XmlUtilities.from_element(root,
135
+ 'merchant-request-id',
136
+ String)
137
+ result = XmlUtilities.from_element(root, 'result', Result)
138
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
139
+ optin_request_id = XmlUtilities.from_element(root, 'optin-request-id',
140
+ String)
141
+ optin_state = XmlUtilities.from_element(root, 'optin-state', OptinState)
142
+ optin_type = XmlUtilities.from_element(root, 'optin-type', String)
143
+ payment_method = XmlUtilities.from_element(root, 'payment-method', String)
144
+ prior_optin = XmlUtilities.from_element(root, 'prior-optin', TrueClass)
145
+
146
+ new(merchant_id,
147
+ merchant_request_id,
148
+ result,
149
+ optin_id,
150
+ optin_request_id,
151
+ optin_state,
152
+ optin_type,
153
+ payment_method,
154
+ prior_optin)
155
+ end
156
+
157
+ def to_xml_element(doc, root_name)
158
+ root = doc.create_element(root_name)
159
+
160
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
161
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
162
+ merchant_request_id)
163
+ XmlUtilities.add_as_subelement(doc, root, 'result', result)
164
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
165
+ XmlUtilities.add_as_subelement(doc, root, 'optin-request-id',
166
+ optin_request_id)
167
+ XmlUtilities.add_as_subelement(doc, root, 'optin-state', optin_state)
168
+ XmlUtilities.add_as_subelement(doc, root, 'optin-type', optin_type)
169
+ XmlUtilities.add_as_subelement(doc, root, 'payment-method',
170
+ payment_method)
171
+ XmlUtilities.add_as_subelement(doc, root, 'prior-optin', prior_optin)
172
+
173
+ root
174
+ end
175
+
176
+ # Provides a human-readable string representation of the object.
177
+ def to_s
178
+ class_name = self.class.name.split('::').last
179
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
180
+ " result: #{@result}, optin_id: #{@optin_id}, optin_request_id: #{@optin_request_id},"\
181
+ " optin_state: #{@optin_state}, optin_type: #{@optin_type}, payment_method:"\
182
+ " #{@payment_method}, prior_optin: #{@prior_optin}>"
183
+ end
184
+
185
+ # Provides a debugging-friendly string with detailed object information.
186
+ def inspect
187
+ class_name = self.class.name.split('::').last
188
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
189
+ " #{@merchant_request_id.inspect}, result: #{@result.inspect}, optin_id:"\
190
+ " #{@optin_id.inspect}, optin_request_id: #{@optin_request_id.inspect}, optin_state:"\
191
+ " #{@optin_state.inspect}, optin_type: #{@optin_type.inspect}, payment_method:"\
192
+ " #{@payment_method.inspect}, prior_optin: #{@prior_optin.inspect}>"
193
+ end
194
+ end
195
+ end
@@ -0,0 +1,135 @@
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
+ # 'verify-device' Request - General Parameters
8
+ class VerifyDeviceRequest < 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
+ # Multiple requests received with the same merchant-request-id will be
18
+ # handled idempotently within the idempotency window.
19
+ # @return [String]
20
+ attr_accessor :merchant_request_id
21
+
22
+ # ISO 3166-1 alpha-2 country code.
23
+ # @return [String]
24
+ attr_accessor :country
25
+
26
+ # Merchant-assigned unique opt-in ID.
27
+ # @return [String]
28
+ attr_accessor :merchant_optin_id
29
+
30
+ # Boku-assigned unique opt-in ID.
31
+ # @return [String]
32
+ attr_accessor :optin_id
33
+
34
+ # A mapping from model property names to API property names.
35
+ def self.names
36
+ @_hash = {} if @_hash.nil?
37
+ @_hash['merchant_id'] = 'merchant-id'
38
+ @_hash['merchant_request_id'] = 'merchant-request-id'
39
+ @_hash['country'] = 'country'
40
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
41
+ @_hash['optin_id'] = 'optin-id'
42
+ @_hash
43
+ end
44
+
45
+ # An array for optional fields
46
+ def self.optionals
47
+ %w[
48
+ country
49
+ merchant_optin_id
50
+ optin_id
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(merchant_id = nil, merchant_request_id = nil, country = SKIP,
60
+ merchant_optin_id = SKIP, optin_id = SKIP)
61
+ @merchant_id = merchant_id
62
+ @merchant_request_id = merchant_request_id
63
+ @country = country unless country == SKIP
64
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
65
+ @optin_id = optin_id unless optin_id == SKIP
66
+ end
67
+
68
+ # Creates an instance of the object from a hash.
69
+ def self.from_hash(hash)
70
+ return nil unless hash
71
+
72
+ # Extract variables from the hash.
73
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
74
+ merchant_request_id =
75
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
76
+ country = hash.key?('country') ? hash['country'] : SKIP
77
+ merchant_optin_id =
78
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
79
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
80
+
81
+ # Create object from extracted values.
82
+ VerifyDeviceRequest.new(merchant_id,
83
+ merchant_request_id,
84
+ country,
85
+ merchant_optin_id,
86
+ optin_id)
87
+ end
88
+
89
+ def self.from_element(root)
90
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
91
+ merchant_request_id = XmlUtilities.from_element(root,
92
+ 'merchant-request-id',
93
+ String)
94
+ country = XmlUtilities.from_element(root, 'country', String)
95
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
96
+ String)
97
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
98
+
99
+ new(merchant_id,
100
+ merchant_request_id,
101
+ country,
102
+ merchant_optin_id,
103
+ optin_id)
104
+ end
105
+
106
+ def to_xml_element(doc, root_name)
107
+ root = doc.create_element(root_name)
108
+
109
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
110
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
111
+ merchant_request_id)
112
+ XmlUtilities.add_as_subelement(doc, root, 'country', country)
113
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
114
+ merchant_optin_id)
115
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
116
+
117
+ root
118
+ end
119
+
120
+ # Provides a human-readable string representation of the object.
121
+ def to_s
122
+ class_name = self.class.name.split('::').last
123
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
124
+ " country: #{@country}, merchant_optin_id: #{@merchant_optin_id}, optin_id: #{@optin_id}>"
125
+ end
126
+
127
+ # Provides a debugging-friendly string with detailed object information.
128
+ def inspect
129
+ class_name = self.class.name.split('::').last
130
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
131
+ " #{@merchant_request_id.inspect}, country: #{@country.inspect}, merchant_optin_id:"\
132
+ " #{@merchant_optin_id.inspect}, optin_id: #{@optin_id.inspect}>"
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,137 @@
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
+ # 'verify-device' Response - General Elements
8
+ class VerifyDeviceResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The 'result' element is defined in every response type. It is used to
13
+ # convey the outcome of an API request.
14
+ # @return [Result]
15
+ attr_accessor :result
16
+
17
+ # Boku-assigned merchant ID. Provided if result.status == OK.
18
+ # @return [String]
19
+ attr_accessor :merchant_id
20
+
21
+ # Merchant-assigned request ID.
22
+ # @return [String]
23
+ attr_accessor :merchant_request_id
24
+
25
+ # Boku-assigned consumer opt-in ID. Provided if result.status == OK.
26
+ # @return [String]
27
+ attr_accessor :optin_id
28
+
29
+ # Boku-assigned device verification session ID. Provided if result.status ==
30
+ # OK.
31
+ # @return [Integer]
32
+ attr_accessor :verify_session_id
33
+
34
+ # A mapping from model property names to API property names.
35
+ def self.names
36
+ @_hash = {} if @_hash.nil?
37
+ @_hash['result'] = 'result'
38
+ @_hash['merchant_id'] = 'merchant-id'
39
+ @_hash['merchant_request_id'] = 'merchant-request-id'
40
+ @_hash['optin_id'] = 'optin-id'
41
+ @_hash['verify_session_id'] = 'verify-session-id'
42
+ @_hash
43
+ end
44
+
45
+ # An array for optional fields
46
+ def self.optionals
47
+ %w[
48
+ merchant_id
49
+ merchant_request_id
50
+ optin_id
51
+ verify_session_id
52
+ ]
53
+ end
54
+
55
+ # An array for nullable fields
56
+ def self.nullables
57
+ []
58
+ end
59
+
60
+ def initialize(result = nil, merchant_id = SKIP, merchant_request_id = SKIP,
61
+ optin_id = SKIP, verify_session_id = SKIP)
62
+ @result = result
63
+ @merchant_id = merchant_id unless merchant_id == SKIP
64
+ @merchant_request_id = merchant_request_id unless merchant_request_id == SKIP
65
+ @optin_id = optin_id unless optin_id == SKIP
66
+ @verify_session_id = verify_session_id unless verify_session_id == SKIP
67
+ end
68
+
69
+ # Creates an instance of the object from a hash.
70
+ def self.from_hash(hash)
71
+ return nil unless hash
72
+
73
+ # Extract variables from the hash.
74
+ result = Result.from_hash(hash['result']) if hash['result']
75
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : SKIP
76
+ merchant_request_id =
77
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : SKIP
78
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
79
+ verify_session_id =
80
+ hash.key?('verify-session-id') ? hash['verify-session-id'] : SKIP
81
+
82
+ # Create object from extracted values.
83
+ VerifyDeviceResponse.new(result,
84
+ merchant_id,
85
+ merchant_request_id,
86
+ optin_id,
87
+ verify_session_id)
88
+ end
89
+
90
+ def self.from_element(root)
91
+ result = XmlUtilities.from_element(root, 'result', Result)
92
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
93
+ merchant_request_id = XmlUtilities.from_element(root,
94
+ 'merchant-request-id',
95
+ String)
96
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
97
+ verify_session_id = XmlUtilities.from_element(root, 'verify-session-id',
98
+ Integer)
99
+
100
+ new(result,
101
+ merchant_id,
102
+ merchant_request_id,
103
+ optin_id,
104
+ verify_session_id)
105
+ end
106
+
107
+ def to_xml_element(doc, root_name)
108
+ root = doc.create_element(root_name)
109
+
110
+ XmlUtilities.add_as_subelement(doc, root, 'result', result)
111
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
112
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
113
+ merchant_request_id)
114
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
115
+ XmlUtilities.add_as_subelement(doc, root, 'verify-session-id',
116
+ verify_session_id)
117
+
118
+ root
119
+ end
120
+
121
+ # Provides a human-readable string representation of the object.
122
+ def to_s
123
+ class_name = self.class.name.split('::').last
124
+ "<#{class_name} result: #{@result}, merchant_id: #{@merchant_id}, merchant_request_id:"\
125
+ " #{@merchant_request_id}, optin_id: #{@optin_id}, verify_session_id:"\
126
+ " #{@verify_session_id}>"
127
+ end
128
+
129
+ # Provides a debugging-friendly string with detailed object information.
130
+ def inspect
131
+ class_name = self.class.name.split('::').last
132
+ "<#{class_name} result: #{@result.inspect}, merchant_id: #{@merchant_id.inspect},"\
133
+ " merchant_request_id: #{@merchant_request_id.inspect}, optin_id: #{@optin_id.inspect},"\
134
+ " verify_session_id: #{@verify_session_id.inspect}>"
135
+ end
136
+ end
137
+ end
@@ -0,0 +1,11 @@
1
+ # boku_direct_payments_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module BokuDirectPaymentsApi
8
+ # A utility that supports dateTime conversion to different formats
9
+ class DateTimeHelper < CoreLibrary::DateTimeHelper
10
+ end
11
+ end
@@ -0,0 +1,28 @@
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
+ # A utility to allow users to set the content-type for files
8
+ class FileWrapper < CoreLibrary::FileWrapper
9
+ # The constructor.
10
+ # @param [File] file The file to be sent in the request.
11
+ # @param [string] content_type The content type of the provided file.
12
+ def initialize(file, content_type: 'application/octet-stream')
13
+ super
14
+ end
15
+
16
+ # Provides a human-readable string representation of the object.
17
+ def to_s
18
+ class_name = self.class.name.split('::').last
19
+ "<#{class_name} file: #{@file}, content_type: #{@content_type}>"
20
+ end
21
+
22
+ # Provides a debugging-friendly string with detailed object information.
23
+ def to_inspect
24
+ class_name = self.class.name.split('::').last
25
+ "<#{class_name} file: #{@file.inspect}, content_type: #{@content_type.inspect}>"
26
+ end
27
+ end
28
+ end