Class: BridgeBankin::Transfer

Inherits:
BridgeObject show all
Extended by:
API::Resource
Defined in:
lib/bridge_bankin/transfer.rb

Overview

Transfer resource

Constant Summary collapse

RESOURCE_TYPE =
"transfert"

Constants inherited from BridgeObject

BridgeObject::HIDDEN_ATTRIBUTES

Class Method Summary collapse

Methods inherited from BridgeObject

#==, convert_to_bridge_object, #initialize, #to_hash, #to_json

Constructor Details

This class inherits a constructor from BridgeBankin::BridgeObject

Class Method Details

.find(uuid:, access_token:, **params) ⇒ Transfer

Retrieve a single transfer for the logged in user

Parameters:

  • uuid (UUID)

    the uuid of the requested resource

  • access_token (String)

    the access token provided during the user authentication

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:


52
53
54
55
56
57
# File 'lib/bridge_bankin/transfer.rb', line 52

def find(uuid:, access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/transfers/#{uuid}", params)
    convert_to_bridge_object(data)
  end
end

.list(access_token:, **params) ⇒ Array<Transfer>

List all logged in user transfers

Parameters:

  • access_token (String)

    the access token provided during the user authentication

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:

  • (Array<Transfer>)

    the user's transfers


36
37
38
39
40
41
# File 'lib/bridge_bankin/transfer.rb', line 36

def list(access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/transfers", params)
    convert_to_bridge_object(data)
  end
end

.list_all_receiver_accounts(access_token:, **params) ⇒ Array<BridgeObject>

List all receiver transfer accounts

Parameters:

  • access_token (String)

    the access token provided during the user authentication

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:


82
83
84
85
86
87
# File 'lib/bridge_bankin/transfer.rb', line 82

def list_all_receiver_accounts(access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/transfers/accounts/receivers", params)
    convert_to_bridge_object(data)
  end
end

.list_all_sender_accounts(access_token:, **params) ⇒ Array<BridgeObject>

List all sender transfer accounts

Parameters:

  • access_token (String)

    the access token provided during the user authentication

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:


67
68
69
70
71
72
# File 'lib/bridge_bankin/transfer.rb', line 67

def list_all_sender_accounts(access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/transfers/accounts/senders", params)
    convert_to_bridge_object(data)
  end
end

.list_receiver_accounts_for_sender(sender_account_id:, access_token:, **params) ⇒ Array<BridgeObject>

List all receiver transfer accounts for a specific sender account

Parameters:

  • sender_account_id (Integer)

    the sender_account_id of the requested resource

  • access_token (String)

    the access token provided during the user authentication

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:


98
99
100
101
102
103
# File 'lib/bridge_bankin/transfer.rb', line 98

def list_receiver_accounts_for_sender(sender_account_id:, access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/transfers/accounts/#{}/receivers", params)
    convert_to_bridge_object(data)
  end
end

.send(access_token:, **params) ⇒ BridgeObject

Request the URL to Bridge's Pay funnel to make a transfer

Parameters:

  • access_token (String)

    the access token provided during the user authentication

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:


21
22
23
24
25
26
# File 'lib/bridge_bankin/transfer.rb', line 21

def send(access_token:, **params)
  protected_resource(access_token) do
    data = api_client.post("/v2/pay/transfer/url", params)
    convert_to_bridge_object(data)
  end
end