btcpayserver / xenforo

MIT License
5 stars 4 forks source link

Manually marking an invoice as paid breaks a webhooks #7

Open pavlenex opened 3 months ago

pavlenex commented 3 months ago

We have noticed that when a customer pays with BTCPay and they over pay the invoice the payment is not added to their account. However, we have notieced to things.

If we manually mark the payment as settled in BTCPay the webhook instantly fails with a status of a red X and not other callback will work on any future payments unless we removed the webhook and add it again.

In addition to this. Even when the payment is manually changed to settled the BTCPay plugin in Xenforo cannot find the transaction.

 _`Error: Could not validate purchasable: Unable to find transaction '25067'`_ 

Below is the full error log in Xenforo minus some edited keys

array(3) { ["signature"] => string(71) "sha256=9c8b026d6XXXXXXXXXXXX0f3983205cf714438f5ad6508bac993e44580f" ["type"] => string(14) "InvoiceSettled" ["body"] => string(472) "{ "deliveryId": "XGCABCXXXXXXXXXbWA2xZc", "webhookId": "BMu7LCXXXXXXXXXXX6rVCz", "originalDeliveryId": "4t2L2VXXXXXXspHw9w", "isRedelivery": true, "type": "InvoiceSettled", "timestamp": 1722213086, "manuallyMarked": true, "overPaid": false, "storeId": "CH3P2hYfLL3XXXXXXXXXXXXXSvsjyzGpSPJTYa", "invoiceId": "GQHsXXXXXXXXXKEHDgD", "metadata": { "request_key": "KYJjkR24XXXXXXXXXXXOxH46c7oe", "purchase_request_id": 18056 } }" }

We are using Xenforo 2.2.16 and the latest BTCPay © BTCPay Server v1.13.5+30d91d0bd BTCPay Provider 1.0.0 ( Xenforo Plugin )

Thank you

Originally posted by @BenjaminM007 in https://github.com/btcpayserver/btcpayserver/discussions/6126

021-projects commented 3 months ago

Hello, @BenjaminM007!

If we manually mark the payment as settled in BTCPay the webhook instantly fails with a status of a red X and not other callback will work on any future payments unless we removed the webhook and add it again.

Does this issue only occur with overpaid invoices? It seems that if you mark an unpaid invoice as settled, there is no such issue.

Could you please clarify what exactly you are paying for: user upgrades or something else from custom add-ons?