Class: Sydecar::Plaid
- Inherits:
-
Object
- Object
- Sydecar::Plaid
- Defined in:
- lib/sydecar/plaid.rb
Constant Summary collapse
- CREATE_LINK_TOKEN_URL =
'v1/plaid/create_link_token'
- PLAID_INSTITUTIONS_URL =
'v1/plaid/plaid_institutions'
- CREATE_PLAID_BANK_ACCOUNT_URL =
'v1/plaid/create_plaid_bank_account'
Class Method Summary collapse
-
.create_bank_account(body:) ⇒ Object
body argument expects to have the following keys: [String] profile_id: required [String] public_token: required [Hash] metadata: PlaidLinkOnSuccessMetadata => { [Hash or nil] institution: required [Array of objects (PlaidAccount)] accounts: required [String] link_session_id: required } See more for details: api-docs.sydecar.io/api/#tag/Plaid/operation/setPlaidAccessToken.
- .create_bank_account_url ⇒ Object
-
.create_link_token(body:) ⇒ Hash
This method creates a bank account using the specified body parameters.
-
.create_plaid_account(body:) ⇒ Object
Create a Plaid account without using Plaid link (Sandbox only) Response sample (application/json) : { “id”: “string”, “created_at”: “2019-08-24T14:15:22Z”, “updated_at”: “2019-08-24T14:15:22Z”, “bank_name”: “string”, “account_name”: “string”, “type”: “STANDARD”, “account_type”: “CHECKING”, “is_us_based”: true, “account_number”: “string”, “routing_number”: “string”, “street_1”: “123 Maple Street”, “street_2”: “Unit 2”, “city”: “Maple Town”, “state”: “CA”, “zip_code”: “94033”, “country_code”: “US”, “for_further_credit”: “string”, “profile_ids”: [ “string” ], “plaid_consent_expiration_time”: “2022-10-12T07:30:50.52Z”, “plaid_account_number_mask”: “1111”, “plaid_institution_id”: “string” }.
-
.fetch_plaid_institutions(query: {}) ⇒ Object
This method Fetch a list of all available Plaid institutions.
-
.reset_plaid_login(bank_account_id:) ⇒ Object
This method reset a Plaid account’s login (Sandbox only) Response sample (application/json) : { “id”: “string”, “created_at”: “2019-08-24T14:15:22Z”, “updated_at”: “2019-08-24T14:15:22Z”, “bank_name”: “string”, “account_name”: “string”, “type”: “STANDARD”, “account_type”: “CHECKING”, “is_us_based”: true, “account_number”: “string”, “routing_number”: “string”, “street_1”: “123 Maple Street”, “street_2”: “Unit 2”, “city”: “Maple Town”, “state”: “CA”, “zip_code”: “94033”, “country_code”: “US”, “for_further_credit”: “string”, “profile_ids”: [ “string” ], “plaid_consent_expiration_time”: “2022-10-12T07:30:50.52Z”, “plaid_account_number_mask”: “1111”, “plaid_institution_id”: “string” }.
- .reset_plaid_login_url(bank_account_id:) ⇒ Object
Class Method Details
.create_bank_account(body:) ⇒ Object
body argument expects to have the following keys:
- String
-
profile_id: required
- String
-
public_token: required
- Hash
-
metadata: PlaidLinkOnSuccessMetadata =>
[Hash or nil] institution: required
[Array of objects (PlaidAccount)] accounts: required
[String] link_session_id: required
See more for details: api-docs.sydecar.io/api/#tag/Plaid/operation/setPlaidAccessToken
24 25 26 27 |
# File 'lib/sydecar/plaid.rb', line 24 def create_bank_account(body:) url = create_bank_account_url Connection.instance.post(url, body) end |
.create_bank_account_url ⇒ Object
10 11 12 |
# File 'lib/sydecar/plaid.rb', line 10 def create_bank_account_url '/v1/plaid/link_plaid_bank_account' end |
.create_link_token(body:) ⇒ Hash
This method creates a bank account using the specified body parameters.
40 41 42 |
# File 'lib/sydecar/plaid.rb', line 40 def create_link_token(body:) Connection.instance.post(CREATE_LINK_TOKEN_URL, body) end |
.create_plaid_account(body:) ⇒ Object
Create a Plaid account without using Plaid link (Sandbox only) Response sample (application/json) :
{
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"bank_name": "string",
"account_name": "string",
"type": "STANDARD",
"account_type": "CHECKING",
"is_us_based": true,
"account_number": "string",
"routing_number": "string",
"street_1": "123 Maple Street",
"street_2": "Unit 2",
"city": "Maple Town",
"state": "CA",
"zip_code": "94033",
"country_code": "US",
"for_further_credit": "string",
"profile_ids": [
"string"
],
"plaid_consent_expiration_time": "2022-10-12T07:30:50.52Z",
"plaid_account_number_mask": "1111",
"plaid_institution_id": "string"
}
121 122 123 |
# File 'lib/sydecar/plaid.rb', line 121 def create_plaid_account(body:) Connection.instance.post(CREATE_PLAID_BANK_ACCOUNT_URL, body) end |
.fetch_plaid_institutions(query: {}) ⇒ Object
This method Fetch a list of all available Plaid institutions. Responses sample:
{
"data": [
{
"institution_id": "string",
"name": "string",
"products": [
"assets"
],
"country_codes": [
"US"
],
"url": "string",
"primary_color": "string",
"logo": "string",
"routing_numbers": [
"string"
],
"oauth": true,
"status": {},
"payment_initiation_metadata": {},
"auth_metadata": {}
}
],
"pagination": {
"limit": 0,
"offset": 0,
"total": 0
}
}
82 83 84 |
# File 'lib/sydecar/plaid.rb', line 82 def fetch_plaid_institutions(query: {}) Connection.instance.get(PLAID_INSTITUTIONS_URL, query) end |
.reset_plaid_login(bank_account_id:) ⇒ Object
This method reset a Plaid account’s login (Sandbox only) Response sample (application/json) :
{
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"bank_name": "string",
"account_name": "string",
"type": "STANDARD",
"account_type": "CHECKING",
"is_us_based": true,
"account_number": "string",
"routing_number": "string",
"street_1": "123 Maple Street",
"street_2": "Unit 2",
"city": "Maple Town",
"state": "CA",
"zip_code": "94033",
"country_code": "US",
"for_further_credit": "string",
"profile_ids": [
"string"
],
"plaid_consent_expiration_time": "2022-10-12T07:30:50.52Z",
"plaid_account_number_mask": "1111",
"plaid_institution_id": "string"
}
159 160 161 |
# File 'lib/sydecar/plaid.rb', line 159 def reset_plaid_login(bank_account_id:) Connection.instance.post(reset_plaid_login_url(bank_account_id: bank_account_id), body:{}) end |
.reset_plaid_login_url(bank_account_id:) ⇒ Object
7 8 9 |
# File 'lib/sydecar/plaid.rb', line 7 def reset_plaid_login_url(bank_account_id:) "v1/plaid/#{bank_account_id}/reset_plaid_login" end |