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,141 @@
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
+ # 'confirm-optin' Request - General Parameters
8
+ class ConfirmOptinRequest < 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.
27
+ # @return [String]
28
+ attr_accessor :optin_id
29
+
30
+ # The merchant-assigned ID used as 'merchant-request-id' in the original
31
+ # opt-in call.
32
+ # @return [String]
33
+ attr_accessor :optin_request_id
34
+
35
+ # A mapping from model property names to API property names.
36
+ def self.names
37
+ @_hash = {} if @_hash.nil?
38
+ @_hash['merchant_id'] = 'merchant-id'
39
+ @_hash['merchant_request_id'] = 'merchant-request-id'
40
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
41
+ @_hash['optin_id'] = 'optin-id'
42
+ @_hash['optin_request_id'] = 'optin-request-id'
43
+ @_hash
44
+ end
45
+
46
+ # An array for optional fields
47
+ def self.optionals
48
+ %w[
49
+ merchant_optin_id
50
+ optin_id
51
+ optin_request_id
52
+ ]
53
+ end
54
+
55
+ # An array for nullable fields
56
+ def self.nullables
57
+ []
58
+ end
59
+
60
+ def initialize(merchant_id = nil, merchant_request_id = nil,
61
+ merchant_optin_id = SKIP, optin_id = SKIP,
62
+ optin_request_id = SKIP)
63
+ @merchant_id = merchant_id
64
+ @merchant_request_id = merchant_request_id
65
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
66
+ @optin_id = optin_id unless optin_id == SKIP
67
+ @optin_request_id = optin_request_id unless optin_request_id == SKIP
68
+ end
69
+
70
+ # Creates an instance of the object from a hash.
71
+ def self.from_hash(hash)
72
+ return nil unless hash
73
+
74
+ # Extract variables from the hash.
75
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
76
+ merchant_request_id =
77
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
78
+ merchant_optin_id =
79
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
80
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
81
+ optin_request_id =
82
+ hash.key?('optin-request-id') ? hash['optin-request-id'] : SKIP
83
+
84
+ # Create object from extracted values.
85
+ ConfirmOptinRequest.new(merchant_id,
86
+ merchant_request_id,
87
+ merchant_optin_id,
88
+ optin_id,
89
+ optin_request_id)
90
+ end
91
+
92
+ def self.from_element(root)
93
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
94
+ merchant_request_id = XmlUtilities.from_element(root,
95
+ 'merchant-request-id',
96
+ String)
97
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
98
+ String)
99
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
100
+ optin_request_id = XmlUtilities.from_element(root, 'optin-request-id',
101
+ String)
102
+
103
+ new(merchant_id,
104
+ merchant_request_id,
105
+ merchant_optin_id,
106
+ optin_id,
107
+ optin_request_id)
108
+ end
109
+
110
+ def to_xml_element(doc, root_name)
111
+ root = doc.create_element(root_name)
112
+
113
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
114
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
115
+ merchant_request_id)
116
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
117
+ merchant_optin_id)
118
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
119
+ XmlUtilities.add_as_subelement(doc, root, 'optin-request-id',
120
+ optin_request_id)
121
+
122
+ root
123
+ end
124
+
125
+ # Provides a human-readable string representation of the object.
126
+ def to_s
127
+ class_name = self.class.name.split('::').last
128
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
129
+ " merchant_optin_id: #{@merchant_optin_id}, optin_id: #{@optin_id}, optin_request_id:"\
130
+ " #{@optin_request_id}>"
131
+ end
132
+
133
+ # Provides a debugging-friendly string with detailed object information.
134
+ def inspect
135
+ class_name = self.class.name.split('::').last
136
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
137
+ " #{@merchant_request_id.inspect}, merchant_optin_id: #{@merchant_optin_id.inspect},"\
138
+ " optin_id: #{@optin_id.inspect}, optin_request_id: #{@optin_request_id.inspect}>"
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,211 @@
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
+ # 'confirm-optin' Response - General Elements
8
+ class ConfirmOptinResponse < 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
+ # Specifies which method to use to perform the opt-in.
21
+ # @return [OptinTypeEnum]
22
+ attr_accessor :optin_type
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
+ # **DISCLAIMER: This API or element is use-case specific and not needed for
30
+ # generic usage of
31
+ # our payment product. Please disregard unless otherwise directed to include
32
+ # in your integration.**
33
+ # Returned if result.status == OK and the include-account-profile flag in
34
+ # the request is not explicitly set to false.
35
+ # @return [AccountProfile]
36
+ attr_accessor :account_profile
37
+
38
+ # Boku-assigned unique opt-in ID.
39
+ # @return [String]
40
+ attr_accessor :optin_id
41
+
42
+ # The merchant-assigned ID used as 'merchant-request-id' in the original
43
+ # opt-in call.
44
+ # @return [String]
45
+ attr_accessor :optin_request_id
46
+
47
+ # Gives the state of the opt-in at the time this response was returned
48
+ # @return [OptinState]
49
+ attr_accessor :optin_state
50
+
51
+ # The payment method selected.
52
+ # @return [String]
53
+ attr_accessor :payment_method
54
+
55
+ # Time the request was received ('YYYY-MM-DD hh:mm:ss')
56
+ # All timestamps are in UTC.
57
+ # @return [String]
58
+ attr_accessor :timestamp
59
+
60
+ # A mapping from model property names to API property names.
61
+ def self.names
62
+ @_hash = {} if @_hash.nil?
63
+ @_hash['merchant_id'] = 'merchant-id'
64
+ @_hash['merchant_request_id'] = 'merchant-request-id'
65
+ @_hash['optin_type'] = 'optin-type'
66
+ @_hash['result'] = 'result'
67
+ @_hash['account_profile'] = 'account-profile'
68
+ @_hash['optin_id'] = 'optin-id'
69
+ @_hash['optin_request_id'] = 'optin-request-id'
70
+ @_hash['optin_state'] = 'optin-state'
71
+ @_hash['payment_method'] = 'payment-method'
72
+ @_hash['timestamp'] = 'timestamp'
73
+ @_hash
74
+ end
75
+
76
+ # An array for optional fields
77
+ def self.optionals
78
+ %w[
79
+ account_profile
80
+ optin_id
81
+ optin_request_id
82
+ optin_state
83
+ payment_method
84
+ timestamp
85
+ ]
86
+ end
87
+
88
+ # An array for nullable fields
89
+ def self.nullables
90
+ []
91
+ end
92
+
93
+ def initialize(merchant_id = nil, merchant_request_id = nil,
94
+ optin_type = nil, result = nil, account_profile = SKIP,
95
+ optin_id = SKIP, optin_request_id = SKIP, optin_state = SKIP,
96
+ payment_method = SKIP, timestamp = SKIP)
97
+ @merchant_id = merchant_id
98
+ @merchant_request_id = merchant_request_id
99
+ @optin_type = optin_type
100
+ @result = result
101
+ @account_profile = account_profile unless account_profile == SKIP
102
+ @optin_id = optin_id unless optin_id == SKIP
103
+ @optin_request_id = optin_request_id unless optin_request_id == SKIP
104
+ @optin_state = optin_state unless optin_state == SKIP
105
+ @payment_method = payment_method unless payment_method == SKIP
106
+ @timestamp = timestamp unless timestamp == SKIP
107
+ end
108
+
109
+ # Creates an instance of the object from a hash.
110
+ def self.from_hash(hash)
111
+ return nil unless hash
112
+
113
+ # Extract variables from the hash.
114
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
115
+ merchant_request_id =
116
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
117
+ optin_type = hash.key?('optin-type') ? hash['optin-type'] : nil
118
+ result = Result.from_hash(hash['result']) if hash['result']
119
+ account_profile = AccountProfile.from_hash(hash['account-profile']) if
120
+ hash['account-profile']
121
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
122
+ optin_request_id =
123
+ hash.key?('optin-request-id') ? hash['optin-request-id'] : SKIP
124
+ optin_state = OptinState.from_hash(hash['optin-state']) if hash['optin-state']
125
+ payment_method =
126
+ hash.key?('payment-method') ? hash['payment-method'] : SKIP
127
+ timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
128
+
129
+ # Create object from extracted values.
130
+ ConfirmOptinResponse.new(merchant_id,
131
+ merchant_request_id,
132
+ optin_type,
133
+ result,
134
+ account_profile,
135
+ optin_id,
136
+ optin_request_id,
137
+ optin_state,
138
+ payment_method,
139
+ timestamp)
140
+ end
141
+
142
+ def self.from_element(root)
143
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
144
+ merchant_request_id = XmlUtilities.from_element(root,
145
+ 'merchant-request-id',
146
+ String)
147
+ optin_type = XmlUtilities.from_element(root, 'optin-type', String)
148
+ result = XmlUtilities.from_element(root, 'result', Result)
149
+ account_profile = XmlUtilities.from_element(root, 'AccountProfile',
150
+ AccountProfile)
151
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
152
+ optin_request_id = XmlUtilities.from_element(root, 'optin-request-id',
153
+ String)
154
+ optin_state = XmlUtilities.from_element(root, 'optin-state', OptinState)
155
+ payment_method = XmlUtilities.from_element(root, 'payment-method', String)
156
+ timestamp = XmlUtilities.from_element(root, 'timestamp', String)
157
+
158
+ new(merchant_id,
159
+ merchant_request_id,
160
+ optin_type,
161
+ result,
162
+ account_profile,
163
+ optin_id,
164
+ optin_request_id,
165
+ optin_state,
166
+ payment_method,
167
+ timestamp)
168
+ end
169
+
170
+ def to_xml_element(doc, root_name)
171
+ root = doc.create_element(root_name)
172
+
173
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
174
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
175
+ merchant_request_id)
176
+ XmlUtilities.add_as_subelement(doc, root, 'optin-type', optin_type)
177
+ XmlUtilities.add_as_subelement(doc, root, 'result', result)
178
+ XmlUtilities.add_as_subelement(doc, root, 'AccountProfile',
179
+ account_profile)
180
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
181
+ XmlUtilities.add_as_subelement(doc, root, 'optin-request-id',
182
+ optin_request_id)
183
+ XmlUtilities.add_as_subelement(doc, root, 'optin-state', optin_state)
184
+ XmlUtilities.add_as_subelement(doc, root, 'payment-method',
185
+ payment_method)
186
+ XmlUtilities.add_as_subelement(doc, root, 'timestamp', timestamp)
187
+
188
+ root
189
+ end
190
+
191
+ # Provides a human-readable string representation of the object.
192
+ def to_s
193
+ class_name = self.class.name.split('::').last
194
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
195
+ " optin_type: #{@optin_type}, result: #{@result}, account_profile: #{@account_profile},"\
196
+ " optin_id: #{@optin_id}, optin_request_id: #{@optin_request_id}, optin_state:"\
197
+ " #{@optin_state}, payment_method: #{@payment_method}, timestamp: #{@timestamp}>"
198
+ end
199
+
200
+ # Provides a debugging-friendly string with detailed object information.
201
+ def inspect
202
+ class_name = self.class.name.split('::').last
203
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
204
+ " #{@merchant_request_id.inspect}, optin_type: #{@optin_type.inspect}, result:"\
205
+ " #{@result.inspect}, account_profile: #{@account_profile.inspect}, optin_id:"\
206
+ " #{@optin_id.inspect}, optin_request_id: #{@optin_request_id.inspect}, optin_state:"\
207
+ " #{@optin_state.inspect}, payment_method: #{@payment_method.inspect}, timestamp:"\
208
+ " #{@timestamp.inspect}>"
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,161 @@
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
+ # 'confirm-verify-device' Request - General Parameters
8
+ class ConfirmVerifyDeviceRequest < 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
+ # One-time PIN entered by the consumer. Minimum 4 characters.
21
+ # @return [String]
22
+ attr_accessor :otp
23
+
24
+ # Boku-assigned device verification session ID.
25
+ # @return [Integer]
26
+ attr_accessor :verify_session_id
27
+
28
+ # ISO 3166-1 alpha-2 country code.
29
+ # @return [String]
30
+ attr_accessor :country
31
+
32
+ # Merchant-assigned unique opt-in ID.
33
+ # @return [String]
34
+ attr_accessor :merchant_optin_id
35
+
36
+ # Boku-assigned consumer opt-in ID.
37
+ # @return [String]
38
+ attr_accessor :optin_id
39
+
40
+ # A mapping from model property names to API property names.
41
+ def self.names
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['merchant_id'] = 'merchant-id'
44
+ @_hash['merchant_request_id'] = 'merchant-request-id'
45
+ @_hash['otp'] = 'otp'
46
+ @_hash['verify_session_id'] = 'verify-session-id'
47
+ @_hash['country'] = 'country'
48
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
49
+ @_hash['optin_id'] = 'optin-id'
50
+ @_hash
51
+ end
52
+
53
+ # An array for optional fields
54
+ def self.optionals
55
+ %w[
56
+ country
57
+ merchant_optin_id
58
+ optin_id
59
+ ]
60
+ end
61
+
62
+ # An array for nullable fields
63
+ def self.nullables
64
+ []
65
+ end
66
+
67
+ def initialize(merchant_id = nil, merchant_request_id = nil, otp = nil,
68
+ verify_session_id = nil, country = SKIP,
69
+ merchant_optin_id = SKIP, optin_id = SKIP)
70
+ @merchant_id = merchant_id
71
+ @merchant_request_id = merchant_request_id
72
+ @otp = otp
73
+ @verify_session_id = verify_session_id
74
+ @country = country unless country == SKIP
75
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
76
+ @optin_id = optin_id unless optin_id == SKIP
77
+ end
78
+
79
+ # Creates an instance of the object from a hash.
80
+ def self.from_hash(hash)
81
+ return nil unless hash
82
+
83
+ # Extract variables from the hash.
84
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
85
+ merchant_request_id =
86
+ hash.key?('merchant-request-id') ? hash['merchant-request-id'] : nil
87
+ otp = hash.key?('otp') ? hash['otp'] : nil
88
+ verify_session_id =
89
+ hash.key?('verify-session-id') ? hash['verify-session-id'] : nil
90
+ country = hash.key?('country') ? hash['country'] : SKIP
91
+ merchant_optin_id =
92
+ hash.key?('merchant-optin-id') ? hash['merchant-optin-id'] : SKIP
93
+ optin_id = hash.key?('optin-id') ? hash['optin-id'] : SKIP
94
+
95
+ # Create object from extracted values.
96
+ ConfirmVerifyDeviceRequest.new(merchant_id,
97
+ merchant_request_id,
98
+ otp,
99
+ verify_session_id,
100
+ country,
101
+ merchant_optin_id,
102
+ optin_id)
103
+ end
104
+
105
+ def self.from_element(root)
106
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
107
+ merchant_request_id = XmlUtilities.from_element(root,
108
+ 'merchant-request-id',
109
+ String)
110
+ otp = XmlUtilities.from_element(root, 'otp', String)
111
+ verify_session_id = XmlUtilities.from_element(root, 'verify-session-id',
112
+ Integer)
113
+ country = XmlUtilities.from_element(root, 'country', String)
114
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
115
+ String)
116
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
117
+
118
+ new(merchant_id,
119
+ merchant_request_id,
120
+ otp,
121
+ verify_session_id,
122
+ country,
123
+ merchant_optin_id,
124
+ optin_id)
125
+ end
126
+
127
+ def to_xml_element(doc, root_name)
128
+ root = doc.create_element(root_name)
129
+
130
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
131
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-request-id',
132
+ merchant_request_id)
133
+ XmlUtilities.add_as_subelement(doc, root, 'otp', otp)
134
+ XmlUtilities.add_as_subelement(doc, root, 'verify-session-id',
135
+ verify_session_id)
136
+ XmlUtilities.add_as_subelement(doc, root, 'country', country)
137
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
138
+ merchant_optin_id)
139
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
140
+
141
+ root
142
+ end
143
+
144
+ # Provides a human-readable string representation of the object.
145
+ def to_s
146
+ class_name = self.class.name.split('::').last
147
+ "<#{class_name} merchant_id: #{@merchant_id}, merchant_request_id: #{@merchant_request_id},"\
148
+ " otp: #{@otp}, verify_session_id: #{@verify_session_id}, country: #{@country},"\
149
+ " merchant_optin_id: #{@merchant_optin_id}, optin_id: #{@optin_id}>"
150
+ end
151
+
152
+ # Provides a debugging-friendly string with detailed object information.
153
+ def inspect
154
+ class_name = self.class.name.split('::').last
155
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, merchant_request_id:"\
156
+ " #{@merchant_request_id.inspect}, otp: #{@otp.inspect}, verify_session_id:"\
157
+ " #{@verify_session_id.inspect}, country: #{@country.inspect}, merchant_optin_id:"\
158
+ " #{@merchant_optin_id.inspect}, optin_id: #{@optin_id.inspect}>"
159
+ end
160
+ end
161
+ 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
+ # 'confirm-verify-device' Response - General Elements
8
+ class ConfirmVerifyDeviceResponse < 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
+ ConfirmVerifyDeviceResponse.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,40 @@
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
+ # Eligibility status of the consumer. Provided if result.status == OK.
8
+ class EligibilityStatusEnum
9
+ ELIGIBILITY_STATUS_ENUM = [
10
+ # TODO: Write general description for ELIGIBLE
11
+ ELIGIBLE = 'eligible'.freeze,
12
+
13
+ # TODO: Write general description for NOTELIGIBLE
14
+ NOTELIGIBLE = 'not-eligible'.freeze,
15
+
16
+ # TODO: Write general description for NOTFOUND
17
+ NOTFOUND = 'not-found'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ ELIGIBILITY_STATUS_ENUM.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = ELIGIBLE)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'eligible' then ELIGIBLE
33
+ when 'noteligible' then NOTELIGIBLE
34
+ when 'notfound' then NOTFOUND
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ end