48 Commits
Author SHA1 Message Date
ndeet 9da65a6bad Merge pull request #18 from SatoDri/18.0-fix-security-and-ipn
Fix amount tampering, broken IPN URL and invoice status handling
v18.0.1.1
2026-08-07 16:57:56 +02:00
Sato DRI e11cbab174 Merge pull request #1 from ndeet/satodri-18-fixes
Hardening the payment flow
2026-08-07 16:47:43 +02:00
ndeet fadfb0f6a8 * 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 16:25:15 +02:00
SatoDri 9dc936ef33 Build the BTCPay invoice server-side and fix notification handling
Security: the checkout controller built the BTCPay invoice from the POSTed
redirect-form data (price, currency, orderId), and the IPN never checked
the settled amount 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 the settled amount and currency returned by
BTCPay are verified before the transaction 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.
- Let the payment framework confirm the order and send the confirmation
  email via its post-processing, instead of calling
  _check_amount_and_confirm_order() and _send_order_confirmation_mail()
  manually, which sent the confirmation email twice.
- Fix a crsf=False typo (was disabling nothing) to csrf=False on the
  return route, and drop the redundant _handle_notification_data override
  that duplicated the core method.
- Guard against a missing reference instead of calling all() on it.
2026-07-19 23:56:03 +02:00
SatoDri 9705023233 Remove dead payment.provider create() override
The override guarded on self.code inside create(), which is empty on the
model-level recordset, so the branch never ran; it also called a
misspelled helper (generate_privakey). Removing it lets the private key be
generated during pairing as intended, and keeps copying a provider from
regenerating (and thus invalidating) an already paired key.
2026-07-19 23:56:03 +02:00
SatoDri dc6b7a5758 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-19 23:56:03 +02:00
ndeet b935000fda Odoo 18.0 compatibility. v18.0.1.0 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. v17.0.2.0 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
ndeet 25b06ab911 Preparing module for app store submission. 2024-08-12 13:30:34 +02:00
ndeet 7994834151 Bumping version. v17.0.1.1 2024-07-31 14:21:48 +02:00
ndeet 6042284704 Make sure email is passed, also if used in PoS context. 2024-07-31 14:19:23 +02:00
ndeet 848b1f5e30 Updating teaser image also on primary README 2024-07-17 16:55:25 +02:00
ndeet d3f8e2a60c Updating teaser image. 2024-07-17 16:51:55 +02:00
ndeet 43920ce700 Replace relative links with full github url. 2024-07-16 15:00:55 +02:00
ndeet 7cb3ee2400 Link to Odoo 16 documentation. 2024-07-16 14:50:30 +02:00
ndeet 8cb6afd918 Fix image for btcpayserver docs embedding. 2024-07-09 11:52:14 +02:00
ndeet 86cf5af6fa Adding general readme linking to both versions installation instructions. 2024-07-09 11:11:50 +02:00
ndeet 0742b68e48 Update docs to latest changes.
(cherry picked from commit 9e2475f415)
v17.0.1.0
2024-07-09 10:26:33 +02:00
ndeet 0aa893767d Merge pull request #10 from ndeet/redirect
Simplify setup by removing confirmationURL parameter
2024-07-08 16:38:46 +02:00
ndeet 6a22f82a73 Remove customizable return url and redirect the user to order confirmation / payment status page as it would be expected. 2024-07-08 16:37:32 +02:00
ndeet 17cb4f7814 Fix IPN processing to cover additional invoice states. 2024-07-08 11:12:29 +02:00
ndeet c469a3b4c1 Fix typo. 2024-07-08 09:18:47 +02:00
ndeet cfbee77a5b Porting module to work with Odoo 17.0 (#9) 2024-07-08 09:10:22 +02:00
ndeet 27670dae99 Improvements (#6)
* Add external dependencies to manifest to avoid error on module activation; add requirements.txt.
* Readme 
* Fix errors, restructure settings form, update installation steps, streamline overall.
* Change version
2024-07-03 14:49:50 +02:00
vandekul 7930e3eb30 BTCPay Library Included 2023-11-13 14:40:43 +01:00
vandekul a37990667a Image modify 2023-09-19 14:40:53 +02:00
vandekul 411b83fb06 Modify Image for documentation 2023-09-19 14:37:35 +02:00
vandekul 73d2feabbe Modify url and delete notifyMailer field 2023-09-19 14:20:00 +02:00
vandekul feb4aa72b7 License and Readme 2023-09-19 12:10:37 +02:00
vandekul fa5d459fa2 Bug in duplicate providers 2023-09-18 12:04:39 +02:00
vandekul 7810629596 New version 16.0 2023-09-15 14:42:14 +02:00
vandekul ac2194498a Merge branch '9.0' of github.com:zynthian/addons-vandekul into 9.0 2023-07-26 18:13:22 +02:00
jofemodo 2e832d5b18 Add alternate icons for the payment acquirer. 2022-04-02 20:32:24 +02:00
jofemodo bad3ea017b + Improve BTCPay IPN controller handler for avoiding uneeded API call to BTCPay.
+ Add some logging/error messages.
2022-04-02 20:31:06 +02:00
susanna 80ce33f40d Error IPN 2021-11-05 13:05:56 +01:00
susanna 0c251a6790 Modify IPN error 2021-11-05 11:57:07 +01:00
jofemodo 25aecac922 Fix recently added Bitcoin icon. 2020-09-15 14:22:43 +02:00
jofemodo b2820f1cb2 Add Bitcoin icon for using on the payment button. 2020-09-15 13:57:06 +02:00
vandekul 01d2a36d37 Exception control in return status 2020-09-11 12:31:35 +02:00
vandekul 363c4169dc Bug solved in xml files structure 2020-09-10 23:52:16 +02:00
vandekul e980bad67e Merge branch '9.0' of github.com:vandekul/addons-vandekul into 9.0 2020-04-11 01:05:56 +02:00
vandekul 0aa10bf49c Validate provide BTCPay for new fields controll 2020-04-11 01:04:08 +02:00
Susanna ef6f02da2a Update README.md 2020-04-11 00:10:27 +02:00
Susanna 8844df3cb6 Update README.md 2020-04-11 00:08:24 +02:00
vandekul 73f0c9996f Price modify 2020-04-10 23:27:12 +02:00
vandekul 169b913804 Initial Addons 2020-04-10 23:04:44 +02:00