Class: Transbank::Webpay::Api

Inherits:
Object
  • Object
show all
Includes:
Params
Defined in:
lib/transbank/webpay/api.rb

Constant Summary

Constants included from Helper

Helper::XS_DATE_TIME, Helper::XS_INTEGER

Instance Method Summary collapse

Methods included from Params

#build_init_transaction_params, #build_nullify_params

Methods included from Helper

#camelcase, #typecasting, #underscore, #xml_to_hash

Instance Method Details

#acknowledge_transaction(token) ⇒ Object



18
19
20
21
22
# File 'lib/transbank/webpay/api.rb', line 18

def acknowledge_transaction(token)
  params = { tokenInput: token }
  url    = config.wsdl_transaction_url
  Request.new(url, :acknowledge_transaction, params).response
end

#get_transaction_result(token) ⇒ Object



12
13
14
15
16
# File 'lib/transbank/webpay/api.rb', line 12

def get_transaction_result(token)
  params = { tokenInput: token }
  url    = config.wsdl_transaction_url
  Request.new(url, :get_transaction_result, params).response
end

#init_transaction(underscore_params = {}) ⇒ Object



6
7
8
9
10
# File 'lib/transbank/webpay/api.rb', line 6

def init_transaction(underscore_params = {})
  params = build_init_transaction_params(underscore_params)
  url    = config.wsdl_transaction_url
  Request.new(url, :init_transaction, params).response
end

#nullify(underscore_params = {}) ⇒ Object



24
25
26
27
28
# File 'lib/transbank/webpay/api.rb', line 24

def nullify(underscore_params = {})
  params = build_nullify_params(underscore_params)
  url    = config.wsdl_nullify_url
  Request.new(url, :nullify, params).response
end