Class: StraddlePay::Resources::FundingEvents

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

Overview

Query funding events (bank settlement records).

Constant Summary

Constants inherited from Base

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

#get(id, **options) ⇒ Hash

Retrieve a funding event by ID.

Parameters:

  • funding event ID

Returns:

  • funding event details



20
21
22
23
# File 'lib/straddle_pay/resources/funding_events.rb', line 20

def get(id, **options)
  headers = extract_headers(options)
  @client.get("v1/funding_events/#{id}", headers: headers)
end

#list(**options) ⇒ Hash

List funding events with optional filters.

Parameters:

  • filter/pagination params

Returns:

  • paginated funding event list



11
12
13
14
# File 'lib/straddle_pay/resources/funding_events.rb', line 11

def list(**options)
  headers = extract_headers(options)
  @client.get("v1/funding_events", params: options, headers: headers)
end

#simulate(**options) ⇒ Hash

Simulate a funding event in sandbox.

Parameters:

  • simulation payload

Returns:

  • simulated funding event



29
30
31
32
33
# File 'lib/straddle_pay/resources/funding_events.rb', line 29

def simulate(**options)
  payload = options.compact
  headers = extract_headers(payload)
  @client.post("v1/funding_events/simulate", payload.empty? ? nil : payload, headers: headers)
end