Method: WebpayNormal#initialize
- Defined in:
- lib/webpaynormal.rb
#initialize(configuration) ⇒ WebpayNormal
Returns a new instance of WebpayNormal.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/webpaynormal.rb', line 9 def initialize(configuration) @wsdl_path = '' @ambient = configuration.environment case @ambient when 'INTEGRACION' @wsdl_path='https://webpay3gint.transbank.cl/WSWebpayTransaction/cxf/WSWebpayService?wsdl' when 'CERTIFICACION' @wsdl_path='https://webpay3gint.transbank.cl/WSWebpayTransaction/cxf/WSWebpayService?wsdl' when 'PRODUCCION' @wsdl_path='https://webpay3g.transbank.cl/WSWebpayTransaction/cxf/WSWebpayService?wsdl' else #Por defecto esta el ambiente de INTEGRACION @wsdl_path='https://webpay3gint.transbank.cl/WSWebpayTransaction/cxf/WSWebpayService?wsdl' end @commerce_code = configuration.commerce_code @private_key = OpenSSL::PKey::RSA.new(configuration.private_key) @public_cert = OpenSSL::X509::Certificate.new(configuration.public_cert) @webpay_cert = OpenSSL::X509::Certificate.new(configuration.webpay_cert) @client = Savon.client(wsdl: @wsdl_path) end |