Hdpi 5499 service call back implementation#1618
Draft
Conversation
- Create `PaymentStatus` enum - Add `FeePaymentEntity` and `FeePaymentRepository` - Add migration `V075__fee_payment.sql` - Extend `PaymentService` to save new fee payments and update status on callback - Implement `PaymentCallBackController` for payment updates - Add `ServiceRequestUpdate` DTO - Update tests for new functionality
…equest creation and simplify method signatures. Remove duplicate callback handler and add helper for party lookup. Ensure new logic persists fee payments using claim data.
…lBackController, and update logging and test names.
…499-Service-call-back-implementation
…ment system for the callback.
CCD diff summary👉 Full report: https://github.com/hmcts/pcs-api/actions/runs/23904078347?check_suite_focus=true No change |
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.
HDPI-5499 - ### Jira link
Change description
This PR implements the payment callback flow for the Fees & Pay service, enabling the application to receive and persist payment status updates from the payments service.
Adds a Flyway migration (V075__fee_payment.sql) creating a fee_payment table to persist payment records, linked to claim and party via foreign keys.
FeePaymentEntity — JPA entity mapped to the new fee_payment table, storing payment amount, status, request reference, and associations to ClaimEntity and PartyEntity.
FeePaymentRepository — Spring Data JPA repository with a findByRequestReference lookup method.
PaymentCallBackController — POST /service-request-update endpoint that receives service request update callbacks from the payments service and delegates to PaymentService.
ServiceRequestUpdate — Deserialisation model for the incoming payment callback payload.
Payment — Nested payment details model within ServiceRequestUpdate.
PaymentStatus enum — PAID, NOT_PAID, PARTIALLY_PAID with case-insensitive string lookup. (NOTE THIS IS NOT DIRECTLY USED YET)
createServiceRequest now saves a new FeePaymentEntity after a successful service request is created.
New processPaymentResponse method looks up an existing FeePaymentEntity by request reference and updates its payment status.
New WireMock stub (payment-success.json) simulates a successful payment service request and fires a webhook callback back to the application.
Testing done
Local round trip testing using a Docker based Wiremock implementation of the payment callback