Class: Khipu::PaymentsApi
- Inherits:
-
Object
- Object
- Khipu::PaymentsApi
- Defined in:
- lib/khipu-api-client/api/payments_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = nil) ⇒ PaymentsApi
constructor
A new instance of PaymentsApi.
-
#payments_get(notification_token, opts = {}) ⇒ PaymentsResponse
Obtener información de un pago Información completa del pago.
-
#payments_id_confirm_post(id, opts = {}) ⇒ SuccessResponse
Confirmar el pago.
-
#payments_id_delete(id, opts = {}) ⇒ SuccessResponse
Borrar un pago Solo se pueden borrar pagos que estén pendientes de pagar.
-
#payments_id_get(id, opts = {}) ⇒ PaymentsResponse
Obtener información de un pago Información completa del pago.
-
#payments_id_refunds_post(id, opts = {}) ⇒ SuccessResponse
Reembolsar total o parcialmente un pago Reembolsa total o parcialmente el monto de un pago.
-
#payments_post(subject, currency, amount, opts = {}) ⇒ PaymentsCreateResponse
Crear un pago Crea un pago en khipu y obtiene las URLs para redirección al usuario para que complete el pago.
Constructor Details
#initialize(api_client = nil) ⇒ PaymentsApi
Returns a new instance of PaymentsApi.
7 8 9 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 7 def initialize(api_client = nil) @api_client = api_client || Configuration.api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 5 def api_client @api_client end |
Instance Method Details
#payments_get(notification_token, opts = {}) ⇒ PaymentsResponse
Obtener información de un pago Información completa del pago. Datos con los que fue creado y el estado actual del pago. Se obtiene del notification_token que envia khipu cuando el pago es conciliado.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 16 def payments_get(notification_token, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: PaymentsApi#payments_get ..." end # verify the required parameter 'notification_token' is set fail "Missing the required parameter 'notification_token' when calling payments_get" if notification_token.nil? # resource path path = "/payments".sub('{format}','json') # query parameters query_params = {} query_params[:'notification_token'] = notification_token # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['khipu'] result = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PaymentsResponse') if Configuration.debugging Configuration.logger.debug "API called: PaymentsApi#payments_get. Result: #{result.inspect}" end return result end |
#payments_id_confirm_post(id, opts = {}) ⇒ SuccessResponse
Confirmar el pago. Al confirmar el pago, este será rendido al día siguiente.
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 274 def payments_id_confirm_post(id, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: PaymentsApi#payments_id_confirm_post ..." end # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling payments_id_confirm_post" if id.nil? # resource path path = "/payments/{id}/confirm".sub('{format}','json').sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['khipu'] result = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SuccessResponse') if Configuration.debugging Configuration.logger.debug "API called: PaymentsApi#payments_id_confirm_post. Result: #{result.inspect}" end return result end |
#payments_id_delete(id, opts = {}) ⇒ SuccessResponse
Borrar un pago Solo se pueden borrar pagos que estén pendientes de pagar. Esta operación no puede deshacerse.
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 223 def payments_id_delete(id, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: PaymentsApi#payments_id_delete ..." end # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling payments_id_delete" if id.nil? # resource path path = "/payments/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['khipu'] result = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SuccessResponse') if Configuration.debugging Configuration.logger.debug "API called: PaymentsApi#payments_id_delete. Result: #{result.inspect}" end return result end |
#payments_id_get(id, opts = {}) ⇒ PaymentsResponse
Obtener información de un pago Información completa del pago. Datos con los que fue creado y el estado actual del pago.
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 172 def payments_id_get(id, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: PaymentsApi#payments_id_get ..." end # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling payments_id_get" if id.nil? # resource path path = "/payments/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['khipu'] result = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PaymentsResponse') if Configuration.debugging Configuration.logger.debug "API called: PaymentsApi#payments_id_get. Result: #{result.inspect}" end return result end |
#payments_id_refunds_post(id, opts = {}) ⇒ SuccessResponse
Reembolsar total o parcialmente un pago Reembolsa total o parcialmente el monto de un pago. Esta operación solo se puede realizar en los comercios que recauden en cuenta khipu y antes de la rendición de los fondos correspondientes.
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 326 def payments_id_refunds_post(id, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: PaymentsApi#payments_id_refunds_post ..." end # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling payments_id_refunds_post" if id.nil? # resource path path = "/payments/{id}/refunds".sub('{format}','json').sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} form_params["amount"] = opts[:'amount'] if opts[:'amount'] # http body (model) post_body = nil auth_names = ['khipu'] result = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SuccessResponse') if Configuration.debugging Configuration.logger.debug "API called: PaymentsApi#payments_id_refunds_post. Result: #{result.inspect}" end return result end |
#payments_post(subject, currency, amount, opts = {}) ⇒ PaymentsCreateResponse
Crear un pago Crea un pago en khipu y obtiene las URLs para redirección al usuario para que complete el pago.
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 |
# File 'lib/khipu-api-client/api/payments_api.rb', line 91 def payments_post(subject, currency, amount, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: PaymentsApi#payments_post ..." end # verify the required parameter 'subject' is set fail "Missing the required parameter 'subject' when calling payments_post" if subject.nil? # verify the required parameter 'currency' is set fail "Missing the required parameter 'currency' when calling payments_post" if currency.nil? # verify the required parameter 'amount' is set fail "Missing the required parameter 'amount' when calling payments_post" if amount.nil? # resource path path = "/payments".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/x-www-form-urlencoded'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} form_params["subject"] = subject form_params["currency"] = currency form_params["amount"] = amount form_params["transaction_id"] = opts[:'transaction_id'] if opts[:'transaction_id'] form_params["custom"] = opts[:'custom'] if opts[:'custom'] form_params["body"] = opts[:'body'] if opts[:'body'] form_params["bank_id"] = opts[:'bank_id'] if opts[:'bank_id'] form_params["return_url"] = opts[:'return_url'] if opts[:'return_url'] form_params["cancel_url"] = opts[:'cancel_url'] if opts[:'cancel_url'] form_params["picture_url"] = opts[:'picture_url'] if opts[:'picture_url'] form_params["notify_url"] = opts[:'notify_url'] if opts[:'notify_url'] form_params["contract_url"] = opts[:'contract_url'] if opts[:'contract_url'] form_params["notify_api_version"] = opts[:'notify_api_version'] if opts[:'notify_api_version'] form_params["expires_date"] = opts[:'expires_date'] if opts[:'expires_date'] form_params["send_email"] = opts[:'send_email'] if opts[:'send_email'] form_params["payer_name"] = opts[:'payer_name'] if opts[:'payer_name'] form_params["payer_email"] = opts[:'payer_email'] if opts[:'payer_email'] form_params["send_reminders"] = opts[:'send_reminders'] if opts[:'send_reminders'] form_params["responsible_user_email"] = opts[:'responsible_user_email'] if opts[:'responsible_user_email'] form_params["fixed_payer_personal_identifier"] = opts[:'fixed_payer_personal_identifier'] if opts[:'fixed_payer_personal_identifier'] form_params["integrator_fee"] = opts[:'integrator_fee'] if opts[:'integrator_fee'] form_params["collect_account_uuid"] = opts[:'collect_account_uuid'] if opts[:'collect_account_uuid'] form_params["confirm_timeout_date"] = opts[:'confirm_timeout_date'] if opts[:'confirm_timeout_date'] form_params["mandatory_payment_method"] = opts[:'mandatory_payment_method'] if opts[:'mandatory_payment_method'] # http body (model) post_body = nil auth_names = ['khipu'] result = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PaymentsCreateResponse') if Configuration.debugging Configuration.logger.debug "API called: PaymentsApi#payments_post. Result: #{result.inspect}" end return result end |