Skip to content

Classypay tools to translate, generate, and validate recurring dates and frequencies.

License

Notifications You must be signed in to change notification settings

classy-org/classypay-schedule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

classypay-schedule

Classy Pay library to generate a schedule for a recurring start date.

Quickstart

git clone https://github.com/classy-org/classypay-schedule.git
cd classypay-schedule
yarn install
node ./bin/schedule.js

Examples

Get the schedule for a given recurring start date:

node ./bin/schedule.js schedule 2018-06-21

Rules

Leap Year

February 29th will be converted to February 28th during leap years.

Use Case

This tool will be used to generate a schedule for a given ISO date: YYYY-MM-DD. The schedule will include MONTHLY, QUARTERLY, and YEARLY dates that correspond to start dates (stored in Pay) which share the scheduled charge date supplied in the request.

Classy

When a client creates, adds or updates a recurring plan on Classy Pay, Classy Pay will return the schedule as part of the response. In addition, Pay will attempt to sync the schedule with any valid recurring sync operations to APIv2.

Classy Pay

Within Classy Pay itself, the schedule will be used to find all recurring plans which should be charged for the day.

Functions

msort(a, b)Number

Sort.

generateSchedule(date, count, interval)Object

Given a moment, generate a schedule given count and interval.

getSchedule(date)Object

Given a valid ISO date, generate a schedule.

msort(a, b) ⇒ Number

Sort.

Kind: global function
Returns: Number - lt/gt

Param Type Description
a * a
b * b

generateSchedule(date, count, interval) ⇒ Object

Given a moment, generate a schedule given count and interval.

Kind: global function
Returns: Object - A schedule.

Param Type Default Description
date Moment A moment in time.
count number 1 The number of dates to generate.
interval number The number of months to add for each interval.

getSchedule(date) ⇒ Object

Given a valid ISO date, generate a schedule.

Kind: global function
Returns: Object - A schedule.

Param Type Description
date String A valid ISO date.

About

Classypay tools to translate, generate, and validate recurring dates and frequencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published