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

Class Method Details

.confirm_details(deposit_id:) ⇒ Object

Confirm check deposit details

Parameters:

  • deposit_id (String)

See Also:



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

Parameters:

  • account_id (String)
  • amount (Integer)
  • description (String)
  • tags (Hash) (defaults to: nil)
    • optional

  • idempotency_key (String) (defaults to: nil)
    • optional

See Also:



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(, amount, description, tags, 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

Parameters:

  • deposit_id (String)
  • include (Array<String>) (defaults to: nil)
    • optional

See Also:



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

Parameters:

  • deposit_id (String)
  • is_front_side (Boolean) (defaults to: false)
    • optional

See Also:



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

Parameters:

  • deposit_id (String)
  • is_front_side (Boolean) (defaults to: true)
    • optional

See Also:



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

Parameters:

  • limit (Integer) (defaults to: CHECK_DEPOSIT_LIMIT)
    • optional

  • offset (Integer) (defaults to: CHECK_DEPOSIT_OFFSET)
    • optional

  • account_id (String) (defaults to: nil)
    • optional

  • customer_id (String) (defaults to: nil)
    • optional

  • tags (Hash) (defaults to: nil)
    • optional

  • sort (String) (defaults to: nil)
    • optional

  • include (Array<String>) (defaults to: nil)
    • optional

See Also:



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, , customer_id, tags, sort, include)
  Unit::Resource::CheckDepositResource.list(request)
end

.update_deposit(deposit_id:, tags:) ⇒ Object

Update a check deposit

Parameters:

  • deposit_id (String)
  • tags (Hash)
    • optional

See Also:



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, tags)
  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

Parameters:

  • deposit_id (String)
  • file_content (String)
  • is_front_side (Boolean) (defaults to: false)
    • optional

See Also:



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

Parameters:

  • deposit_id (String)
  • file_content (String)
  • is_front_side (Boolean) (defaults to: true)
    • optional

See Also:



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