Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: HMAC verification on IPN callback for security #561

Merged

Conversation

Benjamin-Freoua-Alma
Copy link
Member

Reason for change

Linear task

Code changes

We add the call function to isHmacValidated in php client to check is the IPN callback is signed by Alma before to validate the order by IPN

How to test

As a reviewer, you are encouraged to test the PR locally.

Make an order, close the page before the return validation payment
Call the ipn callback with some other browser or API Client to check if the IPN need the Alma signature

Checklist for authors and reviewers

  • The title of the PR uses business wording, not technical jargon, for the changelog readers to understand it
  • The PR implements the changes asked in the referenced task / issue
  • The automated tests are compliant with the testing strategy
  • The tests are relevant, and cover the corner/error cases, not only the happy path
  • You understand the impact of this PR on existing code/features
  • The changes include adequate logging and Datadog traces
  • Documentation is updated (API, developer documentation, ADR, Notion...)

Non applicable

@github-actions github-actions bot added the type: feature New feature label Aug 13, 2024
@Benjamin-Freoua-Alma Benjamin-Freoua-Alma self-assigned this Sep 17, 2024
@Benjamin-Freoua-Alma Benjamin-Freoua-Alma marked this pull request as ready for review September 17, 2024 12:49
@Benjamin-Freoua-Alma Benjamin-Freoua-Alma requested a review from a team as a code owner September 17, 2024 12:49

This comment has been minimized.

This comment has been minimized.

alma/controllers/front/ipn.php Show resolved Hide resolved
alma/controllers/front/ipn.php Show resolved Hide resolved
alma/controllers/front/ipn.php Show resolved Hide resolved
alma/controllers/front/ipn.php Outdated Show resolved Hide resolved
alma/exceptions/PaymentValidationException.php Outdated Show resolved Hide resolved
alma/lib/Validators/PaymentValidation.php Outdated Show resolved Hide resolved
alma/lib/Validators/PaymentValidation.php Outdated Show resolved Hide resolved
alma/lib/Validators/PaymentValidation.php Show resolved Hide resolved

This comment has been minimized.

This comment has been minimized.

Copy link

⏳E2E tests are currently running.
➡️ You can follow their progression here.

Copy link

sonarcloud bot commented Sep 19, 2024

Copy link

❌ E2E tests have failed.
➡️ You can find the results here.

@Benjamin-Freoua-Alma Benjamin-Freoua-Alma merged commit 38454b8 into develop Sep 25, 2024
4 of 5 checks passed
@Benjamin-Freoua-Alma Benjamin-Freoua-Alma deleted the feature/ecom-1818-ps-add-hmac-verification-on-ipn branch September 25, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants