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) ⇒ 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) ⇒ Client
rubocop:disable Metrics/ParameterLists
17 18 19 20 21 22 23 24 |
# File 'lib/tipalti-ruby/client.rb', line 17 def initialize(client_id:, client_secret:, access_token:, refresh_token: nil, code_verifier: nil, sandbox: false) # 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 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
26 27 28 |
# File 'lib/tipalti-ruby/client.rb', line 26 def base_url @sandbox ? BASE_URL_S : BASE_URL_P end |
#connection ⇒ Object
30 31 32 |
# File 'lib/tipalti-ruby/client.rb', line 30 def connection Connection.new(access_token: @access_token, url: base_url) end |
#connection_token ⇒ Object
34 35 36 |
# File 'lib/tipalti-ruby/client.rb', line 34 def connection_token Connection.new(url: token_url) end |
#token_url ⇒ Object
38 39 40 |
# File 'lib/tipalti-ruby/client.rb', line 38 def token_url @sandbox ? TOKEN_URL_S : TOKEN_URL_P end |