Class: Tipalti::Client
- Inherits:
-
Object
- Object
- Tipalti::Client
- Defined in:
- lib/tipalti-ruby/client.rb
Constant Summary collapse
- BASE_URL_P =
"https://api-p.tipalti.com"- BASE_URL_S =
"https://api-sb.tipalti.com"- TOKEN_URL_P =
"https://sso.tipalti.com"- TOKEN_URL_S =
"https://sso.sandbox.tipalti.com"
Instance Attribute Summary collapse
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
Instance Method Summary collapse
- #base_url ⇒ Object
- #connection ⇒ Object
- #connection_token ⇒ Object
-
#initialize(client_id:, client_secret:, access_token:, refresh_token: nil, code_verifier: nil, sandbox: false, timeout: 60) ⇒ Client
constructor
rubocop:disable Metrics/ParameterLists.
- #token_url ⇒ Object
Methods included from Actions::Token
Methods included from Actions::PaymentBatch
#payment_batch_create, #payment_batch_instructions_get
Methods included from Actions::Payment
Methods included from Actions::Payee
#payee_create, #payee_get, #payee_list
Constructor Details
#initialize(client_id:, client_secret:, access_token:, refresh_token: nil, code_verifier: nil, sandbox: false, timeout: 60) ⇒ Client
rubocop:disable Metrics/ParameterLists
17 18 19 20 21 22 23 24 25 |
# File 'lib/tipalti-ruby/client.rb', line 17 def initialize(client_id:, client_secret:, access_token:, refresh_token: nil, code_verifier: nil, sandbox: false, timeout: 60) # rubocop:disable Metrics/ParameterLists @client_id = client_id @client_secret = client_secret @access_token = access_token @refresh_token = refresh_token @code_verifier = code_verifier @sandbox = sandbox @timeout = timeout end |
Instance Attribute Details
#sandbox ⇒ Object
Returns the value of attribute sandbox.
15 16 17 |
# File 'lib/tipalti-ruby/client.rb', line 15 def sandbox @sandbox end |
Instance Method Details
#base_url ⇒ Object
27 28 29 |
# File 'lib/tipalti-ruby/client.rb', line 27 def base_url @sandbox ? BASE_URL_S : BASE_URL_P end |
#connection ⇒ Object
31 32 33 |
# File 'lib/tipalti-ruby/client.rb', line 31 def connection Connection.new(access_token: @access_token, url: base_url, timeout: @timeout) end |
#connection_token ⇒ Object
35 36 37 |
# File 'lib/tipalti-ruby/client.rb', line 35 def connection_token Connection.new(url: token_url, timeout: @timeout) end |
#token_url ⇒ Object
39 40 41 |
# File 'lib/tipalti-ruby/client.rb', line 39 def token_url @sandbox ? TOKEN_URL_S : TOKEN_URL_P end |