10 Commits
Author SHA1 Message Date
ndeet 457455edf0 Backward compatibilty fix. 2026-08-12 22:15:19 +02:00
ndeet cab44f0847 Make sure changes from 18.0 are also here:
* Strict invoice and order identity binding.
* IPN lookup by stored invoice ID instead of untrusted order ID.
* Invoice ID stored as provider_reference and checked for reuse.
* Transaction row locking prevents concurrent duplicate checkouts.
* Existing invoices are reused; expired ones are replaced safely.
* Late notifications for replaced invoices are ignored.
* Reduced sensitive webhook logging and restricted IPN to POST.
2026-08-07 20:22:15 +02:00
SatoDri 303bfce067 Build the BTCPay invoice server-side and validate the settled amount
Security: the checkout controller built the BTCPay invoice from the POSTed
redirect-form data (price, currency, orderId), and _extract_amount_data
returned None to opt out of amount validation, so the settled amount was
never checked against the transaction. A buyer could therefore submit an
arbitrary price and confirm an order after paying far less. The invoice is
now built server-side from the transaction, the redirect form only carries
the reference, and _extract_amount_data returns the amount and currency
settled on BTCPay (read back from the invoice in the IPN) so the framework
validates them against the transaction before it is set done.

Other fixes in the notification path:
- Fix the IPN notification URL: it was concatenated without a leading
  slash (base_url + "payment/btcpay/ipn"), producing an unreachable host
  so notifications never arrived. It is now built with urls.url_join.
- Handle the "expired" invoice status (cancel the transaction) instead of
  leaving it pending forever, and set an error on unknown statuses.
2026-07-20 00:06:39 +02:00
SatoDri 023e4060c5 Remove dead payment.provider create() override
The override guarded on self.code, which is empty on the model-level
recordset passed to create(), so the branch never ran. The private key is
generated during pairing (in the onchange) instead, so the override is
dead code; removing it also keeps copying a provider from regenerating
(and thus invalidating) an already paired key.
2026-07-20 00:06:39 +02:00
SatoDri 9f3f702c9f Declare ecdsa as the module Python dependency
The bundled BTCPay client (models/libs) imports ecdsa, while the manifest
and requirements only listed btcpay-python, which is not used (the client
is vendored). Installations that did not already have ecdsa available
failed the external-dependency check. Declare ecdsa instead and bump the
module version.
2026-07-20 00:06:39 +02:00
ndeet 225d4c33c5 Odoo 19 compatibilty (#16)
* Odoo 19 compatibilty.

* Update docs.
2026-03-30 16:36:20 +02:00
ndeet b935000fda Odoo 18.0 compatibility. 2025-01-27 14:50:53 +01:00
ndeet dec467e55b Add troubleshooting to readme. 2024-10-17 13:39:19 +02:00
ndeet a6b435d7e2 Marketplace: make banner work, updating description. 2024-08-12 16:35:47 +02:00
ndeet 706860e35f Rename the module for publish on odoo marketplace. (#12)
* Rename the module for publish on odoo marketplace.

* More renaming needed.
2024-08-12 15:33:59 +02:00