Class: Nombaone::Resources::Settlements
- Inherits:
-
BaseResource
- Object
- BaseResource
- Nombaone::Resources::Settlements
- Defined in:
- lib/nombaone/resources/settlements.rb,
sig/nombaone/resources.rbs
Overview
Settlements — where collected money lands, and how it leaves (refunds, payouts) under the escrow lock. Collections split into a non-refundable platform fee plus the net to your tenant sub-account.
Instance Method Summary collapse
-
#create_payout(amount_in_kobo:, bank_code:, account_number:, request_options: {}) ⇒ NombaObject
Withdraw settled funds to your bank account.
-
#list(status: OMIT, limit: OMIT, cursor: OMIT, request_options: {}) ⇒ Page<NombaObject>
List settlements, newest first.
-
#refund(id, amount_in_kobo: OMIT, request_options: {}) ⇒ NombaObject
Refund a settlement's tenant share.
-
#retrieve(id, request_options: {}) ⇒ NombaObject
Retrieve a settlement by id.
-
#retrieve_escrow(request_options: {}) ⇒ NombaObject
Your escrow lock and available-to-withdraw balance.
Methods inherited from BaseResource
#encode, #initialize, #request, #request_page
Constructor Details
This class inherits a constructor from Nombaone::Resources::BaseResource
Instance Method Details
#create_payout(amount_in_kobo:, bank_code:, account_number:, request_options: {}) ⇒ NombaObject
Withdraw settled funds to your bank account.
Money moves here, and the Idempotency-Key doubles as the payout's
durable merchantTxRef. Always pass an explicit, stable
request_options[:idempotency_key] (e.g. your own payout id) — an
auto-generated key protects SDK-level retries, but a brand-new process
retrying with a fresh key would create a second payout.
80 81 82 83 84 85 86 87 88 |
# File 'lib/nombaone/resources/settlements.rb', line 80 def create_payout(amount_in_kobo:, bank_code:, account_number:, request_options: {}) request(:post, "/settlements/payout", body: { amount_in_kobo: amount_in_kobo, bank_code: bank_code, account_number: account_number, }, options: ) end |
#list(status: OMIT, limit: OMIT, cursor: OMIT, request_options: {}) ⇒ Page<NombaObject>
List settlements, newest first.
26 27 28 29 30 |
# File 'lib/nombaone/resources/settlements.rb', line 26 def list(status: OMIT, limit: OMIT, cursor: OMIT, request_options: {}) request_page("/settlements", query: { status: status, limit: limit, cursor: cursor }, options: ) end |
#refund(id, amount_in_kobo: OMIT, request_options: {}) ⇒ NombaObject
Refund a settlement's tenant share. The platform fee is never refunded.
Money moves here. The API requires an Idempotency-Key; the SDK
sends one automatically, but pass your own stable
request_options[:idempotency_key] so a retry from a new process
cannot refund twice.
54 55 56 57 |
# File 'lib/nombaone/resources/settlements.rb', line 54 def refund(id, amount_in_kobo: OMIT, request_options: {}) request(:post, "/settlements/#{encode(id)}/refund", body: { amount_in_kobo: amount_in_kobo }, options: ) end |
#retrieve(id, request_options: {}) ⇒ NombaObject
Retrieve a settlement by id.
15 16 17 |
# File 'lib/nombaone/resources/settlements.rb', line 15 def retrieve(id, request_options: {}) request(:get, "/settlements/#{encode(id)}", options: ) end |
#retrieve_escrow(request_options: {}) ⇒ NombaObject
Your escrow lock and available-to-withdraw balance.
36 37 38 |
# File 'lib/nombaone/resources/settlements.rb', line 36 def retrieve_escrow(request_options: {}) request(:get, "/settlements/escrow", options: ) end |