Skip to content

Commit e0e3a11

Browse files
authored
fix: confirm invoice confirmedAt is undefined (#320)
1 parent 7969701 commit e0e3a11

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/@types/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface IPaymentsService {
1111
updateInvoice(invoice: Partial<Invoice>): Promise<void>
1212
updateInvoiceStatus(invoice: Pick<Invoice, 'id' | 'status'>): Promise<Invoice>
1313
confirmInvoice(
14-
invoice: Pick<Invoice, 'id' | 'amountPaid' | 'confirmedAt'>,
14+
invoice: Pick<Invoice, 'id' | 'amountPaid' | 'confirmedAt' | 'status' | 'pubkey'>,
1515
): Promise<void>
1616
sendInvoiceUpdateNotification(invoice: Invoice): Promise<void>
1717
getPendingInvoices(): Promise<Invoice[]>

src/controllers/callbacks/opennode-callback-controller.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export class OpenNodeCallbackController implements IController {
5151
try {
5252
await this.paymentsService.confirmInvoice({
5353
id: invoice.id,
54+
pubkey: invoice.pubkey,
55+
status: updatedInvoice.status,
5456
amountPaid: updatedInvoice.amountRequested,
5557
confirmedAt: updatedInvoice.confirmedAt,
5658
})

src/controllers/callbacks/zebedee-callback-controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ export class ZebedeeCallbackController implements IController {
7070
}
7171

7272
invoice.amountPaid = invoice.amountRequested
73+
invoice.status = updatedInvoice.status
7374
updatedInvoice.amountPaid = invoice.amountRequested
7475

7576
try {
7677
await this.paymentsService.confirmInvoice({
7778
id: invoice.id,
79+
pubkey: invoice.pubkey,
80+
status: invoice.status,
7881
confirmedAt: invoice.confirmedAt,
7982
amountPaid: invoice.amountRequested,
8083
})

0 commit comments

Comments
 (0)