Module: Unit::ReceivedPayment

Defined in:
lib/unit/models/received_payment/received_payment.rb,
lib/unit/models/received_payment/list_payment_params.rb,
lib/unit/models/received_payment/patch_payment_request.rb

Defined Under Namespace

Classes: ListPaymentParams, PatchPaymentRequest

Constant Summary collapse

RECEIVED_PAYMENT_LIMIT =
100
RECEIVED_PAYMENT_OFFSET =
0

Class Method Summary collapse

Class Method Details

.advance_payment(payment_id:) ⇒ Object

Advance a received payment by calling Unit’s API

Parameters:

  • payment_id (String)

See Also:



49
50
51
# File 'lib/unit/models/received_payment/received_payment.rb', line 49

def advance_payment(payment_id:)
  Unit::Resource::ReceivedPaymentResource.advance_payment(payment_id)
end

.get_payment(payment_id:) ⇒ Object

Get received ach payment by calling Unit’s API

Parameters:

  • payment_id (String)

See Also:



15
16
17
# File 'lib/unit/models/received_payment/received_payment.rb', line 15

def get_payment(payment_id:)
  Unit::Resource::ReceivedPaymentResource.get_payment(payment_id)
end

.list_payments(limit: RECEIVED_PAYMENT_LIMIT, offset: RECEIVED_PAYMENT_OFFSET, account_id: nil, customer_id: nil, status: nil, include_completed: nil, tags: nil, sort: nil, include: nil) ⇒ Object

List ach payments by calling Unit’s API

Parameters:

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

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

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

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

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

  • include_completed (Boolean) (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:



39
40
41
42
43
44
# File 'lib/unit/models/received_payment/received_payment.rb', line 39

def list_payments(limit: RECEIVED_PAYMENT_LIMIT, offset: RECEIVED_PAYMENT_OFFSET, account_id: nil, customer_id: nil, status: nil,
                  include_completed: nil, tags: nil, sort: nil, include: nil)
  request = Unit::ReceivedPayment::ListPaymentParams.new(limit, offset, , customer_id, status,
                                                         include_completed, tags, sort, include)
  Unit::Resource::ReceivedPaymentResource.list_payments(request)
end

.update_payment(payment_id:, tags: nil) ⇒ Object

Update a received ACH payment by calling Unit’s API

Parameters:

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

See Also:



23
24
25
26
# File 'lib/unit/models/received_payment/received_payment.rb', line 23

def update_payment(payment_id:, tags: nil)
  request = Unit::ReceivedPayment::PatchPaymentRequest.new(payment_id, tags)
  Unit::Resource::ReceivedPaymentResource.update_payment(request)
end