Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/hyperwallet/api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def request_url_for(resource)
base_url + "/" + resource
end

def base_url
active_url + API_VERSION
def base_url
active_url + self.class.superclass.api_version
end

def active_url
Expand Down
16 changes: 11 additions & 5 deletions lib/hyperwallet/api/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ module Hyperwallet
module Api
class Config

PRODUCTION_URL = "https://api.paylution.com/rest"
UAT_URL = "https://uat-api.paylution.com/rest"

API_VERSION = "/v3"
MODES = [:uat, :production]
PRODUCTION_URL = "https://api.paylution.com/rest"
UAT_URL = "https://uat-api.paylution.com/rest"
PRODUCTION_API_VERSION = "/v3"
UAT_API_VERSION = "/v4"
MODES = [:uat, :production]

class << self
attr_accessor :api_user, :api_password, :api_mode, :proxy
Expand All @@ -17,6 +17,12 @@ def uat?
def production?
api_mode == :production
end

def api_version
return PRODUCTION_API_VERSION if production?

UAT_API_VERSION
end
end
end
end
Expand Down