Module: Unit::StopPayment

Defined in:
lib/unit/models/stop_payment/stop_payment.rb,
lib/unit/models/stop_payment/list_stop_payment_params.rb,
lib/unit/models/stop_payment/create_stop_payment_request.rb

Defined Under Namespace

Classes: CreateStopPaymentRequest, ListStopPaymentParams

Constant Summary collapse

STOP_PAYMENT_LIMIT =
100
STOP_PAYMENT_OFFSET =
0

Class Method Summary collapse

Class Method Details

.create_stop_payment(account_id:, amount:, check_number:, tags: nil, idempotency_key: nil) ⇒ Object

Create a stop payment

Parameters:

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

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

See Also:



18
19
20
21
# File 'lib/unit/models/stop_payment/stop_payment.rb', line 18

def create_stop_payment(account_id:, amount:, check_number:, tags: nil, idempotency_key: nil)
  request = CreateStopPaymentRequest.new(, amount, check_number, tags, idempotency_key)
  Unit::Resource::StopPaymentResource.create_payment(request)
end

.disable_stop_payment(payment_id:) ⇒ Object

Disable a stop payment

Parameters:

  • payment_id (String)

See Also:



56
57
58
# File 'lib/unit/models/stop_payment/stop_payment.rb', line 56

def disable_stop_payment(payment_id:)
  Unit::Resource::StopPaymentResource.disable_payment(payment_id)
end

.get_payment(payment_id:) ⇒ Object

Get a stop payment

Parameters:

  • payment_id (String)

See Also:



26
27
28
# File 'lib/unit/models/stop_payment/stop_payment.rb', line 26

def get_payment(payment_id:)
  Unit::Resource::StopPaymentResource.get(payment_id)
end

.list_stop_payment(limit: STOP_PAYMENT_LIMIT, offset: STOP_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 stop payments

Parameters:

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

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



45
46
47
48
49
50
51
# File 'lib/unit/models/stop_payment/stop_payment.rb', line 45

def list_stop_payment(limit: STOP_PAYMENT_LIMIT, offset: STOP_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 = ListStopPaymentParams.new(limit, offset, , customer_id, tags, sort, since, _until,
                                      status, from_amount, to_amount, check_number, include)
  Unit::Resource::StopPaymentResource.list(request)
end