Class: BridgeBankin::Transaction

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

Overview

Transaction resource

Constant Summary collapse

RESOURCE_TYPE =
"transaction"

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(id:, access_token:, **params) ⇒ Transaction

Retrieve a single transaction for logged in user

Parameters:

  • id (Integer)

    the 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:



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

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

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

List all logged in user transactions

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/transaction.rb', line 21

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

.list_by_account(account_id:, access_token:, **params) ⇒ Array<Transaction>

List all logged in user transactions for a specific account

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/transaction.rb', line 67

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

.list_by_iban(access_token:, **params) ⇒ Array<Transaction>

List all logged in user transactions with a specific IBAN

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:



97
98
99
100
101
102
# File 'lib/bridge_bankin/transaction.rb', line 97

def list_by_iban(access_token:, **params)
  protected_resource(access_token) do
    data = api_client.post("/v2/transactions/search", **params)
    convert_to_bridge_object(**data)
  end
end

.list_updated(access_token:, **params) ⇒ Array<Transaction>

List all logged in user updated transactions

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:



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

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

.list_updated_by_account(account_id:, access_token:, **params) ⇒ Array<Transaction>

List all logged in user updated transactions for a specific account

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/transaction.rb', line 82

def (account_id:, access_token:, **params)
  protected_resource(access_token) do
    data = api_client.get("/v2/accounts/#{}/transactions/updated", **params)
    convert_to_bridge_object(**data)
  end
end