Class: AruxApp::API::Checkout

Inherits:
Object
  • Object
show all
Defined in:
lib/arux_app/api/checkout.rb

Constant Summary collapse

API_VERSION =
1

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.api_routeObject



22
23
24
# File 'lib/arux_app/api/checkout.rb', line 22

def self.api_route
  "#{api_uri}/api/v#{API_VERSION}/"
end

.api_uriObject



14
15
16
# File 'lib/arux_app/api/checkout.rb', line 14

def self.api_uri
  AruxApp::API.uri(subdomain: "pay.api")
end

.iframe_urlObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/arux_app/api/checkout.rb', line 26

def self.iframe_url
  case AruxApp::API.mode
  when :production
    "https://htp.tokenex.com/Iframe/Iframe-v3.min.js"
  when :staging, :development, :test
    "https://test-htp.tokenex.com/Iframe/Iframe-v3.min.js"
  else
    raise "AruxApp::API environment not supported"
  end
end

.public_uriObject



6
7
8
# File 'lib/arux_app/api/checkout.rb', line 6

def self.public_uri
  AruxApp::API.uri(subdomain: "pay")
end

Instance Method Details

#api_uriObject



18
19
20
# File 'lib/arux_app/api/checkout.rb', line 18

def api_uri
  self.class.api_uri
end

#public_uriObject



10
11
12
# File 'lib/arux_app/api/checkout.rb', line 10

def public_uri
  self.class.public_uri
end