module KsCheckEnvironment

Constants

KSENDPOINT

Declare the Endpoints according to the environment Endpoints are required to make a post call through Rest Client the constant ks_production holds the endpoint for making API call with live credentials the constant ks_sandbox holds the endpoint for making API call with sandbox credentials

Public Class Methods

ks_endpoint() click to toggle source

Invoke this method to set the endpoints according to the value of ks_sandbox variable

# File lib/koduc_express_paypal/koduc_check_environment.rb, line 33
def self.ks_endpoint
        if ks_sandbox?
                KsCheckEnvironment::KSENDPOINT[:ks_sandbox]
        else
                KsCheckEnvironment::KSENDPOINT[:ks_production]       
        end
end
ks_sandbox(ks_boolean_value) click to toggle source

Call this method to set the environment pass ks_boolean_value as true for sandbox And false for Live environemnt

# File lib/koduc_express_paypal/koduc_check_environment.rb, line 28
def self.ks_sandbox(ks_boolean_value)
        @@ks_sandbox = ks_boolean_value
end
ks_sandbox?() click to toggle source

Call this method to check the value of ks_sandbox variable after initialization

# File lib/koduc_express_paypal/koduc_check_environment.rb, line 21
def self.ks_sandbox?
        @@ks_sandbox
end