Class: Tipalti::Ipn

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#sandboxObject

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_urlObject



15
16
17
# File 'lib/tipalti-ruby/ipn.rb', line 15

def base_url
  @sandbox ? BASE_URL_S : BASE_URL_P
end

#connectionObject



19
20
21
# File 'lib/tipalti-ruby/ipn.rb', line 19

def connection
  Connection.new(url: base_url)
end

#verifyObject



23
24
25
# File 'lib/tipalti-ruby/ipn.rb', line 23

def verify
  connection.request(:post, "/notif/ipn.aspx", @payload)
end