Module: Unit::CheckPayment

Defined in:
lib/unit/models/check_payment/get_request.rb,
lib/unit/models/check_payment/check_payment.rb,
lib/unit/models/check_payment/get_image_request.rb,
lib/unit/models/check_payment/list_check_payment_params.rb,
lib/unit/models/check_payment/return_check_payment_request.rb,
lib/unit/models/check_payment/originate_check_payment_request.rb

Defined Under Namespace

Classes: GetImageRequest, GetRequest, ListPaymentParams, OriginateCheckPaymentRequest, ReturnCheckPaymentRequest

Constant Summary collapse

CHECK_PAYMENT_LIMIT =
100
CHECK_PAYMENT_OFFSET =
0

Class Method Summary collapse

Class Method Details

.approve_payment_verification(payment_id:) ⇒ Object

Approve Check Payment Additional Verification



87
88
89
# File 'lib/unit/models/check_payment/check_payment.rb', line 87

def approve_payment_verification(payment_id:)
  Unit::Resource::CheckPaymentResource.approve_payment_verification(payment_id)
end

.cancel_check_payment(payment_id:) ⇒ Object

Cancel Check Payment



94
95
96
# File 'lib/unit/models/check_payment/check_payment.rb', line 94

def cancel_check_payment(payment_id:)
  Unit::Resource::CheckPaymentResource.cancel_payment(payment_id)
end

.get_image(payment_id:, is_front_side: true) ⇒ Object

Get a check deposit image front or back side

Parameters:

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

See Also:



70
71
72
73
# File 'lib/unit/models/check_payment/check_payment.rb', line 70

def get_image(payment_id:, is_front_side: true)
  request = GetImageRequest.new(payment_id, is_front_side: is_front_side)
  Unit::Resource::CheckPaymentResource.get_image(request)
end

.get_payment(payment_id:, include: nil) ⇒ Object

Get a check payment by id

Parameters:

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

See Also:



36
37
38
39
# File 'lib/unit/models/check_payment/check_payment.rb', line 36

def get_payment(payment_id:, include: nil)
  request = GetRequest.new(payment_id, include)
  Unit::Resource::CheckPaymentResource.get(request)
end

.list_payment(limit: CHECK_PAYMENT_LIMIT, offset: CHECK_PAYMENT_OFFSET, account_id: nil, customer_id: nil, tags: nil, sort: nil, since: nil, _until: nil, status: nil, from_amount: nil, to_amount: nil, check_number: nil, include: nil) ⇒ Object

Request to list check payments

Parameters:

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

  • offset (Integer) (defaults to: CHECK_PAYMENT_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

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

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

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

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

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

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

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

See Also:



56
57
58
59
60
61
62
63
# File 'lib/unit/models/check_payment/check_payment.rb', line 56

def list_payment(limit: CHECK_PAYMENT_LIMIT, offset: CHECK_PAYMENT_OFFSET, account_id: nil,
                 customer_id: nil, tags: nil, sort: nil, since: nil, _until: nil, status: nil,
                 from_amount: nil, to_amount: nil, check_number: nil, include: nil)

  request = ListPaymentParams.new(limit, offset, , customer_id, tags, sort, since, _until,
                                  status, from_amount, to_amount, check_number, include)
  Unit::Resource::CheckPaymentResource.list(request)
end

.originate_check_payment(account_id:, customer_id:, customer_type:, amount:, counterparty:, description:, idempotency_key:, memo: nil, send_date: nil, tags: nil) ⇒ Object

Originate a check payment by id

Parameters:

  • account_id (String)
  • customer_id (String)
  • customer_type (String)
  • amount (Integer)
  • counterparty (CheckPaymentCounterparty)
  • description (String)
  • idempotency_key (String)
  • memo (String) (defaults to: nil)
    • optional

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

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

See Also:



27
28
29
30
# File 'lib/unit/models/check_payment/check_payment.rb', line 27

def originate_check_payment(account_id:, customer_id:, customer_type:, amount:, counterparty:, description:, idempotency_key:, memo: nil, send_date: nil, tags: nil)
  request = OriginateCheckPaymentRequest.new(, customer_id, customer_type, amount, counterparty, description, idempotency_key, memo, send_date, tags)
  Unit::Resource::CheckPaymentResource.originate_payment(request)
end

.return_payment(payment_id:, return_reason_code:) ⇒ Object

Return check payment by id

Parameters:

  • payment_id (String)
  • return_reason_code (String)

See Also:



79
80
81
82
# File 'lib/unit/models/check_payment/check_payment.rb', line 79

def return_payment(payment_id:, return_reason_code:)
  request = ReturnCheckPaymentRequest.new(payment_id, return_reason_code)
  Unit::Resource::CheckPaymentResource.return_payment(request)
end