mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 10:51:20 +00:00
Merge pull request #12 from AustinKelsay/feature/detailed-payment-memos
Add memo with user id and content id when there are purchases or subscriptions
This commit is contained in:
commit
0a3872b7f8
@ -79,7 +79,8 @@ const CoursePaymentButton = ({ lnAddress, amount, onSuccess, onError, courseId }
|
||||
const ln = new LightningAddress(lnAddress);
|
||||
await ln.fetch();
|
||||
const invoice = await ln.requestInvoice({
|
||||
satoshi: discountApplied ? calculateDiscount(amount).discountedAmount : amount
|
||||
satoshi: discountApplied ? calculateDiscount(amount).discountedAmount : amount,
|
||||
comment: `Course Purchase: ${courseId}, User: ${session?.user?.id}`
|
||||
});
|
||||
setInvoice(invoice);
|
||||
setDialogVisible(true);
|
||||
|
@ -54,7 +54,7 @@ const ResourcePaymentButton = ({ lnAddress, amount, onSuccess, onError, resource
|
||||
try {
|
||||
const ln = new LightningAddress(lnAddress);
|
||||
await ln.fetch();
|
||||
const invoice = await ln.requestInvoice({ satoshi: amount });
|
||||
const invoice = await ln.requestInvoice({ satoshi: amount, comment: `Resource Purchase: ${resourceId}, User: ${session?.user?.id}` });
|
||||
setInvoice(invoice);
|
||||
setDialogVisible(true);
|
||||
} catch (error) {
|
||||
|
@ -60,7 +60,7 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
||||
try {
|
||||
const ln = new LightningAddress(lnAddress);
|
||||
await ln.fetch();
|
||||
const newInvoice = await ln.requestInvoice({ satoshi: amount });
|
||||
const newInvoice = await ln.requestInvoice({ satoshi: amount, comment: `Subscription Purchase. User: ${session?.user?.id}` });
|
||||
return newInvoice;
|
||||
} catch (error) {
|
||||
console.error('Error fetching invoice:', error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user