Skip to content

Commit

Permalink
add language
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoPalmeiro committed Jan 30, 2025
1 parent 9e2cf8f commit 918a141
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@RequiredArgsConstructor
public class FeesPaymentController {

public static final String FEES_PAYMENT_REQUEST_URL = "/fees/case/{caseReference}/payment";
public static final String FEES_PAYMENT_REQUEST_URL = "/fees/case/{caseReference}/{language}payment";
public static final String FEES_PAYMENT_STATUS_URL = "/fees/case/{caseReference}/payment/{paymentReference}/status";
private final FeesPaymentService feesPaymentService;

Expand All @@ -34,10 +34,11 @@ public class FeesPaymentController {
@ApiResponse(responseCode = "400", description = "Bad Request")})
public ResponseEntity<CardPaymentStatusResponse> createGovPaymentRequest(
@RequestHeader(HttpHeaders.AUTHORIZATION) String authorization,
@PathVariable("caseReference") String caseReference) {
@PathVariable("caseReference") String caseReference,
@PathVariable("language") String language) {

return new ResponseEntity<>(
feesPaymentService.createGovPaymentRequest(caseReference, authorization),
feesPaymentService.createGovPaymentRequest(caseReference, language, authorization),
HttpStatus.OK
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class FeesPaymentService {
private final UpdatePaymentStatusService updatePaymentStatusService;
@Value("${cui-front-end.url}") String cuiFrontEndUrl;

public CardPaymentStatusResponse createGovPaymentRequest(String caseReference, String authorization) {
public CardPaymentStatusResponse createGovPaymentRequest(String caseReference,String language, String authorization) {

log.info("Creating gov Payment request url for caseId {}", caseReference);
log.info("Creating gov Payment request url for caseId {} {}", caseReference, language);
CaseDetails caseDetails = coreCaseDataService.getCase(Long.valueOf(caseReference));
CaseData caseData = caseDetailsConverter.toCaseData(caseDetails);
String parentCaseRef = caseData.getParentCaseReference();
Expand All @@ -48,7 +48,7 @@ public CardPaymentStatusResponse createGovPaymentRequest(String caseReference, S
.divide(BigDecimal.valueOf(100), RoundingMode.CEILING)
.setScale(2, RoundingMode.CEILING))
.currency("GBP")
.language(caseData.isApplicantBilingual() ? "cy" : "En")
.language(language)
.returnUrl(cuiFrontEndUrl + returnUrlSubPath + caseReference)
.build();
CardPaymentServiceRequestResponse govPayCardPaymentRequest = paymentStatusService
Expand Down

0 comments on commit 918a141

Please sign in to comment.