Class: ZipMoney::Configuration
- Inherits:
-
Object
- Object
- ZipMoney::Configuration
- Defined in:
- lib/zipMoney/configuration.rb
Constant Summary collapse
- API_VERSION =
"1.0.6"
- API_PLATFORM =
"ruby"
- API_NAME =
"zipMoney Ruby SDK"
- ENV_LIVE_API_URL =
"https://api.zipmoney.com.au/v1/"
- ENV_TEST_API_URL =
"https://api.sandbox.zipmoney.com.au/v1/"
- ATTRIBUTES =
[ :merchant_id, :merchant_key, :environment, ]
Class Method Summary collapse
-
.credentials_valid(merchant_id, merchant_key) ⇒ Object
Checks if passed merchant_id and merchant_key match with the one provided during setup.
-
.environment=(env) ⇒ Object
Checks if passed value is valid and assigns it true.
-
.is_sandbox ⇒ Object
True|false.
Class Method Details
.credentials_valid(merchant_id, merchant_key) ⇒ Object
Checks if passed merchant_id and merchant_key match with the one provided during setup
44 45 46 |
# File 'lib/zipMoney/configuration.rb', line 44 def credentials_valid(merchant_id,merchant_key) raise ExpressError, "Invalid merchant credentials in the request" unless @merchant_id.to_i.eql?(merchant_id.to_i) && @merchant_key.to_s.eql?(merchant_key.to_s) end |
.environment=(env) ⇒ Object
Checks if passed value is valid and assigns it true
27 28 29 30 31 |
# File 'lib/zipMoney/configuration.rb', line 27 def environment=(env) env = env.to_sym raise ArgumentError, "#{env.inspect} is not a valid environment" unless [:sandbox, :live].include?(env) @environment = env end |
.is_sandbox ⇒ Object
Returns true|false.
36 37 38 |
# File 'lib/zipMoney/configuration.rb', line 36 def is_sandbox environment.to_s == "sandbox" end |