Class: Colppy::Core::Gateway
- Inherits:
-
Object
- Object
- Colppy::Core::Gateway
- 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
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
- #call(payload = {}) ⇒ Object
-
#initialize(mode = "sandbox") ⇒ Gateway
constructor
A new instance of Gateway.
- #sandbox ⇒ Object
- #sandbox? ⇒ Boolean
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
#mode ⇒ Object (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 |
#sandbox ⇒ Object
19 20 21 |
# File 'lib/colppy/core/gateway.rb', line 19 def sandbox @mode = "sandbox" end |
#sandbox? ⇒ Boolean
23 24 25 |
# File 'lib/colppy/core/gateway.rb', line 23 def sandbox? @mode == "sandbox" end |