[16.0][MIG] payment_worldline: backport odoo module from 18 to 16#900
Open
[16.0][MIG] payment_worldline: backport odoo module from 18 to 16#900
Conversation
083e5bb to
e81c275
Compare
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
marcos-mendez
approved these changes
Mar 14, 2026
marcos-mendez
left a comment
There was a problem hiding this comment.
Automated Review -- Tests Passed
All tests for payment_worldline passed successfully on Odoo 16.0.
Environment: Minikube + K8s Job + oca-ci/py3.10-odoo16.0
Test Coverage Suggestions
Coverage Gaps
The existing tests likely cover basic provider setup and transaction processing, but there are several key areas with potential coverage gaps:
- Webhook signature verification failure – The
_verify_notification_signaturemethod incontrollers/main.pyis not tested when the signature is invalid. - Error handling in
_worldline_make_request– Thepayment_provider.pyincludes error handling for API calls, but not all failure modes are tested. - Transaction state transitions – Especially for declined or cancelled payments, which are mapped from Worldline statuses.
- Tokenization flow with payment – The module supports tokenization with payment, but this path may not be fully tested.
- 3D Secure redirection handling – The module mentions support for 3D Secure 2, but there's no explicit test of the redirect flow or handling of 3D Secure responses.
Suggested Test Cases
def test_worldline_verify_signature_invalid(self):
"""Test that invalid webhook signatures raise Forbidden."""
# Create a transaction and mock an invalid signature
# Assert Forbidden is raised during webhook processing
def test_worldline_transaction_status_mapping(self):
"""Test that Worldline statuses are correctly mapped to Odoo transaction states."""
# Simulate different Worldline response statuses and assert correct Odoo state transitions
def test_worldline_tokenization_with_payment(self):
"""Test tokenization flow when a payment is made."""
# Create a transaction with tokenization enabled and assert token is createdCodecov Risk
controllers/main.py::WorldlineController._verify_notification_signature– High risk if not tested trip, especially with invalid signatures.models/payment_provider.py::_worldline_make_request– Risky due to API call and exception handling.models/payment_transaction.py– Risk of missing edge cases in_get_tx_from_notification_dataand_handle_notification_data.
These methods are new or critical and should be covered to avoid regressions.
Automated review by OCA Neural Reviewer + qwen3-coder:30b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.