Module: Unit::Repayment
- Defined in:
- lib/unit/models/repayment/repayment.rb,
lib/unit/models/repayment/list_repayment_params.rb,
lib/unit/models/repayment/create_ach_repayment_request.rb,
lib/unit/models/repayment/create_book_repayment_request.rb
Defined Under Namespace
Classes: CreateAchRepaymentRequest, CreateBookRepaymentRequest, ListRepaymentParams
Constant Summary collapse
- REPAYMENT_LIMIT =
100
- REPAYMENT_OFFSET =
0
Class Method Summary collapse
-
.create_ach_repayment(account_id:, credit_account_id:, counterparty_id:, description:, amount:, addenda: nil, tags: nil, idempotency_key: nil, same_day: false) ⇒ Object
Create an ach repayment by calling Unit’s API.
-
.create_book_repayment(account_id:, credit_account_id:, counterparty_account_id:, description:, amount:, transaction_summary_override:, tags: nil, idempotency_key: nil) ⇒ Object
Create a book repayment by calling Unit’s API.
-
.get_repayment(repayment_id:) ⇒ Object
Get a repayment by calling Unit’s API.
-
.list_repayments(limit: REPAYMENT_LIMIT, offset: REPAYMENT_OFFSET, account_id: nil, credit_account_id: nil, customer_id: nil, status: nil, type: nil) ⇒ Object
List repayments by calling Unit’s API.
Class Method Details
.create_ach_repayment(account_id:, credit_account_id:, counterparty_id:, description:, amount:, addenda: nil, tags: nil, idempotency_key: nil, same_day: false) ⇒ Object
Create an ach repayment by calling Unit’s API
46 47 48 49 |
# File 'lib/unit/models/repayment/repayment.rb', line 46 def create_ach_repayment(account_id:, credit_account_id:, counterparty_id:, description:, amount:, addenda: nil, tags: nil, idempotency_key: nil, same_day: false) request = Unit::Repayment::CreateAchRepaymentRequest.new(account_id, credit_account_id, counterparty_id, description, amount, addenda, , idempotency_key, same_day: same_day) Unit::Resource::RepaymentResource.create(request) end |
.create_book_repayment(account_id:, credit_account_id:, counterparty_account_id:, description:, amount:, transaction_summary_override:, tags: nil, idempotency_key: nil) ⇒ Object
Create a book repayment by calling Unit’s API
30 31 32 33 |
# File 'lib/unit/models/repayment/repayment.rb', line 30 def create_book_repayment(account_id:, credit_account_id:, counterparty_account_id:, description:, amount:, transaction_summary_override:, tags: nil, idempotency_key: nil) request = Unit::Repayment::CreateBookRepaymentRequest.new(account_id, credit_account_id, counterparty_account_id, description, amount, transaction_summary_override, , idempotency_key) Unit::Resource::RepaymentResource.create(request) end |
.get_repayment(repayment_id:) ⇒ Object
Get a repayment by calling Unit’s API
16 17 18 |
# File 'lib/unit/models/repayment/repayment.rb', line 16 def get_repayment(repayment_id:) Unit::Resource::RepaymentResource.get(repayment_id) end |
.list_repayments(limit: REPAYMENT_LIMIT, offset: REPAYMENT_OFFSET, account_id: nil, credit_account_id: nil, customer_id: nil, status: nil, type: nil) ⇒ Object
List repayments by calling Unit’s API
60 61 62 63 64 |
# File 'lib/unit/models/repayment/repayment.rb', line 60 def list_repayments(limit: REPAYMENT_LIMIT, offset: REPAYMENT_OFFSET, account_id: nil, credit_account_id: nil, customer_id: nil, status: nil, type: nil) request = Unit::Repayment::ListRepaymentParams.new(limit, offset, account_id, credit_account_id, customer_id, status, type) Unit::Resource::RepaymentResource.list(request) end |