fix payments

This commit is contained in:
Emily
2024-06-11 23:01:54 +02:00
parent 7460ad5ed4
commit b7c3ef19ba
8 changed files with 101 additions and 124 deletions

View File

@@ -57,9 +57,14 @@ export function getPlanFromId(id: number) {
}
}
export function getPlanFromPrice(price: string) {
export function getPlanFromPrice(price: string, testMode: boolean) {
for (const tag of PREMIUM_TAGS) {
const plan = getPlanFromTag(tag);
if (plan.PRICE === price) return plan;
if (testMode) {
if (plan.PRICE_TEST === price) return plan;
} else {
if (plan.PRICE === price) return plan;
}
}
}