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,209 @@
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 business details
8
+ class BusinessDetails < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Address of this business. Please provide full address details
13
+ # @return [String]
14
+ attr_accessor :business_address
15
+
16
+ # Contact phone number of this business
17
+ # @return [String]
18
+ attr_accessor :business_contact_number
19
+
20
+ # Full name of point of contact for this business
21
+ # @return [String]
22
+ attr_accessor :business_contact_person
23
+
24
+ # Legal name of business
25
+ # @return [String]
26
+ attr_accessor :business_legal_name
27
+
28
+ # A unique identifier and may be either a state tax ID number or a
29
+ # registered identification number
30
+ # @return [String]
31
+ attr_accessor :business_registration_number
32
+
33
+ # The name under which the business operates
34
+ # @return [String]
35
+ attr_accessor :doing_business_as
36
+
37
+ # 4 digit number used by to classify business by market segment
38
+ # @return [String]
39
+ attr_accessor :merchant_category_code
40
+
41
+ # Category of business
42
+ # @return [String]
43
+ attr_accessor :business_category
44
+
45
+ # Business website url
46
+ # @return [String]
47
+ attr_accessor :business_url
48
+
49
+ # A mapping from model property names to API property names.
50
+ def self.names
51
+ @_hash = {} if @_hash.nil?
52
+ @_hash['business_address'] = 'business-address'
53
+ @_hash['business_contact_number'] = 'business-contact-number'
54
+ @_hash['business_contact_person'] = 'business-contact-person'
55
+ @_hash['business_legal_name'] = 'business-legal-name'
56
+ @_hash['business_registration_number'] = 'business-registration-number'
57
+ @_hash['doing_business_as'] = 'doing-business-as'
58
+ @_hash['merchant_category_code'] = 'merchant-category-code'
59
+ @_hash['business_category'] = 'business-category'
60
+ @_hash['business_url'] = 'business-url'
61
+ @_hash
62
+ end
63
+
64
+ # An array for optional fields
65
+ def self.optionals
66
+ %w[
67
+ business_category
68
+ business_url
69
+ ]
70
+ end
71
+
72
+ # An array for nullable fields
73
+ def self.nullables
74
+ []
75
+ end
76
+
77
+ def initialize(business_address = nil, business_contact_number = nil,
78
+ business_contact_person = nil, business_legal_name = nil,
79
+ business_registration_number = nil, doing_business_as = nil,
80
+ merchant_category_code = nil, business_category = SKIP,
81
+ business_url = SKIP)
82
+ @business_address = business_address
83
+ @business_contact_number = business_contact_number
84
+ @business_contact_person = business_contact_person
85
+ @business_legal_name = business_legal_name
86
+ @business_registration_number = business_registration_number
87
+ @doing_business_as = doing_business_as
88
+ @merchant_category_code = merchant_category_code
89
+ @business_category = business_category unless business_category == SKIP
90
+ @business_url = business_url unless business_url == SKIP
91
+ end
92
+
93
+ # Creates an instance of the object from a hash.
94
+ def self.from_hash(hash)
95
+ return nil unless hash
96
+
97
+ # Extract variables from the hash.
98
+ business_address =
99
+ hash.key?('business-address') ? hash['business-address'] : nil
100
+ business_contact_number =
101
+ hash.key?('business-contact-number') ? hash['business-contact-number'] : nil
102
+ business_contact_person =
103
+ hash.key?('business-contact-person') ? hash['business-contact-person'] : nil
104
+ business_legal_name =
105
+ hash.key?('business-legal-name') ? hash['business-legal-name'] : nil
106
+ business_registration_number =
107
+ hash.key?('business-registration-number') ? hash['business-registration-number'] : nil
108
+ doing_business_as =
109
+ hash.key?('doing-business-as') ? hash['doing-business-as'] : nil
110
+ merchant_category_code =
111
+ hash.key?('merchant-category-code') ? hash['merchant-category-code'] : nil
112
+ business_category =
113
+ hash.key?('business-category') ? hash['business-category'] : SKIP
114
+ business_url = hash.key?('business-url') ? hash['business-url'] : SKIP
115
+
116
+ # Create object from extracted values.
117
+ BusinessDetails.new(business_address,
118
+ business_contact_number,
119
+ business_contact_person,
120
+ business_legal_name,
121
+ business_registration_number,
122
+ doing_business_as,
123
+ merchant_category_code,
124
+ business_category,
125
+ business_url)
126
+ end
127
+
128
+ def self.from_element(root)
129
+ business_address = XmlUtilities.from_element(root, 'business-address',
130
+ String)
131
+ business_contact_number = XmlUtilities.from_element(
132
+ root, 'business-contact-number', String
133
+ )
134
+ business_contact_person = XmlUtilities.from_element(
135
+ root, 'business-contact-person', String
136
+ )
137
+ business_legal_name = XmlUtilities.from_element(root,
138
+ 'business-legal-name',
139
+ String)
140
+ business_registration_number = XmlUtilities.from_element(
141
+ root, 'business-registration-number', String
142
+ )
143
+ doing_business_as = XmlUtilities.from_element(root, 'doing-business-as',
144
+ String)
145
+ merchant_category_code = XmlUtilities.from_element(
146
+ root, 'merchant-category-code', String
147
+ )
148
+ business_category = XmlUtilities.from_element(root, 'business-category',
149
+ String)
150
+ business_url = XmlUtilities.from_element(root, 'business-url', String)
151
+
152
+ new(business_address,
153
+ business_contact_number,
154
+ business_contact_person,
155
+ business_legal_name,
156
+ business_registration_number,
157
+ doing_business_as,
158
+ merchant_category_code,
159
+ business_category,
160
+ business_url)
161
+ end
162
+
163
+ def to_xml_element(doc, root_name)
164
+ root = doc.create_element(root_name)
165
+
166
+ XmlUtilities.add_as_subelement(doc, root, 'business-address',
167
+ business_address)
168
+ XmlUtilities.add_as_subelement(doc, root, 'business-contact-number',
169
+ business_contact_number)
170
+ XmlUtilities.add_as_subelement(doc, root, 'business-contact-person',
171
+ business_contact_person)
172
+ XmlUtilities.add_as_subelement(doc, root, 'business-legal-name',
173
+ business_legal_name)
174
+ XmlUtilities.add_as_subelement(doc, root, 'business-registration-number',
175
+ business_registration_number)
176
+ XmlUtilities.add_as_subelement(doc, root, 'doing-business-as',
177
+ doing_business_as)
178
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-category-code',
179
+ merchant_category_code)
180
+ XmlUtilities.add_as_subelement(doc, root, 'business-category',
181
+ business_category)
182
+ XmlUtilities.add_as_subelement(doc, root, 'business-url', business_url)
183
+
184
+ root
185
+ end
186
+
187
+ # Provides a human-readable string representation of the object.
188
+ def to_s
189
+ class_name = self.class.name.split('::').last
190
+ "<#{class_name} business_address: #{@business_address}, business_contact_number:"\
191
+ " #{@business_contact_number}, business_contact_person: #{@business_contact_person},"\
192
+ " business_legal_name: #{@business_legal_name}, business_registration_number:"\
193
+ " #{@business_registration_number}, doing_business_as: #{@doing_business_as},"\
194
+ " merchant_category_code: #{@merchant_category_code}, business_category:"\
195
+ " #{@business_category}, business_url: #{@business_url}>"
196
+ end
197
+
198
+ # Provides a debugging-friendly string with detailed object information.
199
+ def inspect
200
+ class_name = self.class.name.split('::').last
201
+ "<#{class_name} business_address: #{@business_address.inspect}, business_contact_number:"\
202
+ " #{@business_contact_number.inspect}, business_contact_person:"\
203
+ " #{@business_contact_person.inspect}, business_legal_name: #{@business_legal_name.inspect},"\
204
+ " business_registration_number: #{@business_registration_number.inspect}, doing_business_as:"\
205
+ " #{@doing_business_as.inspect}, merchant_category_code: #{@merchant_category_code.inspect},"\
206
+ " business_category: #{@business_category.inspect}, business_url: #{@business_url.inspect}>"
207
+ end
208
+ end
209
+ end
@@ -0,0 +1,123 @@
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
+ # 'cancel-optin' Request - General Parameters
8
+ class CancelOptinRequest < 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
+ # Merchant-assigned unique opt-in ID.
23
+ # @return [String]
24
+ attr_accessor :merchant_optin_id
25
+
26
+ # Boku-assigned unique opt-in ID for the consumer.
27
+ # @return [String]
28
+ attr_accessor :optin_id
29
+
30
+ # A mapping from model property names to API property names.
31
+ def self.names
32
+ @_hash = {} if @_hash.nil?
33
+ @_hash['merchant_id'] = 'merchant-id'
34
+ @_hash['merchant_request_id'] = 'merchant-request-id'
35
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
36
+ @_hash['optin_id'] = 'optin-id'
37
+ @_hash
38
+ end
39
+
40
+ # An array for optional fields
41
+ def self.optionals
42
+ %w[
43
+ merchant_optin_id
44
+ optin_id
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(merchant_id = nil, merchant_request_id = nil,
54
+ merchant_optin_id = SKIP, optin_id = SKIP)
55
+ @merchant_id = merchant_id
56
+ @merchant_request_id = merchant_request_id
57
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
58
+ @optin_id = optin_id unless optin_id == SKIP
59
+ end
60
+
61
+ # Creates an instance of the object from a hash.
62
+ def self.from_hash(hash)
63
+ return nil unless hash
64
+
65
+ # Extract variables from the hash.
66
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
67
+ merchant_request_id =
68
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
69
+ merchant_optin_id =
70
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
71
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
72
+
73
+ # Create object from extracted values.
74
+ CancelOptinRequest.new(merchant_id,
75
+ merchant_request_id,
76
+ merchant_optin_id,
77
+ optin_id)
78
+ end
79
+
80
+ def self.from_element(root)
81
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
82
+ merchant_request_id = XmlUtilities.from_element(root,
83
+ 'merchant-request-id',
84
+ String)
85
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
86
+ String)
87
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
88
+
89
+ new(merchant_id,
90
+ merchant_request_id,
91
+ merchant_optin_id,
92
+ optin_id)
93
+ end
94
+
95
+ def to_xml_element(doc, root_name)
96
+ root = doc.create_element(root_name)
97
+
98
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
99
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
100
+ merchant_request_id)
101
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
102
+ merchant_optin_id)
103
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
104
+
105
+ root
106
+ end
107
+
108
+ # Provides a human-readable string representation of the object.
109
+ def to_s
110
+ class_name = self.class.name.split('::').last
111
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
112
+ " merchant_optin_id: #{@merchant_optin_id}, optin_id: #{@optin_id}>"
113
+ end
114
+
115
+ # Provides a debugging-friendly string with detailed object information.
116
+ def inspect
117
+ class_name = self.class.name.split('::').last
118
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
119
+ " #{@merchant_request_id.inspect}, merchant_optin_id: #{@merchant_optin_id.inspect},"\
120
+ " optin_id: #{@optin_id.inspect}>"
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,143 @@
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
+ # 'cancel-optin' Response - General Elements
8
+ class CancelOptinResponse < 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 request ID.
17
+ # @return [String]
18
+ attr_accessor :merchant_request_id
19
+
20
+ # Boku-assigned unique opt-in ID for the consumer.
21
+ # @return [String]
22
+ attr_accessor :optin_id
23
+
24
+ # The 'result' element is defined in every response type. It is used to
25
+ # convey the outcome of an API request.
26
+ # @return [Result]
27
+ attr_accessor :result
28
+
29
+ # Gives the state of the opt-in at the time this response was returned
30
+ # @return [OptinState]
31
+ attr_accessor :optin_state
32
+
33
+ # Specifies which method to use to perform the opt-in.
34
+ # @return [OptinTypeEnum]
35
+ attr_accessor :optin_type
36
+
37
+ # A mapping from model property names to API property names.
38
+ def self.names
39
+ @_hash = {} if @_hash.nil?
40
+ @_hash['merchant_id'] = 'merchant-id'
41
+ @_hash['merchant_request_id'] = 'merchant-request-id'
42
+ @_hash['optin_id'] = 'optin-id'
43
+ @_hash['result'] = 'result'
44
+ @_hash['optin_state'] = 'optin-state'
45
+ @_hash['optin_type'] = 'optin-type'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ %w[
52
+ optin_state
53
+ optin_type
54
+ ]
55
+ end
56
+
57
+ # An array for nullable fields
58
+ def self.nullables
59
+ []
60
+ end
61
+
62
+ def initialize(merchant_id = nil, merchant_request_id = nil, optin_id = nil,
63
+ result = nil, optin_state = SKIP, optin_type = SKIP)
64
+ @merchant_id = merchant_id
65
+ @merchant_request_id = merchant_request_id
66
+ @optin_id = optin_id
67
+ @result = result
68
+ @optin_state = optin_state unless optin_state == SKIP
69
+ @optin_type = optin_type unless optin_type == SKIP
70
+ end
71
+
72
+ # Creates an instance of the object from a hash.
73
+ def self.from_hash(hash)
74
+ return nil unless hash
75
+
76
+ # Extract variables from the hash.
77
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
78
+ merchant_request_id =
79
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
80
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : nil
81
+ result = Result.from_hash(hash['result']) if hash['result']
82
+ optin_state = OptinState.from_hash(hash['optin-state']) if hash['optin-state']
83
+ optin_type = hash.key?('optin-type') ? hash['optin-type'] : SKIP
84
+
85
+ # Create object from extracted values.
86
+ CancelOptinResponse.new(merchant_id,
87
+ merchant_request_id,
88
+ optin_id,
89
+ result,
90
+ optin_state,
91
+ optin_type)
92
+ end
93
+
94
+ def self.from_element(root)
95
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
96
+ merchant_request_id = XmlUtilities.from_element(root,
97
+ 'merchant-request-id',
98
+ String)
99
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
100
+ result = XmlUtilities.from_element(root, 'result', Result)
101
+ optin_state = XmlUtilities.from_element(root, 'optin-state', OptinState)
102
+ optin_type = XmlUtilities.from_element(root, 'optin-type', String)
103
+
104
+ new(merchant_id,
105
+ merchant_request_id,
106
+ optin_id,
107
+ result,
108
+ optin_state,
109
+ optin_type)
110
+ end
111
+
112
+ def to_xml_element(doc, root_name)
113
+ root = doc.create_element(root_name)
114
+
115
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
116
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
117
+ merchant_request_id)
118
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
119
+ XmlUtilities.add_as_subelement(doc, root, 'result', result)
120
+ XmlUtilities.add_as_subelement(doc, root, 'optin-state', optin_state)
121
+ XmlUtilities.add_as_subelement(doc, root, 'optin-type', optin_type)
122
+
123
+ root
124
+ end
125
+
126
+ # Provides a human-readable string representation of the object.
127
+ def to_s
128
+ class_name = self.class.name.split('::').last
129
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
130
+ " optin_id: #{@optin_id}, result: #{@result}, optin_state: #{@optin_state}, optin_type:"\
131
+ " #{@optin_type}>"
132
+ end
133
+
134
+ # Provides a debugging-friendly string with detailed object information.
135
+ def inspect
136
+ class_name = self.class.name.split('::').last
137
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
138
+ " #{@merchant_request_id.inspect}, optin_id: #{@optin_id.inspect}, result:"\
139
+ " #{@result.inspect}, optin_state: #{@optin_state.inspect}, optin_type:"\
140
+ " #{@optin_type.inspect}>"
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,82 @@
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
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
8
+ # generic usage of our payment product. Please disregard unless otherwise
9
+ # directed to include in your integration.** Indicates that this network
10
+ # supports some kind of "carrier gateway" based opt-in verification, and gives
11
+ # instructions on how to do so.
12
+ class CarrierGw < BaseModel
13
+ SKIP = Object.new
14
+ private_constant :SKIP
15
+
16
+ # Describes a HTTP call to be made from the client device via cellular data
17
+ # network as part of the opt-in.
18
+ # If absent from an optin-info carrier-gw element, indicates that though
19
+ # carrier-gw is supported, the URL must be generated on a per-request basis
20
+ # via a call to `optin`.
21
+ # @return [ClientCall]
22
+ attr_accessor :client_call
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['client_call'] = 'client-call'
28
+ @_hash
29
+ end
30
+
31
+ # An array for optional fields
32
+ def self.optionals
33
+ []
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(client_call = nil)
42
+ @client_call = client_call
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
+ client_call = ClientCall.from_hash(hash['client-call']) if hash['client-call']
51
+
52
+ # Create object from extracted values.
53
+ CarrierGw.new(client_call)
54
+ end
55
+
56
+ def self.from_element(root)
57
+ client_call = XmlUtilities.from_element(root, 'ClientCall', ClientCall)
58
+
59
+ new(client_call)
60
+ end
61
+
62
+ def to_xml_element(doc, root_name)
63
+ root = doc.create_element(root_name)
64
+
65
+ XmlUtilities.add_as_subelement(doc, root, 'ClientCall', client_call)
66
+
67
+ root
68
+ end
69
+
70
+ # Provides a human-readable string representation of the object.
71
+ def to_s
72
+ class_name = self.class.name.split('::').last
73
+ "<#{class_name} client_call: #{@client_call}>"
74
+ end
75
+
76
+ # Provides a debugging-friendly string with detailed object information.
77
+ def inspect
78
+ class_name = self.class.name.split('::').last
79
+ "<#{class_name} client_call: #{@client_call.inspect}>"
80
+ end
81
+ end
82
+ end