đĄDevelop with saaster
Guide to help you get started developing with saaster
Last updated
Guide to help you get started developing with saaster
Last updated
To know which plan or which modules the customer has booked, you can query a struct. This gives you all the relevant information you need to develop your software.
There are two session structs in saaster with which you can get this data:
session.currentPlan
session.currentModules
With the session variable session.currentPlan you get all the data for a booked plan. This is how it looks like:
bookingID
The primary id from table bookings
endDate
The end of the current subscription (date)
invoiceID
The primary id from table invoices, which is joined to the plan
maxUsers
The maximum number of users within this subscription
modulesIncluded
An array with all modules included within this plan
nextPlan
A struct containing the data of the next plan if itâs another one
planID
The primary id from table plans
planName
The name of the current plan
priceMonthly
The price paid monthly
recurring
The current cycle of the plan; ecurring and status
startDate
The start of the current subscription (date)
status
The status of the current subscription; Recurring and status
With the session variable session.currentModules you get all the data you need. This is how it looks like:
includedInCurrentPlan
Whether the module is included within the current plan
invoiceID
The primary id from table invoices, which is joined to the module
moduleData
All data of the corresponding module as a struct
moduleID
The primary id from table modules
Struct moduleStatus:
bookingID
The primary id from table bookings
endDate
The end of the current subscription (date)
fontColor
The font color is used to display a text in that color
recurring
The current cycle of the plan; Recurring and status
startDate
The start of the current subscription (date)
status
The status of the current subscription; Recurring and status
statusText
The status description to display to the customer
statusTitle
The status title to display to the customer
We work in saaster with the term "recurring" to save the cycle of the plan or module. These values are used:
test
The plan is in test mode and will not be automatically renewed
monthly
The plan is in a monthly cycle
yearly
The plan is in a yearly cycle
Furthermore, many different statuses exist to define plans and modules. These values are used as statuses:
test
The plan is in test mode
free
There is a free plan running
active
There is a paid plan running
payment
Waiting for payment from the customer
waiting
Waiting to start the plan (next plan)
canceled
The plan has been canceled by the customer
expired
The plan has expired