Class: Colppy::Core::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/colppy/core/gateway.rb

Constant Summary collapse

MIME_JSON =
"application/json".freeze
SANDBOX_API_URL =
"http://staging.colppy.com".freeze
PRODUCTION_API_URL =
"https://login.colppy.com".freeze
API_PATH =
"/lib/frontera2/service.php".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mode = "sandbox") ⇒ Gateway

Returns a new instance of Gateway.



11
12
13
# File 'lib/colppy/core/gateway.rb', line 11

def initialize(mode = "sandbox")
  @mode = mode
end

Instance Attribute Details

#modeObject (readonly)

Returns the value of attribute mode.



4
5
6
# File 'lib/colppy/core/gateway.rb', line 4

def mode
  @mode
end

Instance Method Details

#call(payload = {}) ⇒ Object



15
16
17
# File 'lib/colppy/core/gateway.rb', line 15

def call(payload = {})
  make_request(payload)
end

#sandboxObject



19
20
21
# File 'lib/colppy/core/gateway.rb', line 19

def sandbox
  @mode = "sandbox"
end

#sandbox?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/colppy/core/gateway.rb', line 23

def sandbox?
  @mode == "sandbox"
end