https://developer.mastercard.com/page/java-sdk-guide#project-setup
I am referring this document but can not understand how to call API and configure SDK.
Update 2:
dependency used for payment gateway
<dependency>
<groupId>com.github.marcoblos</groupId>
<artifactId>mastercard-mpgs-sdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
getting started With the below code in the simple main class.
MastercardProperties properties = new MastercardProperties();
properties.setBaseUrl("https://eu-
gateway.mastercard.com/api/rest/version/");
properties.setApiVersion("45");
properties.setMerchantId("TEST...");
properties.setApiKey("xxxxxxxxxxxxxxxxxx");
MastercardRestTemplate restTemplate = new
MastercardRestTemplate(properties.getMerchantId(),
properties.getApiKey());
// normally you get this informations from your user and your
system (amount,
// credit card data, etc.) this isnecessary data to build the MPGS
request
MastercardRequestDTO dto = MastercardRequestDTO.builder()
.apiOperation(MastercardAPIOperationType.PAY)
.amount(new BigDecimal("10000.00"))
.cardNumber("cccccccccccccccc")
...
.build();
MastercardRequestResponseDTO requestResponseDTO =
MastercardObjectRequestFactory.build(dto);
MastercardResponse response =
MastercardBaseRequest.execute(restTemplate, properties,
requestResponseDTO, "myOrderId323214343");
Referance: github link
Everything works fine but the API response are all null. so we can determine that something wants wrong and also we got success response and no error logs.