Module: Unit::RecurringPayment

Defined in:
lib/unit/models/recurring_payment/recurring_payment.rb,
lib/unit/models/recurring_payment/list_recurring_payment_params.rb,
lib/unit/models/recurring_payment/create_recurring_debit_ach_payment_request.rb,
lib/unit/models/recurring_payment/create_recurring_credit_ach_payment_request.rb,
lib/unit/models/recurring_payment/create_recurring_credit_book_payment_request.rb

Defined Under Namespace

Classes: CreateRecurringCreditAchPaymentRequest, CreateRecurringCreditBookPaymentRequest, CreateRecurringDebitAchPaymentRequest, ListRecurringPaymentParams

Constant Summary collapse

RECURRING_PAYMENT_LIMIT =
100
RECURRING_PAYMENT_OFFSET =
0

Class Method Summary collapse

Class Method Details

.create_recurring_credit_ach_payment(account_id:, counterparty_id:, amount:, description:, schedule:, addenda: nil, idempotency_key: nil, tags: nil) ⇒ Object

Create a recurring credit ACH payment

Parameters:

  • account_id (String)
  • counterparty_id (String)
  • amount (Integer)
  • description (String)
  • schedule (CreateSchedule)
  • addenda (String) (defaults to: nil)
    • optional

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

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

See Also:



40
41
42
43
# File 'lib/unit/models/recurring_payment/recurring_payment.rb', line 40

def create_recurring_credit_ach_payment(account_id:, counterparty_id:, amount:, description:, schedule:, addenda: nil, idempotency_key: nil, tags: nil)
  request = Unit::RecurringPayment::CreateRecurringCreditAchPaymentRequest.new(, counterparty_id, amount, description, schedule, addenda, idempotency_key, tags)
  Unit::Resource::RecurringPaymentResource.create_recurring_payment(request)
end

.create_recurring_credit_book_payment(account_id:, counterparty_id:, amount:, description:, schedule:, transaction_summary_override: nil, idempotency_key: nil, tags: nil) ⇒ Object

Create a recurring credit book payment

Parameters:

  • account_id (String)
  • counterparty_id (String)
  • amount (Integer)
  • description (String)
  • schedule (CreateSchedule)
  • transaction_summary_override (String) (defaults to: nil)
    • optional

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

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

See Also:



23
24
25
26
27
28
# File 'lib/unit/models/recurring_payment/recurring_payment.rb', line 23

def create_recurring_credit_book_payment(account_id:, counterparty_id:, amount:, description:,
                                         schedule:, transaction_summary_override: nil, idempotency_key: nil, tags: nil)
  request = Unit::RecurringPayment::CreateRecurringCreditBookPaymentRequest.new(, counterparty_id, amount, description, schedule,
                                                                                transaction_summary_override, idempotency_key, tags)
  Unit::Resource::RecurringPaymentResource.create_recurring_payment(request)
end

.create_recurring_debit_ach_payment(account_id:, counterparty_id:, amount:, description:, schedule:, addenda: nil, idempotency_key: nil, tags: nil, verify_counterparty_balance: nil, same_day: nil) ⇒ Object

Create a recurring debit ACH payment

Parameters:

  • account_id (String)
  • counterparty_id (String)
  • amount (Integer)
  • description (String)
  • schedule (CreateSchedule)
  • addenda (String) (defaults to: nil)
    • optional

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

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

  • verify_counterparty_balance (Boolean) (defaults to: nil)
    • optional

  • same_day (Boolean) (defaults to: nil)
    • optional

See Also:



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

def create_recurring_debit_ach_payment(account_id:, counterparty_id:, amount:, description:, schedule:, addenda: nil, idempotency_key: nil, tags: nil,
                                       verify_counterparty_balance: nil, same_day: nil)
  request = Unit::RecurringPayment::CreateRecurringDebitAchPaymentRequest.new(, counterparty_id, amount, description, schedule, addenda, idempotency_key, tags,
                                                                              verify_counterparty_balance, same_day)
  Unit::Resource::RecurringPaymentResource.create_recurring_payment(request)
end

.disable_recurring_payment(recurring_payment_id:) ⇒ Object

Disable a recurring payment

Parameters:

  • recurring_payment_id (String)

See Also:



74
75
76
# File 'lib/unit/models/recurring_payment/recurring_payment.rb', line 74

def disable_recurring_payment(recurring_payment_id:)
  Unit::Resource::RecurringPaymentResource.disable_recurring_payment(recurring_payment_id)
end

.enable_recurring_payment(recurring_payment_id:) ⇒ Object

Enable a recurring payment

Parameters:

  • recurring_payment_id (String)

See Also:



67
68
69
# File 'lib/unit/models/recurring_payment/recurring_payment.rb', line 67

def enable_recurring_payment(recurring_payment_id:)
  Unit::Resource::RecurringPaymentResource.enable_recurring_payment(recurring_payment_id)
end

.get_recurring_payment(recurring_payment_id:) ⇒ Object

Get a recurring payment

Parameters:

  • recurring_payment_id (String)

See Also:



101
102
103
# File 'lib/unit/models/recurring_payment/recurring_payment.rb', line 101

def get_recurring_payment(recurring_payment_id:)
  Unit::Resource::RecurringPaymentResource.get_recurring_payment(recurring_payment_id)
end

.list_recurring_payment(limit: RECURRING_PAYMENT_LIMIT, offset: RECURRING_PAYMENT_OFFSET, account_id: nil, customer_id: nil, status: nil, type: nil, from_start_time: nil, to_start_time: nil, from_end_time: nil, to_end_time: nil, sort: nil) ⇒ Object

List recurring payments

Parameters:

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

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

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

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

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

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

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

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

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

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

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

See Also:



91
92
93
94
95
96
# File 'lib/unit/models/recurring_payment/recurring_payment.rb', line 91

def list_recurring_payment(limit: RECURRING_PAYMENT_LIMIT, offset: RECURRING_PAYMENT_OFFSET, account_id: nil, customer_id: nil, status: nil, type: nil,
                           from_start_time: nil, to_start_time: nil, from_end_time: nil, to_end_time: nil, sort: nil)
  request = Unit::RecurringPayment::ListRecurringPaymentParams.new(limit, offset, , customer_id, status, type,
                                                                   from_start_time, to_start_time, from_end_time, to_end_time, sort)
  Unit::Resource::RecurringPaymentResource.list_recurring_payment(request)
end