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,97 @@
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
+ # ForexRequest Model.
8
+ class ForexRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Source ISO 4217 three-letter currency code.
13
+ # @return [String]
14
+ attr_accessor :from
15
+
16
+ # Boku-assigned merchant ID.
17
+ # @return [String]
18
+ attr_accessor :merchant_id
19
+
20
+ # Destination ISO 4217 three-letter currency code.
21
+ # @return [String]
22
+ attr_accessor :to
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['from'] = 'from'
28
+ @_hash['merchant_id'] = 'merchant-id'
29
+ @_hash['to'] = 'to'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ []
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(from = nil, merchant_id = nil, to = nil)
44
+ @from = from
45
+ @merchant_id = merchant_id
46
+ @to = to
47
+ end
48
+
49
+ # Creates an instance of the object from a hash.
50
+ def self.from_hash(hash)
51
+ return nil unless hash
52
+
53
+ # Extract variables from the hash.
54
+ from = hash.key?('from') ? hash['from'] : nil
55
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
56
+ to = hash.key?('to') ? hash['to'] : nil
57
+
58
+ # Create object from extracted values.
59
+ ForexRequest.new(from,
60
+ merchant_id,
61
+ to)
62
+ end
63
+
64
+ def self.from_element(root)
65
+ from = XmlUtilities.from_element(root, 'from', String)
66
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
67
+ to = XmlUtilities.from_element(root, 'to', String)
68
+
69
+ new(from,
70
+ merchant_id,
71
+ to)
72
+ end
73
+
74
+ def to_xml_element(doc, root_name)
75
+ root = doc.create_element(root_name)
76
+
77
+ XmlUtilities.add_as_subelement(doc, root, 'from', from)
78
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
79
+ XmlUtilities.add_as_subelement(doc, root, 'to', to)
80
+
81
+ root
82
+ end
83
+
84
+ # Provides a human-readable string representation of the object.
85
+ def to_s
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} from: #{@from}, merchant_id: #{@merchant_id}, to: #{@to}>"
88
+ end
89
+
90
+ # Provides a debugging-friendly string with detailed object information.
91
+ def inspect
92
+ class_name = self.class.name.split('::').last
93
+ "<#{class_name} from: #{@from.inspect}, merchant_id: #{@merchant_id.inspect}, to:"\
94
+ " #{@to.inspect}>"
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,127 @@
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
+ # ForexResponse Model.
8
+ class ForexResponse < 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
+ # The 'result' element is defined in every response type. It is used to
17
+ # convey the outcome of an API request.
18
+ # @return [Result]
19
+ attr_accessor :result
20
+
21
+ # Latest available foreign exchange rate between source and destination
22
+ # currency.
23
+ # @return [Float]
24
+ attr_accessor :exchange_rate
25
+
26
+ # Source ISO 4217 three-letter currency code.
27
+ # @return [String]
28
+ attr_accessor :from
29
+
30
+ # Destination ISO 4217 three-letter currency code.
31
+ # @return [String]
32
+ attr_accessor :to
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['result'] = 'result'
39
+ @_hash['exchange_rate'] = 'exchange-rate'
40
+ @_hash['from'] = 'from'
41
+ @_hash['to'] = 'to'
42
+ @_hash
43
+ end
44
+
45
+ # An array for optional fields
46
+ def self.optionals
47
+ %w[
48
+ exchange_rate
49
+ from
50
+ to
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(merchant_id = nil, result = nil, exchange_rate = SKIP,
60
+ from = SKIP, to = SKIP)
61
+ @merchant_id = merchant_id
62
+ @result = result
63
+ @exchange_rate = exchange_rate unless exchange_rate == SKIP
64
+ @from = from unless from == SKIP
65
+ @to = to unless to == 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
+ result = Result.from_hash(hash['result']) if hash['result']
75
+ exchange_rate = hash.key?('exchange-rate') ? hash['exchange-rate'] : SKIP
76
+ from = hash.key?('from') ? hash['from'] : SKIP
77
+ to = hash.key?('to') ? hash['to'] : SKIP
78
+
79
+ # Create object from extracted values.
80
+ ForexResponse.new(merchant_id,
81
+ result,
82
+ exchange_rate,
83
+ from,
84
+ to)
85
+ end
86
+
87
+ def self.from_element(root)
88
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
89
+ result = XmlUtilities.from_element(root, 'result', Result)
90
+ exchange_rate = XmlUtilities.from_element(root, 'exchange-rate', Float)
91
+ from = XmlUtilities.from_element(root, 'from', String)
92
+ to = XmlUtilities.from_element(root, 'to', String)
93
+
94
+ new(merchant_id,
95
+ result,
96
+ exchange_rate,
97
+ from,
98
+ to)
99
+ end
100
+
101
+ def to_xml_element(doc, root_name)
102
+ root = doc.create_element(root_name)
103
+
104
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
105
+ XmlUtilities.add_as_subelement(doc, root, 'result', result)
106
+ XmlUtilities.add_as_subelement(doc, root, 'exchange-rate', exchange_rate)
107
+ XmlUtilities.add_as_subelement(doc, root, 'from', from)
108
+ XmlUtilities.add_as_subelement(doc, root, 'to', to)
109
+
110
+ root
111
+ end
112
+
113
+ # Provides a human-readable string representation of the object.
114
+ def to_s
115
+ class_name = self.class.name.split('::').last
116
+ "<#{class_name} merchant_id: #{@merchant_id}, result: #{@result}, exchange_rate:"\
117
+ " #{@exchange_rate}, from: #{@from}, to: #{@to}>"
118
+ end
119
+
120
+ # Provides a debugging-friendly string with detailed object information.
121
+ def inspect
122
+ class_name = self.class.name.split('::').last
123
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, result: #{@result.inspect},"\
124
+ " exchange_rate: #{@exchange_rate.inspect}, from: #{@from.inspect}, to: #{@to.inspect}>"
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,132 @@
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.** 'fund-check' Request - General
10
+ # Parameters
11
+ class FundCheckRequest < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Amount to be charged in the next charge request, against which the fund
16
+ # check is performed.
17
+ # @return [Float]
18
+ attr_accessor :amount
19
+
20
+ # ISO 4217 three-letter currency code.
21
+ # @return [String]
22
+ attr_accessor :currency
23
+
24
+ # Boku-assigned merchant ID.
25
+ # @return [String]
26
+ attr_accessor :merchant_id
27
+
28
+ # Merchant-assigned unique opt-in ID.
29
+ # @return [String]
30
+ attr_accessor :merchant_optin_id
31
+
32
+ # Boku-assigned unique opt-in ID.
33
+ # @return [String]
34
+ attr_accessor :optin_id
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['amount'] = 'amount'
40
+ @_hash['currency'] = 'currency'
41
+ @_hash['merchant_id'] = 'merchant-id'
42
+ @_hash['merchant_optin_id'] = 'merchant-optin-id'
43
+ @_hash['optin_id'] = 'optin-id'
44
+ @_hash
45
+ end
46
+
47
+ # An array for optional fields
48
+ def self.optionals
49
+ %w[
50
+ merchant_optin_id
51
+ optin_id
52
+ ]
53
+ end
54
+
55
+ # An array for nullable fields
56
+ def self.nullables
57
+ []
58
+ end
59
+
60
+ def initialize(amount = nil, currency = nil, merchant_id = nil,
61
+ merchant_optin_id = SKIP, optin_id = SKIP)
62
+ @amount = amount
63
+ @currency = currency
64
+ @merchant_id = merchant_id
65
+ @merchant_optin_id = merchant_optin_id unless merchant_optin_id == SKIP
66
+ @optin_id = optin_id unless optin_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
+ amount = hash.key?('amount') ? hash['amount'] : nil
75
+ currency = hash.key?('currency') ? hash['currency'] : nil
76
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
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
+ FundCheckRequest.new(amount,
83
+ currency,
84
+ merchant_id,
85
+ merchant_optin_id,
86
+ optin_id)
87
+ end
88
+
89
+ def self.from_element(root)
90
+ amount = XmlUtilities.from_element(root, 'amount', Float)
91
+ currency = XmlUtilities.from_element(root, 'currency', String)
92
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
93
+ merchant_optin_id = XmlUtilities.from_element(root, 'merchant-optin-id',
94
+ String)
95
+ optin_id = XmlUtilities.from_element(root, 'optin-id', String)
96
+
97
+ new(amount,
98
+ currency,
99
+ merchant_id,
100
+ merchant_optin_id,
101
+ optin_id)
102
+ end
103
+
104
+ def to_xml_element(doc, root_name)
105
+ root = doc.create_element(root_name)
106
+
107
+ XmlUtilities.add_as_subelement(doc, root, 'amount', amount)
108
+ XmlUtilities.add_as_subelement(doc, root, 'currency', currency)
109
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
110
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-optin-id',
111
+ merchant_optin_id)
112
+ XmlUtilities.add_as_subelement(doc, root, 'optin-id', optin_id)
113
+
114
+ root
115
+ end
116
+
117
+ # Provides a human-readable string representation of the object.
118
+ def to_s
119
+ class_name = self.class.name.split('::').last
120
+ "<#{class_name} amount: #{@amount}, currency: #{@currency}, merchant_id: #{@merchant_id},"\
121
+ " merchant_optin_id: #{@merchant_optin_id}, optin_id: #{@optin_id}>"
122
+ end
123
+
124
+ # Provides a debugging-friendly string with detailed object information.
125
+ def inspect
126
+ class_name = self.class.name.split('::').last
127
+ "<#{class_name} amount: #{@amount.inspect}, currency: #{@currency.inspect}, merchant_id:"\
128
+ " #{@merchant_id.inspect}, merchant_optin_id: #{@merchant_optin_id.inspect}, optin_id:"\
129
+ " #{@optin_id.inspect}>"
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,89 @@
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.** 'fund-check' Response - General
10
+ # Parameters
11
+ class FundCheckResponse < BaseModel
12
+ SKIP = Object.new
13
+ private_constant :SKIP
14
+
15
+ # Boku-assigned merchant ID.
16
+ # @return [String]
17
+ attr_accessor :merchant_id
18
+
19
+ # The 'result' element is defined in every response type. It is used to
20
+ # convey the outcome of an API request.
21
+ # @return [Result]
22
+ attr_accessor :result
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['merchant_id'] = 'merchant-id'
28
+ @_hash['result'] = 'result'
29
+ @_hash
30
+ end
31
+
32
+ # An array for optional fields
33
+ def self.optionals
34
+ []
35
+ end
36
+
37
+ # An array for nullable fields
38
+ def self.nullables
39
+ []
40
+ end
41
+
42
+ def initialize(merchant_id = nil, result = nil)
43
+ @merchant_id = merchant_id
44
+ @result = result
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ merchant_id = hash.key?('merchant-id') ? hash['merchant-id'] : nil
53
+ result = Result.from_hash(hash['result']) if hash['result']
54
+
55
+ # Create object from extracted values.
56
+ FundCheckResponse.new(merchant_id,
57
+ result)
58
+ end
59
+
60
+ def self.from_element(root)
61
+ merchant_id = XmlUtilities.from_element(root, 'merchant-id', String)
62
+ result = XmlUtilities.from_element(root, 'result', Result)
63
+
64
+ new(merchant_id,
65
+ result)
66
+ end
67
+
68
+ def to_xml_element(doc, root_name)
69
+ root = doc.create_element(root_name)
70
+
71
+ XmlUtilities.add_as_subelement(doc, root, 'merchant-id', merchant_id)
72
+ XmlUtilities.add_as_subelement(doc, root, 'result', result)
73
+
74
+ root
75
+ end
76
+
77
+ # Provides a human-readable string representation of the object.
78
+ def to_s
79
+ class_name = self.class.name.split('::').last
80
+ "<#{class_name} merchant_id: #{@merchant_id}, result: #{@result}>"
81
+ end
82
+
83
+ # Provides a debugging-friendly string with detailed object information.
84
+ def inspect
85
+ class_name = self.class.name.split('::').last
86
+ "<#{class_name} merchant_id: #{@merchant_id.inspect}, result: #{@result.inspect}>"
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,93 @@
1
+ # boku_direct_payments_api
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module BokuDirectPaymentsApi
7
+ # Provides per-field error information when the submitted request does not
8
+ # satisfy validation constraints.
9
+ class InvalidRequestField < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Property path of the field in error. The element or attribute name is
14
+ # given in camel-case, with nested objects delimited by `.` (period).
15
+ # If there are multiple distinct errors regarding a particular field, it may
16
+ # appear more than once. I.e., `field[path]` is not necessarily unique.
17
+ # @return [String]
18
+ attr_accessor :path
19
+
20
+ # A descriptive reason why the field was invalid. This message is not
21
+ # localized and is not appropriate for user messaging.
22
+ # @return [String]
23
+ attr_accessor :reason
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['path'] = 'path'
29
+ @_hash['reason'] = 'reason'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ path
37
+ reason
38
+ ]
39
+ end
40
+
41
+ # An array for nullable fields
42
+ def self.nullables
43
+ []
44
+ end
45
+
46
+ def initialize(path = SKIP, reason = SKIP)
47
+ @path = path unless path == SKIP
48
+ @reason = reason unless reason == SKIP
49
+ end
50
+
51
+ # Creates an instance of the object from a hash.
52
+ def self.from_hash(hash)
53
+ return nil unless hash
54
+
55
+ # Extract variables from the hash.
56
+ path = hash.key?('path') ? hash['path'] : SKIP
57
+ reason = hash.key?('reason') ? hash['reason'] : SKIP
58
+
59
+ # Create object from extracted values.
60
+ InvalidRequestField.new(path,
61
+ reason)
62
+ end
63
+
64
+ def self.from_element(root)
65
+ path = XmlUtilities.from_attribute(root, 'path', String)
66
+ reason = XmlUtilities.from_attribute(root, 'reason', String)
67
+
68
+ new(path,
69
+ reason)
70
+ end
71
+
72
+ def to_xml_element(doc, root_name)
73
+ root = doc.create_element(root_name)
74
+
75
+ XmlUtilities.add_as_attribute(root, 'path', path)
76
+ XmlUtilities.add_as_attribute(root, 'reason', reason)
77
+
78
+ root
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} path: #{@path}, reason: #{@reason}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} path: #{@path.inspect}, reason: #{@reason.inspect}>"
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,92 @@
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
+ # Defines transaction behavior constraints associated with a mandate. This
8
+ # field is used to specify conditions under which transactions may be
9
+ # processed. Applicable only when `optin-purpose` is set to
10
+ # `standing-approval-mandate` or `subscription-mandate`and `optin-type` is set
11
+ # to `hosted`.
12
+ class MandateConstraint < BaseModel
13
+ SKIP = Object.new
14
+ private_constant :SKIP
15
+
16
+ # Period over which the specified maximum amount will be enforced.
17
+ # @return [MandatePeriodEnum]
18
+ attr_accessor :mandate_period
19
+
20
+ # The maximum amount that can be processed per period.
21
+ # @return [Float]
22
+ attr_accessor :max_amount
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['mandate_period'] = 'mandate-period'
28
+ @_hash['max_amount'] = 'max-amount'
29
+ @_hash
30
+ end
31
+
32
+ # An array for optional fields
33
+ def self.optionals
34
+ []
35
+ end
36
+
37
+ # An array for nullable fields
38
+ def self.nullables
39
+ []
40
+ end
41
+
42
+ def initialize(mandate_period = nil, max_amount = nil)
43
+ @mandate_period = mandate_period
44
+ @max_amount = max_amount
45
+ end
46
+
47
+ # Creates an instance of the object from a hash.
48
+ def self.from_hash(hash)
49
+ return nil unless hash
50
+
51
+ # Extract variables from the hash.
52
+ mandate_period =
53
+ hash.key?('mandate-period') ? hash['mandate-period'] : nil
54
+ max_amount = hash.key?('max-amount') ? hash['max-amount'] : nil
55
+
56
+ # Create object from extracted values.
57
+ MandateConstraint.new(mandate_period,
58
+ max_amount)
59
+ end
60
+
61
+ def self.from_element(root)
62
+ mandate_period = XmlUtilities.from_element(root, 'mandate-period', String)
63
+ max_amount = XmlUtilities.from_element(root, 'max-amount', Float)
64
+
65
+ new(mandate_period,
66
+ max_amount)
67
+ end
68
+
69
+ def to_xml_element(doc, root_name)
70
+ root = doc.create_element(root_name)
71
+
72
+ XmlUtilities.add_as_subelement(doc, root, 'mandate-period',
73
+ mandate_period)
74
+ XmlUtilities.add_as_subelement(doc, root, 'max-amount', max_amount)
75
+
76
+ root
77
+ end
78
+
79
+ # Provides a human-readable string representation of the object.
80
+ def to_s
81
+ class_name = self.class.name.split('::').last
82
+ "<#{class_name} mandate_period: #{@mandate_period}, max_amount: #{@max_amount}>"
83
+ end
84
+
85
+ # Provides a debugging-friendly string with detailed object information.
86
+ def inspect
87
+ class_name = self.class.name.split('::').last
88
+ "<#{class_name} mandate_period: #{@mandate_period.inspect}, max_amount:"\
89
+ " #{@max_amount.inspect}>"
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,48 @@
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
+ # Period over which the specified maximum amount will be enforced.
8
+ class MandatePeriodEnum
9
+ MANDATE_PERIOD_ENUM = [
10
+ # TODO: Write general description for DAY
11
+ DAY = 'day'.freeze,
12
+
13
+ # TODO: Write general description for WEEK
14
+ WEEK = 'week'.freeze,
15
+
16
+ # TODO: Write general description for MONTH
17
+ MONTH = 'month'.freeze,
18
+
19
+ # TODO: Write general description for YEAR
20
+ YEAR = 'year'.freeze,
21
+
22
+ # TODO: Write general description for TRANSACTION
23
+ TRANSACTION = 'transaction'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ MANDATE_PERIOD_ENUM.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = DAY)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'day' then DAY
39
+ when 'week' then WEEK
40
+ when 'month' then MONTH
41
+ when 'year' then YEAR
42
+ when 'transaction' then TRANSACTION
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end