Class: Pesamoni::DefaultApi
- Inherits:
-
Object
- Object
- Pesamoni::DefaultApi
- Defined in:
- lib/pesamoni_ruby/api/default_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ DefaultApi
constructor
A new instance of DefaultApi.
-
#transactions_post(method, amount, opts = {}) ⇒ InlineResponse200
Below are parameters and their respective expected responses.
-
#transactions_post_with_http_info(method, amount, opts = {}) ⇒ Array<(InlineResponse200, Fixnum, Hash)>
Below are parameters and their respective expected responses.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ DefaultApi
Returns a new instance of DefaultApi.
15 16 17 |
# File 'lib/pesamoni_ruby/api/default_api.rb', line 15 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
13 14 15 |
# File 'lib/pesamoni_ruby/api/default_api.rb', line 13 def api_client @api_client end |
Instance Method Details
#transactions_post(method, amount, opts = {}) ⇒ InlineResponse200
Below are parameters and their respective expected responses. In order to try out the service, simply click Try it out.
36 37 38 39 |
# File 'lib/pesamoni_ruby/api/default_api.rb', line 36 def transactions_post(method, amount, opts = {}) data, _status_code, _headers = transactions_post_with_http_info(method, amount, opts) data end |
#transactions_post_with_http_info(method, amount, opts = {}) ⇒ Array<(InlineResponse200, Fixnum, Hash)>
Below are parameters and their respective expected responses. In order to try out the service, simply click Try it out.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/pesamoni_ruby/api/default_api.rb', line 59 def transactions_post_with_http_info(method, amount, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.transactions_post ...' end # verify the required parameter 'method' is set if @api_client.config.client_side_validation && method.nil? fail ArgumentError, "Missing the required parameter 'method' when calling DefaultApi.transactions_post" end if @api_client.config.client_side_validation && method < 1 fail ArgumentError, 'invalid value for "method" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end # verify the required parameter 'amount' is set if @api_client.config.client_side_validation && amount.nil? fail ArgumentError, "Missing the required parameter 'amount' when calling DefaultApi.transactions_post" end if @api_client.config.client_side_validation && amount < 1 fail ArgumentError, 'invalid value for "amount" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'mobile'].nil? && opts[:'mobile'] < 1 fail ArgumentError, 'invalid value for "opts[:"mobile"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'holdername'].nil? && opts[:'holdername'] < 1 fail ArgumentError, 'invalid value for "opts[:"holdername"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'cardnumber'].nil? && opts[:'cardnumber'] < 1 fail ArgumentError, 'invalid value for "opts[:"cardnumber"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'cvv'].nil? && opts[:'cvv'] < 1 fail ArgumentError, 'invalid value for "opts[:"cvv"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'exp'].nil? && opts[:'exp'] < 1 fail ArgumentError, 'invalid value for "opts[:"exp"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'currency'].nil? && opts[:'currency'] < 1 fail ArgumentError, 'invalid value for "opts[:"currency"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'account'].nil? && opts[:'account'] < 1 fail ArgumentError, 'invalid value for "opts[:"account"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'reference'].nil? && opts[:'reference'] < 1 fail ArgumentError, 'invalid value for "opts[:"reference"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'genericmsg'].nil? && opts[:'genericmsg'] < 1 fail ArgumentError, 'invalid value for "opts[:"genericmsg"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'token'].nil? && opts[:'token'] < 1 fail ArgumentError, 'invalid value for "opts[:"token"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'bouquet'].nil? && opts[:'bouquet'] < 1 fail ArgumentError, 'invalid value for "opts[:"bouquet"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'payoption'].nil? && opts[:'payoption'] < 1 fail ArgumentError, 'invalid value for "opts[:"payoption"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'meternumber'].nil? && opts[:'meternumber'] < 1 fail ArgumentError, 'invalid value for "opts[:"meternumber"]" when calling DefaultApi.transactions_post, must be greater than or equal to 1.' end # resource path local_var_path = '/transactions' # query parameters query_params = {} query_params[:'method'] = method query_params[:'amount'] = amount query_params[:'mobile'] = opts[:'mobile'] if !opts[:'mobile'].nil? query_params[:'holdername'] = opts[:'holdername'] if !opts[:'holdername'].nil? query_params[:'cardnumber'] = opts[:'cardnumber'] if !opts[:'cardnumber'].nil? query_params[:'cvv'] = opts[:'cvv'] if !opts[:'cvv'].nil? query_params[:'exp'] = opts[:'exp'] if !opts[:'exp'].nil? query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil? query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil? query_params[:'reference'] = opts[:'reference'] if !opts[:'reference'].nil? query_params[:'genericmsg'] = opts[:'genericmsg'] if !opts[:'genericmsg'].nil? query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil? query_params[:'bouquet'] = opts[:'bouquet'] if !opts[:'bouquet'].nil? query_params[:'payoption'] = opts[:'payoption'] if !opts[:'payoption'].nil? query_params[:'meternumber'] = opts[:'meternumber'] if !opts[:'meternumber'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apipassword', 'apiusername'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse200') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#transactions_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |