fix
This commit is contained in:
parent
d86ee1817c
commit
485fe9dc66
1 changed files with 4 additions and 1 deletions
|
|
@ -164,8 +164,11 @@ export default class {
|
||||||
const isAppUserPayment = userId !== linkedApplication.owner.user_id
|
const isAppUserPayment = userId !== linkedApplication.owner.user_id
|
||||||
const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_INVOICE, payAmount, isAppUserPayment)
|
const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_INVOICE, payAmount, isAppUserPayment)
|
||||||
const internalInvoice = await this.storage.paymentStorage.GetInvoiceOwner(req.invoice)
|
const internalInvoice = await this.storage.paymentStorage.GetInvoiceOwner(req.invoice)
|
||||||
|
if (internalInvoice && internalInvoice.paid_at_unix > 0) {
|
||||||
|
throw new Error("this invoice was already paid")
|
||||||
|
}
|
||||||
const invoiceAlreadyPaid = await this.storage.paymentStorage.GetPaymentOwner(req.invoice)
|
const invoiceAlreadyPaid = await this.storage.paymentStorage.GetPaymentOwner(req.invoice)
|
||||||
if (invoiceAlreadyPaid || (internalInvoice && internalInvoice.paid_at_unix > 0)) {
|
if (invoiceAlreadyPaid && invoiceAlreadyPaid.paid_at_unix > 0) {
|
||||||
throw new Error("this invoice was already paid")
|
throw new Error("this invoice was already paid")
|
||||||
}
|
}
|
||||||
let paymentInfo = { preimage: "", amtPaid: 0, networkFee: 0, serialId: 0 }
|
let paymentInfo = { preimage: "", amtPaid: 0, networkFee: 0, serialId: 0 }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue