class Paycargo::Client
Constants
- BASE_URL
Attributes
adapter[R]
token[R]
Public Class Methods
new(token:, adapter: Faraday.default_adapter)
click to toggle source
# File lib/paycargo/client.rb, line 10 def initialize(token:, adapter: Faraday.default_adapter) @token = token || ENV["JWT_TOKEN"] @adapter = adapter end
Public Instance Methods
connection()
click to toggle source
# File lib/paycargo/client.rb, line 35 def connection @connection ||= Faraday.new do |con| con.url_prefix = BASE_URL con.request :json con.response :json, content_type: "application/json" con.adapter adapter end end
payer()
click to toggle source
# File lib/paycargo/client.rb, line 19 def payer PayerResource.new(self) end
reports()
click to toggle source
# File lib/paycargo/client.rb, line 23 def reports ReportsResource.new(self) end
transactions()
click to toggle source
# File lib/paycargo/client.rb, line 15 def transactions TransactionsResource.new(self) end
users()
click to toggle source
# File lib/paycargo/client.rb, line 27 def users UsersResource.new(self) end
vendors()
click to toggle source
# File lib/paycargo/client.rb, line 31 def vendors VendorsResource.new(self) end