mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
Update cron to be one day 25 sats to test recurring subscriptions
This commit is contained in:
parent
3c9a91e7d8
commit
c33aecea5c
@ -96,7 +96,7 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
|||||||
requestMethods: ['pay_invoice'],
|
requestMethods: ['pay_invoice'],
|
||||||
maxAmount: 25,
|
maxAmount: 25,
|
||||||
editable: false,
|
editable: false,
|
||||||
budgetRenewal: 'monthly',
|
budgetRenewal: 'daily',
|
||||||
expiresAt: yearFromNow,
|
expiresAt: yearFromNow,
|
||||||
};
|
};
|
||||||
await newNwc.initNWC(initNwcOptions);
|
await newNwc.initNWC(initNwcOptions);
|
||||||
|
@ -193,13 +193,15 @@ export const updateUserSubscription = async (userId, isSubscribed, nwc) => {
|
|||||||
|
|
||||||
export const findExpiredSubscriptions = async () => {
|
export const findExpiredSubscriptions = async () => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const thirtyOneDaysAgo = new Date(now.getTime() - 31 * 24 * 60 * 60 * 1000);
|
// const thirtyOneDaysAgo = new Date(now.getTime() - 31 * 24 * 60 * 60 * 1000);
|
||||||
|
const oneDayAndOneHourAgo = new Date(now.getTime() - 1 * 24 * 60 * 60 * 1000 - 1 * 60 * 60 * 1000);
|
||||||
|
|
||||||
return await prisma.role.findMany({
|
return await prisma.role.findMany({
|
||||||
where: {
|
where: {
|
||||||
subscribed: true,
|
subscribed: true,
|
||||||
lastPaymentAt: {
|
lastPaymentAt: {
|
||||||
lt: thirtyOneDaysAgo
|
// lt: thirtyOneDaysAgo
|
||||||
|
lt: oneDayAndOneHourAgo
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user