feat: Add Cardhoilder Access Token Endpoint Support #487
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.
This pull request introduces support for requesting cardholder access tokens via a new form-url-encoded API endpoint, along with related infrastructure changes to the transport and client layers. The main changes include new request/response models, enhancements to the transport interface to support custom content types, and the addition of a new method to the issuing client for token requests.
Cardholder Access Token Feature:
RequestAnAccessTokenRequest
andRequestAnAccessTokenResponse
models to represent the request and response for the cardholder access token API. The request model includes a helper to convert itself to form parameters for URL-encoded submission. (src/main/java/com/checkout/cardissuing/cardholderaccesstokens/requests/RequestAnAccessTokenRequest.java
, [1];src/main/java/com/checkout/cardissuing/cardholderaccesstokens/responses/RequestAnAccessTokenResponse.java
, [2]RequestAnAccessToken
to theIssuingClient
interface and its implementation, which submits a form-url-encoded request to the appropriate endpoint and returns the access token response. (src/main/java/com/checkout/issuing/IssuingClient.java
, [1];src/main/java/com/checkout/issuing/IssuingClientImpl.java
, [2]Transport and API Client Enhancements:
Transport
interface andApacheHttpClientTransport
implementation to support a newinvoke
method with a customcontentType
parameter, enabling form-url-encoded requests. (src/main/java/com/checkout/Transport.java
, [1];src/main/java/com/checkout/ApacheHttpClientTransport.java
, [2]postFormUrlEncodedAsync
toApiClient
and its implementation, which serializes form parameters, encodes them, and submits them using the new transport method. (src/main/java/com/checkout/ApiClient.java
, [1];src/main/java/com/checkout/ApiClientImpl.java
, [2]Minor and Supporting Changes:
src/main/java/com/checkout/ApiClient.java
, [1];src/main/java/com/checkout/ApiClientImpl.java
, [2];src/main/java/com/checkout/issuing/IssuingClientImpl.java
, [3]src/test/java/com/checkout/handlepaymentsandpayouts/flow/PaymentSessionsTestIT.java
, src/test/java/com/checkout/handlepaymentsandpayouts/flow/PaymentSessionsTestIT.javaR1-R5)