Sha256: 8006263ea7b6392eeb7c4b6abad5a96a1afb198f82cae260bb4c313c8544484f

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

require_relative '../Catalogs/environment_type'
require 'yaml'
class MetropagoGateway

  def initialize(envrionment, merchantId, terminalId, secretKey)  # terminalId, publicKey, privateKey, culture)
    @envrionment = envrionment
    @merchantId = merchantId
    @terminalId = terminalId
    @publicKey = secretKey
    @privateKey = ""
    @sdkVersion = "1.0"
    #@culture = "en"

    #set gateway API url
    if(envrionment == EnvironmentType::SANDBOX.to_str)
      @gatewayURL = "http://securegateway.merchantprocess.net/NeoGatewayAPI_Test/api/"
    
      #TLS Enabled server
      #@gatewayURL = "https://gateway12.merchantprocess.net/sdk/api/"


    else if(envrionment == EnvironmentType::PRODUCTION.to_str)
      @gatewayURL = "https://gateway.merchantprocess.net/api/prod-v1.0/api/"

    else
      raise "Invalid Enviroment"
     end

    end

    #Logs enabled?
    env = 'development'
    config = YAML::load(File.open('Config/application.yml'))[env]
   if(config["enable_logs"] != nil && config["enable_logs"] == true)
     @enableLogs = true
   else
     @enableLogs = false
   end

  end

  def GatewayURL=(gatewayURL)
    @gatewayURL = gatewayURL
  end

  def EnableLogs=(enableLogs)
    @enableLogs = enableLogs
  end

  def Culture=(culture)
    @culture = culture
  end



end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
MetropagoRubyGem-0.1.0 lib/Gateway/metropago_gateway.rb