mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 19:01:19 +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'],
|
||||
maxAmount: 25,
|
||||
editable: false,
|
||||
budgetRenewal: 'monthly',
|
||||
budgetRenewal: 'daily',
|
||||
expiresAt: yearFromNow,
|
||||
};
|
||||
await newNwc.initNWC(initNwcOptions);
|
||||
|
@ -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: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user