mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-05-19 16:32:03 +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
src/components/bitcoinConnect
@ -79,7 +79,8 @@ const CoursePaymentButton = ({ lnAddress, amount, onSuccess, onError, courseId }
|
|||||||
const ln = new LightningAddress(lnAddress);
|
const ln = new LightningAddress(lnAddress);
|
||||||
await ln.fetch();
|
await ln.fetch();
|
||||||
const invoice = await ln.requestInvoice({
|
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);
|
setInvoice(invoice);
|
||||||
setDialogVisible(true);
|
setDialogVisible(true);
|
||||||
|
@ -54,7 +54,7 @@ const ResourcePaymentButton = ({ lnAddress, amount, onSuccess, onError, resource
|
|||||||
try {
|
try {
|
||||||
const ln = new LightningAddress(lnAddress);
|
const ln = new LightningAddress(lnAddress);
|
||||||
await ln.fetch();
|
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);
|
setInvoice(invoice);
|
||||||
setDialogVisible(true);
|
setDialogVisible(true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -60,7 +60,7 @@ const SubscriptionPaymentButtons = ({ onSuccess, onError, onRecurringSubscriptio
|
|||||||
try {
|
try {
|
||||||
const ln = new LightningAddress(lnAddress);
|
const ln = new LightningAddress(lnAddress);
|
||||||
await ln.fetch();
|
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;
|
return newInvoice;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching invoice:', error);
|
console.error('Error fetching invoice:', error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user