Class: Tipalti::Ipn
- Inherits:
-
Object
- Object
- Tipalti::Ipn
- Defined in:
- lib/tipalti-ruby/ipn.rb
Constant Summary collapse
- BASE_URL_P =
"https://console.tipalti.com"
- BASE_URL_S =
"https://console.sandbox.tipalti.com"
Instance Attribute Summary collapse
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
Instance Method Summary collapse
- #base_url ⇒ Object
- #connection ⇒ Object
-
#initialize(payload:, sandbox: false) ⇒ Ipn
constructor
A new instance of Ipn.
- #verify ⇒ Object
Constructor Details
#initialize(payload:, sandbox: false) ⇒ Ipn
Returns a new instance of Ipn.
10 11 12 13 |
# File 'lib/tipalti-ruby/ipn.rb', line 10 def initialize(payload:, sandbox: false) @payload = payload @sandbox = sandbox end |
Instance Attribute Details
#sandbox ⇒ Object
Returns the value of attribute sandbox.
8 9 10 |
# File 'lib/tipalti-ruby/ipn.rb', line 8 def sandbox @sandbox end |
Instance Method Details
#base_url ⇒ Object
15 16 17 |
# File 'lib/tipalti-ruby/ipn.rb', line 15 def base_url @sandbox ? BASE_URL_S : BASE_URL_P end |
#connection ⇒ Object
19 20 21 |
# File 'lib/tipalti-ruby/ipn.rb', line 19 def connection Connection.new(url: base_url) end |
#verify ⇒ Object
23 24 25 |
# File 'lib/tipalti-ruby/ipn.rb', line 23 def verify connection.request(:post, "/notif/ipn.aspx", @payload) end |