com.mastercard.masterpass.merchant.DecryptionApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mastercard-masterpass-merchant Show documentation
Show all versions of mastercard-masterpass-merchant Show documentation
Masterpass Merchant Checkout SDK on MasterCard Developer Zone (https://developer.mastercard.com)
The newest version!
package com.mastercard.masterpass.merchant;
import com.mastercard.masterpass.merchant.model.DecryptionResponse;
import com.mastercard.masterpass.merchant.model.DecryptionRequest;
import com.mastercard.sdk.core.invoker.ApiClient;
import com.mastercard.sdk.core.util.ServiceRequest;
import com.mastercard.sdk.core.util.QueryParams;
import com.mastercard.sdk.core.exceptions.MasterpassErrorHandler;
import com.mastercard.sdk.core.ApiConfig;
import com.mastercard.sdk.core.MasterCardApiConfig;
import com.mastercard.masterpass.merchant.impl.APITrackerImpl;
public class DecryptionApi {
/**
* Decryption Service
* Decryption Service Android SDK.
* @param decryptionRequest the Decryption Service.
* @return the DecryptionResponse.
*/
public static DecryptionResponse create(DecryptionRequest decryptionRequest){
return create( decryptionRequest, MasterCardApiConfig.config());
}
/**
* Decryption Service
* Decryption Service Android SDK.
* @param decryptionRequest the Decryption Service.
* @param apiConfig the ApiConfig object for multiple environment configuration
* @return the DecryptionResponse.
*/
public static DecryptionResponse create(DecryptionRequest decryptionRequest, ApiConfig apiConfig){
String path = "/masterpass/v6/decrypt";
ServiceRequest serviceRequest = new ServiceRequest();
serviceRequest.requestBody(decryptionRequest);
serviceRequest.contentType("application/xml");
ApiClient apiClient = new ApiClient(apiConfig);
apiClient.setApiTracker(new APITrackerImpl());
apiClient.setErrorHandler(new MasterpassErrorHandler());
return apiClient.call(path,serviceRequest,"POST",DecryptionResponse.class);
}
}