Update cron to be one day 25 sats to test recurring subscriptions

This commit is contained in:
austinkelsay 2024-10-06 14:44:20 -05:00
parent 3c9a91e7d8
commit c33aecea5c
2 changed files with 5 additions and 3 deletions

View File

@ -96,7 +96,7 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
requestMethods: ['pay_invoice'],
maxAmount: 25,
editable: false,
budgetRenewal: 'monthly',
budgetRenewal: 'daily',
expiresAt: yearFromNow,
};
await newNwc.initNWC(initNwcOptions);

View File

@ -193,13 +193,15 @@ export const updateUserSubscription = async (userId, isSubscribed, nwc) => {
export const findExpiredSubscriptions = async () => {
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({
where: {
subscribed: true,
lastPaymentAt: {
lt: thirtyOneDaysAgo
// lt: thirtyOneDaysAgo
lt: oneDayAndOneHourAgo
}
},
select: {