mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-05 00:32:03 +00:00
Set real subscription price and recurring cron job
This commit is contained in:
parent
6040cdf879
commit
18b1271326
@ -27,7 +27,7 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
||||
const router = useRouter();
|
||||
|
||||
const lnAddress = process.env.NEXT_PUBLIC_LIGHTNING_ADDRESS;
|
||||
const amount = 25;
|
||||
const amount = 70000;
|
||||
|
||||
useEffect(() => {
|
||||
initializeBitcoinConnect();
|
||||
@ -94,9 +94,9 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
||||
const initNwcOptions = {
|
||||
name: "plebdevs.com",
|
||||
requestMethods: ['pay_invoice'],
|
||||
maxAmount: 25,
|
||||
maxAmount: 70000,
|
||||
editable: false,
|
||||
budgetRenewal: 'daily',
|
||||
budgetRenewal: 'monthly',
|
||||
expiresAt: yearFromNow,
|
||||
};
|
||||
await newNwc.initNWC(initNwcOptions);
|
||||
@ -259,7 +259,7 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
||||
<AlbyButton handleSubmit={handleRecurringSubscription} />
|
||||
<span className='my-4 text-lg font-bold'>or</span>
|
||||
<p className='text-lg font-bold'>Manually enter NWC URL</p>
|
||||
<span className='text-sm text-gray-500'>*make sure you set a budget of at least 25000 sats and set budget renewal to monthly</span>
|
||||
<span className='text-sm text-gray-500'>*make sure you set a budget of at least 70000 sats and set budget renewal to monthly</span>
|
||||
<input
|
||||
type="text"
|
||||
value={nwcInput}
|
||||
|
@ -187,13 +187,13 @@ export const updateUserSubscription = async (userId, isSubscribed, nwc) => {
|
||||
export const findExpiredSubscriptions = async () => {
|
||||
try {
|
||||
const now = new Date();
|
||||
const oneDayAndOneHourAgo = new Date(now.getTime() - 1 * 24 * 60 * 60 * 1000 - 1 * 60 * 60 * 1000);
|
||||
const oneMonthAndOneHourAgo = new Date(now.getTime() - 1 * 30 * 24 * 60 * 60 * 1000 - 1 * 60 * 60 * 1000);
|
||||
|
||||
const result = await prisma.role.findMany({
|
||||
where: {
|
||||
subscribed: true,
|
||||
lastPaymentAt: {
|
||||
lt: oneDayAndOneHourAgo
|
||||
lt: oneMonthAndOneHourAgo
|
||||
}
|
||||
},
|
||||
select: {
|
||||
|
@ -3,7 +3,7 @@ import { webln } from "@getalby/sdk";
|
||||
import { LightningAddress } from '@getalby/lightning-tools';
|
||||
|
||||
const lnAddress = process.env.LIGHTNING_ADDRESS;
|
||||
const amount = 25; // Set the subscription amount in satoshis
|
||||
const amount = 70000; // Set the subscription amount in satoshis
|
||||
|
||||
export default async function handler(req, res) {
|
||||
// if (req.headers.authorization !== process.env.CRON_SECRET) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user