Skip to content

Commit 204fd57

Browse files
author
dharmendra kumar
authored
Merge pull request #65 from hmcts/point-to-card-payments-status-api
Point to card payment status api
2 parents 440ac0b + 25de75e commit 204fd57

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/main/java/uk/gov/hmcts/reform/payments/client/PaymentsApi.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ PaymentDto retrieveCardPayment(
4646
@RequestHeader("ServiceAuthorization") String serviceAuthorization
4747
);
4848

49+
@GetMapping("/card-payments/{paymentReference}/statuses")
50+
PaymentDto retrieveCardPaymentStatus(
51+
@PathVariable("paymentReference") String paymentReference,
52+
@RequestHeader("Authorization") String authorization,
53+
@RequestHeader("ServiceAuthorization") String serviceAuthorization
54+
);
55+
4956
@PostMapping(value = "/card-payments/{paymentReference}/cancel")
5057
void cancelCardPayment(
5158
@PathVariable("paymentReference") String paymentReference,

src/main/java/uk/gov/hmcts/reform/payments/client/PaymentsClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ public CardPaymentServiceRequestResponse createGovPayCardPaymentRequest(
8888
}
8989

9090
public PaymentDto getGovPayCardPaymentStatus(String paymentReference, String authorization) {
91-
return paymentsApi.getGovPayCardPaymentStatus(paymentReference, authorization, authTokenGenerator.generate());
91+
return paymentsApi.retrieveCardPaymentStatus(paymentReference, authorization, authTokenGenerator.generate());
9292
}
9393
}

src/test/java/uk/gov/hmcts/reform/payments/client/PaymentsClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void createGovPayCardPaymentRequest() {
150150
void getGovPayCardPaymentStatus() {
151151
client.getGovPayCardPaymentStatus("payment-reference", "authorisation");
152152
verify(paymentsApi)
153-
.getGovPayCardPaymentStatus("payment-reference", "authorisation", "auth token");
153+
.retrieveCardPaymentStatus("payment-reference", "authorisation", "auth token");
154154
}
155155

156156
@Test

src/test/resources/mappings/gov-pay-card-payment-status-successful.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id" : "f4db6fd2-dea4-4a3a-80df-643b2cf1344d",
33
"name" : "card-payments_rc-1701-0909-0602-0418",
44
"request" : {
5-
"url" : "/payments/RC-1701-0909-0602-0418",
5+
"url" : "/card-payments/RC-1701-0909-0602-0418/statuses",
66
"method" : "GET"
77
},
88
"response" : {

0 commit comments

Comments
 (0)