Module: Unit::CheckDeposit
- Defined in:
- lib/unit/models/check_deposit/get_request.rb,
lib/unit/models/check_deposit/check_deposit.rb,
lib/unit/models/check_deposit/get_image_request.rb,
lib/unit/models/check_deposit/list_deposit_params.rb,
lib/unit/models/check_deposit/upload_image_request.rb,
lib/unit/models/check_deposit/patch_deposit_request.rb,
lib/unit/models/check_deposit/create_check_deposit_request.rb
Defined Under Namespace
Classes: CreateCheckDepositRequest, GetImageRequest, GetRequest, ListDepositParams, PatchDepositRequest, UploadImageRequest
Constant Summary collapse
- CHECK_DEPOSIT_LIMIT =
100
- CHECK_DEPOSIT_OFFSET =
0
Class Method Summary collapse
-
.confirm_details(deposit_id:) ⇒ Object
Confirm check deposit details.
-
.create_deposit(account_id:, amount:, description:, tags: nil, idempotency_key: nil) ⇒ Object
Create a check deposit.
-
.get_deposit(deposit_id:, include: nil) ⇒ Object
Get a check deposit by calling Unit’s API.
-
.get_image_back(deposit_id:, is_front_side: false) ⇒ Object
Get a check deposit image back side.
-
.get_image_front(deposit_id:, is_front_side: true) ⇒ Object
Get a check deposit image front side.
-
.list_deposit(limit: CHECK_DEPOSIT_LIMIT, offset: CHECK_DEPOSIT_OFFSET, account_id: nil, customer_id: nil, tags: nil, sort: nil, include: nil) ⇒ Object
List check deposits.
-
.update_deposit(deposit_id:, tags:) ⇒ Object
Update a check deposit.
-
.upload_image_back(deposit_id:, file_content:, is_front_side: false) ⇒ Object
Upload an image back side for a check deposit.
-
.upload_image_front(deposit_id:, file_content:, is_front_side: true) ⇒ Object
Upload an image front side for a check deposit.
Class Method Details
.confirm_details(deposit_id:) ⇒ Object
Confirm check deposit details
102 103 104 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 102 def confirm_details(deposit_id:) Unit::Resource::CheckDepositResource.confirm_details(deposit_id) end |
.create_deposit(account_id:, amount:, description:, tags: nil, idempotency_key: nil) ⇒ Object
Create a check deposit
23 24 25 26 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 23 def create_deposit(account_id:, amount:, description:, tags: nil, idempotency_key: nil) request = CreateCheckDepositRequest.new(account_id, amount, description, , idempotency_key) Unit::Resource::CheckDepositResource.create_deposit(request) end |
.get_deposit(deposit_id:, include: nil) ⇒ Object
Get a check deposit by calling Unit’s API
32 33 34 35 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 32 def get_deposit(deposit_id:, include: nil) request = GetRequest.new(deposit_id, include) Unit::Resource::CheckDepositResource.get(request) end |
.get_image_back(deposit_id:, is_front_side: false) ⇒ Object
Get a check deposit image back side
85 86 87 88 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 85 def get_image_back(deposit_id:, is_front_side: false) request = GetImageRequest.new(deposit_id, is_front_side: is_front_side) Unit::Resource::CheckDepositResource.get_image(request) end |
.get_image_front(deposit_id:, is_front_side: true) ⇒ Object
Get a check deposit image front side
76 77 78 79 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 76 def get_image_front(deposit_id:, is_front_side: true) request = GetImageRequest.new(deposit_id, is_front_side: is_front_side) Unit::Resource::CheckDepositResource.get_image(request) end |
.list_deposit(limit: CHECK_DEPOSIT_LIMIT, offset: CHECK_DEPOSIT_OFFSET, account_id: nil, customer_id: nil, tags: nil, sort: nil, include: nil) ⇒ Object
List check deposits
46 47 48 49 50 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 46 def list_deposit(limit: CHECK_DEPOSIT_LIMIT, offset: CHECK_DEPOSIT_OFFSET, account_id: nil, customer_id: nil, tags: nil, sort: nil, include: nil) request = ListDepositParams.new(limit, offset, account_id, customer_id, , sort, include) Unit::Resource::CheckDepositResource.list(request) end |
.update_deposit(deposit_id:, tags:) ⇒ Object
Update a check deposit
94 95 96 97 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 94 def update_deposit(deposit_id:, tags:) request = PatchDepositRequest.new(deposit_id, ) Unit::Resource::CheckDepositResource.update(request) end |
.upload_image_back(deposit_id:, file_content:, is_front_side: false) ⇒ Object
Upload an image back side for a check deposit
67 68 69 70 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 67 def upload_image_back(deposit_id:, file_content:, is_front_side: false) request = UploadImageRequest.new(deposit_id, file_content, is_front_side: is_front_side) Unit::Resource::CheckDepositResource.upload(request) end |
.upload_image_front(deposit_id:, file_content:, is_front_side: true) ⇒ Object
Upload an image front side for a check deposit
57 58 59 60 |
# File 'lib/unit/models/check_deposit/check_deposit.rb', line 57 def upload_image_front(deposit_id:, file_content:, is_front_side: true) request = UploadImageRequest.new(deposit_id, file_content, is_front_side: is_front_side) Unit::Resource::CheckDepositResource.upload(request) end |