Class: StraddlePay::Resources::Bridge

Inherits:
Base
  • Object
show all
Defined in:
lib/straddle_pay/resources/bridge.rb

Overview

Bank account linking via Bridge.

Constant Summary

Constants inherited from Base

StraddlePay::Resources::Base::HEADER_KEYS

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from StraddlePay::Resources::Base

Instance Method Details

#initialize_session(customer_id:, **options) ⇒ Hash

Initialize a Bridge session for a customer.

Parameters:

  • customer_id (String)

    customer ID

Returns:

  • (Hash)

    session details



14
15
16
17
18
# File 'lib/straddle_pay/resources/bridge.rb', line 14

def initialize_session(customer_id:, **options)
  payload = { customer_id: customer_id, **options }.compact
  headers = extract_headers(payload)
  @client.post("v1/bridge/initialize", payload, headers: headers)
end

Returns bank account link sub-resource.

Returns:



8
# File 'lib/straddle_pay/resources/bridge.rb', line 8

def links = @links ||= BridgeLinks.new(@client)

#speedchex(customer_id:, speedchex_token:, **options) ⇒ Hash

Create a paykey from a Speedchex token.

Parameters:

  • customer_id (String)

    customer ID

  • speedchex_token (String)

    Speedchex token

  • options (Hash)

    additional fields or header params

Returns:

  • (Hash)

    created paykey



26
27
28
29
30
31
32
# File 'lib/straddle_pay/resources/bridge.rb', line 26

def speedchex(customer_id:, speedchex_token:, **options)
  payload = {
    customer_id: customer_id, speedchex_token: speedchex_token, **options
  }.compact
  headers = extract_headers(payload)
  @client.post("v1/bridge/speedchex", payload, headers: headers)
end