Use the following guides to QA Payment
A student does NOT pay for the same course twice.
The array of enrollmentCosts
on the course is to provide a discounted rate on subsequent purchases of courses in Aktiv as a whole.
So imagine we have courseA
with enrollementCosts:[25$, 20$]
and courseB
with enrollementCosts:[42$, 33$]
. StudentX first pays for courseA
at 25$, then pays for courseB
at $33 (he pays for courseB
at 33$ instead of 42$ because he has already paid for a course beforehand - courseA
).
In other words, we keep like a running total of course purchases a student has made in the company. And then potentially provide discounts on subsequent purchases for courses.
Now, courseB
must have dynamic pricing enabled for the student to be offered a reduced rate (courseB.staticPricing != true
).
Also we only scope previous course purchases that match the following criteria: courseA.deleted != true
, courseA.type == PAID
and courseA.staticPricing != true
.
In other words a previous purchase for a course that has since been deleted, or has since changed to non-paid, or was/is statically priced then it DOES NOT COUNT when considering discounts on subsequent purchases.