Class: Straddle::Resources::Bridge

Inherits:
Object
  • Object
show all
Defined in:
lib/straddle/resources/bridge.rb,
sig/straddle/resources/bridge.rbs

Overview

Bridge connects customer bank accounts and creates paykeys from supported provider tokens or bank account details.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Bridge

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Bridge.

Parameters:



203
204
205
# File 'lib/straddle/resources/bridge.rb', line 203

def initialize(client:)
  @client = client
end

Instance Method Details

#create_bank_account_paykey(account_number:, account_type:, customer_id:, routing_number:, config: nil, external_id: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse

Some parameter documentations has been truncated, see Models::BridgeCreateBankAccountPaykeyParams for more details.

Creates a paykey from a routing number, account number, and account type.

Parameters:

  • account_number (String) —

    Body param: Bank account number.

  • account_type (Symbol, Straddle::Models::AccountType) —

    Body param

  • customer_id (String) —

    Body param: Unique identifier for the customer associated with the paykey.

  • routing_number (String) —

    Body param: Bank routing number.

  • config (Straddle::Models::PaykeyConfiguration) —

    Body param

  • external_id (String, nil) —

    Body param: Unique identifier for the paykey in your system.

  • metadata (Hash{Symbol=>String}, nil) —

    Body param: Up to 20 user-defined key-value pairs associated with the paykey.

  • correlation_id (String) —

    Header param: Optional client-generated identifier for tracing a series of relat

  • idempotency_key (String) —

    Header param: Optional client-generated key for an idempotent request.

  • request_id (String) —

    Header param: Optional client-generated identifier for tracing one request.

  • straddle_account_id (String) —

    Header param: For platform requests, the embedded account UUID that sets the req

  • request_options (Straddle::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/straddle/resources/bridge.rb', line 42

def (params)
  parsed, options = Straddle::BridgeCreateBankAccountPaykeyParams.dump_request(params)
  header_params = {
    correlation_id: "correlation-id",
    idempotency_key: "idempotency-key",
    request_id: "request-id",
    straddle_account_id: "straddle-account-id"
  }
  @client.request(
    method: :post,
    path: "v1/bridge/bank_account",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Straddle::PaykeyResponse,
    options: options
  )
end

#create_plaid_paykey(customer_id:, plaid_token:, config: nil, external_id: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::PaykeyResponse

Some parameter documentations has been truncated, see Models::BridgeCreatePlaidPaykeyParams for more details.

Creates a paykey from a Plaid processor token.

Parameters:

  • customer_id (String) —

    Body param: Unique identifier for the customer associated with the paykey.

  • plaid_token (String) —

    Body param: Plaid processor token generated by your application for use with the

  • config (Straddle::Models::PaykeyConfiguration) —

    Body param

  • external_id (String, nil) —

    Body param: Unique identifier for the paykey in your system.

  • metadata (Hash{Symbol=>String}, nil) —

    Body param: Up to 20 user-defined key-value pairs associated with the paykey.

  • correlation_id (String) —

    Header param: Optional client-generated identifier for tracing a series of relat

  • idempotency_key (String) —

    Header param: Optional client-generated key for an idempotent request.

  • request_id (String) —

    Header param: Optional client-generated identifier for tracing one request.

  • straddle_account_id (String) —

    Header param: For platform requests, the embedded account UUID that sets the req

  • request_options (Straddle::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/straddle/resources/bridge.rb', line 90

def create_plaid_paykey(params)
  parsed, options = Straddle::BridgeCreatePlaidPaykeyParams.dump_request(params)
  header_params = {
    correlation_id: "correlation-id",
    idempotency_key: "idempotency-key",
    request_id: "request-id",
    straddle_account_id: "straddle-account-id"
  }
  @client.request(
    method: :post,
    path: "v1/bridge/plaid",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Straddle::PaykeyResponse,
    options: options
  )
end

#create_quiltt_paykey(customer_id:, quiltt_token:, config: nil, external_id: nil, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::RevealedPaykeyResponse

Some parameter documentations has been truncated, see Models::BridgeCreateQuilttPaykeyParams for more details.

Creates a paykey from a Quiltt processor token.

Parameters:

  • customer_id (String) —

    Body param: Unique identifier for the customer associated with the paykey.

  • quiltt_token (String) —

    Body param: Quiltt processor token generated by your application for use with th

  • config (Straddle::Models::PaykeyConfiguration) —

    Body param

  • external_id (String, nil) —

    Body param: Unique identifier for the paykey in your system.

  • metadata (Hash{Symbol=>String}, nil) —

    Body param: Up to 20 user-defined key-value pairs associated with the paykey.

  • correlation_id (String) —

    Header param: Optional client-generated identifier for tracing a series of relat

  • idempotency_key (String) —

    Header param: Optional client-generated key for an idempotent request.

  • request_id (String) —

    Header param: Optional client-generated identifier for tracing one request.

  • straddle_account_id (String) —

    Header param: For platform requests, the embedded account UUID that sets the req

  • request_options (Straddle::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/straddle/resources/bridge.rb', line 138

def create_quiltt_paykey(params)
  parsed, options = Straddle::BridgeCreateQuilttPaykeyParams.dump_request(params)
  header_params = {
    correlation_id: "correlation-id",
    idempotency_key: "idempotency-key",
    request_id: "request-id",
    straddle_account_id: "straddle-account-id"
  }
  @client.request(
    method: :post,
    path: "v1/bridge/quiltt",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Straddle::RevealedPaykeyResponse,
    options: options
  )
end

#create_token(customer_id:, config: nil, external_id: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::BridgeTokenResponse

Some parameter documentations has been truncated, see Models::BridgeCreateTokenParams for more details.

Creates a session token for the Bridge widget.

Parameters:

  • customer_id (String) —

    Body param: Unique identifier for the customer associated with the Bridge sessio

  • config (Straddle::Models::PaykeyConfiguration) —

    Body param

  • external_id (String, nil) —

    Body param: Unique identifier for the paykey in your system.

  • correlation_id (String) —

    Header param: Optional client-generated identifier for tracing a series of relat

  • idempotency_key (String) —

    Header param: Optional client-generated key for an idempotent request.

  • request_id (String) —

    Header param: Optional client-generated identifier for tracing one request.

  • straddle_account_id (String) —

    Header param: For platform requests, the embedded account UUID that sets the req

  • request_options (Straddle::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/straddle/resources/bridge.rb', line 182

def create_token(params)
  parsed, options = Straddle::BridgeCreateTokenParams.dump_request(params)
  header_params = {
    correlation_id: "correlation-id",
    idempotency_key: "idempotency-key",
    request_id: "request-id",
    straddle_account_id: "straddle-account-id"
  }
  @client.request(
    method: :post,
    path: "v1/bridge/initialize",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Straddle::BridgeTokenResponse,
    options: options
  )
end