diff --git a/src/main/java/io/craftgate/adapter/PaymentAdapter.java b/src/main/java/io/craftgate/adapter/PaymentAdapter.java index 2ffd9bdd..0cc2260c 100644 --- a/src/main/java/io/craftgate/adapter/PaymentAdapter.java +++ b/src/main/java/io/craftgate/adapter/PaymentAdapter.java @@ -235,6 +235,12 @@ public MultiPaymentResponse retrieveMultiPayment(String token) { return HttpClient.get(requestOptions.getBaseUrl() + path, createHeaders(path, requestOptions), MultiPaymentResponse.class); } + public StoredCardResponse retrieveProviderCard(RetrieveProviderCardRequest retrieveProviderCardRequest) { + String query = RequestQueryParamsBuilder.buildQueryParam(retrieveProviderCardRequest); + String path = "/payment/v1/cards/provider-card-mappings" + query; + return HttpClient.get(requestOptions.getBaseUrl() + path, createHeaders(path, requestOptions), StoredCardResponse.class); + } + public boolean is3DSecureCallbackVerified(String threeDSecureCallbackKey, Map params) { String hash = params.get("hash"); String hashString = threeDSecureCallbackKey + diff --git a/src/main/java/io/craftgate/request/RetrieveProviderCardRequest.java b/src/main/java/io/craftgate/request/RetrieveProviderCardRequest.java new file mode 100644 index 00000000..96a4cf6c --- /dev/null +++ b/src/main/java/io/craftgate/request/RetrieveProviderCardRequest.java @@ -0,0 +1,14 @@ +package io.craftgate.request; + +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class RetrieveProviderCardRequest { + + private String providerCardToken; + private String externalId; + private String providerCardUserId; + +} diff --git a/src/test/java/io/craftgate/sample/PaymentSample.java b/src/test/java/io/craftgate/sample/PaymentSample.java index dc184637..b6abd110 100644 --- a/src/test/java/io/craftgate/sample/PaymentSample.java +++ b/src/test/java/io/craftgate/sample/PaymentSample.java @@ -1764,6 +1764,20 @@ void retrieve_multi_payment() { assertNotNull(response); } + @Test + void retrieve_provider_card() { + + RetrieveProviderCardRequest retrieveProviderCardRequest = RetrieveProviderCardRequest.builder() + .providerCardToken("45f12c74-3000-465c-96dc-876850e7dd7a") + .providerCardUserId("0309ac2d-c5a5-4b4f-a91f-5c444ba07b24") + .externalId("1001") + .build(); + + StoredCardResponse response = craftgate.payment().retrieveProviderCard(retrieveProviderCardRequest); + + assertNotNull(response); + } + @Test void should_validate_3D_secure_callback_verified() { //given