question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Partially paid and expired invoice with late overpayment

See original GitHub issue

What is your BTCPay version?

v1.6.10.0

How did you deploy BTCPay Server?

btcpayserver-docker

What happened?

Following use case:

  • an invoice gets partially paid and expires
  • after expiration the invoice is overpaid

Problem 1: UI

In the invoice details you can’t see in any way that the invoice was overpaid as the invoice status is “Expired (PaidLate)” (or I miss something?)

Shown invoice was over `0.00013790’ BTC:

  • first payment was 0.00010790 BTC then the invoice expired
  • second payment was 0.00010100 BTC

I can’t see that this was an overpayment as I do not see the original BTC value anywhere. The amount “Due” should be negative?

Also the invoice status is “Expired” and additional status is “PaidLate” instead of “PaidOver”?

image

Problem 2: webhook events

The webhook events of InvoiceReceivedPayment and InvoicePaymentSettled do also not reflect that it is an overpayment. The field overPaid is false both times, expected to be true.

{
  "afterExpiration": true,
  "paymentMethod": "BTC",
  "payment": {
    "id": "fd8f11483c1804142599cd3ba59e3d456252880f357fe9d2d65792a7851fbbbc-1",
    "receivedDate": 1663672742,
    "value": "0.000101",
    "fee": "0.000001",
    "status": "Invalid",
    "destination": "my7iba8Gxo7WqcwH9H4pD6z176SBKScVsc"
  },
  "overPaid": false,
  "deliveryId": "5xHgTQYuVVaSsFuu8UMyY6",
  "webhookId": "Hy3bxuiiioYwcvjjH7g87",
  "originalDeliveryId": "5xHgTQYuVVaSsFuu8UMyY6",
  "isRedelivery": false,
  "type": "InvoiceReceivedPayment",
  "timestamp": 1663672742,
  "storeId": "4bc71hXipmSvK7e9PAGsRqW61EhtpmATsjcyMu5ko3sL",
  "invoiceId": "YAugfJRpSR7Sea5i1ujgoJ"
}
{
  "afterExpiration": true,
  "paymentMethod": "BTC",
  "payment": {
    "id": "5ec9b5fd504dccde8e9f04efe13a12fd000c686c9296502ba462612d1487316b-0",
    "receivedDate": 1663672018,
    "value": "0.0001079",
    "fee": "0.0",
    "status": "Settled",
    "destination": "my7iba8Gxo7WqcwH9H4pD6z176SBKScVsc"
  },
  "overPaid": false,
  "deliveryId": "RnDovMYKE9KEZBvVvZfLYd",
  "webhookId": "Hy3bxuiiioYwcvjjH7g87",
  "originalDeliveryId": "RnDovMYKE9KEZBvVvZfLYd",
  "isRedelivery": false,
  "type": "InvoicePaymentSettled",
  "timestamp": 1663673249,
  "storeId": "4bc71hXipmSvK7e9PAGsRqW61EhtpmATsjcyMu5ko3sL",
  "invoiceId": "YAugfJRpSR7Sea5i1ujgoJ"
}

How did you encounter this bug?

partially pay invoice, let it expire and overpay the remaining amount

Relevant log output

No response

What browser do you use?

No response

Additional information

No response

Are you sure this is a bug report?

  • I confirm this is a bug report

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
bolatovumarcommented, Oct 5, 2022

@ndeet addressed in #4192

1reaction
ndeetcommented, Sep 28, 2022

@bolatovumar we discussed in dev call right now. The conclusion was that we should make sure to show the overpaid column on the invoice summary even if the status is paidLate (maybe also any other status) so it is always clear there was an overpayment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Overpayments where an amount is debited that is ...
Here's how to do it: Edit the invoice in Xero and change the amount to $606.98; From the Unprocessed Payment in Wise-Pay, click...
Read more >
How can I get a refund on a product or service I purchased ...
First, reach out to the company that sold the product or service to you. Explain the issue. Maybe the product you received was...
Read more >
Medicare Program; Reporting and Returning of ...
Response: We agree that payments that were proper at the time the payment was made do not become overpayments at a later time...
Read more >
20.2.4 Overpayment Interest | Internal Revenue Service
Credit interest is allowed on the overpayment that comprised the original refund from the later of the payment received date, the delinquent return...
Read more >
Understanding and Improving Overpayment Waivers for ...
An overpayment occurs when unemployment insurance (UI) benefits have been paid out to a claimant and it is later found that the claimant...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found