Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions types/recurringPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type RecurringPaymentStatus = "Active" | "Completed" | "Disabled"

export type Interval = "Monthly"

export type RecurringPayment = RecurringCreditAchPayment
export type RecurringPayment = RecurringCreditAchPayment | RecurringCreditBookPayment

interface RecurringPaymentAttributes {
/**
Expand Down Expand Up @@ -115,11 +115,6 @@ export interface RecurringCreditBookPayment {
* JSON object representing the recurring payment resource.
*/
attributes: {
/**
* Represents the number of payments that were created by this recurring payment.
*/
numberOfPayments: number

/**
* If this field is populated, its contents will be returned as the bookTransaction’s summary field (maximum of 100 characters).
*/
Expand Down Expand Up @@ -160,6 +155,11 @@ interface BaseSchedule {
* Interval of the schedule. Can be Monthly.
*/
interval?: Interval

/**
* Optional. Total number of payment repetitions. Positive integers only.
*/
totalNumberOfPayments?: number
}

export type CreateSchedule = BaseSchedule
Expand All @@ -169,7 +169,7 @@ export interface Schedule extends BaseSchedule {
* RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs
* The next scheduled date of the action.
*/
nextScheduledAction?: string
nextScheduledAction: string
}

export type CreateRecurringPaymentRequest = CreateRecurringCreditAchPaymentRequest | CreateRecurringCreditBookPaymentRequest
Expand All @@ -190,6 +190,11 @@ interface CreateRecurringRequestAttributes {
*/
schedule: CreateSchedule

/**
* See [Idempotency](https://docs.unit.co/#intro-idempotency).
*/
idempotencyKey?: string

/**
* See [Tags](https://developers.unit.co/#tags).
*/
Expand Down