The main interface to Plaid API.
- A
- B
- C
- L
- N
- P
[R] | accounts | The Plaid::Accounts product accessor. |
[R] | asset_report | The Plaid::AssetReport product accessor. |
[R] | auth | The Plaid::Auth product accessor. |
[R] | categories | The Plaid::Categories product accessor. |
[R] | credit_details | The Plaid::CreditDetails product accessor. |
[R] | deposit_switch | The Plaid::DepositSwitch product accessor. |
[R] | identity | The Plaid::Identity product accessor. |
[R] | income | The Plaid::Income product accessor. |
[R] | institutions | The Plaid::Institutions product accessor. |
[R] | investments | The Plaid::Investments product accessor. |
[R] | item | The Plaid::Item product accessor. |
[R] | liabilities | The Plaid::Liabilities product accessor. |
[R] | payment_initiation | The Plaid::PaymentInitiation product accessor. |
[R] | processor | The Plaid::Processor product accessor. |
[R] | sandbox | The Plaid::Sandbox product accessor. |
[R] | transactions | The Plaid::Transactions product accessor. |
[R] | webhooks | The Plaid::Webhooks endpoint accessor. |
:attr_reader: Public: The Plaid::LinkToken endpoint accessor.
Source: show
# File lib/plaid/client.rb, line 121 subproduct :link_token
ENVIRONMENTS | = | %i[sandbox development production].freeze |
All possible environments for the client to use. |
[R] | client_id | The client ID. |
[R] | env | The current environment in use (one of ENVIRONMENTS). |
Set Plaid defaults on the Faraday connection.
- builder
-
The Faraday builder object.
Source: show
# File lib/plaid/client.rb, line 149 def self.build_default_connection(builder) builder.options[:timeout] = Plaid::Middleware::NETWORK_TIMEOUT builder.headers = Plaid::Middleware::NETWORK_HEADERS builder.request :json builder.use Plaid::Middleware builder.response :json, content_type: /\bjson$/ builder.adapter Faraday.default_adapter end
Construct a Client instance
Optionally takes a block to allow overriding the default Faraday connection options.
- env
-
The Symbol (:sandbox, :development, :production)
- #client_id
-
The String Plaid account client ID to authenticate requests
- secret
-
The String Plaid account secret to authenticate requests
Source: show
# File lib/plaid/client.rb, line 22 def initialize(env:, client_id:, secret:, &block) @env = env.to_sym @api_host = api_host @client_id = client_id @secret = secret create_connection(&block) end
Make a post request
- path
-
Path or URL to make the request to
- payload
-
The payload or data to post
Returns
Returns the resulting parsed JSON of the request
Source: show
# File lib/plaid/client.rb, line 129 def post(path, payload) @connection.post(path, payload).body end
Make a post request with appended authentication fields
- path
-
Path or URL to make the request to
- payload
-
The payload or data to post
Returns
Returns the resulting parsed JSON of the request
Source: show
# File lib/plaid/client.rb, line 139 def post_with_auth(path, payload) @connection.post( path, payload.merge(client_id: @client_id, secret: @secret) ).body end
Gets the API hostname for given environment.
- env
-
The Symbol (:sandbox, :development, :production)
Returns
Returns a String representing the environment URL. Raises ArgumentError if environment is unknown.
Source: show
# File lib/plaid/client.rb, line 171 def api_host unless ENVIRONMENTS.include?(@env) raise ArgumentError, "Invalid value for env (#{@env.inspect}): must be one of " + ENVIRONMENTS.map(&:inspect) * ', ' end "https://#{@env}.plaid.com" end
subproduct-generated methods depend on client method.
Source: show
# File lib/plaid/client.rb, line 161 def client self end
Initializes a new Plaid connection object via Faraday.
Optionally takes a block to allow overriding the defaults.
Source: show
# File lib/plaid/client.rb, line 184 def create_connection @connection = Faraday.new(url: @api_host) do |builder| block_given? ? yield(builder) : Client.build_default_connection(builder) end end