From 22939d3485dff896788e0a3d5633ac6f8578b390 Mon Sep 17 00:00:00 2001 From: "Kamal, Raj" Date: Mon, 18 Nov 2024 14:47:07 +0530 Subject: [PATCH] Added Example for the suspected fraud service --- .../com/mastercard/fld/BaseClassUtil.java | 141 -- .../fld/api/manage/DeleteFraud.java | 52 - .../fld/api/manage/IssuerFraudChange.java | 76 - .../fld/api/manage/MastercardFraudChange.java | 57 - .../fld/api/manage/SuspendToConfirm.java | 53 - .../fld/api/submit/IssuerFraudSubmit.java | 104 - .../fld/api/submit/MastercardFraudSubmit.java | 77 - .../fld/fraud/confirmed/BaseClassUtil.java | 109 + .../api/manage/ConfirmedHealthStatus.java | 44 + .../confirmed/api/manage/DeleteFraud.java | 51 + .../confirmed/api/manage/FraudStatus.java | 35 + .../api/manage/IssuerFraudChange.java | 77 + .../api/manage/MastercardFraudChange.java | 75 + .../api/manage/SuspendToConfirm.java | 50 + .../api/submit/IssuerFraudSubmit.java | 121 ++ .../api/submit/MastercardFraudSubmit.java | 107 + .../fraud/confirmed/helper/RequestHelper.java | 39 + .../fld/fraud/constants/Constants.java | 11 + .../fld/fraud/suspected/BaseClassUtil.java | 109 + .../api/manage/SuspectedFraudStatus.java | 35 + .../api/manage/SuspectedHealthStatus.java | 44 + ...cquirerSuspectedMastercardFraudChange.java | 51 + .../acquirer/AcquirerSuspectedToConfirm.java | 50 + .../AcquirerSuspectedToNotConfirm.java | 50 + .../manage/acquirer/SuspectedToDelete.java | 50 + .../IssuerSuspectedMastercardFraudChange.java | 54 + .../issuer/IssuerSuspectedToConfirm.java | 68 + .../issuer/IssuerSuspectedToNotConfirm.java | 51 + .../SuspectedMastercardFraudSubmit.java | 72 + .../fraud/suspected/helper/RequestHelper.java | 39 + .../fld/utility/EncryptionHelper.java | 67 +- .../mastercard/fld/utility/LoggerUtil.java | 76 +- .../mastercard/fld/utility/ObjectUtility.java | 102 + .../fld/utility/PropertyFileReader.java | 33 + .../mastercard/fld/utility/RequestHelper.java | 34 - src/main/resources/application.properties | 85 +- src/main/resources/confirmed/IssuerFraud.json | 52 + .../KeyAlias001-production_govind.p12 | Bin 0 -> 2400 bytes .../confirmed/KeyAlias036-production.p12 | Bin 0 -> 2400 bytes src/main/resources/confirmed/config.json | 25 + ...firmed-fraud-apiClientEnc1728393521516.pem | 27 + .../confirmed/confirmed-swagger.yaml | 1775 ++++++++++++++++ ...audsubmissionapiClientEnc1685962215446.pem | 27 + ...ubmissionapiClientEnc1689348362311.pem.old | 26 + .../confirmed/key-alias-sandbox.p12.old | Bin 0 -> 2392 bytes .../resources/confirmed/key-alias-stage.p12 | Bin 0 -> 2392 bytes .../confirmed/keyalias-production.p12 | Bin 0 -> 2388 bytes src/main/resources/confirmed/update.json | 14 + src/main/resources/jenkins/build/jenkins-file | 54 + src/main/resources/log4j2.xml | 16 + .../suspected/MTF_FLD_SPCT-sandbox.p12 | Bin 0 -> 2388 bytes ...ldsuspectedfraudapiClientEnc1689576266.pem | 26 + .../suspected/mtf/key-alias-sandbox.p12 | Bin 0 -> 2392 bytes ...ldsuspectedfraudapiClientEnc1692261643.pem | 26 + .../stage/MTFPerfKeyAlias007-production.p12 | Bin 0 -> 2428 bytes .../suspected/stage/Suspect_API-sandbox.p12 | Bin 0 -> 2388 bytes ...uspectedfraudapiClientEnc1673939029302.pem | 27 + ...ldsuspectedfraudapiClientEnc1692662971.pem | 26 + .../suspected/suspected-swagger.yaml | 1122 ++++++++++ src/main/resources/swagger.yaml | 1886 ----------------- .../com/mastercard/fld/BaseClassUtilTest.java | 52 - .../fld/api/manage/DeleteFraudTest.java | 96 - .../fld/api/manage/IssuerFraudChangeTest.java | 90 - .../api/manage/MastercardFraudChangeTest.java | 91 - .../fld/api/manage/SuspendToConfirmTest.java | 89 - .../fld/api/submit/IssuerFraudSubmitTest.java | 90 - .../api/submit/MastercardFraudSubmitTest.java | 92 - .../fld/api/utility/EncryptionHelperTest.java | 26 - .../fld/api/utility/RequestHelperTest.java | 48 - .../fraud/confirmed/BaseClassUtil1Test.java | 57 + .../confirmed/api/manage/DeleteFraudTest.java | 108 + .../confirmed/api/manage/FraudStatusTest.java | 98 + .../api/manage/IssuerFraudChangeTest.java | 101 + .../api/manage/MastercardFraudChangeTest.java | 102 + .../api/manage/SuspendToConfirmTest.java | 100 + .../api/submit/IssuerFraudSubmitTest.java | 101 + .../api/submit/MastercardFraudSubmitTest.java | 103 + .../api/utility/EncryptionHelperTest.java | 29 + .../api/utility/RequestHelperTest.java | 53 + .../fraud/suspected/BaseClassUtilTest.java | 57 + ...rerSuspectedMastercardFraudChangeTest.java | 104 + .../AcquirerSuspectedToConfirmTest.java | 100 + .../AcquirerSuspectedToNotConfirmTest.java | 100 + .../SuspectedMastercardFraudChangeTest.java | 102 + .../api/manage/SuspectedToConfirmTest.java | 100 + .../api/manage/SuspectedToDeleteTest.java | 107 + .../api/manage/SuspectedToNotConfirmTest.java | 100 + .../SuspectedMastercardFraudSubmitTest.java | 102 + .../api/utility/EncryptionHelperTest.java | 28 + .../api/utility/RequestHelperTest.java | 53 + src/test/resources/application.properties | 19 +- src/test/resources/{ => confirmed}/dummy.p12 | Bin src/test/resources/{ => confirmed}/dummy.pem | 0 src/test/resources/key.p12 | Bin 0 -> 2388 bytes src/test/resources/suspected/dummy.p12 | Bin 0 -> 2388 bytes src/test/resources/suspected/dummy.pem | 25 + src/test/resources/test.pem | 25 + 97 files changed, 6800 insertions(+), 3226 deletions(-) delete mode 100644 src/main/java/com/mastercard/fld/BaseClassUtil.java delete mode 100644 src/main/java/com/mastercard/fld/api/manage/DeleteFraud.java delete mode 100644 src/main/java/com/mastercard/fld/api/manage/IssuerFraudChange.java delete mode 100644 src/main/java/com/mastercard/fld/api/manage/MastercardFraudChange.java delete mode 100644 src/main/java/com/mastercard/fld/api/manage/SuspendToConfirm.java delete mode 100644 src/main/java/com/mastercard/fld/api/submit/IssuerFraudSubmit.java delete mode 100644 src/main/java/com/mastercard/fld/api/submit/MastercardFraudSubmit.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/ConfirmedHealthStatus.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraud.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatus.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChange.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChange.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirm.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmit.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmit.java create mode 100644 src/main/java/com/mastercard/fld/fraud/confirmed/helper/RequestHelper.java create mode 100644 src/main/java/com/mastercard/fld/fraud/constants/Constants.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/BaseClassUtil.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedFraudStatus.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedHealthStatus.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedMastercardFraudChange.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToConfirm.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToNotConfirm.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/SuspectedToDelete.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedMastercardFraudChange.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToConfirm.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToNotConfirm.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmit.java create mode 100644 src/main/java/com/mastercard/fld/fraud/suspected/helper/RequestHelper.java create mode 100644 src/main/java/com/mastercard/fld/utility/ObjectUtility.java create mode 100644 src/main/java/com/mastercard/fld/utility/PropertyFileReader.java delete mode 100644 src/main/java/com/mastercard/fld/utility/RequestHelper.java create mode 100644 src/main/resources/confirmed/IssuerFraud.json create mode 100644 src/main/resources/confirmed/KeyAlias001-production_govind.p12 create mode 100644 src/main/resources/confirmed/KeyAlias036-production.p12 create mode 100644 src/main/resources/confirmed/config.json create mode 100644 src/main/resources/confirmed/confirmed-fraud-apiClientEnc1728393521516.pem create mode 100644 src/main/resources/confirmed/confirmed-swagger.yaml create mode 100644 src/main/resources/confirmed/fraudsubmissionapiClientEnc1685962215446.pem create mode 100644 src/main/resources/confirmed/fraudsubmissionapiClientEnc1689348362311.pem.old create mode 100644 src/main/resources/confirmed/key-alias-sandbox.p12.old create mode 100644 src/main/resources/confirmed/key-alias-stage.p12 create mode 100644 src/main/resources/confirmed/keyalias-production.p12 create mode 100644 src/main/resources/confirmed/update.json create mode 100644 src/main/resources/jenkins/build/jenkins-file create mode 100644 src/main/resources/log4j2.xml create mode 100644 src/main/resources/suspected/MTF_FLD_SPCT-sandbox.p12 create mode 100644 src/main/resources/suspected/fldsuspectedfraudapiClientEnc1689576266.pem create mode 100644 src/main/resources/suspected/mtf/key-alias-sandbox.p12 create mode 100644 src/main/resources/suspected/mtf/sandbox-fldsuspectedfraudapiClientEnc1692261643.pem create mode 100644 src/main/resources/suspected/stage/MTFPerfKeyAlias007-production.p12 create mode 100644 src/main/resources/suspected/stage/Suspect_API-sandbox.p12 create mode 100644 src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1673939029302.pem create mode 100644 src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1692662971.pem create mode 100644 src/main/resources/suspected/suspected-swagger.yaml delete mode 100644 src/main/resources/swagger.yaml delete mode 100644 src/test/java/com/mastercard/fld/BaseClassUtilTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/manage/DeleteFraudTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/manage/IssuerFraudChangeTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/manage/MastercardFraudChangeTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/manage/SuspendToConfirmTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/submit/IssuerFraudSubmitTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/submit/MastercardFraudSubmitTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/utility/EncryptionHelperTest.java delete mode 100644 src/test/java/com/mastercard/fld/api/utility/RequestHelperTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil1Test.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraudTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatusTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChangeTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChangeTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirmTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmitTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmitTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/EncryptionHelperTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/RequestHelperTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/BaseClassUtilTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedMastercardFraudChangeTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToConfirmTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToNotConfirmTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedMastercardFraudChangeTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToConfirmTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToDeleteTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToNotConfirmTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmitTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/utility/EncryptionHelperTest.java create mode 100644 src/test/java/com/mastercard/fld/fraud/suspected/api/utility/RequestHelperTest.java rename src/test/resources/{ => confirmed}/dummy.p12 (100%) rename src/test/resources/{ => confirmed}/dummy.pem (100%) create mode 100644 src/test/resources/key.p12 create mode 100644 src/test/resources/suspected/dummy.p12 create mode 100644 src/test/resources/suspected/dummy.pem create mode 100644 src/test/resources/test.pem diff --git a/src/main/java/com/mastercard/fld/BaseClassUtil.java b/src/main/java/com/mastercard/fld/BaseClassUtil.java deleted file mode 100644 index 5b45020..0000000 --- a/src/main/java/com/mastercard/fld/BaseClassUtil.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.mastercard.fld; - -import java.io.IOException; -import java.io.InputStream; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; -import java.util.Map; -import java.util.Properties; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.developer.interceptors.OkHttpFieldLevelEncryptionInterceptor; -import com.mastercard.developer.interceptors.OkHttpOAuth1Interceptor; -import com.mastercard.developer.utils.AuthenticationUtils; -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.utility.EncryptionHelper; - -import okhttp3.logging.HttpLoggingInterceptor; - -/** - * This class Prepare the Https client with provided User Credential - * - * @author Mastercard - * - */ -public class BaseClassUtil { - - private static final String BASE_URL = "mastercard.fld.api.url"; - private static final String CONSUMER_KEY = "mastercard.fld.client.ref.app.consumer.key"; - private static final String KEYSTORE_PATH = "mastercard.fld.client.p12.path"; - private static final String KEYSTORE_ALIAS = "mastercard.fld.client.ref.app.keystore.alias"; - private static final String KEYSTORE_PASS = "mastercard.fld.client.ref.app.keystore.password"; - private static final String ENCRYPTION_CERT = "mastercard.fld.client.ref.app.encryption.file"; - private static final String ENCRYPTION_KEY = "mastercard.fld.client.ref.app.encryption.key"; - - private static Properties prop = null; - - private static String propertyFile = "./application.properties"; - - private static ApiClient client; - - private BaseClassUtil() { - } - - public static ApiClient getClient() { - return client; - } - - public static void loadProperties() { - if (prop == null || prop.isEmpty()) { - try { - InputStream input = BaseClassUtil.class.getClassLoader().getResourceAsStream(propertyFile); - prop = new Properties(); - if (input == null) { - return; - } - prop.load(input); - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - } - } - - public static String getProperty(String key) { - loadProperties(); - return prop.getProperty(key); - } - - public static void setUpEnv() { - loadProperties(); - PrivateKey signingKey = null; // Provided by the OAuth1 Signer lib - try { - signingKey = AuthenticationUtils.loadSigningKey(prop.getProperty(KEYSTORE_PATH), - prop.getProperty(KEYSTORE_ALIAS), prop.getProperty(KEYSTORE_PASS)); - } catch (IOException | KeyStoreException | CertificateException | NoSuchAlgorithmException - | UnrecoverableKeyException exception) { - HttpLoggingInterceptor.Logger.DEFAULT.log(exception.toString()); - } - - client = new ApiClient(); - // Below URL is subjected to change as per environment - client.setBasePath(prop.getProperty(BASE_URL)); - client.setDebugging(true); - - client.setHttpClient(client.getHttpClient().newBuilder() - .addInterceptor(new OkHttpOAuth1Interceptor(prop.getProperty(CONSUMER_KEY), signingKey)) // Provided by - // the - // OAuth1 - // Signer - // lib - .build()); - } - - public static void setUpEncryptionEnv() throws EncryptionException { - loadProperties(); - PrivateKey signingKey = null; // Provided by the OAuth1 Signer lib - try { - signingKey = AuthenticationUtils.loadSigningKey(prop.getProperty(KEYSTORE_PATH), - prop.getProperty(KEYSTORE_ALIAS), prop.getProperty(KEYSTORE_PASS)); - } catch (IOException | KeyStoreException | CertificateException | NoSuchAlgorithmException - | UnrecoverableKeyException exception) { - HttpLoggingInterceptor.Logger.DEFAULT.log(exception.toString()); - } - - client = new ApiClient(); - // Below URL is subjected to change as per environment - client.setBasePath(prop.getProperty(BASE_URL)); - client.setDebugging(true); - - client.setHttpClient(client.getHttpClient().newBuilder() - .addInterceptor(new OkHttpFieldLevelEncryptionInterceptor(EncryptionHelper - .encryptionConfig(prop.getProperty(ENCRYPTION_CERT), prop.getProperty(ENCRYPTION_KEY)))) // Encryption - .addInterceptor(new OkHttpOAuth1Interceptor(prop.getProperty(CONSUMER_KEY), signingKey)) // Provided by - // the - // OAuth1 - // Signer - // lib - .build()); - } - - public static ApiCallback getCallback() { - return new ApiCallback() { - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty method - } - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty method - } - public void onFailure(ApiException e, int statusCode, Map responseHeaders) { - //empty method - } - public void onSuccess(Object result, int statusCode, Map responseHeaders) { - //empty method - } - }; - } -} \ No newline at end of file diff --git a/src/main/java/com/mastercard/fld/api/manage/DeleteFraud.java b/src/main/java/com/mastercard/fld/api/manage/DeleteFraud.java deleted file mode 100644 index 2e16abc..0000000 --- a/src/main/java/com/mastercard/fld/api/manage/DeleteFraud.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.mastercard.fld.api.manage; - -import java.io.IOException; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.FraudDeleteAndConfirm; -import com.mastercard.fld.api.fld.model.FraudState; -import com.mastercard.fld.api.fld.model.SafeFraudProvider; -import com.mastercard.fld.utility.LoggerUtil; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.Response; - -public class DeleteFraud { - - private RequestHelper helper = new RequestHelper(); - - public static void main(String[] args) { - DeleteFraud call = new DeleteFraud(); - call.deleteFraud(call.createRequest()); - } - - public Response deleteFraud(FraudDeleteAndConfirm request) { - ApiCallback callback = helper.getCallback(); - Response response = null; - helper.initiateNonEncryptClient(); - ConfirmedFraudManagementApi fraudApi = new ConfirmedFraudManagementApi(helper.getClient()); - try { - Call call = fraudApi.fraudStateCall(request, callback); - response = helper.apiCall(call); - LoggerUtil.logResponse(fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", response); - } catch (ApiException | IOException exception) { - return null; - } - return response; - } - - public FraudDeleteAndConfirm createRequest() { - FraudDeleteAndConfirm request = new FraudDeleteAndConfirm(); - request.setTimestamp("2021-07-04T20:34:37-06:00"); - request.setAuditControlNumber("292328194169030"); - request.setRefId("aab34943-eabd-42y6-87wd-69c19792bdd6"); - request.setIcaNumber("3043"); - request.setProviderId(SafeFraudProvider.NUMBER_10); - request.setOperationType(FraudState.FDD); - request.setMemo("Request Description"); - return request; - } -} diff --git a/src/main/java/com/mastercard/fld/api/manage/IssuerFraudChange.java b/src/main/java/com/mastercard/fld/api/manage/IssuerFraudChange.java deleted file mode 100644 index e22c5d6..0000000 --- a/src/main/java/com/mastercard/fld/api/manage/IssuerFraudChange.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.mastercard.fld.api.manage; - -import java.io.IOException; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.UpdatedIssuerFraud; -import com.mastercard.fld.utility.LoggerUtil; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.Response; - -public class IssuerFraudChange { - - private RequestHelper helper = new RequestHelper(); - - public static void main(String[] args) { - IssuerFraudChange issuerFraudChange = new IssuerFraudChange(); - issuerFraudChange.submitIssuerFraudChange(issuerFraudChange.createChangeRequest("292328194169030", "2742")); - } - - public Response submitIssuerFraudChange(UpdatedIssuerFraud changeIssuer) { - ConfirmedFraudManagementApi manageApi = null; - ApiCallback callback = helper.getCallback(); - Response response = null; - try { - helper.initiateEncryptClient(); - manageApi = new ConfirmedFraudManagementApi(helper.getClient()); - Call call = manageApi.updateIssuerFraudCall(changeIssuer, callback); - response = helper.apiCall(call); - LoggerUtil.logResponse(manageApi.getApiClient().getBasePath() + "/issuer-frauds", "put", response); - } catch (ApiException | EncryptionException | IOException exception) { - return null; - } - return response; - } - - public UpdatedIssuerFraud createChangeRequest(String acn, String ica) { - UpdatedIssuerFraud request = new UpdatedIssuerFraud(); - request.setIcaNumber(ica); - request.setRefId("jes2b943-eabd-42y6-87wd-69c19592vjg2"); - request.setTimestamp("2021-07-04T01:34:37-06:00"); - request.setAcquirerId("2742"); - request.setAuditControlNumber(acn); - request.setCardNumber("5587450000000009197"); - request.setFraudTypeCode("01"); - request.setMerchantCity("city"); - request.setFraudSubTypeCode("U"); - request.setCardProductCode("CIR"); - request.setMerchantId("6698696"); - request.setMerchantName("1234"); - request.setMerchantCountryCode("USA"); - request.setMerchantStateProvinceCode("CO"); - request.setMerchantPostalCode("78786"); - request.setMerchantCategoryCode("6010"); - request.setTerminalId("0"); - request.setCatLevelIndicator("2"); - request.setTerminalOperatingEnvironment("1"); - request.setTerminalCapabilityIndicator("0"); - request.setCardholderPresenceIndicator("0"); - request.setTerminalAttendanceIndicator("1"); - request.setCardPresenceIndicator("0"); - request.setCardInPossession("Y"); - request.setPosEntryMode("06"); - request.setCvcInvalidIndicator("M"); - request.setAvsResponseCode("A"); - request.setAuthResponseCode("40"); - request.setSecureCode("0"); - request.setAccountDeviceType("A"); - request.setMemo("Fraud change"); - return request; - } -} diff --git a/src/main/java/com/mastercard/fld/api/manage/MastercardFraudChange.java b/src/main/java/com/mastercard/fld/api/manage/MastercardFraudChange.java deleted file mode 100644 index e5ffbb8..0000000 --- a/src/main/java/com/mastercard/fld/api/manage/MastercardFraudChange.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.mastercard.fld.api.manage; - -import java.io.IOException; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.UpdatedMastercardFraud; -import com.mastercard.fld.utility.LoggerUtil; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.Response; - -public class MastercardFraudChange { - - private RequestHelper helper = new RequestHelper(); - - public static void main(String[] args) { - MastercardFraudChange call = new MastercardFraudChange(); - call.submitFraudChange(call.createRequest()); - } - - public Response submitFraudChange(UpdatedMastercardFraud request) { - ConfirmedFraudManagementApi fraudApi = null; - Response response = null; - ApiCallback callback = helper.getCallback(); - try { - helper.initiateEncryptClient(); - fraudApi = new ConfirmedFraudManagementApi(helper.getClient()); - Call call = fraudApi.updateMastercardFraudCall(request, callback); - response = helper.apiCall(call); - - LoggerUtil.logResponse(fraudApi.getApiClient().getBasePath() + "/mastercard-frauds", "put", response); - } catch (ApiException | EncryptionException | IOException exception) { - return null; - } - return response; - } - - public UpdatedMastercardFraud createRequest() { - UpdatedMastercardFraud request = new UpdatedMastercardFraud(); - request.setAuditControlNumber("292328194169030"); - request.setRefId("nnnd943-eabd-42y6-87wd-69c19792bded6"); - request.setTimestamp("2021-05-24T20:34:37-06:00"); - request.setIcaNumber("3043"); - request.setFraudTypeCode("01"); - request.setFraudSubTypeCode("K"); - request.setAccountDeviceType("1"); - request.setCardInPossession("Y"); - request.setFraudPostedDate("20210529"); - request.setMemo("Request Description"); - request.setCardholderReportedDate("20210528"); - return request; - } -} diff --git a/src/main/java/com/mastercard/fld/api/manage/SuspendToConfirm.java b/src/main/java/com/mastercard/fld/api/manage/SuspendToConfirm.java deleted file mode 100644 index 5ee15d7..0000000 --- a/src/main/java/com/mastercard/fld/api/manage/SuspendToConfirm.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.mastercard.fld.api.manage; - -import java.io.IOException; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.FraudDeleteAndConfirm; -import com.mastercard.fld.api.fld.model.FraudState; -import com.mastercard.fld.api.fld.model.SafeFraudProvider; -import com.mastercard.fld.utility.LoggerUtil; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.Response; - -public class SuspendToConfirm { - - private RequestHelper helper = new RequestHelper(); - - public static void main(String[] args) { - SuspendToConfirm call = new SuspendToConfirm(); - call.confirmFraud(call.createRequest()); - } - - public Response confirmFraud(FraudDeleteAndConfirm request) { - ApiCallback callback = helper.getCallback(); - helper.initiateNonEncryptClient(); - ConfirmedFraudManagementApi fraudApi = null; - Response response = null; - try { - fraudApi = new ConfirmedFraudManagementApi(helper.getClient()); - Call call = fraudApi.fraudStateCall(request, callback); - response = helper.apiCall(call); - LoggerUtil.logResponse(fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", response); - } catch (ApiException | IOException exception) { - return null; - } - return response; - } - - public FraudDeleteAndConfirm createRequest() { - FraudDeleteAndConfirm request = new FraudDeleteAndConfirm(); - request.setAuditControlNumber("292328194169030"); - request.setRefId("ewq3d943-eabd-42y6-87wd-69c19792bdd6"); - request.setTimestamp("2021-05-24T20:34:37-06:00"); - request.setIcaNumber("3043"); - request.setOperationType(FraudState.FDE); - request.setProviderId(SafeFraudProvider.NUMBER_10); - request.setMemo("Request Description"); - return request; - } -} diff --git a/src/main/java/com/mastercard/fld/api/submit/IssuerFraudSubmit.java b/src/main/java/com/mastercard/fld/api/submit/IssuerFraudSubmit.java deleted file mode 100644 index dcaebfb..0000000 --- a/src/main/java/com/mastercard/fld/api/submit/IssuerFraudSubmit.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.mastercard.fld.api.submit; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudSubmissionApi; -import com.mastercard.fld.api.fld.model.CfcIndicator; -import com.mastercard.fld.api.fld.model.IssuerFraud; -import com.mastercard.fld.api.fld.model.TransactionIdentifier; -import com.mastercard.fld.utility.LoggerUtil; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.Response; - -public class IssuerFraudSubmit { - - private RequestHelper helper = new RequestHelper(); - - public static void main(String[] args) { - IssuerFraudSubmit call = new IssuerFraudSubmit(); - call.submitIssuerFraud(call.createRequest()); - } - - public Response submitIssuerFraud(IssuerFraud additionIssuer) { - ApiCallback callback = helper.getCallback(); - ConfirmedFraudSubmissionApi submissionApi = null; - Response response = null; - try { - helper.initiateEncryptClient(); - submissionApi = new ConfirmedFraudSubmissionApi(helper.getClient()); - Call call = submissionApi.submitIssuerFraudCall(additionIssuer, callback); - response = helper.apiCall(call); - LoggerUtil.logResponse(submissionApi.getApiClient().getBasePath() + "/issuer-frauds", "post", response); - } catch (ApiException | EncryptionException | IOException exception) { - return null; - } - return response; - } - - public IssuerFraud createRequest() { - IssuerFraud request = new IssuerFraud(); - - request.setRefId("ecb2d943-eabd-42y6-87wd-69c19792vjg1"); - request.setTimestamp("2021-07-04T01:34:37-06:00"); - request.setIcaNumber("2742"); - request.setAcquirerId("2742"); - - List transactionIdentofoers = new ArrayList<>(); - TransactionIdentifier trc = new TransactionIdentifier(); - trc.setCfcKey(CfcIndicator.TRC); - trc.setCfcValue("500011"); - transactionIdentofoers.add(trc); - - TransactionIdentifier ser = new TransactionIdentifier(); - ser.setCfcKey(CfcIndicator.SER); - ser.setCfcValue("500000011"); - transactionIdentofoers.add(ser); - - request.setTransactionIdentifiers(transactionIdentofoers); - - request.setCardNumber("5587450000000009197"); - request.setFraudTypeCode("01"); - request.setFraudSubTypeCode("U"); - request.setCardProductCode("CIR"); - request.setTransactionDate("20200215"); - request.setFraudPostedDate("20210704"); - request.setSettlementDate("20210213"); - request.setCardholderReportedDate("20210213"); - request.setTransactionAmount("3500"); - request.setTransactionCurrencyCode("840"); - request.setBillingAmount("3500"); - request.setBillingCurrencyCode("840"); - request.setMerchantName("1234"); - request.setMerchantCity("city"); - request.setMerchantId("6698696"); - request.setMerchantCategoryCode("6010"); - request.setMerchantStateProvinceCode("CO"); - request.setMerchantCountryCode("USA"); - request.setMerchantPostalCode("78786"); - request.setTerminalAttendanceIndicator("1"); - request.setTerminalId("0"); - request.setTerminalCapabilityIndicator("0"); - request.setTerminalOperatingEnvironment("1"); - request.setAccountDeviceType("A"); - request.setCardholderPresenceIndicator("0"); - request.setCardPresenceIndicator("0"); - request.setCardInPossession("Y"); - request.setCvcInvalidIndicator("M"); - request.setCatLevelIndicator("2"); - request.setPosEntryMode("06"); - request.setAvsResponseCode("A"); - request.setAuthResponseCode("40"); - request.setSecureCode("0"); - request.setAcquirerRoutingTransitNumber("1111111111"); - request.setIssuerRoutingTransitNumber("1111111111"); - request.setMemo("Fraud Addition"); - return request; - } -} diff --git a/src/main/java/com/mastercard/fld/api/submit/MastercardFraudSubmit.java b/src/main/java/com/mastercard/fld/api/submit/MastercardFraudSubmit.java deleted file mode 100644 index 9de415b..0000000 --- a/src/main/java/com/mastercard/fld/api/submit/MastercardFraudSubmit.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.mastercard.fld.api.submit; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudSubmissionApi; -import com.mastercard.fld.api.fld.model.CfcIndicator; -import com.mastercard.fld.api.fld.model.MastercardFraud; -import com.mastercard.fld.api.fld.model.SafeFraudProvider; -import com.mastercard.fld.api.fld.model.TransactionIdentifier; -import com.mastercard.fld.utility.LoggerUtil; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.Response; - -public class MastercardFraudSubmit { - - private RequestHelper helper = new RequestHelper(); - - public static void main(String[] args) { - MastercardFraudSubmit call = new MastercardFraudSubmit(); - call.submitMastercardFraud(call.createRequest()); - } - - public Response submitMastercardFraud(MastercardFraud request) { - ConfirmedFraudSubmissionApi fraudApi = null; - ApiCallback callback = helper.getCallback(); - Response response = null; - - try { - helper.initiateEncryptClient(); - fraudApi = new ConfirmedFraudSubmissionApi(helper.getClient()); - Call call = fraudApi.submitMastercardFraudCall(request, callback); - response = helper.apiCall(call); - LoggerUtil.logResponse(fraudApi.getApiClient().getBasePath() + "/mastercard-frauds", "post", response); - } catch (ApiException | EncryptionException | IOException exception) { - return null; - } - return response; - } - - public Response updateMastercardFraudCall(Call call)throws IOException { - return call.execute(); - } - - public MastercardFraud createRequest() { - MastercardFraud request = new MastercardFraud(); - request.setRefId("ecb2d943-eabd-42y6-87wd-69c19792bdd6"); - request.setTimestamp("2021-05-24T20:34:37-06:00"); - request.setIcaNumber("1234"); - request.setProviderId(SafeFraudProvider.NUMBER_10); - request.setCardNumber("5411050000000000037"); - request.setTransactionAmount("1234"); - request.setTransactionDate("20210727"); - request.setFraudPostedDate("20210527"); - request.setFraudTypeCode("01"); - request.setFraudSubTypeCode("K"); - request.setAccountDeviceType("1"); - request.setCardholderReportedDate("20210527"); - request.setCardInPossession("Y"); - request.setAvsResponseCode("U"); - request.setAuthResponseCode("00"); - request.setMemo("Request Description"); - List transactionIdentofoers = new ArrayList<>(); - TransactionIdentifier arn = new TransactionIdentifier(); - arn.setCfcKey(CfcIndicator.ARN); - arn.setCfcValue("01111110713000000040817"); - transactionIdentofoers.add(arn); - request.setTransactionIdentifiers(transactionIdentofoers); - return request; - } -} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil.java b/src/main/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil.java new file mode 100644 index 0000000..19d75ed --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil.java @@ -0,0 +1,109 @@ +package com.mastercard.fld.fraud.confirmed; + +import java.util.Map; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.utility.ObjectUtility; +import com.mastercard.fld.utility.PropertyFileReader; + +/** + * This class Prepare the Https client with provided User Credential + * + * @author Mastercard + * + */ +public class BaseClassUtil { + + private static final String BASE_URL = "mastercard.fld.api.url"; + private static final String END_POINT = "mastercard.fld.confirmed.client.ref.app.endpoint"; + private static final String CONSUMER_KEY = "mastercard.fld.confirmed.client.ref.app.consumer.key"; + private static final String KEYSTORE_PATH = "mastercard.fld.confirmed.client.p12.path"; + private static final String KEYSTORE_ALIAS = "mastercard.fld.confirmed.client.ref.app.keystore.alias"; + private static final String KEYSTORE_PASS = "mastercard.fld.confirmed.client.ref.app.keystore.password"; + private static final String ENCRYPTION_CERT = "mastercard.fld.confirmed.client.ref.app.encryption.file"; + private static final String ENCRYPTION_KEY = "mastercard.fld.confirmed.client.ref.app.encryption.key"; + + private static ApiClient client; + + private BaseClassUtil() { + + } + + public static ApiClient getClient() { + + return client; + } + + public static void setUpEnv() { + + client = new ApiClient(); + // Below URL is subjected to change as per environment + client.setBasePath(PropertyFileReader.getProperty(BASE_URL) + PropertyFileReader.getProperty(END_POINT)); + client.setDebugging(true); + + // Enable when working from local system and remove + client.setConnectTimeout(60000); + client.setReadTimeout(60000); + client.setWriteTimeout(60000); + + client.setHttpClient(client.getHttpClient() + .newBuilder() + // Add Signing info + .addInterceptor(ObjectUtility.createSigningInfo(KEYSTORE_PATH, KEYSTORE_PASS, KEYSTORE_ALIAS, CONSUMER_KEY)) + .build()); + } + + public static void setUpEncryptionEnv() throws EncryptionException { + + client = new ApiClient(); + // Below URL is subjected to change as per environment + client.setBasePath(PropertyFileReader.getProperty(BASE_URL) + PropertyFileReader.getProperty(END_POINT)); + client.setDebugging(true); + + // Enable when working from local system and remove + client.setConnectTimeout(60000); + client.setReadTimeout(60000); + client.setWriteTimeout(60000); + + client.setHttpClient(client.getHttpClient() + .newBuilder() + // Add Encryption + .addInterceptor(ObjectUtility.createEncryptionConfig(ENCRYPTION_CERT, ENCRYPTION_KEY)) + // Add Signing info + .addInterceptor(ObjectUtility.createSigningInfo(KEYSTORE_PATH, KEYSTORE_PASS, KEYSTORE_ALIAS, CONSUMER_KEY)) + .build()); + } + + public static ApiCallback getCallback() { + + return new ApiCallback() { + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + + // empty method + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + + // empty method + } + + @Override + public void onFailure(ApiException e, int statusCode, Map responseHeaders) { + + // empty method + } + + @Override + public void onSuccess(Object result, int statusCode, Map responseHeaders) { + + // empty method + } + }; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/ConfirmedHealthStatus.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/ConfirmedHealthStatus.java new file mode 100644 index 0000000..6e63aa9 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/ConfirmedHealthStatus.java @@ -0,0 +1,44 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.Pair; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.Response; + +public class ConfirmedHealthStatus { + + public static void main(String[] args) { + + RequestHelper helper = new RequestHelper(); + helper.initiateNonEncryptClient(); + try { + Call call = buildGetHttpCall(helper, "/health"); + Response response = call.execute(); + System.out.println("\nResponse " + new String(response.body().bytes())); + } catch (ApiException | IOException e) { + e.printStackTrace(); + } + } + + public static Call buildGetHttpCall(RequestHelper helper, String endPointString) throws ApiException { + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + String[] localVarAuthNames = new String[] {}; + + return helper.getClient() + .buildCall(helper.getClient().getBasePath(), endPointString, "GET", localVarQueryParams, localVarCollectionQueryParams, null, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, helper.getCallback()); + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraud.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraud.java new file mode 100644 index 0000000..bc1a115 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraud.java @@ -0,0 +1,51 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import java.io.IOException; + +import com.google.gson.JsonSyntaxException; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.Fraud; +import com.mastercard.fld.api.fld.confirmed.model.FraudDeleteAndConfirm; +import com.mastercard.fld.api.fld.confirmed.model.FraudState; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.utility.ObjectUtility; + +public class DeleteFraud { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) throws JsonSyntaxException { + + DeleteFraud call = new DeleteFraud(); + ObjectUtility.printJavaObjectOnColsole(call.deleteFraud(call.createRequest())); + } + + public Fraud deleteFraud(FraudDeleteAndConfirm request) { + + helper.initiateNonEncryptClient(); + ConfirmedFraudManagementApi fraudApi = new ConfirmedFraudManagementApi(helper.getClient()); + try { + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.CONFIRMED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", + helper.apiCall(fraudApi.fraudStateCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException exception) { + exception.printStackTrace(); + return null; + } + } + + public FraudDeleteAndConfirm createRequest() { + + FraudDeleteAndConfirm request = new FraudDeleteAndConfirm(); + request.setTimestamp("2024-09-13T08:50:50-05:00"); + request.setAuditControlNumber("504474824830976"); + request.setRefId("aab34943-e1sd-42y6-87wd-69c19792bdd6"); + request.setIcaNumber("2742"); + request.setProviderId("10"); + request.setOperationType(FraudState.FDD); + request.setMemo("Request Description"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatus.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatus.java new file mode 100644 index 0000000..da382ad --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatus.java @@ -0,0 +1,35 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import java.io.IOException; + +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.Fraud; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.utility.ObjectUtility; + +public class FraudStatus { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + FraudStatus call = new FraudStatus(); + ObjectUtility.printJavaObjectOnColsole(call.fraudStatus("3043", "aab34943-eabd-42y6-87wd-69c19792bdd6", "292328194169030")); + } + + public Fraud fraudStatus(String ica, String refId, String acn) { + + helper.initiateNonEncryptClient(); + ConfirmedFraudManagementApi fraudApi = new ConfirmedFraudManagementApi(helper.getClient()); + try { + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.CONFIRMED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-statuses/icas/" + ica + "?ref_id=" + refId + "&acn=" + acn, "get", + helper.apiCall(fraudApi.fraudRequestStatusCall(ica, refId, acn, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException exception) { + exception.printStackTrace(); + return null; + } + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChange.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChange.java new file mode 100644 index 0000000..125db04 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChange.java @@ -0,0 +1,77 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.Fraud; +import com.mastercard.fld.api.fld.confirmed.model.UpdatedIssuerFraud; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.utility.ObjectUtility; + +public class IssuerFraudChange { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + IssuerFraudChange issuerFraudChange = new IssuerFraudChange(); + ObjectUtility.printJavaObjectOnColsole( + issuerFraudChange.submitIssuerFraudChange(issuerFraudChange.createChangeRequest("504474824830976", "2742"))); + } + + public Fraud submitIssuerFraudChange(UpdatedIssuerFraud changeIssuer) { + + try { + helper.initiateEncryptClient(); + ConfirmedFraudManagementApi manageApi = new ConfirmedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.CONFIRMED_FRAUD_API, + manageApi.getApiClient().getBasePath() + "/issuer-frauds", "put", + helper.apiCall(manageApi.updateIssuerFraudCall(changeIssuer, helper.getCallback())), Fraud.class); + } catch (ApiException | EncryptionException | IOException exception) { + exception.printStackTrace(); + return null; + } + } + + public UpdatedIssuerFraud createChangeRequest(String acn, String ica) { + + UpdatedIssuerFraud request = new UpdatedIssuerFraud(); + request.setIcaNumber(ica); + request.setRefId("khsib943-eakd-42y6-87wd-69i19514vjg2"); + request.setTimestamp("2024-09-13T08:46:28-05:00"); + request.setAcquirerId("2742"); + request.setAuditControlNumber(acn); + // request.setCardNumber("5587450000000001699"); + request.setFraudTypeCode("01"); + request.setMerchantCity("city1"); + /* request.setFraudSubTypeCode("U"); + request.setCardProductCode("CIR"); + request.setMerchantId("6698696"); + request.setMerchantName("Chicago "); + request.setMerchantCountryCode("USA"); + request.setMerchantStateProvinceCode("AK "); + request.setMerchantPostalCode("78786"); + request.setMerchantCategoryCode("6010"); + request.setTerminalId("0"); + request.setCatLevelIndicator("2"); + request.setTerminalOperatingEnvironment("1"); + request.setTerminalCapabilityIndicator("0"); + request.setCardholderPresenceIndicator("0"); + request.setTerminalAttendanceIndicator("1"); + request.setCardPresenceIndicator("0"); + request.setCardInPossession("Y"); + request.setPosEntryMode("06"); + request.setCvcInvalidIndicator("M"); + request.setAvsResponseCode("A"); + request.setAuthResponseCode("40"); + request.setSecureCode("0"); + request.setAccountDeviceType("A");*/ + request.setMemo("Memo for FDC"); + // request.setIssuerSCAExemption("01"); + // request.setTransactionIndicator("MC01"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChange.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChange.java new file mode 100644 index 0000000..e6ba4ec --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChange.java @@ -0,0 +1,75 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import java.io.FileReader; +import java.io.IOException; + +import com.google.gson.Gson; +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.Fraud; +import com.mastercard.fld.api.fld.confirmed.model.MastercardFraud; +import com.mastercard.fld.api.fld.confirmed.model.UpdatedMastercardFraud; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.utility.ObjectUtility; + +public class MastercardFraudChange { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) throws IOException { + + MastercardFraudChange call = new MastercardFraudChange(); + ObjectUtility.printJavaObjectOnColsole(call.submitFraudChange(call.createPayload())); + } + + public Fraud submitFraudChange(UpdatedMastercardFraud request) { + + try { + helper.initiateEncryptClient(); + ConfirmedFraudManagementApi fraudApi = new ConfirmedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.CONFIRMED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/mastercard-frauds", "put", + helper.apiCall(fraudApi.updateMastercardFraudCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | EncryptionException | IOException exception) { + exception.printStackTrace(); + return null; + } + } + + public UpdatedMastercardFraud createPayload() throws IOException { + + String filepath = System.getProperty("user.dir") + "/src/main/resources/confirmed/update.json"; + + + // MastercardFraudBuilder mastercardFraudBuilder = MastercardFraudBuilder.builder(). + Gson gson = new Gson(); + UpdatedMastercardFraud myClass = gson.fromJson(new FileReader(filepath), UpdatedMastercardFraud.class); + // myClass.setTimestamp(java.time.OffsetDateTime.now().format(java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME)); + myClass.setTimestamp("2024-04-24T02:01:32-05:00"); + System.out.println("My class " + myClass.toString()); + return myClass; + + } + + + + public UpdatedMastercardFraud createRequest() { + + UpdatedMastercardFraud request = new UpdatedMastercardFraud(); + request.setAuditControlNumber("936348180837376"); + request.setRefId("nnnd943-eabd-42y6-87wd-69c19792bdea0"); + request.setTimestamp("2024-03-05T20:34:37-06:00"); + request.setIcaNumber("1076"); + request.setFraudTypeCode("01"); + request.setFraudSubTypeCode("K"); + request.setAccountDeviceType("1"); + request.setCardInPossession("Y"); + request.setFraudPostedDate("20230816"); + request.setMemo("Request Description"); + request.setCardholderReportedDate("20240305"); + request.setIssuerSCAExemption("04"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirm.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirm.java new file mode 100644 index 0000000..6e18702 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirm.java @@ -0,0 +1,50 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import java.io.IOException; + +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.Fraud; +import com.mastercard.fld.api.fld.confirmed.model.FraudDeleteAndConfirm; +import com.mastercard.fld.api.fld.confirmed.model.FraudState; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.utility.ObjectUtility; + +public class SuspendToConfirm { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + SuspendToConfirm call = new SuspendToConfirm(); + ObjectUtility.printJavaObjectOnColsole(call.confirmFraud(call.createRequest())); + } + + public Fraud confirmFraud(FraudDeleteAndConfirm request) { + + helper.initiateNonEncryptClient(); + try { + ConfirmedFraudManagementApi fraudApi = new ConfirmedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.CONFIRMED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", + helper.apiCall(fraudApi.fraudStateCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException exception) { + exception.printStackTrace(); + return null; + } + } + + public FraudDeleteAndConfirm createRequest() { + + FraudDeleteAndConfirm request = new FraudDeleteAndConfirm(); + request.setAuditControlNumber("124847553614848"); + request.setRefId("azq3d943-eabd-42y6-87wd-69c19792bdd6"); + request.setTimestamp("2024-09-13T08:53:07-05:00"); + request.setIcaNumber("2742"); + request.setOperationType(FraudState.FDE); + request.setProviderId("10"); + request.setMemo("Request Description"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmit.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmit.java new file mode 100644 index 0000000..594be63 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmit.java @@ -0,0 +1,121 @@ +package com.mastercard.fld.fraud.confirmed.api.submit; + +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudSubmissionApi; +import com.mastercard.fld.api.fld.confirmed.model.*; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.utility.ObjectUtility; + +public class IssuerFraudSubmit { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) throws IOException { + + IssuerFraudSubmit call = new IssuerFraudSubmit(); + ObjectUtility.printJavaObjectOnColsole(call.submitIssuerFraud(call.createPayload())); + } + + public Fraud submitIssuerFraud(IssuerFraud additionIssuer) { + + try { + helper.initiateEncryptClient(); + ConfirmedFraudSubmissionApi submissionApi = new ConfirmedFraudSubmissionApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.CONFIRMED_FRAUD_API, + submissionApi.getApiClient().getBasePath() + "/issuer-frauds", "post", + helper.apiCall(submissionApi.submitIssuerFraudCall(additionIssuer, helper.getCallback())), Fraud.class); + } catch (ApiException | EncryptionException | IOException exception) { + exception.printStackTrace(); + return null; + } + } + + public IssuerFraud createPayload() throws IOException { + + String filepath = System.getProperty("user.dir") + "/src/main/resources/confirmed/IssuerFraud.json"; + + + // MastercardFraudBuilder mastercardFraudBuilder = MastercardFraudBuilder.builder(). + Gson gson = new Gson(); + IssuerFraud myClass = gson.fromJson(new FileReader(filepath), IssuerFraud.class); + // myClass.setTimestamp(java.time.OffsetDateTime.now().format(java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME)); + myClass.setTimestamp("2024-09-13T08:44:48-05:00"); + System.out.println("My class " + myClass.toString()); + return myClass; + + } + + public IssuerFraud createRequest() { + + IssuerFraud request = new IssuerFraud(); + + request.setRefId("985kxk9a-5l2t-kt8a-cta9-eqw7fvref87r"); + request.setTimestamp("2024-03-12T20:34:37-06:00"); + request.setIcaNumber("2742"); + request.setAcquirerId("5313"); + + List transactionIdentofoers = new ArrayList<>(); + TransactionIdentifier acn = new TransactionIdentifier(); + acn.setCfcKey(CfcIndicator.ARN); + acn.setCfcValue("01111111007000000011327"); + transactionIdentofoers.add(acn); + TransactionIdentifier brn = new TransactionIdentifier(); + brn.setCfcKey(CfcIndicator.BRN); + brn.setCfcValue("756QR7"); + transactionIdentofoers.add(brn); + + request.setTransactionIdentifiers(transactionIdentofoers); + + request.setCardNumber("5587450000000001699"); + request.setFraudTypeCode("00"); + request.setFraudSubTypeCode("K"); + request.setCardProductCode("MCC"); + request.setTransactionDate("20231007"); + request.setFraudPostedDate("20240311"); + request.setSettlementDate("20240311"); + request.setCardholderReportedDate("20240311"); + request.setTransactionAmount("2300"); + request.setTransactionCurrencyCode("840"); + request.setBillingAmount("2100"); + request.setBillingCurrencyCode("840"); + request.setMerchantName("Webuto Infotech"); + request.setMerchantCity("New York"); + request.setMerchantId("TEST DE42"); + request.setMerchantCategoryCode("6012"); + request.setMerchantStateProvinceCode("CA "); + request.setMerchantCountryCode("USA"); + request.setMerchantPostalCode("78786 "); + request.setTerminalAttendanceIndicator("0"); + request.setTerminalId("T1234567"); + request.setTerminalCapabilityIndicator("0"); + request.setTerminalOperatingEnvironment("1"); + request.setAccountDeviceType("1"); + request.setCardholderPresenceIndicator("4"); + request.setCardPresenceIndicator("1"); + request.setCardInPossession("Y"); + request.setCvcInvalidIndicator("*"); + request.setCatLevelIndicator("9"); + + request.setElectronicCommerceIndicator("21"); + + request.setPosEntryMode("09"); + request.setAvsResponseCode("U"); + request.setAuthResponseCode("00"); + request.setSecureCode("2"); + request.setAcquirerRoutingTransitNumber("1111111111"); + request.setIssuerRoutingTransitNumber("1111111111"); + request.setMemo("Fraud Addition"); + request.setIssuerSCAExemption("04"); + request.setTransactionIndicator("M101"); + return request; + } + +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmit.java b/src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmit.java new file mode 100644 index 0000000..447c8ed --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmit.java @@ -0,0 +1,107 @@ +package com.mastercard.fld.fraud.confirmed.api.submit; + +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudSubmissionApi; +import com.mastercard.fld.api.fld.confirmed.model.CfcIndicator; +import com.mastercard.fld.api.fld.confirmed.model.Fraud; +import com.mastercard.fld.api.fld.confirmed.model.MastercardFraud; +import com.mastercard.fld.api.fld.confirmed.model.TransactionIdentifier; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.utility.ObjectUtility; + +import okhttp3.Call; +import okhttp3.Response; + +public class MastercardFraudSubmit { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) throws IOException { + + MastercardFraudSubmit call = new MastercardFraudSubmit(); + ObjectUtility.printJavaObjectOnColsole(call.submitMastercardFraud(call.createPayload())); + } + + public Fraud submitMastercardFraud(MastercardFraud request) { + + try { + helper.initiateEncryptClient(); + ConfirmedFraudSubmissionApi fraudApi = new ConfirmedFraudSubmissionApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.CONFIRMED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/mastercard-frauds", "post", + helper.apiCall(fraudApi.submitMastercardFraudCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException | EncryptionException exception) { + exception.printStackTrace(); + return null; + } + } + + public MastercardFraud createPayload() throws IOException { + + String filepath = System.getProperty("user.dir") + "/src/main/resources/confirmed/config.json"; + + + // MastercardFraudBuilder mastercardFraudBuilder = MastercardFraudBuilder.builder(). + Gson gson = new Gson(); + MastercardFraud myClass = gson.fromJson(new FileReader(filepath), MastercardFraud.class); + // myClass.setTimestamp(java.time.OffsetDateTime.now().format(java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME)); + myClass.setTimestamp("2024-07-24T05:48:47-05:00"); + System.out.println("My class " + myClass.toString()); + return myClass; + + } + + + + public Response updateMastercardFraudCall(Call call) throws IOException { + + return call.execute(); + } + + public MastercardFraud createRequest() { + + MastercardFraud request = new MastercardFraud(); + request.setRefId("wkd2d1a6-5pblo-16l6-ukwd-00m1p0g9dc5"); + request.setTimestamp("2024-07-24T20:34:37-06:00"); + request.setIcaNumber("2742"); + request.setProviderId("10"); + request.setCardNumber("5587450000000001699"); + request.setTransactionAmount("2100"); + request.setTransactionDate("20231007"); + request.setFraudPostedDate("20240305"); + request.setFraudTypeCode("04"); + request.setFraudSubTypeCode("K"); + request.setAccountDeviceType("1"); + request.setCardholderReportedDate("20240305"); + request.setCardInPossession("Y"); + request.setAvsResponseCode("U"); + request.setAuthResponseCode("00"); + request.setMemo("Request Description"); + List transactionIdentofoers = new ArrayList<>(); + TransactionIdentifier arn = new TransactionIdentifier(); + arn.setCfcKey(CfcIndicator.ARN); arn.setCfcValue("15487050713330003230075"); + transactionIdentofoers.add(arn); + //Serial ID + TransactionIdentifier ser = new TransactionIdentifier(); + ser.setCfcKey(CfcIndicator.ARN); + ser.setCfcValue("01111111007000000033297"); + transactionIdentofoers.add(ser); + //Trace ID + TransactionIdentifier trc = new TransactionIdentifier(); + trc.setCfcKey(CfcIndicator.BRN); + trc.setCfcValue("756QR7"); + transactionIdentofoers.add(trc); + + request.setTransactionIdentifiers(transactionIdentofoers); + request.setIssuerSCAExemption("06"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/confirmed/helper/RequestHelper.java b/src/main/java/com/mastercard/fld/fraud/confirmed/helper/RequestHelper.java new file mode 100644 index 0000000..f3f46c0 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/confirmed/helper/RequestHelper.java @@ -0,0 +1,39 @@ +package com.mastercard.fld.fraud.confirmed.helper; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.fraud.confirmed.BaseClassUtil; + +import okhttp3.Call; +import okhttp3.Response; + +public class RequestHelper { + + public void initiateNonEncryptClient() { + + BaseClassUtil.setUpEnv(); + } + + public void initiateEncryptClient() throws EncryptionException { + + BaseClassUtil.setUpEncryptionEnv(); + } + + public ApiClient getClient() { + + return BaseClassUtil.getClient(); + } + + public ApiCallback getCallback() { + + return BaseClassUtil.getCallback(); + } + + public Response apiCall(Call call) throws IOException { + + return call.execute(); + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/constants/Constants.java b/src/main/java/com/mastercard/fld/fraud/constants/Constants.java new file mode 100644 index 0000000..ce5a410 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/constants/Constants.java @@ -0,0 +1,11 @@ +package com.mastercard.fld.fraud.constants; + +public class Constants { + + private Constants() { + + } + + public static final String CONFIRMED_FRAUD_API = "confirmed"; + public static final String SUSPECTED_FRAUD_API = "suspected"; +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/BaseClassUtil.java b/src/main/java/com/mastercard/fld/fraud/suspected/BaseClassUtil.java new file mode 100644 index 0000000..f6426a1 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/BaseClassUtil.java @@ -0,0 +1,109 @@ +package com.mastercard.fld.fraud.suspected; + +import java.util.Map; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.utility.ObjectUtility; +import com.mastercard.fld.utility.PropertyFileReader; + +/** + * This class Prepare the Https client with provided User Credential + * + * @author Mastercard + * + */ +public class BaseClassUtil { + + private static final String BASE_URL = "mastercard.fld.api.url"; + private static final String END_POINT = "mastercard.fld.suspected.client.ref.app.endpoint"; + private static final String CONSUMER_KEY = "mastercard.fld.suspected.client.ref.app.consumer.key"; + private static final String KEYSTORE_PATH = "mastercard.fld.suspected.client.p12.path"; + private static final String KEYSTORE_ALIAS = "mastercard.fld.suspected.client.ref.app.keystore.alias"; + private static final String KEYSTORE_PASS = "mastercard.fld.suspected.client.ref.app.keystore.password"; + private static final String ENCRYPTION_CERT = "mastercard.fld.suspected.client.ref.app.encryption.file"; + private static final String ENCRYPTION_KEY = "mastercard.fld.suspected.client.ref.app.encryption.key"; + + private static ApiClient client; + + private BaseClassUtil() { + + } + + public static ApiClient getClient() { + + return client; + } + + public static void setUpEnv() { + + client = new ApiClient(); + // Below URL is subjected to change as per environment + client.setBasePath(PropertyFileReader.getProperty(BASE_URL) + PropertyFileReader.getProperty(END_POINT)); + client.setDebugging(true); + + // Enable when working from local system and remove + client.setConnectTimeout(60000); + client.setReadTimeout(60000); + client.setWriteTimeout(60000); + + client.setHttpClient(client.getHttpClient() + .newBuilder() + // Add Signing info + .addInterceptor(ObjectUtility.createSigningInfo(KEYSTORE_PATH, KEYSTORE_PASS, KEYSTORE_ALIAS, CONSUMER_KEY)) + .build()); + } + + public static void setUpEncryptionEnv() throws EncryptionException { + + client = new ApiClient(); + // Below URL is subjected to change as per environment + client.setBasePath(PropertyFileReader.getProperty(BASE_URL) + PropertyFileReader.getProperty(END_POINT)); + client.setDebugging(true); + + // Enable when working from local system and remove + client.setConnectTimeout(60000); + client.setReadTimeout(60000); + client.setWriteTimeout(60000); + + client.setHttpClient(client.getHttpClient() + .newBuilder() + // Add Encryption + .addInterceptor(ObjectUtility.createEncryptionConfig(ENCRYPTION_CERT, ENCRYPTION_KEY)) + // Add Signing info + .addInterceptor(ObjectUtility.createSigningInfo(KEYSTORE_PATH, KEYSTORE_PASS, KEYSTORE_ALIAS, CONSUMER_KEY)) + .build()); + } + + public static ApiCallback getCallback() { + + return new ApiCallback() { + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + + // empty method + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + + // empty method + } + + @Override + public void onFailure(ApiException e, int statusCode, Map responseHeaders) { + + // empty method + } + + @Override + public void onSuccess(Object result, int statusCode, Map responseHeaders) { + + // empty method + } + }; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedFraudStatus.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedFraudStatus.java new file mode 100644 index 0000000..85f8573 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedFraudStatus.java @@ -0,0 +1,35 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import java.io.IOException; + +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class SuspectedFraudStatus { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + SuspectedFraudStatus call = new SuspectedFraudStatus(); + ObjectUtility.printJavaObjectOnColsole(call.fraudStatus("3043", "aab34943-eabd-42y6-87wd-69c19792bdd6", "292328194169030")); + } + + public Fraud fraudStatus(String ica, String refId, String acn) { + + helper.initiateNonEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + try { + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-statuses/icas/" + ica + "?ref_id=" + refId + "&acn=" + acn, "get", + helper.apiCall(fraudApi.fraudRequestStatusCall(ica, refId, acn, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException exception) { + exception.printStackTrace(); + return null; + } + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedHealthStatus.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedHealthStatus.java new file mode 100644 index 0000000..33f5615 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedHealthStatus.java @@ -0,0 +1,44 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.Pair; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.Response; + +public class SuspectedHealthStatus { + + public static void main(String[] args) { + + RequestHelper helper = new RequestHelper(); + helper.initiateNonEncryptClient(); + try { + Call call = buildGetHttpCall(helper, "/health"); + Response response = call.execute(); + System.out.println("\nResponse " + new String(response.body().bytes())); + } catch (ApiException | IOException e) { + e.printStackTrace(); + } + } + + public static Call buildGetHttpCall(RequestHelper helper, String endPointString) throws ApiException { + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + String[] localVarAuthNames = new String[] {}; + + return helper.getClient() + .buildCall(helper.getClient().getBasePath(), endPointString, "GET", localVarQueryParams, localVarCollectionQueryParams, null, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, helper.getCallback()); + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedMastercardFraudChange.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedMastercardFraudChange.java new file mode 100644 index 0000000..aeb7fa7 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedMastercardFraudChange.java @@ -0,0 +1,51 @@ +package com.mastercard.fld.fraud.suspected.api.manage.acquirer; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudChange; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class AcquirerSuspectedMastercardFraudChange { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + AcquirerSuspectedMastercardFraudChange call = new AcquirerSuspectedMastercardFraudChange(); + ObjectUtility.printJavaObjectOnColsole(call.submitFraudChange(call.createRequest())); + } + + public Fraud submitFraudChange(SuspectedFraudChange request) { + + try { + helper.initiateEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/mastercard-frauds", "put", + helper.apiCall(fraudApi.updateSuspectedFraudCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | EncryptionException | IOException exception) { + exception.printStackTrace(); + return null; + } + } + + public SuspectedFraudChange createRequest() { + + SuspectedFraudChange request = new SuspectedFraudChange(); + request.setAuditControlNumber("292328194169030"); + request.setRefId("nnnd943-eabd-42y6-87wd-69c19792bded6"); + request.setTimestamp("2021-05-24T20:34:37-06:00"); + request.setIcaNumber("3043"); + request.setProviderId("10"); + request.setFraudTypeCode("01"); + request.setFraudPostedDate("20210529"); + request.setMemo("Request Description"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToConfirm.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToConfirm.java new file mode 100644 index 0000000..939ebe4 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToConfirm.java @@ -0,0 +1,50 @@ +package com.mastercard.fld.fraud.suspected.api.manage.acquirer; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class AcquirerSuspectedToConfirm { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + AcquirerSuspectedToConfirm call = new AcquirerSuspectedToConfirm(); + ObjectUtility.printJavaObjectOnColsole(call.confirmFraud(call.createRequest())); + } + + public Fraud confirmFraud(SuspectedFraudStateChange request) { + + try { + helper.initiateEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", + helper.apiCall(fraudApi.fraudStateCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException | EncryptionException exception) { + exception.printStackTrace(); + return null; + } + } + + public SuspectedFraudStateChange createRequest() { + + SuspectedFraudStateChange request = new SuspectedFraudStateChange(); + request.setAuditControlNumber("292328194169030"); + request.setRefId("ewq3d943-eabd-42y6-87wd-69c19792bdd6"); + request.setTimestamp("2021-05-24T20:34:37-06:00"); + request.setIcaNumber("3043"); + request.setOperationType("CONFIRM_FRAUD"); + request.setProviderId("10"); + request.setMemo("Request Description"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToNotConfirm.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToNotConfirm.java new file mode 100644 index 0000000..f935d3b --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/AcquirerSuspectedToNotConfirm.java @@ -0,0 +1,50 @@ +package com.mastercard.fld.fraud.suspected.api.manage.acquirer; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class AcquirerSuspectedToNotConfirm { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + AcquirerSuspectedToNotConfirm call = new AcquirerSuspectedToNotConfirm(); + ObjectUtility.printJavaObjectOnColsole(call.confirmNotFraud(call.createRequest())); + } + + public Fraud confirmNotFraud(SuspectedFraudStateChange request) { + + try { + helper.initiateEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", + helper.apiCall(fraudApi.fraudStateCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException | EncryptionException exception) { + exception.printStackTrace(); + return null; + } + } + + public SuspectedFraudStateChange createRequest() { + + SuspectedFraudStateChange request = new SuspectedFraudStateChange(); + request.setAuditControlNumber("292328194169030"); + request.setRefId("ewq3d943-eabd-42y6-87wd-69c19792bdd6"); + request.setTimestamp("2023-08-22T20:34:37-06:00"); + request.setIcaNumber("3043"); + request.setOperationType("NOT_FRAUD"); + request.setProviderId("10"); + request.setMemo("Request Description"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/SuspectedToDelete.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/SuspectedToDelete.java new file mode 100644 index 0000000..7dbc223 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/acquirer/SuspectedToDelete.java @@ -0,0 +1,50 @@ +package com.mastercard.fld.fraud.suspected.api.manage.acquirer; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class SuspectedToDelete { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + SuspectedToDelete call = new SuspectedToDelete(); + ObjectUtility.printJavaObjectOnColsole(call.deleteFraud(call.createRequest())); + } + + public Fraud deleteFraud(SuspectedFraudStateChange request) { + + try { + helper.initiateEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", + helper.apiCall(fraudApi.fraudStateCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException | EncryptionException exception) { + exception.printStackTrace(); + return null; + } + } + + public SuspectedFraudStateChange createRequest() { + + SuspectedFraudStateChange request = new SuspectedFraudStateChange(); + request.setAuditControlNumber("292328194169030"); + request.setRefId("ewq3d943-eabd-42y6-87wd-69c19792bdd7"); + request.setTimestamp("2024-03-27T20:34:37"); + request.setIcaNumber("3043"); + request.setOperationType("DELETE"); + request.setProviderId("20"); + request.setMemo("Request Description"); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedMastercardFraudChange.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedMastercardFraudChange.java new file mode 100644 index 0000000..52ace74 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedMastercardFraudChange.java @@ -0,0 +1,54 @@ +package com.mastercard.fld.fraud.suspected.api.manage.issuer; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudChange; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class IssuerSuspectedMastercardFraudChange { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + IssuerSuspectedMastercardFraudChange call = new IssuerSuspectedMastercardFraudChange(); + ObjectUtility.printJavaObjectOnColsole(call.submitFraudChange(call.createRequest())); + } + + public SuspectedFraudChange createRequest() { + + SuspectedFraudChange request = new SuspectedFraudChange(); + request.setAuditControlNumber("292328194169030"); + request.setRefId("nnnd943-eabd-82y6-87wd-69c19792bded6"); + request.setTimestamp("2024-03-27T20:34:37"); + request.setIcaNumber("3043"); + request.setFraudTypeCode("01"); + request.setAccountDeviceType("1"); + request.setCardInPossession("Y"); + request.setFraudPostedDate("20240327"); + request.setProviderId("10"); + request.setMemo("Request Description"); + request.setCardholderReportedDate("20240327"); + return request; + } + + public Fraud submitFraudChange(SuspectedFraudChange request) { + + try { + helper.initiateEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/mastercard-frauds", "put", + helper.apiCall(fraudApi.updateSuspectedFraudCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | EncryptionException | IOException exception) { + exception.printStackTrace(); + return null; + } + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToConfirm.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToConfirm.java new file mode 100644 index 0000000..dc302fe --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToConfirm.java @@ -0,0 +1,68 @@ +package com.mastercard.fld.fraud.suspected.api.manage.issuer; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.model.CfcIndicator; + //import com.mastercard.fld.api.fld.confirmed.model.MastercardFraudAllOf; +import com.mastercard.fld.api.fld.suspected.model.TransactionIdentifier; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class IssuerSuspectedToConfirm { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + IssuerSuspectedToConfirm call = new IssuerSuspectedToConfirm(); + ObjectUtility.printJavaObjectOnColsole(call.confirmFraud(call.createRequest())); + } + + public SuspectedFraudStateChange createRequest() { + + SuspectedFraudStateChange request = new SuspectedFraudStateChange(); + request.setAuditControlNumber("292328194169030"); + request.setRefId("ewqkd943-eabd-42y6-87wd-69c19792bdd6"); + request.setTimestamp("2024-03-27T20:34:37"); + request.setIcaNumber("3043"); + request.setOperationType("CONFIRM_FRAUD"); + request.setProviderId("10"); + request.setMemo("Request Description"); + request.setFraudPostedDate("20240327"); + request.setFraudTypeCode("04"); + request.setFraudSubTypeCode("K"); + request.setAccountDeviceType("1"); + request.setCardholderReportedDate("20240327"); + request.setAuthResponseCode("40"); + request.setAvsResponseCode("U"); + TransactionIdentifier ser = new TransactionIdentifier(); + ser.setSerialId("500000033"); + ser.setTraceId("500033"); + + request.setTransactionIdentifiers(ser); + + return request; + } + + public Fraud confirmFraud(SuspectedFraudStateChange request) { + + try { + helper.initiateEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", + helper.apiCall(fraudApi.fraudStateCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException | EncryptionException exception) { + exception.printStackTrace(); + return null; + } + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToNotConfirm.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToNotConfirm.java new file mode 100644 index 0000000..ff6e37b --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/manage/issuer/IssuerSuspectedToNotConfirm.java @@ -0,0 +1,51 @@ +package com.mastercard.fld.fraud.suspected.api.manage.issuer; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +public class IssuerSuspectedToNotConfirm { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + IssuerSuspectedToNotConfirm call = new IssuerSuspectedToNotConfirm(); + ObjectUtility.printJavaObjectOnColsole(call.confirmNotFraud(call.createRequest())); + } + + public SuspectedFraudStateChange createRequest() { + + SuspectedFraudStateChange request = new SuspectedFraudStateChange(); + request.setAuditControlNumber("292328194169030"); + request.setRefId("c0112b25-4363-4df2-896d-fa7ae1dc8524"); + request.setTimestamp("2024-03-27T20:34:37"); + request.setIcaNumber("2742"); + request.setOperationType("NOT_FRAUD"); + request.setNotFraudTypeCode("00"); + request.setProviderId("10"); + request.setMemo("Request Description"); + return request; + } + + public Fraud confirmNotFraud(SuspectedFraudStateChange request) { + + try { + helper.initiateEncryptClient(); + SuspectedFraudManagementApi fraudApi = new SuspectedFraudManagementApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/fraud-states", "put", + helper.apiCall(fraudApi.fraudStateCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException | EncryptionException exception) { + exception.printStackTrace(); + return null; + } + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmit.java b/src/main/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmit.java new file mode 100644 index 0000000..55d77c0 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmit.java @@ -0,0 +1,72 @@ +package com.mastercard.fld.fraud.suspected.api.submit; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudSubmissionApi; +import com.mastercard.fld.api.fld.suspected.model.Fraud; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraud; +import com.mastercard.fld.api.fld.suspected.model.TransactionIdentifier; +import com.mastercard.fld.fraud.constants.Constants; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; +import com.mastercard.fld.utility.ObjectUtility; + +import okhttp3.Call; +import okhttp3.Response; + +public class SuspectedMastercardFraudSubmit { + + private RequestHelper helper = new RequestHelper(); + + public static void main(String[] args) { + + SuspectedMastercardFraudSubmit call = new SuspectedMastercardFraudSubmit(); + ObjectUtility.printJavaObjectOnColsole(call.submitMastercardFraud(call.createRequest())); + } + + public Fraud submitMastercardFraud(SuspectedFraud request) { + + SuspectedFraudSubmissionApi fraudApi = null; + try { + helper.initiateEncryptClient(); + fraudApi = new SuspectedFraudSubmissionApi(helper.getClient()); + return ObjectUtility.returnResponseAndPrintOnColsole(Constants.SUSPECTED_FRAUD_API, + fraudApi.getApiClient().getBasePath() + "/mastercard-frauds", "post", + helper.apiCall(fraudApi.submitSuspectedFraudCall(request, helper.getCallback())), Fraud.class); + } catch (ApiException | IOException | EncryptionException exception) { + exception.printStackTrace(); + return null; + } + } + + public Response updateMastercardFraudCall(Call call) throws IOException { + + return call.execute(); + } + + public SuspectedFraud createRequest() { + + SuspectedFraud request = new SuspectedFraud(); + request.setRefId("ecb2dl16-ea7d-u2y6-87wd-69c19792bdd6"); + request.setTimestamp("2024-03-27T14:12:37"); + request.setIcaNumber("1076"); + request.setProviderId("10"); + request.setCardNumber("5505130000000000302"); + request.setTransactionAmount("2100"); + request.setTransactionDate("20231007"); + request.setFraudPostedDate("20240327"); + request.setFraudTypeCode("04"); + request.setAccountDeviceType("1"); + request.setCardholderReportedDate("20240327"); + request.setCardInPossession("Y"); + request.setMemo("Request Description"); + TransactionIdentifier arn = new TransactionIdentifier(); + arn.setAcqRefNum("15505130816110008000998"); + arn.setBanknetRefNum("858001"); + // arn.setSerialId(""); + // arn.traceId(""); + request.setTransactionIdentifiers(arn); + return request; + } +} diff --git a/src/main/java/com/mastercard/fld/fraud/suspected/helper/RequestHelper.java b/src/main/java/com/mastercard/fld/fraud/suspected/helper/RequestHelper.java new file mode 100644 index 0000000..08216a8 --- /dev/null +++ b/src/main/java/com/mastercard/fld/fraud/suspected/helper/RequestHelper.java @@ -0,0 +1,39 @@ +package com.mastercard.fld.fraud.suspected.helper; + +import java.io.IOException; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.fraud.suspected.BaseClassUtil; + +import okhttp3.Call; +import okhttp3.Response; + +public class RequestHelper { + + public void initiateNonEncryptClient() { + + BaseClassUtil.setUpEnv(); + } + + public void initiateEncryptClient() throws EncryptionException { + + BaseClassUtil.setUpEncryptionEnv(); + } + + public ApiClient getClient() { + + return BaseClassUtil.getClient(); + } + + public ApiCallback getCallback() { + + return BaseClassUtil.getCallback(); + } + + public Response apiCall(Call call) throws IOException { + + return call.execute(); + } +} diff --git a/src/main/java/com/mastercard/fld/utility/EncryptionHelper.java b/src/main/java/com/mastercard/fld/utility/EncryptionHelper.java index 0011789..ef08829 100644 --- a/src/main/java/com/mastercard/fld/utility/EncryptionHelper.java +++ b/src/main/java/com/mastercard/fld/utility/EncryptionHelper.java @@ -12,13 +12,13 @@ import com.mastercard.developer.utils.EncryptionUtils; /* - * Copyright (c) 2021 Mastercard + * Copyright (c) 2021 Mastercard * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -29,36 +29,35 @@ public class EncryptionHelper { - private EncryptionHelper() { - } - - private static Certificate getEncryptionCertificate(String filePath) throws IOException, CertificateException { - Certificate encryptionCertificate = null; - File file = new File(filePath); - encryptionCertificate = EncryptionUtils.loadEncryptionCertificate(file.getPath()); - return encryptionCertificate; - } - - public static FieldLevelEncryptionConfig encryptionConfig(String encryptioncert, String fingerprint) - throws EncryptionException { - - FieldLevelEncryptionConfig config = null; - - try { - - config = FieldLevelEncryptionConfigBuilder.aFieldLevelEncryptionConfig() - .withEncryptionCertificate(getEncryptionCertificate(encryptioncert)).withEncryptionPath("$", "$") - .withOaepPaddingDigestAlgorithm("SHA-256").withEncryptedValueFieldName("encryptedValue") - .withEncryptedKeyFieldName("encryptedKey").withIvFieldName("iv") - .withEncryptionKeyFingerprint(fingerprint) - .withEncryptionKeyFingerprintFieldName("publicKeyFingerprint") - .withOaepPaddingDigestAlgorithmFieldName("oaepPaddingDigestAlgorithm") - .withFieldValueEncoding(FieldValueEncoding.HEX).build(); - - } catch (EncryptionException | IOException | CertificateException ex) { - throw new EncryptionException("Error occured while creating FieldLevelEncryptionConfig for encryption", ex); - } - - return config; - } + private EncryptionHelper() { + + } + + private static Certificate getEncryptionCertificate(String filePath) throws IOException, CertificateException { + + File file = new File(filePath); + return EncryptionUtils.loadEncryptionCertificate(file.getPath()); + } + + public static FieldLevelEncryptionConfig encryptionConfig(String encryptioncert, String fingerprint) throws EncryptionException { + + FieldLevelEncryptionConfig config = null; + try { + config = FieldLevelEncryptionConfigBuilder.aFieldLevelEncryptionConfig() + .withEncryptionCertificate(getEncryptionCertificate(encryptioncert)) + .withEncryptionPath("$", "$") + .withOaepPaddingDigestAlgorithm("SHA-256") + .withEncryptedValueFieldName("encryptedValue") + .withEncryptedKeyFieldName("encryptedKey") + .withIvFieldName("iv") + .withEncryptionKeyFingerprint(fingerprint) + .withEncryptionKeyFingerprintFieldName("publicKeyFingerprint") + .withOaepPaddingDigestAlgorithmFieldName("oaepPaddingDigestAlgorithm") + .withFieldValueEncoding(FieldValueEncoding.HEX) + .build(); + } catch (EncryptionException | IOException | CertificateException ex) { + throw new EncryptionException("Error occured while creating FieldLevelEncryptionConfig for encryption", ex); + } + return config; + } } diff --git a/src/main/java/com/mastercard/fld/utility/LoggerUtil.java b/src/main/java/com/mastercard/fld/utility/LoggerUtil.java index f61a878..33d9e09 100644 --- a/src/main/java/com/mastercard/fld/utility/LoggerUtil.java +++ b/src/main/java/com/mastercard/fld/utility/LoggerUtil.java @@ -10,29 +10,55 @@ public class LoggerUtil { - private static final Logger logger = Logger.getLogger(LoggerUtil.class.getName()); - - private LoggerUtil() { - } - - public static BufferedWriter getWriter() throws IOException { - FileWriter fw = new FileWriter("confirmed-fraud-api-output-" + LocalDate.now() + ".log"); //NOSONAR - return new BufferedWriter(fw); - } - - public static void logResponse(String url, String method, Response response) { - BufferedWriter bw; - try { - bw = getWriter(); - bw.write("Sending Request: [" + method + "] " + url); - bw.newLine(); - bw.newLine(); - bw.write("Response: " + response.code() + " " + response.body().string()); - bw.newLine(); - bw.newLine(); - bw.close(); - } catch (IOException e) { - logger.info(e.getMessage()); - } - } + private static final Logger logger = Logger.getLogger(LoggerUtil.class.getName()); + + private LoggerUtil() { + + } + + public static BufferedWriter getWriter(String api) throws IOException { + + FileWriter fw = new FileWriter(api + "-fraud-api-output-" + LocalDate.now() + ".log"); // NOSONAR + return new BufferedWriter(fw); + } + + public static void logResponse(String api, String url, String method, Response response) { + + BufferedWriter bw; + try { + bw = getWriter(api); + bw.write("Sending Request: [" + method + "] " + url); + bw.newLine(); + bw.newLine(); + bw.write("\tHttp Response - "); + bw.write("\t" + response.code()); + bw.newLine(); + bw.write("\tLocation Header - " + response.header("Location", "Not present")); + bw.newLine(); + bw.write("\tBody - " + response.body().string()); + bw.close(); + } catch (IOException e) { + logger.info(e.getMessage()); + } + } + + public static void logResponse(String api, String url, String method, int httpCode, String locationHeader, String body) { + + BufferedWriter bw; + try { + bw = getWriter(api); + bw.write("Sending Request: [" + method + "] " + url); + bw.newLine(); + bw.newLine(); + bw.write("\tHttp Response - "); + bw.write("\t" + httpCode); + bw.newLine(); + bw.write("\tLocation Header - " + locationHeader); + bw.newLine(); + bw.write("\tBody - " + body); + bw.close(); + } catch (IOException e) { + logger.info(e.getMessage()); + } + } } diff --git a/src/main/java/com/mastercard/fld/utility/ObjectUtility.java b/src/main/java/com/mastercard/fld/utility/ObjectUtility.java new file mode 100644 index 0000000..1d83aed --- /dev/null +++ b/src/main/java/com/mastercard/fld/utility/ObjectUtility.java @@ -0,0 +1,102 @@ +package com.mastercard.fld.utility; + +import java.io.IOException; +// import java.net.URI; +// import java.nio.charset.StandardCharsets; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; + +import com.google.gson.Gson; +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.developer.interceptors.OkHttpFieldLevelEncryptionInterceptor; +import com.mastercard.developer.interceptors.OkHttpOAuth1Interceptor; +// import com.mastercard.developer.oauth.OAuth; +import com.mastercard.developer.utils.AuthenticationUtils; +// import com.mastercard.fld.api.fld.confirmed.model.FraudDeleteAndConfirm; +// import com.mastercard.fld.api.fld.confirmed.model.FraudState; + +import okhttp3.Response; +import okhttp3.logging.HttpLoggingInterceptor; + +public class ObjectUtility { + + private ObjectUtility() { + + // Constructtor + } + + // Provided by the OAuth1 Signer lib + public static OkHttpOAuth1Interceptor createSigningInfo(String keyStorePath, String keyStorePassword, String keystoreAlias, + String consumerKey) { + + PrivateKey signingKey = null; + try { + signingKey = AuthenticationUtils.loadSigningKey(PropertyFileReader.getProperty(keyStorePath), + PropertyFileReader.getProperty(keystoreAlias), PropertyFileReader.getProperty(keyStorePassword)); + // System.out.println(signingKey); + } catch (IOException | KeyStoreException | CertificateException | NoSuchAlgorithmException | UnrecoverableKeyException exception) { + HttpLoggingInterceptor.Logger.DEFAULT.log(exception.toString()); + } + // Gson gson = new Gson(); + // try { + // String request = gson.toJson(createRequest()); + // String abc = OAuth.getAuthorizationHeader(URI.create("https://sandbox.api.mastercard.com/fld/confirmed-frauds/fraud-states"), + // "PUT", request, StandardCharsets.UTF_8, consumerKey, signingKey); + // System.out.println("\n\n\n" + abc); + // } catch (Exception e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + return new OkHttpOAuth1Interceptor(PropertyFileReader.getProperty(consumerKey), signingKey); + } + + // Encryption + public static OkHttpFieldLevelEncryptionInterceptor createEncryptionConfig(String encryptionCertificatePath, String encryptionKey) + throws EncryptionException { + + return new OkHttpFieldLevelEncryptionInterceptor(EncryptionHelper + .encryptionConfig(PropertyFileReader.getProperty(encryptionCertificatePath), PropertyFileReader.getProperty(encryptionKey))); + } + + public static T getResponseAsJavaObject(Class clazz, String body) { + + T fraud = null;; + Gson gson = new Gson(); + try { + fraud = gson.fromJson(body, clazz); + } catch (Exception ex) { + // Check for null object. + ex.printStackTrace(); + } + return fraud; + } + + public static T returnResponseAndPrintOnColsole(String api, String url, String method, Response response, Class clazz) + throws IOException { + + int httpCode = response.code(); + if (response.code() >= 400) { + LoggerUtil.logResponse(api, url, method, httpCode, "", response.message()); + System.out.println("\nResponse payload - \n\tHttp Code - " + httpCode + "\n\tBody - " + response.message()); + return null; + } + String locationHeader = response.header("Location", "Not present"); + String body = response.body().string(); + + LoggerUtil.logResponse(api, url, method, httpCode, locationHeader, body); + + System.out + .println("\nResponse payload - \n\tHttp Code - " + httpCode + "\n\tLocation header - " + locationHeader + "\n\tBody - " + body); + + T fraud = ObjectUtility.getResponseAsJavaObject(clazz, body); + return fraud; + } + + public static void printJavaObjectOnColsole(Object obj) { + + System.out.println("\nJava object - \n" + obj); + } +} diff --git a/src/main/java/com/mastercard/fld/utility/PropertyFileReader.java b/src/main/java/com/mastercard/fld/utility/PropertyFileReader.java new file mode 100644 index 0000000..5b3fbb6 --- /dev/null +++ b/src/main/java/com/mastercard/fld/utility/PropertyFileReader.java @@ -0,0 +1,33 @@ +package com.mastercard.fld.utility; + +import java.io.InputStream; +import java.util.Properties; + +public class PropertyFileReader { + + private static Properties prop = null; + + private static String propertyFile = "application.properties"; + + public static void loadProperties() { + + if (prop == null || prop.isEmpty()) { + try { + InputStream input = PropertyFileReader.class.getClassLoader().getResourceAsStream(propertyFile); + prop = new Properties(); + if (input == null) { + return; + } + prop.load(input); + } catch (Exception e) { + throw new IllegalArgumentException(e); + } + } + } + + public static String getProperty(String key) { + + loadProperties(); + return prop.getProperty(key); + } +} diff --git a/src/main/java/com/mastercard/fld/utility/RequestHelper.java b/src/main/java/com/mastercard/fld/utility/RequestHelper.java deleted file mode 100644 index 1bcc65a..0000000 --- a/src/main/java/com/mastercard/fld/utility/RequestHelper.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.mastercard.fld.utility; - -import java.io.IOException; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.BaseClassUtil; -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; - -import okhttp3.Call; -import okhttp3.Response; - -public class RequestHelper { - - public void initiateNonEncryptClient() { - BaseClassUtil.setUpEnv(); - } - - public void initiateEncryptClient() throws EncryptionException { - BaseClassUtil.setUpEncryptionEnv(); - } - - public ApiClient getClient() { - return BaseClassUtil.getClient(); - } - - public ApiCallback getCallback() { - return BaseClassUtil.getCallback(); - } - - public Response apiCall(Call call)throws IOException { - return call.execute(); - } -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 435fe45..33f692d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,78 @@ -mastercard.fld.api.url=https://sandbox.api.mastercard.com/fld/confirmed-frauds -mastercard.fld.client.p12.path=src/main/resources/dummy.p12 -mastercard.fld.client.ref.app.consumer.key=dummyconsumerkey -mastercard.fld.client.ref.app.keystore.alias=dummyalias -mastercard.fld.client.ref.app.keystore.password=dummykeystorepass -mastercard.fld.client.ref.app.encryption.file=src/main/resources/dummy.pem -mastercard.fld.client.ref.app.encryption.key=dummyencryptkey \ No newline at end of file +######## Environment ######## +# Sandbox - MTF +#mastercard.fld.api.url=https://sandbox.api.mastercard.com/fld/ + +# Production +#mastercard.fld.api.url=https://api.mastercard.com/fld/ + +# Dev PCF +# Confirmed fraud +#mastercard.fld.api.url=https://fi-fld-customer-fraud-api-sandbox.apps.stl.bnw-dev-pas.mastercard.int/fld/ + +# Suspected fraud +#mastercard.fld.api.url=https://fi-fld-customer-fraud-api-sandbox.apps.stl.bnw-dev-pas.mastercard.int/fld/ + +# Stage PCF +# Confirmed fraud +mastercard.fld.api.url=https://stage.api.mastercard.com/fld/ + +# Suspected fraud +#mastercard.fld.api.url=https://fld-suspected-fraud-api-service.apps.stl.pcfstage00.mastercard.int/fld/ + +# Local machine +#mastercard.fld.api.url=http://localhost:8080/fld/ + +######## End points ######## +# Confirmed fraud +mastercard.fld.confirmed.client.ref.app.endpoint=confirmed-frauds + +# Suspected fraud +mastercard.fld.suspected.client.ref.app.endpoint=suspected-frauds + +######## Sandbox - MTF ######## +# Confirmed fraud +# Nitin +mastercard.fld.confirmed.client.p12.path=src/main/resources/confirmed/KeyAlias001-production_govind.p12 +mastercard.fld.confirmed.client.ref.app.consumer.key=hV3sDFZiVSd8iY0c2uvVYDkR0UZnNCwDIAG_GUfBb1eb675b!71d338dc75c64e8b999e3836535ad15a0000000000000000 +mastercard.fld.confirmed.client.ref.app.keystore.alias=KeyAlias001 +mastercard.fld.confirmed.client.ref.app.keystore.password=KeyAlias001 +mastercard.fld.confirmed.client.ref.app.encryption.file=src/main/resources/confirmed/confirmed-fraud-apiClientEnc1728393521516.pem +mastercard.fld.confirmed.client.ref.app.encryption.key=186aacd1de431ec29b43da203b07f4f444f3f106acd77addd6f0f9927e5f1461 + + + +# Suspected fraud + +mastercard.fld.suspected.client.ref.app.keystore.alias=MTFPerfKeyAlias007 +mastercard.fld.suspected.client.ref.app.keystore.password=MTFPerfKeyAlias007 +mastercard.fld.suspected.client.p12.path=src/main/resources/suspected/stage/MTFPerfKeyAlias007-production.p12 +mastercard.fld.suspected.client.ref.app.encryption.key=04245884739ee9e9ad429e47c22ffc785981f2ac7aefb538924304d21603fbf7 +mastercard.fld.suspected.client.ref.app.encryption.file=src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1673939029302.pem +mastercard.fld.suspected.client.ref.app.consumer.key=phV3x1S9S9CFa5RY2SNrpYMNhHRSu5UNjcrmyYlD53681309!fa340b0ab1314b2a80e38e81fbd66b490000000000000000 +# Nitin +#mastercard.fld.suspected.client.ref.app.keystore.alias=key-alias +#mastercard.fld.suspected.client.ref.app.keystore.password=key-password +#mastercard.fld.suspected.client.p12.path=src/main/resources/suspected/mtf/key-alias-sandbox.p12 +#mastercard.fld.suspected.client.ref.app.encryption.key=e729516f13e529f5f4ceb207aa882b74f113fc60d8db929d297b44a322a4d69e +#mastercard.fld.suspected.client.ref.app.encryption.file=src/main/resources/suspected/mtf/sandbox-fldsuspectedfraudapiClientEnc1692261643.pem +#mastercard.fld.suspected.client.ref.app.consumer.key=UkcqMlyMOYpWv-0_TcSEtYZ2r8gc-4QLV5x4HkB1f4f6902b!8145c29b11ad464996f15ff2bcd1ef700000000000000000 + +######## Production ######## +# Suspected fraud +# Nitin +#mastercard.fld.suspected.client.ref.app.keystore.alias=key-alias +#mastercard.fld.suspected.client.ref.app.keystore.password=key-password +#mastercard.fld.suspected.client.p12.path=src/main/resources/suspected/prod/prod-key-alias-production.p12 +#mastercard.fld.suspected.client.ref.app.encryption.key=3ae13806c364103e973cb9d993ea3eee7c8bb7cfab6c5e463b743124a57c34cc +#mastercard.fld.suspected.client.ref.app.encryption.file=src/main/resources/suspected/prod/prod-fldsuspectedfraudapiClientEnc1692262841.pem +#mastercard.fld.suspected.client.ref.app.consumer.key=1EfmJSewx3-7snWZqBrciNNQbcoijeGvJ5L9w37K1d2e0acd!376cb07ea4804c41a98b8f42e8ffe5d20000000000000000 + +######## Stage ######## +# Suspected fraud +# Nitin +#mastercard.fld.suspected.client.ref.app.keystore.alias=keyalias +#mastercard.fld.suspected.client.ref.app.keystore.password=keystorepassword +#mastercard.fld.suspected.client.p12.path=src/main/resources/suspected/stage/Suspect_API-sandbox.p12 +#mastercard.fld.suspected.client.ref.app.encryption.key=75faf7f6a0b2ec647a4c8c55b3e0cfd4e5eaef57743b6716af18fb4972a3ed88 +#mastercard.fld.suspected.client.ref.app.encryption.file=src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1692662971.pem +#mastercard.fld.suspected.client.ref.app.consumer.key=6cTAg7ab2YP3efM_BvbZ6ET8Od4-7g1nqq8juunv85650ed0!5eb91f34e47941fa8d14f4ec6ea986ca0000000000000000 \ No newline at end of file diff --git a/src/main/resources/confirmed/IssuerFraud.json b/src/main/resources/confirmed/IssuerFraud.json new file mode 100644 index 0000000..cd63c8b --- /dev/null +++ b/src/main/resources/confirmed/IssuerFraud.json @@ -0,0 +1,52 @@ +{ + "icaNumber": "2742", + "providerId": "10", + "refId": "ea3216f3-zfaf-4053-baaa-f23ae674144e", + "timestamp": "2024-04-29T20:34:37-06:00", + "transactionAmount": "2100", + "transactionDate": "20231007", + "cardNumber": "5587450000000001574", + "transactionIdentifiers": [ + { + "cfcKey": "ARN", + "cfcValue": "01111110713000000011327" + } + ], + "acquirerId": "2742", + "fraudTypeCode": "01", + "fraudSubTypeCode": "P", + "cardProductCode": "CIR", + "settlementDate": "20231221", + "fraudPostedDate": "20240429", + "cardholderReportedDate": "20231221", + "transactionCurrencyCode": "840", + "billingAmount": "2100", + "billingCurrencyCode": "840", + "merchantId": "1234", + "merchantName": "testq", + "merchantCity": "test12", + "merchantStateProvinceCode": "UN", + "merchantCountryCode": "USA", + "merchantPostalCode": "78786", + "merchantCategoryCode": "0742", + "terminalAttendanceIndicator": "1", + "terminalId": "1234", + "terminalOperatingEnvironment": "8", + "cardholderPresenceIndicator": "0", + "cardPresenceIndicator": "1", + "cardInPossession": "Y", + "catLevelIndicator": "1", + "terminalCapabilityIndicator": "0", + "electronicCommerceIndicator": "21", + "posEntryMode": "10", + "cvcInvalidIndicator": "*", + "avsResponseCode": "A", + "authResponseCode": "40", + "secureCode": "0", + "accountDeviceType": "A", + "acquirerRoutingTransitNumber": "1111111111", + "issuerRoutingTransitNumber": "1111111111", + "transactionIndicator": "M101", + "issuerSCAExemption": "01", + "memo": "Issuer FDA Memo" +} diff --git a/src/main/resources/confirmed/KeyAlias001-production_govind.p12 b/src/main/resources/confirmed/KeyAlias001-production_govind.p12 new file mode 100644 index 0000000000000000000000000000000000000000..49f075f493eee0267a9a84648eb50487b51828e3 GIT binary patch literal 2400 zcmb`Hc{tSH7sqF_%#0|+^Zi)L(DDoZuWWNAcMqREndNr^1ghbZ*5FOel%gcxLB zlN!SGwa=i)dnhbMC$Gg9YFY5HJ)Az%iU~<>=$l zYrJ4Ca6SM>!2mcv8zZp*H2Z%-(0CXCz0Jl^Y`ejU{5OjS0fy!SP#HEvb0YqQa3OXr zC@(t!&gL9g0L;pVLckCR7>wopRTYfn0AcYsA*>)L)EWjw@tTnWFS}kkLb~Kaa1Fr; zWB2^zNEF|1E^TCa0*As1{0tyah~ELMq%g0#I#wI2j#F1Zpss1hb~XNR|Fd%dFy_w| zz#Jeb0Okj=TSPzrFc?(CeC^O9(^^Cp20R&0PHvOJiZycX-#Rhg^sNK6Gm0z-(XOsr zs@mAb_%@5ZJAVX$#y>U+G18aIL#88XwGt=h{zP2(Xr+`CB##ayg(< za?H7DUXv|{L}0Jl1qm?)kE+|_@P|Cs?M+0lH|4}1L-^mW4Qh~oh2P5}IBsUzga;6k zr2HgeA{*&$7j;rh=kLVRb6p2U{X1>H&x`eT6+Or}q-m@6;eHJ*#`k`GU2xfWn#rKZE?42K6J&Q$ykvy$x?D$-*u3lYxU|j;;?UQu=Uxe8 zE{dmf13$iT9~$(xH#^vFVmBnZeA<0rN-m97-ou(n#dm8BY$gV4$Et zwmxScKYs8w=jBw@|8QQ6nQu^&~k zD_%=a{a@Qr%Y3W`MNDPPYYkTj1%~>;ngkX@^|JGD;LyIZyrjyPKN57aF-0Y3M0QkF zCb9j-`J*kQ_NxH~PPmg;*6dnW!edOIc@*Awn~M-+h@dCHTEBHgl*d+XL=(t_Q`28 zJpKD>EPa(!Ef|K}v<&BlO|4A&;h0Hut73N)w>5LP{(`x;ht5~KythrQ8k~rOmo^V? zd--gdQBKJON`LPRst&G6yKB#c@PxD&hfau!U%e+!s}NIZ{3318MvSU(ExZsgWiKaRw z_S{<}`fh%Kq=%&xe1h^nD5zB#F*`zIj%kyi}c1DtUnXMj`A~vrxwIkI5FTN)!DLpOY#$E_Jr>7=_uK z8>mqY^=}k>YBpu?vBOB3(7})8%v_fji3nhjo80!M(J?P z&<<~>n;%UEFu^6&^O4J4b;~S?*phmdtP)ja?-m2|8FWKH-tX+_VhR2XBUf)XFm3N>FU>y}|aIB*zci4OHR4(417+QMUYL}O6J+(`-*w~dk z{PZi*k@Z)J-*m``<4}M{T+8R`ypm-lBCT~i8Pl_|;_W53bSlbgwxH(yT}Os}fK{KC zHSyg3T}#vvcT$#NYG%USm}jO(tG*GaO~6pn+n23eqr_EkfGJ<%E>G|xN%UMP>AHqKW*Sm|5dU)sj0zm8FvzNX9Cr*SepCj5QEqWD$2b2V>%5Gf6Trrk8dZ*}~(TOelo zBHH8qX*eF+EB)yWMc1Zi>c^L-H;ikvMf}J|wMh6DpCQm{JyCH7^T@)H&^j_3t6>y( zfKRBJ`5(_(999Mk=j2e~gF?hOKrq1?i(?iVEiPVHqbeH;Z>^P#x4P%UxGgf~Q%FXm I6+egRKe>Dsy#N3J literal 0 HcmV?d00001 diff --git a/src/main/resources/confirmed/KeyAlias036-production.p12 b/src/main/resources/confirmed/KeyAlias036-production.p12 new file mode 100644 index 0000000000000000000000000000000000000000..a915af2662776db3b66a3eb56552dfcc346ecf48 GIT binary patch literal 2400 zcmb`Hc{tQ-8^?dYncqxi7~5#fG7Y- z1^EEZh*$&_1c9aknx@DBX1|f2(wa}a`y|V2*++anP$B4Zylz5}m!zOxC~XoU%&qyL zqrFC*!heVMSK*voVfS8f((`8|ah(9}1Nw4a!|~0ZVrqycA;n*(oHoD3q8!qyD68wX z*nusw>JuVP(aTRQ)p9yRhZa00s$9A*>Zf+N>ChmT$-O0kU>R>#?L}H)%bL=C@*tae zf8?}fm#jxB)VG*Z{#KBDGc*sk{h}^>iyvQ0YSAvGSmK86N-S%aJ+d$dzL?rB?~p@x zZYoY)6{ivO!Gm2rkhSXU%cjy3F{cMmB{5PRn-Pg0dRZD+ot4p~tfX_g2~h#F0>jQK zpBQv?0R$2R{{N9VHv|F-g6#T5tvR-%`1VV@Yh$*ZW`Cy4TEE~!`^lCDQ|%-E@)Vsy zYO<%W*Ur5s#fx&k^>`~B#5_nZmt{N{Tq;Y0q6I2uG2+RN!6nfTh_nKD#yxcc%VtzB z1;&|KD3iNr8-&!IdyksQO*OaG-cLD|WH5w5zVJ+6rx!cwA8PDC$t3HgAi&ImGLtj9 zjuW~1FTS{g?Yez!aN~Ok{NUrB*4(;h`y4C8E&L{~d)?WuI&q5Xi(ZvflG6sBMznTo zUsOh{UddK76C)IJA8Ig3{17Pov5aM8!8UGnMw>ZpS(_NgYIR8W9@7cvkDryPj6T-k z=Tq@6Gkk8R|G66CQCRNh*T?K65+I@79&#?E8zz?rAcLTokE*7$0oUiS!mlJDqKFg$ zumn5+3Sb1B2fP6?5DdV87N84LQC>e2e<&B_1W{2A9Bj)mtKa2`pi`kGmDkv{QkTYA6}3wRsZl^cGtKUue>`kRvL3pTV77b4zc?~@#dwBP->}*4 z#%H9{^4ygkkVi?rWjCrsv$&n%F1S1YnR@<#N3wHIR`>I#KmSHOA%N!%GHiWy<*jhT z*wmrf6Jj?0!g)C%N}8_KcYoyzh>15dT*%^YN*H+>!n4!LVx z;E}tyPJ{?0r7BSUN2~4p=H4{tndB1HHL2KL@&Rs?BHZFb2~BTdv<+clpI~(=`Hw@4 zvr(PV-Ub9_Xg4#8QM81zw6)-5|ihZ6MD8QinafB39Y%}K(ok~ zi)3YiP5W2(28H-T`1Ew-qNN+>3fb#auBLd&^=i!~C7q2@7x**xx7>wk_0q1(a%bdO zJ^W&ygWC?=?ipkTlQ3mOEpNp3i_jeri%U<{7wQey(OM%Xd4lW`JS3!F$K7vByK^&K zVevaMLx6n;v0ZO6_hC9YCJtPh6*<*&oTpaJFMP=07-K9f;1ZXb&zWM&XRYkHGL^MV z?btt>IyHITWY(>%z2wbNyw&;2zE*ZLLwBk!tnilo`;oqa8+EbN2Q9no{jai7n3AHz zCSRq*3o151iaPfbp|NqFmG7c%W|kVL0i4xnsnaKt`IGZddjw-MN$-w{H`1Z1dmc*3 zL^uyS&c)_;cH~nkhzs_5mCXjDXT9HI-5XM7YywoWF=fUb3CXRId9Iae??qCNjF4_K z<6Rnd@MbrZuaG6tBbJ^I%xmTY%uDSmzZlN>-<1+I%*lwf0=S~Gg6^HCD4sw(MXpM- zRXuw)vuc$wxMH|3)Y-p9)cwlX7y12KJR6#%n{D6)J;SbE)@oK}ZGu+c$8gAa+N~fk z8`>_tSJO#&xD}{CW9jajaMg&AD9+q>f9WQc&ad?~kmB7LRAgo>RN9R0y;TbhGLG7l8dmNCaQTi$P2D54+w<;LYJ6XF(QsPo zx}&m@#eepOD1tq8cJs2K8`3FTZDTykCmSZuNvvdzC&bV!XME)cDEK4H2Gf;rH|W^c zNG4yj&zn2TzHLGoUg@=GA8%BL$vBT>)!7A&C`;zf#`4!DL$+%`hUi0)& zSnY(_qsat)MtOc(ulm&J`;!E|Cb$Z#Tzg)yuPs0R?b0QN)Oxayjk~e5;_L3s6MM?i zH#BVjN}P|_PkKJM>^WD3F3;|oigp{7Oe4O Gnf?uTJq{fJ literal 0 HcmV?d00001 diff --git a/src/main/resources/confirmed/config.json b/src/main/resources/confirmed/config.json new file mode 100644 index 0000000..6f0fc47 --- /dev/null +++ b/src/main/resources/confirmed/config.json @@ -0,0 +1,25 @@ +{ + "timestamp": "2024-07-24T20:34:37-06:00", + "icaNumber": "3043", + "refId": "ecbqdq42-edbd-12b6-87sd-69c19692bdc6", + "providerId": "10", + "transactionIdentifiers": [ + { + "cfcKey": "ARN", + "cfcValue": "01111111007000000033297" + } + ], + "cardNumber": "5411057700000007527", + "transactionAmount": "2126", + "transactionDate": "20231007", + "fraudTypeCode": "00", + "fraudPostedDate": "20231016", + "fraudSubTypeCode": "K", + "cardholderReportedDate": "20231016", + "accountDeviceType": "1", + "avsResponseCode": "U", + "cardInPossession": "Y", + "authResponseCode": "01", + "memo": "This is a sample FDA minimal request.", + "issuerSCAExemption": "04" +} \ No newline at end of file diff --git a/src/main/resources/confirmed/confirmed-fraud-apiClientEnc1728393521516.pem b/src/main/resources/confirmed/confirmed-fraud-apiClientEnc1728393521516.pem new file mode 100644 index 0000000..329d296 --- /dev/null +++ b/src/main/resources/confirmed/confirmed-fraud-apiClientEnc1728393521516.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEgTCCA2mgAwIBAgIIDzMLWnpsXGEwDQYJKoZIhvcNAQELBQAwgZAxCzAJBgNV +BAYTAlVTMR0wGwYDVQQKExRNYXN0ZXJDYXJkIFdvcmxkd2lkZTEbMBkGA1UECxMS +Q29ycG9yYXRlIFNlY3VyaXR5MUUwQwYDVQQDEzxNYXN0ZXJDYXJkIFNURyBPcGVu +QVBJIEluYm91bmQgRmllbGQgTGV2ZWwgRW5jcnlwdGlvbiBTdWIgQ0EwHhcNMjQx +MDA4MTMxODQ0WhcNMjUxMTA3MTMxODQ0WjB/MSkwJwYDVQQDEyBHb3ZpbmRtY1N0 +YWdlLWluYm91bmQtZW5jcnlwdGlvbjETMBEGA1UEChMKTWFzdGVyQ2FyZDEQMA4G +A1UECxMHT3BlbkFQSTERMA8GA1UEBxMITmV3IFlvcmsxCzAJBgNVBAgTAk5ZMQsw +CQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5n4Fzl +0UlIPlSt2XTu2XIISbCpJJR8BqZ3HeWLTJjd2GsanEk3rrDUM109yWLKZ+aA+ui3 +wrgJzrot5hCHCz0MUjCrEQfjNWdFj9nyFOC8H4a3mqdpAhC16CgtqPS+Lbd0omsY +u137luRs/7uAHbbXCxJc2Np6m7vUpk8GZVEPLdI62D69P5zdAZtd6TZnfWX4YZkU +2tEAX7LvAdTE8Tj3NpXM01DSyL+KOV7Xx53yxmtnyW+bJYc40dME1NrGpUaRRZNu +PY40tCoWxNeum6cTf+7fyYYBK45sHGMqIYIUC1yrf0+HwvKrBtO7gZJO303aOn7A +P1AxClHFPOwq13sCAwEAAaOB7jCB6zAOBgNVHQ8BAf8EBAMCACAwCQYDVR0TBAIw +ADAdBgNVHQ4EFgQU33FPZbR62JHq60qMLbvzB93fbJgwHwYDVR0jBBgwFoAUFyvF +A9UiGgQEdtjkXBeOC35o5bMwYQYDVR0fBFowWDBWoFSgUoZQaHR0cDovL2NybGRw +LmVjbXMubWNsb2NhbC5pbnQ6MTM1MzYvMTcyYmM1MDNkNTIyMWEwNDA0NzZkOGU0 +NWMxNzhlMGI3ZTY4ZTViMy5jcmwwKwYDVR0RBCQwIoIgR292aW5kbWNTdGFnZS1p +bmJvdW5kLWVuY3J5cHRpb24wDQYJKoZIhvcNAQELBQADggEBAHB7wDR4G90jnWp5 +2PnzbXhUh0Q1TiSTT28H4i2LAW/9kwyV/yQ0soydYFKt74vWW/+JZi5WP/q+eSls +uP46JPgfZpSq5EGMdNZ45lDH40wS+ikoFqE8JO9l2dBekqSRzuRZH76uYlbdY7Io +eThXDdMeW9zoBKFLsnBpYxiQMmfX4di1rijllIuvLAU3XR0nFqeW5raDDxDck86c ++eyH0p8fV9jFlPbA7vV1kKiw/2iIwtckjNDt+cdwDKDc9IrWCBnv51wvK8OKjUNw +NM+u9v1JhEFRTsn00Y6btdZj3/++1QvG3+gaI7GYE7MRimysQp7i5eTzcsFOrtOb +wxkTWW0= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/main/resources/confirmed/confirmed-swagger.yaml b/src/main/resources/confirmed/confirmed-swagger.yaml new file mode 100644 index 0000000..76278e8 --- /dev/null +++ b/src/main/resources/confirmed/confirmed-swagger.yaml @@ -0,0 +1,1775 @@ +openapi: 3.0.3 +info: + title: Confirmed Fraud API + description: These APIs allow issuers to submit transactions as confirmed fraud, change the value/status, and delete an existing fraud transaction. They also allow users to confirm a suspended fraud transaction and mark it as confirmed + fraud. + contact: + name: API Support + email: apisupport@mastercard.com + url: 'https://developer.mastercard.com/support' + version: 1.3.06 +servers: + - url: 'https://api.mastercard.com/fld/confirmed-frauds' + description: Global Production server (uses live data) + - url: 'https://api.mastercard.co.in/fld/confirmed-frauds' + description: India Production server (uses live data) + - url: 'https://sandbox.api.mastercard.com/fld/confirmed-frauds' + description: Global Sandbox server (testing environment) + - url: 'https://sandbox.api.mastercard.co.in/fld/confirmed-frauds' + description: India Sandbox server (testing environment) +tags: + - name: Confirmed Fraud Submission + description: Confirmed Fraud Submission + - name: Confirmed Fraud Management + description: Confirmed Fraud Management +paths: + /mastercard-frauds: + post: + tags: + - Confirmed Fraud Submission + operationId: submitMastercardFraud + description: This endpoint allows the initiator to add a new fraud record using minimal input parameters for Mastercard built transactions. To submit a transaction as fraud, a match has to be found in the Mastercard transaction data repository(Data Warehouse). + summary: Add a new fraud record using minimal input parameters for Mastercard built transactions. + x-mastercard-api-encrypted: true + requestBody: + $ref: '#/components/requestBodies/FraudMastercardRequest' + responses: + '200': + $ref: '#/components/responses/FraudAdditionException' + '201': + $ref: '#/components/responses/FraudAddition' + '202': + $ref: '#/components/responses/FraudAddAccepted' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + put: + tags: + - Confirmed Fraud Management + operationId: updateMastercardFraud + description: This endpoint allows the initiator to change an existing fraud record using minimal input parameters for Mastercard built transactions. The initiator can modify both successful and rejected fraud transactions and also modify transactions which are submitted via other channels such as GFT, file upload, and online. + summary: Change an existing fraud record using minimal input parameters for Mastercard built transactions. + x-mastercard-api-encrypted: true + requestBody: + $ref: '#/components/requestBodies/FraudRequestChange' + responses: + '200': + $ref: '#/components/responses/FraudDataChanged' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + /issuer-frauds: + post: + tags: + - Confirmed Fraud Submission + operationId: submitIssuerFraud + description: This endpoint allows the initiator to add a new fraud record using complete input parameters for both Mastercard and Issuer built transactions. The transaction will be looked up in the Mastercard transaction data repository (Data Warehouse) and if a match is found, it is submitted as a Mastercard built fraud record. If no match is found, the transaction will be submitted as an Issuer built fraud record. + summary: Add a new fraud record using complete input parameters for both Mastercard and Issuer built transactions. + x-mastercard-api-encrypted: true + requestBody: + $ref: '#/components/requestBodies/FraudIssuerRequest' + responses: + '200': + $ref: '#/components/responses/FraudIssuerAdditionException' + '201': + $ref: '#/components/responses/FraudIssuerAddition' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + put: + tags: + - Confirmed Fraud Management + operationId: updateIssuerFraud + description: This endpoint allows the initiator to change an existing fraud record using complete input parameters for both Mastercard and Issuer built transactions. The initiator can modify both successful and rejected fraud transactions and also modify transactions which are submitted via other channels such as GFT, file upload, and online. + summary: Change an existing fraud record using complete input parameters for both Mastercard and Issuer built transactions. + x-mastercard-api-encrypted: true + requestBody: + $ref: '#/components/requestBodies/FraudIssuerRequestChange' + responses: + '200': + $ref: '#/components/responses/FraudIssuerDataChanged' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + /fraud-states: + put: + tags: + - Confirmed Fraud Management + operationId: fraudState + description: This endpoint allows the initiator to delete an existing fraud record or confirm a suspended fraud record for both Mastercard and Issuer built transactions. Operation type FDD will delete existing fraud records from FLD, irrespective of the fraud state i.e., success / rejected / suspended. And operation type FDE will confirm an existing fraud record which was suspended due to reasons such as potential duplicates, billing variance, suspicious amounts, etc. + summary: Delete an existing fraud record or confirm a suspended fraud record for both Mastercard and Issuer built transactions. + requestBody: + $ref: '#/components/requestBodies/FraudStateRequest' + responses: + '200': + $ref: '#/components/responses/FraudStateChanged' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + /fraud-statuses/icas/{ica}: + get: + tags: + - Confirmed Fraud Management + operationId: fraudRequestStatus + description: This endpoint allows the initiator to get the status of an existing fraud record using combination of ICA, Ref ID & ACN, for both Mastercard and Issuer built transactions. The initiator can get status of fraud transaction submitted via any channel GFT, File upload, Online & API. + summary: Get status of an existing fraud record for both Mastercard and Issuer built transactions. + parameters: + - $ref: '#/components/parameters/ICA' + - $ref: '#/components/parameters/Ref_Id' + - $ref: '#/components/parameters/ACN' + responses: + '200': + $ref: '#/components/responses/FraudStatusResponse' + '400': + $ref: '#/components/responses/FraudStatusBadRequestError' + '429': + $ref: '#/components/responses/RateLimitExceededError' +components: + parameters: + ICA: + name: ica + in: path + required: true + schema: + type: string + minLength: 3 + maxLength: 7 + example: "1076" + description: Refers to the ICA of the fraud record which needs to be searched for its status. It is mandatory parameter along with Ref ID or ACN.. + Ref_Id: + name: ref_id + in: query + schema: + type: string + minLength: 36 + maxLength: 36 + example: "ecb2d942-eabd-42b6-87fd-69c19692bdc6" + description: Refers to the reference ID of the API call which was used to submit fraud record. This is optional parameter if ACN is present in the request. + ACN: + name: acn + in: query + schema: + type: string + minLength: 15 + maxLength: 15 + example: "418142102142002" + description: Refers to the ACN of the fraud record whose status is to be fetched. This is optional parameter for record submitted through APIs. + schemas: + APIDataElement: + required: + - refId + - timestamp + - icaNumber + type: object + properties: + refId: + description: Unique identification generated by the transaction originator using UUID logic to unambiguously link a request and response message. + type: string + minLength: 36 + maxLength: 36 + example: "ecb2d942-eabd-42b6-87fd-69c19692bdc6" + timestamp: + type: string + description: Timestamp of the request initiation by the originator in the format 'YYYY-MM-DDThh:mm:ss'. Time stamp is in UTC format. + minLength: 19 + maxLength: 19 + example: "2021-02-02T02:34:37" + icaNumber: + description: ICA number of the Issuer or Acquirer initiating the fraud submission request. + type: string + minLength: 3 + maxLength: 7 + example: "1076" + issuerSCAExemption: + description: Issuer SCA (Strong Customer Authentication) Exemption value. Please refer to [Table 16](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-16-issuer-sca-strong-customer-authentication-exemption) for possible values. + type: string + minLength: 1 + maxLength: 2 + example: "09" + MastercardFraud: + allOf: + - $ref: '#/components/schemas/APIDataElement' + - type: object + required: + - providerId + - transactionIdentifiers + - cardNumber + - transactionAmount + - transactionDate + - fraudTypeCode + - accountDeviceType + - cardInPossession + properties: + providerId: + $ref: '#/components/schemas/SafeFraudProvider' + transactionIdentifiers: + type: "array" + items: + $ref: '#/components/schemas/TransactionIdentifier' + cardNumber: + description: Cardholder account number used in the fraudulent transaction. Card number to be verified through Luhn's algorithm. + type: string + minLength: 12 + maxLength: 19 + example: "5505135664572870000" + transactionAmount: + description: Transaction amount at the merchant location (without any decimals). + type: string + minLength: 1 + maxLength: 12 + example: "10350" + transactionDate: + description: Local date at the merchant location when the transaction occurred. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210115" + fraudPostedDate: + description: Date on which the fraud is posted in FLD by the originator. Format is 'YYYYMMDD'.It is optional field, if not provided FLD System will save it as System date. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210120" + fraudTypeCode: + description: Code identifying the reason the originator submitted the transaction as fraud in FLD. Please refer to [Table 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "04" + fraudSubTypeCode: + description: Code to further identify the reason that the originator submitted the transaction as a fraud in FLD. This attribute is mandatory for the Issuer but optional for the Acquirer. Please refer to [Table 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "U" + accountDeviceType: + description: Indicates if the account uses a magnetic stripe, chip, pin, contactless or any combination thereof. Please refer to [Table 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + cardholderReportedDate: + description: Date on which the cardholder had reported the fraud. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210118" + cardInPossession: + description: Flag to indicate if the card holder was in possession of the card at the time the fraud occurred. Possible values are 'Y', 'N' and 'U' (for Unknown). + type: string + minLength: 1 + maxLength: 1 + example: 'N' + avsResponseCode: + description: The Address Verification Service response code in the Authorization Request Response. Please refer to [Table 4](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-4-avs-response-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "U" + authResponseCode: + description: Indicates the result of the authorization request. Please refer to [Table 5](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-5-authorization-response-codes) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "01" + memo: + description: Brief description by the originator providing some comment supporting the action. + type: string + minLength: 1 + maxLength: 1000 + example: "This is a sample FDA minimal request." + IssuerFraud: + allOf: + - $ref: '#/components/schemas/APIDataElement' + - type: object + required: + - acquirerId + - transactionIdentifiers + - cardNumber + - fraudTypeCode + - fraudSubTypeCode + - cardProductCode + - transactionDate + - settlementDate + - transactionAmount + - transactionCurrencyCode + - billingAmount + - billingCurrencyCode + - merchantId + - merchantName + - merchantCity + - merchantCountryCode + - merchantPostalCode + - merchantCategoryCode + - terminalAttendanceIndicator + - terminalId + - terminalOperatingEnvironment + - cardholderPresenceIndicator + - cardPresenceIndicator + - cardInPossession + - catLevelIndicator + - terminalCapabilityIndicator + - posEntryMode + - cvcInvalidIndicator + - avsResponseCode + - authResponseCode + - accountDeviceType + properties: + acquirerId: + description: Acquirer identification number (ICA number) for the transaction. + type: string + minLength: 3 + maxLength: 7 + example: "5450" + transactionIdentifiers: + type: "array" + items: + $ref: '#/components/schemas/TransactionIdentifier' + cardNumber: + description: Cardholder account number used in the fraudulent transaction. Card number to be verified through Luhn's algorithm. + type: string + minLength: 12 + maxLength: 19 + example: "5505135664572870000" + fraudTypeCode: + description: Code identifying the reason the originator submitted the transaction as fraud in FLD. Please refer to [Table 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "04" + fraudSubTypeCode: + description: Code to further identify the reason that the originator submitted the transaction as fraud in FLD. Please refer to [Table 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "U" + cardProductCode: + description: Value identifying the type of card used in the transaction. Please refer to [Card Type Codes table](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-2/) for possible values. + type: string + minLength: 3 + maxLength: 3 + example: "MSI" + transactionDate: + description: Local date at the merchant location when the transaction occurred. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210115" + settlementDate: + description: Settlement date of transaction reported. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210116" + fraudPostedDate: + description: Date on which the fraud is posted in FLD by the originator. Format is 'YYYYMMDD'. It is optional field, if not provided FLD System will save it as System date. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210120" + cardholderReportedDate: + description: Date on which the cardholder had reported the fraud. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210118" + transactionAmount: + description: Transaction amount at the merchant location (without any decimals). + type: string + minLength: 1 + maxLength: 12 + example: "10350" + transactionCurrencyCode: + description: Code defining the currency used for the transaction amount. The code should be part of the numeric ISO Standard Currency Codes list. + type: string + minLength: 3 + maxLength: 3 + example: "826" + billingAmount: + description: Amount appearing on the cardholder statement in the cardholder's billing currency (without any decimals). + type: string + minLength: 1 + maxLength: 12 + example: "10350" + billingCurrencyCode: + description: Code defining the currency used for the billing amount. The code should be part of the numeric ISO Standard Currency Codes list. + type: string + minLength: 3 + maxLength: 3 + example: "826" + merchantId: + description: Card acceptor / merchant's unique identification number, assigned by the Acquirer. + type: string + minLength: 1 + maxLength: 15 + example: "A42E51982100100" + merchantName: + description: Name of the card acceptor. + type: string + minLength: 1 + maxLength: 22 + example: "BANKNEWPORT" + merchantCity: + description: City in which the merchant is located. + type: string + minLength: 1 + maxLength: 13 + example: "PHOENIX" + merchantStateProvinceCode: + description: If the card acceptor/merchant is in the US, the state in which it is located. + type: string + minLength: 2 + maxLength: 3 + example: "AZ" + merchantCountryCode: + description: Indicates the country in which the merchant is located. + type: string + minLength: 3 + maxLength: 3 + example: "USA" + merchantPostalCode: + description: Postal code at the merchant location. + type: string + minLength: 1 + maxLength: 10 + example: "85001" + merchantCategoryCode: + description: Card acceptor business code / merchant category code. + type: string + minLength: 4 + maxLength: 4 + example: "6011" + terminalAttendanceIndicator: + description: Indicates if the card acceptor was attending the terminal at the time of transaction. Please refer to [Table 12](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-12-terminal-attendance-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + terminalId: + description: Unique code identifying a terminal at the card acceptor (merchant) location. + type: string + minLength: 1 + maxLength: 8 + example: "5055D305" + terminalOperatingEnvironment: + description: Indicates whether the card acceptor is attending the terminal and the location of the terminal. Please refer to [Table 13](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-13-terminal-operating-environment) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "4" + cardholderPresenceIndicator: + description: Indicates whether the cardholder is present at the point of service and explains the condition if the cardholder is not present. Please refer to [Table 6](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-6-cardholder-presence-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "5" + cardPresenceIndicator: + description: Indicates whether the card was present at the point of service. Please refer to [Table 7](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-7-card-present-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + cardInPossession: + description: Flag to indicate if the card holder was in possession of the card at the time the fraud occurred. Possible values are 'Y', 'N' and 'U' (for Unknown). + type: string + minLength: 1 + maxLength: 1 + example: 'N' + catLevelIndicator: + description: Indicates whether the cardholder activated the terminal with the use of the card and the CAT security level. Please refer to [Table 9](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-9-cardholder-activated-terminal-level-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + terminalCapabilityIndicator: + description: Indicates the terminal capability for transferring the data on the card into the terminal. Please refer to [Table 14](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-14-terminal-input-capability-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "5" + electronicCommerceIndicator: + description: + Indicates the security protocol and authentication of the transaction. Mandatory if CAT Level = 6. Please refer to [Table 10](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-10-electronic-commerce-security-level-indicator) for possible values. + type: string + minLength: 1 + maxLength: 2 + example: "24" + posEntryMode: + description: + Indicates how the PAN was entered at the terminal. Please refer to [Table 8](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-8-pos-entry-mode) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "05" + cvcInvalidIndicator: + description: Indicates whether the CVC was valid when authorization was attempted. Please refer to [Table 15](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-15-card-validation-code-cvc-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "M" + avsResponseCode: + description: The Address Verification Service response code in the Authorization Request Response. Please refer to [Table 4](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-4-avs-response-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "U" + authResponseCode: + description: Indicates the result of the authorization request. Please refer to [Table 5](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-5-authorization-response-codes) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "01" + secureCode: + description: Indicates the type of security processing used for the PIN data. Mandatory if ecommerce indicator = 21 or 22. Please refer to [Table 11](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-11-secure-code) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "9" + accountDeviceType: + description: Indicates if the account uses a magnetic stripe, chip, pin, contactless or any combination thereof. Please refer to [Table 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + acquirerRoutingTransitNumber: + description: The identification number of the merchant's acquirer. Applicable for a single message transaction. Mandatory if an acquirer ICA value is '9999999'. + type: string + minLength: 10 + maxLength: 10 + example: "1790018674" + issuerRoutingTransitNumber: + description: The identification number of the issuing institution. Applicable for a single message transaction. Mandatory if an issuer ICA value is '9999999'. + type: string + minLength: 10 + maxLength: 10 + example: "1231380159" + transactionIndicator: + description: Indicates whether the transaction was initiated by the cardholder or the merchant as well as providing more detail as to the type of stored credentials being used for the transaction. Please refer to [Table 17](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-17-cardholder-merchant-initiated-transaction-indicator) for possible values. + type: string + minLength: 4 + maxLength: 4 + example: 'M101' + memo: + description: Brief description by the originator providing some comment supporting the action. + type: string + minLength: 1 + maxLength: 1000 + example: This is a sample FDA complete request. + UpdatedMastercardFraud: + allOf: + - $ref: '#/components/schemas/APIDataElement' + - type: object + required: + - providerId + - auditControlNumber + properties: + providerId: + $ref: '#/components/schemas/SafeFraudProvider' + auditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful fraud record submission (FDA event). This is used as a reference to subsequently modify, delete or convert a suspended to a confirmed fraud record. + type: string + minLength: 15 + maxLength: 15 + example: "418142102142002" + fraudPostedDate: + description: Date on which the fraud is posted in FLD by the originator. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210120" + fraudTypeCode: + description: Code identifying the reason the originator submitted the transaction as fraud in FLD. Please refer to [Table 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "04" + fraudSubTypeCode: + description: Code to further identify the reason why the originator submitted the transaction as fraud in FLD. This attribute is mandatory for Issuer but optional for Acquirer. Please refer to [Table 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "U" + accountDeviceType: + description: Indicates if the account uses a magnetic stripe, chip, pin, contactless or any combination thereof. Please refer to [Table 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + cardholderReportedDate: + description: Date on which the cardholder had reported the fraud. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210118" + cardInPossession: + description: Flag to indicate if the card holder was in possession of the card at the time the fraud occurred. Possible values are 'Y', 'N' and 'U' (for Unknown). + type: string + minLength: 1 + maxLength: 1 + example: 'N' + memo: + description: Brief description by the originator providing some comment supporting the action. + type: string + minLength: 1 + maxLength: 1000 + example: "This is a sample FDC minimal request." + UpdatedIssuerFraud: + allOf: + - $ref: '#/components/schemas/APIDataElement' + - type: object + required: + - auditControlNumber + properties: + acquirerId: + description: Acquirer identification number (ICA number) for the transaction. + type: string + minLength: 3 + maxLength: 7 + example: "5450" + auditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful fraud record submission (FDA event). This is used as a reference to subsequently modify, delete or convert a suspended to a confirmed fraud record. + type: string + minLength: 15 + maxLength: 15 + example: "418142102142002" + cardNumber: + description: Cardholder account number used in the fraudulent transaction. Card number to be verified through Luhn's algorithm. + type: string + minLength: 12 + maxLength: 19 + example: "5505135664572870000" + fraudTypeCode: + description: Code identifying the reason the originator submitted the transaction as fraud in FLD. Please refer to [Table 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "04" + fraudSubTypeCode: + description: Code to further identify the reason that the originator submitted the transaction as fraud in FLD. Please refer to [Table 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "U" + cardProductCode: + description: Value identifying the type of card used in the transaction. Please refer to [Card Type Codes table](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-2/) for possible values. + type: string + minLength: 3 + maxLength: 3 + example: "MSI" + transactionDate: + description: Local date at the merchant location when the transaction occurred. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210115" + settlementDate: + description: Settlement date of transaction reported. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210116" + fraudPostedDate: + description: Date on which the fraud is posted in FLD by the originator. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210120" + cardholderReportedDate: + description: Date on which the cardholder had reported the fraud. Format is 'YYYYMMDD'. + type: string + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + example: "20210118" + transactionAmount: + description: Transaction amount at the merchant location (without any decimals). + type: string + minLength: 1 + maxLength: 12 + example: "10350" + transactionCurrencyCode: + description: Code defining the currency used for the transaction amount. The code should be part of the numeric ISO Standard Currency Codes list. + type: string + minLength: 3 + maxLength: 3 + example: "826" + billingAmount: + description: Amount appearing on the cardholder statement in the cardholder's billing currency (without any decimals). + type: string + minLength: 1 + maxLength: 12 + example: "10350" + billingCurrencyCode: + description: Code defining the currency used for the billing amount. The code should be part of the numeric ISO Standard Currency Codes list. + type: string + minLength: 3 + maxLength: 3 + example: "826" + merchantId: + description: Card acceptor / merchant's unique identification number, assigned by the Acquirer. + type: string + minLength: 1 + maxLength: 15 + example: "A42E51982100100" + merchantName: + description: Name of the card acceptor. + type: string + minLength: 1 + maxLength: 22 + example: "BANKNEWPORT" + merchantCity: + description: City in which the merchant is located. + type: string + minLength: 1 + maxLength: 13 + example: "PHOENIX" + merchantStateProvinceCode: + description: If the card acceptor / merchant is in the US, the state in which it is located. + type: string + minLength: 2 + maxLength: 3 + example: "AZ" + merchantCountryCode: + description: Indicates the country in which the merchant is located. + type: string + minLength: 3 + maxLength: 3 + example: "USA" + merchantPostalCode: + description: Postal code at the merchant location. + type: string + minLength: 1 + maxLength: 10 + example: "85001" + merchantCategoryCode: + description: Card acceptor business code / merchant category code. + type: string + minLength: 4 + maxLength: 4 + example: "6011" + terminalAttendanceIndicator: + description: Indicates if the card acceptor was attending the terminal at the time of transaction. Please refer to [Table 12](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-12-terminal-attendance-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + terminalId: + description: Unique code identifying a terminal at the card acceptor (merchant) location. + type: string + minLength: 1 + maxLength: 8 + example: "5055D305" + terminalOperatingEnvironment: + description: Indicates whether the card acceptor is attending the terminal and the location of the terminal. Please refer to [Table 13](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-13-terminal-operating-environment) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "4" + cardholderPresenceIndicator: + description: Indicates whether the cardholder is present at the point of service and explains the condition if the cardholder is not present. Please refer to [Table 6](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-6-cardholder-presence-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "5" + cardPresenceIndicator: + description: Indicates whether the card was present at the point of service. Please refer to [Table 7](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-7-card-present-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + cardInPossession: + description: Flag to indicate if the card holder was in possession of the card at the time the fraud occurred. Possible values are 'Y', 'N' and 'U' (for Unknown). + type: string + minLength: 1 + maxLength: 1 + example: 'N' + catLevelIndicator: + description: Indicates whether the cardholder activated the terminal with the use of the card and the CAT security level. Please refer to [Table 9](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-9-cardholder-activated-terminal-level-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + terminalCapabilityIndicator: + description: Indicates the terminal capability for transferring the data on the card into the terminal. Please refer to [Table 14](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-14-terminal-input-capability-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "5" + electronicCommerceIndicator: + description: Indicates the security protocol and authentication of the transaction. Mandatory if CAT Level = 6. Please refer to [Table 10](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-10-electronic-commerce-security-level-indicator) for possible values. + type: string + minLength: 1 + maxLength: 2 + example: "24" + posEntryMode: + description: Indicates how the PAN was entered at the terminal. Please refer to [Table 8](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-8-pos-entry-mode) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "05" + cvcInvalidIndicator: + description: Indicates whether the CVC was valid when authorization was attempted. Please refer to [Table 15](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-15-card-validation-code-cvc-indicator) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "M" + avsResponseCode: + description: The Address Verification Service response code in the Authorization Request Response. Please refer to [Table 4](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-4-avs-response-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "U" + authResponseCode: + description: Indicates the result of the authorization request. Please refer to [Table 5](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-5-authorization-response-codes) for possible values. + type: string + minLength: 2 + maxLength: 2 + example: "01" + secureCode: + description: Indicates the type of security processing used for the PIN data. Mandatory if ecommerce indicator = 21 or 22. Please refer to [Table 11](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-11-secure-code) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "9" + accountDeviceType: + description: Indicates if the account uses a magnetic stripe, chip, pin, contactless or any combination thereof. Please refer to [Table 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) for possible values. + type: string + minLength: 1 + maxLength: 1 + example: "1" + transactionIndicator: + description: Indicates whether the transaction was initiated by the cardholder or the merchant as well as providing more detail as to the type of stored credentials being used for the transaction. Please refer to [Table 17](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-17-cardholder-merchant-initiated-transaction-indicator) for possible values. + type: string + minLength: 4 + maxLength: 4 + example: 'M101' + memo: + description: Brief description by the originator providing some comment supporting the action. + type: string + minLength: 1 + maxLength: 1000 + example: "This is a sample FDC complete request." + FraudDeleteAndConfirm: + allOf: + - $ref: '#/components/schemas/APIDataElement' + - type: object + required: + - providerId + - auditControlNumber + - operationType + properties: + providerId: + $ref: '#/components/schemas/SafeFraudProvider' + operationType: + $ref: '#/components/schemas/FraudState' + auditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful fraud record submission (FDA event). This is used as a reference to subsequently modify, delete or convert a suspended to a confirmed fraud record. + type: string + minLength: 15 + maxLength: 15 + example: "418142102142002" + memo: + description: Brief description by the originator providing some comment supporting the action. + type: string + minLength: 1 + maxLength: 1000 + example: "This is a sample FDD / FDE request." + FraudBase: + type: object + properties: + refId: + description: Unique identification generated by the transaction originator using UUID logic to unambiguously link a request and response message. + example: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + maxLength: 36 + minLength: 36 + type: string + timestamp: + description: Timestamp of the request initiation by the originator in the format 'YYYY-MM-DDThh:mm:ss'. + example: '2022-05-24T20:34:37' + maxLength: 19 + minLength: 19 + type: string + icaNumber: + description: ICA number of the Issuer or Acquirer or Provider initiating the fraud submission request. + example: '1076' + maxLength: 7 + minLength: 3 + type: string + Fraud: + allOf: + - $ref: '#/components/schemas/FraudBase' + - type: object + required: + - responseCode + - responseMessage + properties: + responseCode: + description: Response code indicating success or failure of the transaction at an API level. Errors at a record level will be handled through 'errorDetails' element associated with each record. + type: string + minLength: 3 + maxLength: 3 + example: "000" + responseMessage: + description: Transaction response description corresponding to the response code. + type: string + minLength: 1 + maxLength: 100 + example: "Success" + icaNumber: + description: ICA number of the originator provided in the request API which is echoed back. This attribute will be absent if the request is not processed by FLD application. + type: string + minLength: 3 + maxLength: 7 + example: "1076" + auditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful fraud record submission ('FDA' event). This is used as a reference in the request API to subsequently modify, delete or convert a suspended to a confirmed fraud record and is echoed back. This attribute will be absent if the request is not processed by FLD application. + type: string + minLength: 15 + maxLength: 15 + example: "418142102142002" + duplicateAuditControlNumbers: + description: List of existing Audit Control Number which matches the request submitted for Mastercard-built or Issuer-built. This attribute will appear in case of the records already present while trying to submit or update the existing record. + type: array + items: + type: string + minItems: 1 + maxItems: 5 + uniqueItems: true + matchLevelIndicator: + description: Indicates if it is a Mastercard-built or Issuer-built record. Possible values are 'M' for Mastercard built record and 'I' for Issuer built record. This attribute will be absent if the request is not processed by FLD application. + type: string + minLength: 1 + maxLength: 1 + example: "M" + financialTransactionIndicator: + description: Indicates if the fraud record is being submitted against a financial transaction (having a clearing record) or a declined auth transaction (without a clearing record). Possible values are 'APPROVED' for financial transactions (having a clearing record) and 'DECLINED' for declined auth transactions (without a clearing record). This attribute will be absent if the request is not processed by FLD application. + type: string + minLength: 1 + maxLength: 20 + example: "DECLINED" + authorizationResponse: + description: Provides the 'Auth Response Code' and 'Auth Response Code Description' combination if 'Financial Transaction Indicator' value is 'DECLINED'. This attribute will be absent for all other scenarios. + type: string + minLength: 1 + maxLength: 200 + example: "05 - Do not honor" + previousStatus: + description: Previous status of the transaction in terms of an FDC, FDD and FDE event. + type: string + minLength: 1 + maxLength: 50 + example: "CONFIRMED-REJECTED" + currentStatus: + description: Current status of the transaction in terms of an FDA, FDC, FDD and FDE event. + type: string + minLength: 1 + maxLength: 50 + example: "CONFIRMED-SUCCESS" + channel: + description: Fraud request submission fld channel name. + type: string + minLength: 1 + maxLength: 50 + example: 'Online' + errorDetails: + $ref: '#/components/schemas/ErrorWrapper' + SafeFraudProvider: + description: Indicates the originator of the request. Value 10 is for Issuer and 20 for Acquirer. + type: string + example: '10' + pattern: ^(10|20) + minLength: 2 + maxLength: 2 + CfcIndicator: + description: Flag to indicate a single or dual message transaction. Possible values are - - 'ARN' for Acquirer Reference Number - 'BRN' for Banknet Reference Number - 'TRC' for Trace ID - 'SER' for Serial ID + type: string + enum: + - ARN + - BRN + - TRC + - SER + FraudState: + description: Indicates the type of operation to be performed for the given audit control number. The value FDD is to indicate delete operation and FDE is to indicate confirm operation. + type: string + minLength: 1 + maxLength: 50 + enum: + - FDD + - FDE + TransactionIdentifier: + description: Transaction Identifier containing CFC Indicator the key and value pair. + type: object + properties: + cfcKey: + $ref: '#/components/schemas/CfcIndicator' + cfcValue: + description: Actual value depending on the 'CFC Indicator' subject to the following validations 1. For ARN, Min Length is 23, Max Length is 23 and Data Type is N. 2. For BRN, Min Length is 6, Max Length is 9 and Data Type is AN. 3. For TRC, Min Length is 6, Max Length is 6 and Data Type is N. 4. For SER, Min Length is 9, Max Length is 9 and Data Type is N. + type: string + minLength: 6 + maxLength: 23 + example: '0111111111999999999999' + Error: + title: ErrorMessage + required: + - Description + - ReasonCode + type: object + properties: + Source: + type: string + description: The application or component that generated this error. + minLength: 3 + maxLength: 50 + example: "FLD" + ReasonCode: + type: string + description: Reason code is a unique constant identifying the error case encountered during request processing. + minLength: 5 + maxLength: 100 + example: "VALIDATION_ERROR" + Description: + type: string + description: Human-readable short description of the reasonCode + minLength: 10 + maxLength: 250 + example: "Reference Id is not provided" + Details: + type: string + description: Optional detailed description provides information about data received and calculated during request processing. This helps the user to diagnose errors. + minLength: 0 + maxLength: 1000 + example: "This is mandatory field while requesting for fraud submission." + Recoverable: + type: boolean + description: Recoverable flag indicates whether this error is always returned for this request, or retrying could change the outcome. For example, 'true' or 'false'. + example: false + Errors: + title: Errors + required: + - Error + type: object + properties: + Error: + type: array + description: Errors array wrapped in an error object + items: + $ref: '#/components/schemas/Error' + ErrorWrapper: + description: Object containing the list of combination of error reason codes and their corresponding description (can provide up to 5 errors for a record). It will be absent if the request is processed by FLD application successfully. + title: Error Response + required: + - Errors + type: object + properties: + Errors: + $ref: '#/components/schemas/Errors' + requestBodies: + FraudMastercardRequest: + description: Add a new fraud record using minimal input parameters for Mastercard built transactions. This endpoint uses [payload encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). Please refer to the [reference application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) page for implementation details. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MastercardFraud' + examples: + MastercardFraudExample: + $ref: '#/components/examples/MastercardFraudExample' + FraudIssuerRequest: + description: Add a new fraud record using complete input parameters for both Mastercard and Issuer built transactions. This endpoint uses [payload encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). Please refer to the [reference application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) page for implementation details. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IssuerFraud' + examples: + IssuerFraudExample: + $ref: '#/components/examples/IssuerFraudExample' + FraudRequestChange: + description: Change an existing fraud record using minimal input parameters for Mastercard built transactions. This endpoint uses [ payload encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). Please refer to the [reference application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) page for implementation details. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatedMastercardFraud' + examples: + FraudChangeExample: + $ref: '#/components/examples/FraudChangeExample' + FraudIssuerRequestChange: + description: Change an existing fraud record using complete input parameters for both Mastercard and Issuer built transactions. [Mastercard payload encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). Please refer to the [reference application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) page for implementation details. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatedIssuerFraud' + examples: + FraudIssuerChangeExample: + $ref: '#/components/examples/FraudIssuerChangeExample' + FraudStateRequest: + description: Delete an existing fraud record or confirm a suspended fraud record for both Mastercard and Issuer built transactions. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FraudDeleteAndConfirm' + examples: + FraudConfirmExample: + $ref: '#/components/examples/FraudConfirmExample' + FraudDeleteExample: + $ref: '#/components/examples/FraudDeleteExample' + responses: + FraudAddition: + description: Fraud submitted successfully. + headers: + Location: + schema: + type: string + description: Refers to the created resource location. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudAdditionExample: + $ref: '#/components/examples/FraudAdditionExample' + FraudAdditionException: + description: Exception occurred while Fraud submission. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudAdditionRejectExample: + $ref: '#/components/examples/FraudAdditionRejectExample' + FraudAdditionSuspendExample: + $ref: '#/components/examples/FraudAdditionSuspendExample' + FraudIssuerAddition: + description: Fraud submitted successfully. + headers: + Location: + schema: + type: string + description: Refers to the created resource location. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudAdditionExample: + $ref: '#/components/examples/FraudIssuerAdditionExample' + FraudIssuerAdditionException: + description: Exception occurred while Fraud submission. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudAdditionRejectExample: + $ref: '#/components/examples/FraudAdditionRejectExample' + FraudAdditionSuspendExample: + $ref: '#/components/examples/FraudIssuerAdditionSuspendExample' + FraudAddAccepted: + description: Fraud submission accepted successfully. + headers: + Location: + schema: + type: string + description: Refers to the created resource location. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudAddAcceptedExample: + $ref: '#/components/examples/FraudAddAcceptedExample' + FraudDataChanged: + description: Fraud data changed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudDataChanged: + $ref: '#/components/examples/FraudDataChanged' + FraudDataChangedError: + $ref: '#/components/examples/FraudDataChangedError' + FraudIssuerDataChanged: + description: Fraud data changed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudDataChanged: + $ref: '#/components/examples/FraudIssuerDataChanged' + FraudDataChangedError: + $ref: '#/components/examples/FraudDataChangedError' + FraudStateChanged: + description: Fraud data changed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudDataDeleted: + $ref: '#/components/examples/FraudDataDeleted' + FraudDataDeleteIcaNotAuthorize: + $ref: '#/components/examples/FraudDataDeleteIcaNotAuthorize' + FraudDataConfirmed: + $ref: '#/components/examples/FraudDataConfirmed' + FraudDataConfirmedTxnDateOlder: + $ref: '#/components/examples/FraudDataConfirmedTxnDateOlder' + FraudStatusResponse: + description: Fraud request status in the system. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + FraudStatusConfirmed: + $ref: '#/components/examples/FraudStatusConfirmed' + FraudStatusSuspended: + $ref: '#/components/examples/FraudStatusSuspended' + FraudStatusDeleted: + $ref: '#/components/examples/FraudStatusDeleted' + FraudStatusRejected: + $ref: '#/components/examples/FraudStatusRejected' + FraudStatusNoRecordExample: + $ref: '#/components/examples/FraudStatusNoRecordExample' + FraudStatusNoParamRefIdAcnExample: + $ref: '#/components/examples/FraudStatusNoParamRefIdAcnExample' + FraudStatusBadRequestError: + description: Something was wrong with the request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + BadRequestInvalidIca: + $ref: '#/components/examples/BadRequestInvalidIca' + BadRequestInvalidRefId: + $ref: '#/components/examples/BadRequestInvalidRefId' + BadRequestInvalidACN: + $ref: '#/components/examples/BadRequestInvalidACN' + BadRequestError: + description: Something was wrong with the request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + BadRequestRefIdMissing: + $ref: '#/components/examples/BadRequestRefIdMissing' + UnauthorizedError: + description: Unauthorized request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + UnauthorizedExample: + $ref: '#/components/examples/UnauthorizedExample' + ForbiddenError: + description: Consent not given. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + ForbiddenExample: + $ref: '#/components/examples/ForbiddenExample' + RateLimitExceededError: + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + RateLimitExceededExample: + $ref: '#/components/examples/RateLimitExceededExample' + examples: + MastercardFraudExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + transactionIdentifiers: + - cfcKey: ARN + cfcValue: '0712141161891099999900' + - cfcKey: BRN + cfcValue: 999RRR + cardNumber: '5505135664572870008' + transactionAmount: '5505' + transactionDate: '20200713' + fraudPostedDate: '20210316' + fraudTypeCode: '01' + fraudSubTypeCode: 'N' + accountDeviceType: '1' + cardholderReportedDate: '20210314' + cardInPossession: 'Y' + avsResponseCode: U + authResponseCode: '00' + memo: This is a sample FDA minimal request. + issuerSCAExemption: '09' + IssuerFraudExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + transactionIdentifiers: + - cfcKey: ARN + cfcValue: '01111114320000000032087' + - cfcKey: BRN + cfcValue: 543REF + cardNumber: '5587450000000008074' + acquirerId: '2742' + fraudTypeCode: '01' + fraudSubTypeCode: U + cardProductCode: CIR + transactionDate: '20200215' + settlementDate: '20200216' + fraudPostedDate: '20210316' + cardholderReportedDate: '20210314' + transactionAmount: '56823' + transactionCurrencyCode: '840' + billingAmount: '56823' + billingCurrencyCode: '840' + merchantId: '6698696' + merchantName: BANKNEWPORT + merchantCity: Phoenix + merchantStateProvinceCode: AZ + merchantCountryCode: USA + merchantPostalCode: '85001' + merchantCategoryCode: '6011' + terminalAttendanceIndicator: '0' + terminalId: 5055D305 + terminalOperatingEnvironment: '1' + cardholderPresenceIndicator: '0' + cardPresenceIndicator: '1' + cardInPossession: 'Y' + catLevelIndicator: '2' + terminalCapabilityIndicator: '0' + posEntryMode: '00' + cvcInvalidIndicator: M + avsResponseCode: U + authResponseCode: '00' + secureCode: '9' + accountDeviceType: A + transactionIndicator : 'M101' + memo: This is a sample FDA complete request. + issuerSCAExemption: '09' + FraudChangeExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + auditControlNumber: '123111111000025' + fraudPostedDate: '20210316' + fraudTypeCode: '01' + fraudSubTypeCode: 'N' + accountDeviceType: '1' + cardholderReportedDate: '20210314' + cardInPossession: 'Y' + memo: This is a sample FDC minimal request. + issuerSCAExemption: '09' + FraudIssuerChangeExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + auditControlNumber: '123111111000025' + acquirerId: '2742' + cardNumber: '5587450000000008074' + fraudTypeCode: '01' + fraudSubTypeCode: U + cardProductCode: CIR + transactionDate: '20200215' + settlementDate: '20200216' + fraudPostedDate: '20210316' + cardholderReportedDate: '20210314' + transactionAmount: '56823' + transactionCurrencyCode: '840' + billingAmount: '56823' + billingCurrencyCode: '840' + merchantId: '6698696' + merchantName: BANKNEWPORT + merchantCity: Phoenix + merchantStateProvinceCode: AZ + merchantCountryCode: USA + merchantPostalCode: '85001' + merchantCategoryCode: '6011' + terminalAttendanceIndicator: '0' + terminalId: 5055D305 + terminalOperatingEnvironment: '1' + cardholderPresenceIndicator: '0' + cardPresenceIndicator: '1' + cardInPossession: 'Y' + catLevelIndicator: '2' + terminalCapabilityIndicator: '0' + posEntryMode: '00' + cvcInvalidIndicator: M + avsResponseCode: U + authResponseCode: '00' + secureCode: '9' + accountDeviceType: A + transactionIndicator : 'M205' + memo: This is a sample FDC complete request. + issuerSCAExemption: '09' + FraudDeleteExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + auditControlNumber: '123111111000025' + operationType: FDD + memo: This is a sample FDD request. + FraudConfirmExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + auditControlNumber: '123111111000025' + operationType: FDE + memo: This is a sample FDE request. + FraudAdditionExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + currentStatus: CONFIRMED-SUCCESS + matchLevelIndicator: M + financialTransactionIndicator: DECLINED + authorizationResponse: 05 - Do not honor + FraudIssuerAdditionExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + currentStatus: CONFIRMED-SUCCESS + matchLevelIndicator: I + financialTransactionIndicator: APPROVED + FraudAdditionRejectExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '100' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '60004' + Description: 'CardNumber attribute value length not in range. Minimum Length:12 and Maximum Length: 19.' + FraudAdditionSuspendExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '201' + responseMessage: Failure + icaNumber: '1076' + auditControlNumber: '123111111000025' + matchLevelIndicator: M + currentStatus: CONFIRMED-SUSPENDED + duplicateAuditControlNumbers: [ + '000222520077829', + '000222520077830', + '000222520077831', + '000222520077832', + '000222520077833', + ] + errorDetails: + Errors: + Error: + - ReasonCode: '30100' + Description: 'Potential Duplicate Data Found, Record is suspended.' + FraudIssuerAdditionSuspendExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '201' + responseMessage: Failure + icaNumber: '1076' + auditControlNumber: '123111111000025' + matchLevelIndicator: I + currentStatus: CONFIRMED-SUSPENDED + duplicateAuditControlNumbers: [ + '000222520077829', + '000222520077830', + '000222520077831', + '000222520077832', + '000222520077833', + ] + errorDetails: + Errors: + Error: + - ReasonCode: '30100' + Description: 'Potential Duplicate Data Found, Record is suspended.' + FraudAddAcceptedExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '001' + responseMessage: Pending + icaNumber: '1076' + FraudDataChanged: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + previousStatus: CONFIRMED-REJECTED + currentStatus: CONFIRMED-SUCCESS + matchLevelIndicator: M + financialTransactionIndicator: DECLINED + authorizationResponse: 05 - Do not honor + FraudIssuerDataChanged: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + previousStatus: CONFIRMED-REJECTED + currentStatus: CONFIRMED-SUCCESS + matchLevelIndicator: I + financialTransactionIndicator: APPROVED + FraudDataChangedError: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '100' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '60003' + Description: icaNumber incorrect datatype of attribute value. + FraudDataDeleted: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + previousStatus: CONFIRMED-SUCCESS + currentStatus: CONFIRMED-DELETED + FraudDataDeleteIcaNotAuthorize: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '200' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '80207' + Description: The user is not licensed for this particular BIN range. + FraudDataConfirmed: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + previousStatus: CONFIRMED-SUSPENDED + currentStatus: CONFIRMED-SUCCESS + FraudDataConfirmedTxnDateOlder: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '200' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '21508' + Description: Transaction date is older than 18 months. + FraudStatusConfirmed: + value: + refId: 'ecb2d942-eabd-42b6-87fd-69c19692bdc6' + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: 'Success' + auditControlNumber: '123111111000025' + channel: 'EXT_API' + currentStatus: 'CONFIRMED-SUCCESS' + matchLevelIndicator: 'M' + financialTransactionIndicator: 'DECLINED' + authorizationResponse: '05 - Do not honor' + FraudStatusSuspended: + value: + refId: 'ecb2d942-eabd-42b6-87fd-69c19692bdc6' + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: 'Success' + auditControlNumber: '123111111000025' + channel: 'EXT_API' + currentStatus: 'CONFIRMED-SUSPENDED' + errorDetails: + Errors: + Error: + - ReasonCode: '30100' + Description: 'Potential Duplicate Data Found, Record is suspended.' + FraudStatusRejected: + value: + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: 'Success' + auditControlNumber: '123111111000025' + channel: 'Online' + currentStatus: 'CONFIRMED-REJECTED' + errorDetails: + Errors: + Error: + - ReasonCode: '20806' + Description: 'Required field [Fraud Posted Date] is missing. Record is rejected.' + - ReasonCode: '20828' + Description: 'Required field [Fraud Type Code] is missing. Record is rejected.' + - ReasonCode: '20903' + Description: 'Audit control number (ACN) is not unique. Record is rejected.' + - ReasonCode: '21006' + Description: 'Invalid Fraud Posted Date, format should be YYYYMMDD. Record is rejected.' + - ReasonCode: '41200' + Description: 'Unable to match transaction in data warehouse. Record is rejected.' + FraudStatusDeleted: + value: + refId: 'ecb2d942-eabd-42b6-87fd-69c19692bdc6' + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: 'Success' + auditControlNumber: '123111111000025' + channel: 'EXT_API' + currentStatus: 'CONFIRMED-DELETED' + FraudStatusNoRecordExample: + value: + refId: 'ecb2d942-eabd-42b6-87fd-69c19692bdc6' + timestamp: '2021-03-16T20:34:40' + responseCode: '200' + responseMessage: 'Failure' + auditControlNumber: '123111111000025' + errorDetails: + Errors: + Error: + - ReasonCode: '60127' + Description: Record searched could not be found. Correct the input parameter and resubmit. + FraudStatusNoParamRefIdAcnExample: + value: + ica: '1076' + responseCode: '100' + responseMessage: 'Failure' + errorDetails: + Errors: + Error: + - ReasonCode: '60002' + Description: ref_id or acn (Audit Control Number) attribute or attribute value is missing or incorrect. + BadRequestRefIdMissing: + value: + Errors: + Error: + - Source: fld + ReasonCode: VALIDATION_ERROR + Description: Reference Id is not provided + Recoverable: false + BadRequestInvalidIca: + value: + Errors: + Error: + - Source: fld + ReasonCode: VALIDATION_ERROR + Description: ica incorrect datatype of attribute value. + Recoverable: false + BadRequestInvalidRefId: + value: + Errors: + Error: + - Source: fld + ReasonCode: VALIDATION_ERROR + Description: ref_id incorrect datatype of attribute value. + Recoverable: false + BadRequestInvalidACN: + value: + Errors: + Error: + - Source: fld + ReasonCode: VALIDATION_ERROR + Description: acn (Audit Control Number) incorrect datatype of attribute value. + Recoverable: false + ForbiddenExample: + value: + Errors: + Error: + - Source: fld + ReasonCode: CONSENT_NOT_GIVEN + Description: User Consent Not Given + Recoverable: false + UnauthorizedExample: + value: + Errors: + Error: + - Source: fld + ReasonCode: UNAUTHORIZED_REQUEST + Description: Unauthorized request + Recoverable: false + RateLimitExceededExample: + value: + Errors: + Error: + - Source: fld + ReasonCode: RATE_LIMIT_EXCEEDED + Description: You have exceeded the service rate limit. Maximum allowed 10 TPS. + Recoverable: true + details: null \ No newline at end of file diff --git a/src/main/resources/confirmed/fraudsubmissionapiClientEnc1685962215446.pem b/src/main/resources/confirmed/fraudsubmissionapiClientEnc1685962215446.pem new file mode 100644 index 0000000..8b8fc18 --- /dev/null +++ b/src/main/resources/confirmed/fraudsubmissionapiClientEnc1685962215446.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEgTCCA2mgAwIBAgIIDzMLWncDYjQwDQYJKoZIhvcNAQELBQAwgZAxCzAJBgNV +BAYTAlVTMR0wGwYDVQQKExRNYXN0ZXJDYXJkIFdvcmxkd2lkZTEbMBkGA1UECxMS +Q29ycG9yYXRlIFNlY3VyaXR5MUUwQwYDVQQDEzxNYXN0ZXJDYXJkIFNURyBPcGVu +QVBJIEluYm91bmQgRmllbGQgTGV2ZWwgRW5jcnlwdGlvbiBTdWIgQ0EwHhcNMjMw +NjA1MTA1MDE2WhcNMjQwNzA0MTA1MDE2WjB/MSkwJwYDVQQDEyBHb3ZpbmRtY1N0 +YWdlLWluYm91bmQtZW5jcnlwdGlvbjETMBEGA1UEChMKTWFzdGVyQ2FyZDEQMA4G +A1UECxMHT3BlbkFQSTERMA8GA1UEBxMITmV3IFlvcmsxCzAJBgNVBAgTAk5ZMQsw +CQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL5OeDXm +20H8e9wq/ECUJkmfJeS2tMI9FnaBIRlUWiD7VL8O7N+UryO6Km32RlSB0jf5NVXa +C2fmR7IoFiCk63oYcp0xi8RxkCJLD+YwVKKivEODtWk6FkyHNUpu95ikDLARRmnC +r0KLY2ZXvlAyyU+0MMl8SqEEahkRsRQw/bpunCkN09lZtKtNk8JNdcgTdECFfvEH +KnGvSX5ndIYstlTKWvG8M47s3kdCxOmpK304REAlMHXFVQOIlkIQtZqOImrxI9Vi +zzQYSS3vQKdsmOvfZH9MxlAnDFJEfKONVfekthRiKDuDYvgmmmCQjEZsmlBwgwU1 +ym4DEqqGW8i5aKECAwEAAaOB7jCB6zAOBgNVHQ8BAf8EBAMCACAwCQYDVR0TBAIw +ADAdBgNVHQ4EFgQUnJmMz7kaPBAYVGNuPbqI1rRrPREwHwYDVR0jBBgwFoAUFyvF +A9UiGgQEdtjkXBeOC35o5bMwYQYDVR0fBFowWDBWoFSgUoZQaHR0cDovL2NybGRw +LmVjbXMubWNsb2NhbC5pbnQ6MTM1MzYvMTcyYmM1MDNkNTIyMWEwNDA0NzZkOGU0 +NWMxNzhlMGI3ZTY4ZTViMy5jcmwwKwYDVR0RBCQwIoIgR292aW5kbWNTdGFnZS1p +bmJvdW5kLWVuY3J5cHRpb24wDQYJKoZIhvcNAQELBQADggEBABY5I9k2V9LFT97f +f1N5zzmEBqxMeZOyCKyOJf7wVClobtWXXbO9rVKlFNEmQ5Mj18jAkahyqHklOIRF +lHMPhbiCiJz0oSQye9RWybPZ/qWErR3Gs4ELnVYo9dswI1xT/8n++rBVKk42s3Ty +GAT6hQ2uR7c6nqFIYX5q800BkBj7Gle2FocxPG7OmzG1SzIYDo7QsmkkLKi1vjwm +baLFcgd1bR96SyUTIZlb/VRLb40gy/Li8T1wj8oPhVMwy0l3woHY0GfFSzuI3J32 +zU5FtKtL4blgLIIK+1umyAEAFKaPLvdjPkLiUzFGj+NQ+95P24ASvw8xPaIeQMae +O81qKTA= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/main/resources/confirmed/fraudsubmissionapiClientEnc1689348362311.pem.old b/src/main/resources/confirmed/fraudsubmissionapiClientEnc1689348362311.pem.old new file mode 100644 index 0000000..a55178b --- /dev/null +++ b/src/main/resources/confirmed/fraudsubmissionapiClientEnc1689348362311.pem.old @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEeDCCA2CgAwIBAgIIDzMLWnde5o0wDQYJKoZIhvcNAQELBQAwgZAxCzAJBgNV +BAYTAlVTMR0wGwYDVQQKExRNYXN0ZXJDYXJkIFdvcmxkd2lkZTEbMBkGA1UECxMS +Q29ycG9yYXRlIFNlY3VyaXR5MUUwQwYDVQQDEzxNYXN0ZXJDYXJkIFBSRCBPcGVu +QVBJIEluYm91bmQgRmllbGQgTGV2ZWwgRW5jcnlwdGlvbiBTdWIgQ0EwHhcNMjMw +NzE0MTUyNjAzWhcNMjQwODEyMTUyNjAzWjB5MSMwIQYDVQQDExpOaXRpbkhELWlu +Ym91bmQtZW5jcnlwdGlvbjETMBEGA1UEChMKTWFzdGVyQ2FyZDEQMA4GA1UECxMH +T3BlbkFQSTERMA8GA1UEBxMITmV3IFlvcmsxCzAJBgNVBAgTAk5ZMQswCQYDVQQG +EwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANDmSlzN1vkeINjV +lG9KJG9Dk8HLYx4CnQALnUqUsahWqcxUDrTM5RVrDf0Twgc+fz9GWxj3xgL4a9J+ +7Nt5rsIdyW4wgTWF8t0tLxxt128t3YyUcYTmUd3A3o24AsxuqVIRw+W/SmmnRP+h +Mz8AU6PvffN/q/w+0bPTDmpJXs1G/j8lvfKx2Y4zUvD9mBSJdXcSp5QviPfN7VCe +a1jnYnIn2eD60QG1ZinpBQqSb6K4DWnB6NcSODx3nOH/pAdIB+wvJVxHuvroT6KG +smK6M+1bzwerrxcgi0FABNIblHC5RgQR6Wv1m91mnCODgsmOtDTU/lS7ljEtGexQ +kRyyWMMCAwEAAaOB6zCB6DAOBgNVHQ8BAf8EBAMCACAwDAYDVR0TAQH/BAIwADAd +BgNVHQ4EFgQU8471bHFQORDJLPtYJi0pgQTWDRowHwYDVR0jBBgwFoAUws0CZmCB +xl7hEeXbog4ezn8Hmv0wYQYDVR0fBFowWDBWoFSgUoZQaHR0cDovL2NybGRwLmVj +bXMubWNsb2NhbC5pbnQ6MTM1MzYvYzJjZDAyNjY2MDgxYzY1ZWUxMTFlNWRiYTIw +ZTFlY2U3ZjA3OWFmZC5jcmwwJQYDVR0RBB4wHIIaTml0aW5IRC1pbmJvdW5kLWVu +Y3J5cHRpb24wDQYJKoZIhvcNAQELBQADggEBAK0n+1d5BQ1cOnJgIhL32+l6IfeD +LQ7FaD5MFN0N2wbGkFs5XUBcuy0rLTPSHKm5XddtqxCJC3oxRJD1g1CJSMT5Q/7L +/UO9Dt8I60Y8I7nPy6uhYLuBy9LEe++EcXkboUkUulsAk73LxTiZ3yrv77ObSXdw +fRqqK23LwcLT9hBnKpERdSOqBx6zcooUZ2hYzy7z56DRGyjBoImsDJKFtSrUjkBf +0I6475LHeffwSN8oPzRmlsI50ADQBtK3euNDXnRYJ5fgHS/eiFbbApCABITJv7hz +ovknZivtk2OsAWFdT0KfN4OGJN2mhJFA279C2OV/ij7/+djWu9/pdMFJx0Q= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/main/resources/confirmed/key-alias-sandbox.p12.old b/src/main/resources/confirmed/key-alias-sandbox.p12.old new file mode 100644 index 0000000000000000000000000000000000000000..cacaf49798c3c10451f8e1d043518d8b3bf5a8ed GIT binary patch literal 2392 zcmb`Hc{tSj7sqF1W-NnQFj=yMuJ9chjC2Vxh(fa0kRjrBvy?4r$nxt)n?`F!37pd*h%z)*mWBnTmY zNu(rhh=GN{Ogd5oMn?(@upk7@`kxRq8AgXD2=HZr#R!S~lO>7*Lz#4_k^ssJq5gqL zyr33TOpt&Sa5z8*e_}!*UZ2E@Ks1&hEzfF%(RV1=O0FepaM&O0=W7Gmxl;%iHb zBuWFgZ(IZ;{)6v6bj+HF0VKZ#P#DyY0H7c(rn?_7AnE~zfIdKS7r1&qx&PWZbg=Tz zEr8)5C>@Lj30g!!=wLAD@{0wEOnG(}3jgHry6uu?h7F1ct+jHIAKlCn&DZ?mP@(Mpefw90n0JSTB+)OBukT*BIa`oIXN=A5 z3CB3P9=*SJscLWMWa$oX;(;4~dy91KvoN+G!ZD3sQIN4PKuB1~e)+3InDSn9zk-aR zMSGx6D8h$gAWVJd(KXc<(*Ah?V#iTEEXvyMY991G&)paZJBvG$=cmOK8Z2EX;HfPq zt3G$PVTO_Ka*~hLgzGvSx_)uu;=K>-DXExfPEYWR2GEVwtyb^SMSHy5dabV75$Bs& zt2yh7Ps5%a1E&{ZDu#DFpYwo@ACIwzd;l7 z(sY+l#!ZJpW~8QuIeq&XVkTgWuCi9^UIc(+&*_#r(<+TvC>xAaAkvZL9jJm1_IS00pDn zyz{x~w^_pnGIhzTALl+0DdHO2qh4{1i;v6ATv;WN3FH}X|3s_Kq~4&cjrRFwcU&^a z-@wer_eu+NK;qz+uZlhRO(F$Q`Tq5hI3gZ~ou_a9!ZJV5t$KD+FFdOD%edJr4^aBC z2}{H(NP*6RXrM@t7RVbE1PTzWp#UB3`+d_l)xw=&bhv{6+X>A2XK6y1bl3twhs^se_w}5i4eGxoVD-JLxZx^2R*V4?3pRs||6} zu86-%H@N*p+NATTspq|uFAo|No$#{Z#J=9~&wEc$OL5y-IF6_cCyixES3Bsk7=d&# z@#w6B^(8nRC&(SHg^`x=>+2@!&5G)5o82khR+`0Wj=MaS-Y^uyVl5s~OWze!nqZJ3 zi;Z4935cM?pA6xQd9$Ufk6Mb?5_((?%Dhedg9biWQ+9rKTs($AtiJrcRm zblQIjVd!OYSBtuf5KoaC#ZR@TNX@CKxwJla)@3d!G_yh7^0-&;&(+{mw5MWxEsPU2{l!!(=byS9z54^P23D8=Be~J;Ksl{sjYLo_yPa zep$mItB$5Cv;~ONL+Mwyo8Kz+K32mosOwc;mDcBK;gY3!Bjk{FNj(nt#&F(1TMo@T zY_rC5zOR6nPc{$u*cE4#O}^;#YJ9%JRP5PI*ScFle21 zu5RrOD?}_tzRVZ~#U5Ba!y+3;b&1z51ypZ7bE=38Hn_>x>%3XGUU>&SwkElZV_D)xP8FY^BNH;})nvu?;JM z)pVZUqYxGt&$cy6#WimSBr6|$$6N$D%P%Z}4r z?{WMC7_KcdHTK=c(sG!v0>GeM`WU&&Jtf{Cbk^aoWmD#Tu+rf*xsK#u6G zEL0~+WuMd?#LAW4cOq1A%+>l<9_+CzHr~jRmgE$7Li)jUCSd1NH{5nXE^G2%oU=qg x2|xSc~grLy?1scJ?p$rR#v;3RIiUdQmC{Qc|3c`{9LIe+^78J!u zKrlEAM***7K_OrW1PsQZepCgsz(BYQcpe-E4mAg$XcWQ0$Cu=-?cnXKPYT2z!Et}* zENHf$Ttv(G5+04?{2oA}kv{`Cp(7|6S)3wX4yPm|C#P)5aOHk+|Fd%_;A6kG0EU5} z6fir8(IOH;0fRxQql&ok&zpiv)EqiIGek_XqI+LQFj#t*z2-Qnyt=aG<3$j(_5q#wkH?HINdHof3^ zDZE3kisXkt!Jz+tWX27FLGgxBr463Ve!1V?MA%n#D|>xmgLhVH`lnnnaF2Lxv21ej zJas%}AoMBef(cu+|00%S=;PwXxkdYFBeMLoJd5$Cdt4rvkwZQJ zy>o7iV>%(Vy)IgYkjj&zU?XqjQqH3Gr2=DKrqyZX-m`@tQOytE@P2T^`Oe>(wz;Ow zYch>>H}2h|s$?p7pS;OeyV~I_og~ckH_&bFX=3d_WhJa-h@Bk1Z9>-KbwW{r0WDjl z`uG9ymy<*lqjUIeFEh4DOaI2iqZye>H9ky}XKed}GBusJHb>-hPO2LTXk_2_>DAGy z1&`t)f^QO$lJ3nz3+nibIME+pAHj|10WftVG~bwcJHN}k%g>C;Q(_|Sxa#AuKR03U z7$GjuO%Mqb2s#CF0J(u&8LJPD0(1Vc>APxS<^Tm|!oUQEUHVm;kSq$YilYEaIDsGH zWM$}{4PbU{FO^=2qdP+&%piaQbO?V)CYBGSVDD?%${Lg<8LqGPC&v0|VP+)?-~wwB zYghGGqo5`A(RE?#pF_=K1*7MUBB^#KE7JDQtA|h9ulAC(M=R64gg!N?>I615ta5V_ zrh5pp#Z5Uplu7Bb^wM6Rf}ZlJ^A>hC(;h2}z0`s|;T-0WK+ZKQ#J% z+1P~2SC+;xoWt11h zvNLYZ2jDt55;K9hUJ%4F;VU;2f81pb-$h032Xqhbc7>p$UN5Sa&h)pm>#;e|KMl^p z>4#PZNxN(uNNlHjt&OQC|ESc;khOzSo5W||e7@IVvQ~NyX;N#t!jxva_*#1>>Stx} zmUTJj7;^SrcjUx@|d}1=6Ap(m{XB7pAi)O9kKc-qwIGyZ5IAM9(Gk*KqhM z+L`yiLGer|hl+FHgI-vOWF^jLiCTfHgt|1$;>i0+t72y%mA4JhQ^yBeIpXz>+QiMm zB5pQT|6OzKl)Dp^D~+Fl(?08Z`0>l0#fC_+lwmLb0?$bSF?A)!=i<|Vanv!I z?hUKakk!G_V-Jb#oBF~cef{u+$yn?O&lAzuzZB{lN|%)Nk%l>)s3d2WWz&$@d)%~C zvjrB;N3M^H6k`HXZX2xaZLO?7x7!IA!^{0fHx~I?n1X6)bG$<4V)33Kp0%g>Z|kfn z>!_@-k3){ti__cNc7ok9o~H6jNtYzByHE$}E`PA>u6UGZ!P}Rd$2wrgF2>%|L*H@v z59cf%hs7b_uoG-h2pr5HJJ+1`}9+W(70DK?GeQHvxx$n!})2R+7EX4JU6cdvC|{PX5Fr1g;;P z8O!#IAJa53AYus|KMZIr`j>$qc!X6>j-W`CV=Q?h!HS{E|EB(D=K$d2zn1`pgP;Hy z17ehjh5%qNC>9qci$2D}3+chM_GkAM2Pd}K9ExmO`5Cv*`JD7iJ7WIc$l*(-w#HE} zn6-da{uIkmZ@zAWmpffaPjbyv)i?OOL+yQr^5fSfdmchc2je(!Oq9eB7o7t2%GYe@ z`kv_Nf&6(mpI&(jA1DuKC;x@ISQ(?Z#rGk)#9}>4QS5fpn-{m%S8Gb{i0e5|zQ<_a zbmn;Qe2L1mdGj0eBI+2ykJX4Rq%*LDu@@gDEhOAsqXlVqO&-qp~CR|>Uvf=5h z9eS|KBD+Em(L1x-jbH5^w`@9=UP*d-CSWrG=K)>yHUHj}ED{PkFuI&J~GGlP`- zg-+KvMW@qi^EbmWB(?p!7zmiO$G5L0anD-1b%vdtjZJ2wQ*>thk78e*W*KD;-+sv< z4!R0*0{MgNK^`DC#_mG^;0`}se)KH-A`E~VGw^wa=>6W9kURjkL;zs(1pc3`$-?M* zHWxqDHDF%ElSMivSA;ou!wX#KIY|M zSVYzg4Sx6F^7TxCrq0qYLRHZ4h_l0i3WOJxtc6n@>nIUrgw*U z5ux5^yP25OE*yV3 zjNngCVmHx0HPRVMt$Es(!#aEAZgrTw6Zq|*m&`1RTFbJlH&-@fc{WDz&=HD{Pt%&y zB%Jj=jR!vZZ7DZz4Ern|p*LJo-y(i~FG#G}3*W=+q163EGYnEGSl+Ok+ja9115%~4 z1^b7mtd=)5y#3ow{7)hsTEza!MX14)o*lFsZpigr*b6DtvHFXa?4Mlx3iR5C6pbg z{GtQyQlp_O?W#eviq6!i)h=2g-6zXbnL_@4xl4{wx_SYx^E$~P)tG+b?3&s}-+SJ#8q zSCJ+1!cEJa{D{E0k_Q&d*4LI(eXzMcnlZdYqlXKY2mahZieqIsLZgORfX=ckD{6tw zA@&Zq%kOBvLzRXO(p)X^X-ny-;v$+#0W}aqN6_VND`Bg9Cd|Dou1xl@RbTkf{CsTN z`h0%#SNCnJP;*t+`h2~=I%JtE?Z#eYXDkjEJ1u*>Dw9uL9~ybiK~u}jzXCzqam+3;GTw3V-~&{{5=Tq~|GWhec{Zh7@fvmz&a0%G7IL+L8uvV;RLE zA8fT|(TzgnPbqEA^7`+pmh}r+xh1=c0KQn1lF~IXHG`rxah|abn*DX&WYdO5(iuuP zrFo~tQ&B6*&*eqtJ!D)}X9c08UaVtyhG!-YH7?>S@AT!F<6W7T^^Q|bOt*B*qGhOqj(RJ5K?@`NJkb8$PfP|U1>D{8^;Cz4 zD(YI&T!SxA8`{WtgUO)uV2OD4OFJ#uYm+e)vu}2GUjhU)`n2>8US|LhJnBE2vP6Oq x0fm5{WP?I@;UE~!l+1_hG<56Fv6j+z+Pky%LHn#247s}DO?}&~!}ep0{sV;1{wDwc literal 0 HcmV?d00001 diff --git a/src/main/resources/confirmed/update.json b/src/main/resources/confirmed/update.json new file mode 100644 index 0000000..2d9e1fe --- /dev/null +++ b/src/main/resources/confirmed/update.json @@ -0,0 +1,14 @@ +{ + "timestamp": "2024-04-24T20:34:37-06:00", + "refId": "e02af351-8488-4e24-b8c7-2831bb23fe63", + "icaNumber": "3043", + "auditControlNumber": "283554908789760", + "fraudPostedDate": "20240424", + "fraudTypeCode": "02", + "fraudSubTypeCode": "", + "accountDeviceType": "", + "cardholderReportedDate": "", + "cardInPossession": "", + "memo": "updating fraud type code" +} + diff --git a/src/main/resources/jenkins/build/jenkins-file b/src/main/resources/jenkins/build/jenkins-file new file mode 100644 index 0000000..bd044e4 --- /dev/null +++ b/src/main/resources/jenkins/build/jenkins-file @@ -0,0 +1,54 @@ +@Library('JenkinsSharedLib')_ +pipeline { + + agent { node { label 'DTL-LINUX' } } + + tools { + jdk 'ZJDK11' + } + + environment { + sonarProjectKey = "fld-reference-app-key" + sonarProjectName = "fld-reference-app" + sonarQualityGate = "FLD" + } + + stages { + stage('Build and Package Code') { + steps { + sh "${tool 'M3'}/bin/mvn clean package -DskipTests=true" + } + } + stage('Setup project in Sonar') { + steps { + script{ + sonarProjectSetup(sonarProjectKey: '${sonarProjectKey}', + sonarProjectName: "${sonarProjectName}", + sonarBranchName: '${env.BRANCH_NAME}', + sonarQualityGateId: '${sonarQualityGate}') + } + } + } + stage('Run Tests and Gather Coverage') { + steps { + sh "${tool 'M3'}/bin/mvn org.jacoco:jacoco-maven-plugin:prepare-agent install" + sh "${tool 'M3'}/bin/mvn org.jacoco:jacoco-maven-plugin:report" + } + } + stage('Generate Sonar Report and Check QG') { + steps { + sh "${tool 'M3'}/bin/mvn sonar:sonar \ + -Dsonar.login='${SONAR_LOGIN_TOKEN}' \ + -Dsonar.projectKey='${sonarProjectKey}' \ + -Dsonar.projectName='${sonarProjectName}' \ + -Dsonar.branch.name='${env.BRANCH_NAME}' \ + -Dsonar.exclusions='src/main/java/com/mastercard/fld/utility/*.*,src/main/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil.java, src/test/java/com/mastercard/fld/fraud/suspected/api/utility/EncryptionHelperTest.java ,src/main/java/com/mastercard/fld/fraud/constants/Constants.java ,src/main/java/com/mastercard/fld/fraud/suspected/BaseClassUtil.java ,src/main/java/com/mastercard/fld/fraud/suspected/helper/RequestHelper.java, src/main/java/com/mastercard/fld/fraud/confirmed/helper/RequestHelper.java,src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/ConfirmedHealthStatus.java,src/main/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspectedHealthStatus.java,src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedHealthStatus.java,src/main/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedFraudStatus.java'" + } + } + } + post { + always { + junit '**/target/surefire-reports/*.xml' + } + } +} \ No newline at end of file diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000..fe58b6a --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/suspected/MTF_FLD_SPCT-sandbox.p12 b/src/main/resources/suspected/MTF_FLD_SPCT-sandbox.p12 new file mode 100644 index 0000000000000000000000000000000000000000..f81429776c86abcfc166e935037a656ec70fbdfb GIT binary patch literal 2388 zcmb`Hc{J4T7so%d8?rTHCL>!rYUVRTMe(&|U&@l*gc@aS5ZP%)V~t1=g-S@4ieW4b zQMUTpN=V8wrNx?|Me?1_`JU?c`}_OHea^YB``r7S`#jJ4f(-N_C1_)tv;c+8^$Jb`Arw>CYA* z2mr=_hy#Kag`o@x1gPXmS~*EflJr$N&S`H*KgQas@S+XMNQ_5UWIBFWJ9%$pevYl0 zYNTzoprz*w`lhQ66H5hoybPp~*{L86?C_W3 z1JgcwG=5+r6b1qQ|B(eZ1Ob?(0ipUSg*Fya7?yN_^V@mep`K0DJZgT- zXoDvq!la~Ug2a9DJ_0^ni(1YfPq;kYU?1UM@F*2K)cs=E>J$Bdyt(+uSj?tZ%xa0P ztL+=!%$vDT=swMl*$*L-r*rlI9P1+gr6rfuWNoA6n2Q05VK0oK>!*KucfAag8w%CojK(yy#=M$FMy- zgKeqaIo~Zk6?N)aMkuW`C?)n-<($uz{OHdM?q@e;<>T~{bFV5_*kB~Z!yGm7GHQ8o z3A_?-QY1d6(Qt#VO(@wA-2Ch7qov3=I9Axe+L5VQr4>fs?ZZuv3VkhOD&*V9da1~!t)CjSRdoA^ zP><5@v|0O-8=wCcULAegwvChMyDT=)?t1%H zTK=w2UwKJqAtw7Q73;GK3exUm!e;c4nKiEFOvLsZ;dv1&4}!4zhut9bR%YdKD;#D!@9CM>;h zN4^fq*g_4wR1r7cK#w0{2D|KRh^e=0nIRU5Yn#@dd>3gjb>eDb%gxQgs&OJV68514 z3lFbfJiBFLG*kHe!u++U;d6A|Nr!gol!y*)x}Q>8)ubMKTIyzv4RHdvd}F1s^Vv3g zpPCQ^`6b~x4jH0xK0?n>S$Zu?3Nv%wcsXmrxm--!=6)a{BsD#$_f8_ZTUi(P#M1ql z^U9p$#BN=b5(`8d4GnbGC{-&?p`Fw{!^XzQeY?)=SVK1pdbFi{LSW$$s_VO>& zOUhEiMLfdHJPB$+I3jyb2I~|zw2gnp^;v?JhBA3_(YgNu#jL7nJdXJ!G1fTeL|V61 z-;;^zo^prIyD#Jeib4(BxF*&E^ny{I!BOJ=eo9e25FbnIM&>*JXEI-)ZK1XSd;Urr9vs;;}kq_O+%KuDhY*{1N|9 zW=9vvM{dlH+szu`6drY_2u4s#Xe8b&hD13BKokoF`u_)Eij+QY&+VX`)<_4FwG&@ zVh|u(7apneO7M%S%IvxPV{xqgNq1g4Rc?DjVNk;T{lVN)(Co@_OVN&jp?Z%>k{#?T z+6@l{*+~}$ydFs421wzLmaF>4XRmLbZh6C9tnzV4!9sLOoyKrwOv(h4o?=$R+qHhwZy-q7GQ7IfE)3)>K#Tx#bFF14TTrBXP zO<6Li2%?b)6)_l;fB@iFB#yhZmDrObe+xaUX<~PHa87$STc(VgP{x>bQd4WBGCUplqA0v z6w6OQ@i`ozffpE12p9qZg8}T1s$dKp1eg#d0UQEq2ZM@ZEh)Z!u0Dq;J}yUGgNb-R z;ycHP3;pEs23F=oaX|EY04f?0&6+sw3>WGx95}HLlsN_Q*ud8k2IO$Hfhr_Us8%{DKD4s{*}rv!`#3vs z*QOSiuEgd+pkUDdKQjM@z#yYnWU__U8Rfe;x>#a_sjh7CgISA0QR^2Pnz{WA2E5zL zRF9J*%c!e8;Na;Rc18yXi0zn9t%JP!t=#il`|eVk3|7$Q6-J}kUR#q%yQL+hvz+fK!sVwaEr*1NN4+iY zKGE%KFWAz1q+fnV)-BYS0!bJvO4iKB3P1gWqqS6ck~o-WlIf$Sc1iSO_SBqgQ{!N= zd;-4MtK#*a_Yjviiw$o$Ey!6rT=h$$bO;QO|CJuv*mun~netNf-G8WaQu9rl`TY;Qqnd>w6DRL{{h-Sd=KfXRnf+z{YsU5EkoF{5&d|pF`rPxw;RKw`Cz^!Xn8Y1*r zLcGgoRZ3WyaIU#+cF*5*ruxPXwRPTkti3zeHHYxpXuTn~yRK7#KygOtj_P7N>r2~j zDNsJ~y472Tr~;(A=E~Bvo=C|=t^jY)DlMW-SW|ky!LUx}2_Z`uVR&c&vF3ISNg5BDGXGNb9hx=l-$ zF|=VCEEG+MMigC_e~^&ia*dPE1~ZlHea)cD2Gu@x{^0P2XJ%HIr*zm!fTP&C?-RKyHs{E8Wp?lCWe#O8BXBv zRc}=AZiINFXITp)39Xx5Dt7u)@&p$g-b2UHSX}y+p(e{CewGP`I}QrS-Z@P-LJhpT z$t5lt$4kF&`2E(L-pP9Z%f1eG&na4+&Y>@su2V6G^Awo@ z?Ay1hoAhj8NPB!qQr_ zhn^iacVSow8hx>9&fmUH-Mw(WNxGs&y&^)ex|Eez6QeAG&>z(Y8rGXNr$I^#| zxaO;X5(!uv^f48!N*1H~&7TPhnRz6**a*#?9W!F}x zodK0D*SA*+^qmbf9$i?mFLo!Ij+lLntU(Qy6hY6hi_r*0no1V?Vxmre!6$e6-u^bn zW0McvsruXU6FHutARMDRdt-bZT;{4WM&{)YzO@sAYiF&gix~c0PNt5;)!EObMSfyT zX|JPTt_)rH{_1?OC7Z@;y3ZAD$ip)yoFRAt&79QeN|M03-ka literal 0 HcmV?d00001 diff --git a/src/main/resources/suspected/mtf/sandbox-fldsuspectedfraudapiClientEnc1692261643.pem b/src/main/resources/suspected/mtf/sandbox-fldsuspectedfraudapiClientEnc1692261643.pem new file mode 100644 index 0000000..7eca150 --- /dev/null +++ b/src/main/resources/suspected/mtf/sandbox-fldsuspectedfraudapiClientEnc1692261643.pem @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEeDCCA2CgAwIBAgIIDzMLWnfGiRQwDQYJKoZIhvcNAQELBQAwgZAxCzAJBgNV +BAYTAlVTMR0wGwYDVQQKExRNYXN0ZXJDYXJkIFdvcmxkd2lkZTEbMBkGA1UECxMS +Q29ycG9yYXRlIFNlY3VyaXR5MUUwQwYDVQQDEzxNYXN0ZXJDYXJkIFBSRCBPcGVu +QVBJIEluYm91bmQgRmllbGQgTGV2ZWwgRW5jcnlwdGlvbiBTdWIgQ0EwHhcNMjMw +ODE3MDg0MDQzWhcNMjQwOTE1MDg0MDQzWjB5MSMwIQYDVQQDExpOaXRpbkhELWlu +Ym91bmQtZW5jcnlwdGlvbjETMBEGA1UEChMKTWFzdGVyQ2FyZDEQMA4GA1UECxMH +T3BlbkFQSTERMA8GA1UEBxMITmV3IFlvcmsxCzAJBgNVBAgTAk5ZMQswCQYDVQQG +EwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAI/YjdBgdhM1IBxv +WJ9BXWAwEEeWvoBlqvodLL+Rd/LKBsg3Y5dq3/7dfnyx8Rp+vwTT6iplBACEvmKZ +RfbeByZc0EkZ+QVRWB3H64ZwSW4UDZxdNRLzVfRqQCgKJa1iI+iEF/uxnEncwYvC +3xkXCjYhABSAyupiXV9G0Ub6go2dmQboxfPmcSME1sA9fEow8jb5gRqK57gaFBeP +ZS7Qawv61zWMpx0BU/w308bGZYaX+cejSwjQIkJND/fuld/x5BLKM1ozph1Bou4M +r7TIi2awkc/zKxSf/yH820F+AWwblvS0pCXxO6ZUsMnbBWTMe4ZCy8imBK5pW1A8 +8YMx29MCAwEAAaOB6zCB6DAOBgNVHQ8BAf8EBAMCACAwDAYDVR0TAQH/BAIwADAd +BgNVHQ4EFgQUgTKWRSXvGFY1QBJrMZEX1ZrPGjAwHwYDVR0jBBgwFoAUws0CZmCB +xl7hEeXbog4ezn8Hmv0wYQYDVR0fBFowWDBWoFSgUoZQaHR0cDovL2NybGRwLmVj +bXMubWNsb2NhbC5pbnQ6MTM1MzYvYzJjZDAyNjY2MDgxYzY1ZWUxMTFlNWRiYTIw +ZTFlY2U3ZjA3OWFmZC5jcmwwJQYDVR0RBB4wHIIaTml0aW5IRC1pbmJvdW5kLWVu +Y3J5cHRpb24wDQYJKoZIhvcNAQELBQADggEBAGLOr3QKKT8vfZlplhwzebL0/vZq +kInEZyHNzdX8CohGP7AuNC6h0fWnMQkXG0idz3dc8Oqfxw5CdqXD6GA2zRaN5pg4 +4HrvT+967W4hF0FLAjochPrv3QQk5STszIKI4D3/MUKjrlv8M66emSXJAmDyrqcf +GDTDqShnzgfDjYkfSCC+IdjofTZYt7sH9/+THKLfCZk9SsKXnLfOsc0bHTjsZqa3 +JVWMZUluHsoVtiOgYRHQQOplKmzT6rAs+gWipMg690918nSUuxlHUnOmCQUHbH+v +dUiPCtdlwEgXXp8LFaBiOM2l+qncqmHWxk2GCoAdIOY6VHUsmsnbbDuGGg0= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/main/resources/suspected/stage/MTFPerfKeyAlias007-production.p12 b/src/main/resources/suspected/stage/MTFPerfKeyAlias007-production.p12 new file mode 100644 index 0000000000000000000000000000000000000000..c00abaf6456c3656e6a6cd333841fae662201ea8 GIT binary patch literal 2428 zcmcJPcTiNx7KiVh1T!#$ECZibsjbg-r@B$+I3=Q(3F#kd{2Q3#I zOAA2LI1(a)YXxu^2!nwjg#DHkWIzHC0nY)kq2N~$a8|6Ly`R6+ZB6^zH}#!D@SG6) zSI)qS`_4~aG||PgLd;(s7*@=82gJ{bJtqs{@d}UvBrAuvqM33(nE$hLh@ilaC4fi( zP6U|%T8S7K5d?wZ@x|*W4SHXkYT6VS?zh_=)TE2H!XW7Zi&GO+O1kMR`OUqRLgS8# zRg<{7>BWxhyIFbDtgK-p;m(A!b_UHV@(pe3mhF|9m3}+%r=L2iPU2IW8wR571o|`6 zq!q}c^I(xX%ipK%z& zwDXbD?&tXzONFZ1tD^`TwZ7%kGEBb-LU+O?-YXf%=qp=qtJjR5iBlWn-8)bU(c=p8 zsv;2xlos)>;_||b?80T8o+LcmkR;sz!rODqw7GFDs`w|@2Ta;vqU2#%QNiUpuS)w? zodk{W{aFtf90dORk!d#s0?Ly^*(E#KimzCf-OQkzI>qOm=F^5HQYC1i(lx46*FBif zg8yJv0@V3s45h2OcR2EqBrI+4TygY-mRn0!)!_TQ%1_Cm36Za^)K3+A^yLYav?)lJRciO$0(6PO(q3z;Z}pPa zm%gK@#m36m>Zs%2YZV4iGS*BHb~iMWbbFh&9^2aaSo7^IS;`msDI-`sx+k8FSoloT z92-t;z5mcs=(n*f#@H`u``72HUFYDxdtK+){4@jkISK+8A_X!Ru~BLFG=A=eS~*6p z9JrFpfV36k*Ws<^bFp|UNbuX&N3-KO5NyvzxmjV}Jo$Ci8Fc&~gm?;bm{cIy@0-~0 zBK$&tAz%g&029CoxD7Z1`m{9!xCnRxZh$@D2SBu;01=Ua-@?B3G13J=L^{&29c^0w z*sQPuB4QmPB98S3#surFvgXt8mLSuv?#$w~ZQ-o#j{OWhs$`g}vSaHTDf?9hnoyB`=mdGphZejKHq^tJV z96VF`OBMM@D^zcX>yPPg1hMg&Nv9Qg!hKuw-Qz^6XLt?k}v!Spbc%l46@+I?;lFc6G5Va~9BEMgQ@^$KELCwm~r=DqlQ)8wcpb1v-qo zR>+6B%G15+I>7lKsuU4JW@L@jr#IZE`1uDBSNn%}b~Im`hF+N2^sd>WtE!j!6nT#$ z=6vEXk;x=JQT+UQfm%uZzT=z;;Y&F?x8&Xa%)by1%WFs%_ORQy-dws^b7i82VouFk zA%^ILoy`}TkRLpm=G9@0Yn^i#y+d9~X2%uH`AZ0Mx!#zQ7?#SI>Z@Lj$$Th0<-xoE zV!e9TV}4zdTg|yW`&Ut>6NJ+tN5$RDj%Pw+}2$YN{lK}a-tw0N~M2|G& zB68HjA;6i%(HhTsSG_i=(JJY5J%(URcc4)n}Dls%|Xn8J9Rv-xrZ7 zB0j1;nlh`#_1fk)YDWA*5M3|(LAbGfXYxHAW`ST*al>ee(L4EhmiW7(Eh&X}O&94! z%S(3_=%uxW{~~A&?ruJ5?2v<5$b}3WI9_h>sVr*ll?0ZS-wS+Kb z$vU!ige*nYyrRgy<>*Y;b*}1t|2}`*&vo6O`?>Gux}WFy-Vg(01_R*`10#sS91JrI z+u#AYz+47~3&Fr}F!~$BfG7P=2p)!Dz!@AIz%d$%`=2Zv7KG7%}F@l_0 za2`$qhQpB%1Dwx=!$24e1R(AOdY*_C^z&RZ#WrKs6-)1 z;5+BW^Zw*gx@Ja1JhbO~0E@@|3_ub>JgSEwO;uG0f=GuotU0dQFYdo~4g-|=wFM9f zz!@MPz-bW+V}Ky==HXizDY1w*0q9->g)Cd@reW>PiF7`)Ov>$g#Xo1O;Lp=zwr`4P zi+3#sSucSZ#Hy0~r)opRFQOVRAv&t$GWFt6$w4D{0!%-oXEdU5e#$;^e_>d;LxT0i zqmAxCGi~NLp~;~(Ah6>A~_p( z{-pij9~;yq7#sxt|B*R21Oi&yeW7J<_c+GaaZ^3j zVY_&lhuQOLI&ie%)q7lx14@bFq3F)5I;7c9pIym%_JzSbgBz2{1giD&>exI4Z zk=dE;RJ(DWRR?g`z=bSMTW-AnnEGGw@hhJdZwc~?#D6UJGwHJGi(G$s8~3`?$_^e6 znd}?iVF|UmY~5TzA`^l5<1UxaY$pUcP92OnoBN zP-vl%d?2nu*dLOeGJCzd(AP^DbsL;jm(W&UU=nOA%v^jo6zB6Mp(M)@C&|+$@y=Rm zb811Q5ln7)p)%7Smw^3vOyfmK+H9mdvsP2J-6u=AS-Wgzxwbdzx}vSCS8Mhcn7?q3 zUhMVA+WJo0bk;uYwoh!?Wx0@xO9Is^AOFy>{zHCA`zqH$`qz~uO|R+xI#{cFavJ6& zt$N@PcSJY>XnOM(d%nRqYfUCy12x$4u3FYSvLqu1}g z)!0BO8!5@MmfzfTWQk8pd989cp0t{OQ5bzXl+SKwzG7^!x~}c2K~qAMSii;UGC#$b z)#T;67~IY_?J>G5D18Wy1do&r zzFN48xhbi1r-@vMC*C*J@lgD;WF2i%1Rqt2?DsaG+Ey8bNv>YC3D_kVR)n4+KR;u4 zxY~~@OFsYs#uL3voiFE&Zp|;JI6SM=jC@jE?-K-8w7c{@_Dt6zN9%YdtI)$*TxPs( z8JFl^p(LBF03A0U2lQ*sh=isFs=Ux;e_cta+2P{Sfdvm5PQ&vgXRWjP!^>WU-Ho{- zW!jL~ldP4G*^*cI?LnS&#`U1f_ClUMn6Bb+k5i&rb57R9^$mi)ToV$uq8t9T6WAEO83i>X3iJ?dpOl zbV7gzMj{)(WedlJt*zI<1=lm5v>Z%a5f2aerWZ$XRAQ-^N`0IqWoKYd?AoG%dXMyb zDAiIY`Q1vA2d`!NjhKaV3pJU-YTOy$=zg}-HlT(72HLDeE6~hfph?3-@P+Z5Ovj%6 zeCW^+%WHRt(O#m55!I~zYfs5VX#Y(}W4~3k&gd7ibDZN5SO=CD5F|={tbZOyq;kCsEU2YQ>&L~`JRJ+CHJK%LK5pI3_UY`%W+|&>iEFGkGmE;@ z&KzjSN9Sn2ll72m?Cg`DaS`)VWwjP%@G~D)PEiA?&hdt0b?+Y52lek9>)^_inKsvT z>bn@_X_7}f!(~(NQn$z0;aX%GAbw=VAi0@5Tl_8!jvaD(B5OTRK2U^LDLG1t3O5UD ztz!L^T^8G|D#4t)Ag99>YtebkDN=V!i|Ij^4W`ZT#O$El%w?R=Zpx~o`$A}p@C8cJ z5 vD5N4U943kc5QGGlYG$|fyp%^#T&Qs}RhDgj7mGlvSlB48xjNtYK1TlrlC|`k literal 0 HcmV?d00001 diff --git a/src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1673939029302.pem b/src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1673939029302.pem new file mode 100644 index 0000000..efdabe3 --- /dev/null +++ b/src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1673939029302.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEgTCCA2mgAwIBAgIIDzMLWnWYMuAwDQYJKoZIhvcNAQELBQAwgZAxCzAJBgNV +BAYTAlVTMR0wGwYDVQQKExRNYXN0ZXJDYXJkIFdvcmxkd2lkZTEbMBkGA1UECxMS +Q29ycG9yYXRlIFNlY3VyaXR5MUUwQwYDVQQDEzxNYXN0ZXJDYXJkIFNURyBPcGVu +QVBJIEluYm91bmQgRmllbGQgTGV2ZWwgRW5jcnlwdGlvbiBTdWIgQ0EwHhcNMjMw +MTE3MDcwMzQ5WhcNMjQwMTE3MDcwMzQ5WjB/MSkwJwYDVQQDEyBHb3ZpbmRtY1N0 +YWdlLWluYm91bmQtZW5jcnlwdGlvbjETMBEGA1UEChMKTWFzdGVyQ2FyZDEQMA4G +A1UECxMHT3BlbkFQSTERMA8GA1UEBxMITmV3IFlvcmsxCzAJBgNVBAgTAk5ZMQsw +CQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNi4U+x +6mOgw1Lf6iClivl7Lubztz98cPWML+4j5lkHOxpYQr8bnKxfRj1XaHs3nC3DP726 +GdKX+1fcGtVlPthDcSgcWwj3r+cxxEAtIh2K2zK9mfTh0Rh8HSTZPyV5SfFFEYYF +ZaGNP+PMmGN57ArRngMk+zn2OX/DFsatDP5zPj++Ia2yjiKXzw77YxDIsgzS9KLa +IEFUSo6FnMVR1xMPrFPAN2w5QRCcYI7robMB/71O3MpTtBy54FLx3mFcUpxqhEUz +dTCiR0Bju7uXQDKIFsG6de5pGlkBhqP5du/lqckoupnyz7GLUHoss1KniEymSD+h +XQQQL5Q0SOGahisCAwEAAaOB7jCB6zAOBgNVHQ8BAf8EBAMCACAwCQYDVR0TBAIw +ADAdBgNVHQ4EFgQUc/fB1diYAZEFU7FmK9Fu5d8bzj8wHwYDVR0jBBgwFoAUFyvF +A9UiGgQEdtjkXBeOC35o5bMwYQYDVR0fBFowWDBWoFSgUoZQaHR0cDovL2NybGRw +LmVjbXMubWNsb2NhbC5pbnQ6MTM1MzYvMTcyYmM1MDNkNTIyMWEwNDA0NzZkOGU0 +NWMxNzhlMGI3ZTY4ZTViMy5jcmwwKwYDVR0RBCQwIoIgR292aW5kbWNTdGFnZS1p +bmJvdW5kLWVuY3J5cHRpb24wDQYJKoZIhvcNAQELBQADggEBADSNwjvE7ggD+55n +G23iDyJYfMn3qQ6xnhQw/S8aKLbDnsfk0RFPgmOoOT9Oz5d8nNl40C/vELBYwWtr +VFzkSDpfsTOlLYTrEt3G5bEPHq0vk7Kb+PtEDu5SgLjn0nxLHQT47cawFZZeobSE +F2UHu81ATI2EXTz30D9Mxcl5mDbzrGjowePHwgVKvrCQxR5hqGSayojp81vWZ8LB +H7aPcKEZxavk7bKVWP+HK70oDUcALdBGnmi17y7NkGNNjorGUrmE8H/z7GuX5LhO +kmJ7WDL4q7g6HGIDp533mUabyvTtJUhTb1j7iZc0+gR2NJtLGbGbnD7AFG08pJbp +N7Qn5+A= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1692662971.pem b/src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1692662971.pem new file mode 100644 index 0000000..70e1df6 --- /dev/null +++ b/src/main/resources/suspected/stage/fldsuspectedfraudapiClientEnc1692662971.pem @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEdTCCA12gAwIBAgIIDzMLWnfWJC0wDQYJKoZIhvcNAQELBQAwgZAxCzAJBgNV +BAYTAlVTMR0wGwYDVQQKExRNYXN0ZXJDYXJkIFdvcmxkd2lkZTEbMBkGA1UECxMS +Q29ycG9yYXRlIFNlY3VyaXR5MUUwQwYDVQQDEzxNYXN0ZXJDYXJkIFNURyBPcGVu +QVBJIEluYm91bmQgRmllbGQgTGV2ZWwgRW5jcnlwdGlvbiBTdWIgQ0EwHhcNMjMw +ODIyMDAwOTMxWhcNMjQwOTIwMDAwOTMxWjB5MSMwIQYDVQQDExpOaXRpbkhELWlu +Ym91bmQtZW5jcnlwdGlvbjETMBEGA1UEChMKTWFzdGVyQ2FyZDEQMA4GA1UECxMH +T3BlbkFQSTERMA8GA1UEBxMITmV3IFlvcmsxCzAJBgNVBAgTAk5ZMQswCQYDVQQG +EwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALMlArFjTxhoiggY +0Kh+xZXZnKxMHRfBKrv0KQbfFLHEycHrFz1aKzzrIWThqjWNm15OATlbH+Pq2mbU +XH2+0TeZb4yvi9LJTXSCLbwzT4AlA+p+pvmWNeaha/HpbBAb30cHRQt1515G5yd/ +HOR/2WP6VBCB6lYYqpm9R7BqS0xR0HwklGPr9mmfLCiXnHqppz9uN9H90Xh+3jVI +JBesuSJc13plmZQdCbJwWJTTeh+u/9b8Z/5OPIB6s+bYjz/RoLwrtEjMam1BQ+wU +x9KeH1zOcl3tnu1r3/pxN5duCbC9tHTVXgxBbcuYyM26T/cAPpaIjZIQKs980MN4 +XOCsvhMCAwEAAaOB6DCB5TAOBgNVHQ8BAf8EBAMCACAwCQYDVR0TBAIwADAdBgNV +HQ4EFgQUa0jjVg/fjAI9SThbPILCaQfYQGkwHwYDVR0jBBgwFoAUFyvFA9UiGgQE +dtjkXBeOC35o5bMwYQYDVR0fBFowWDBWoFSgUoZQaHR0cDovL2NybGRwLmVjbXMu +bWNsb2NhbC5pbnQ6MTM1MzYvMTcyYmM1MDNkNTIyMWEwNDA0NzZkOGU0NWMxNzhl +MGI3ZTY4ZTViMy5jcmwwJQYDVR0RBB4wHIIaTml0aW5IRC1pbmJvdW5kLWVuY3J5 +cHRpb24wDQYJKoZIhvcNAQELBQADggEBACpZXnqV2sEuSbTUDJeWQ///kIUgce9x +Y1x+FiDTCre1YaKhR+DqgoS4Ofw6dDfJTAW1viE6BzzAY9dVI4rs/jBkLe6mLIZ2 +9cn6+bM9O1ZVBMm/hgt2zjdL80PtgnQfS7/1lzWaPmJN9YqTLKMQmXg+P/KDtkEE +baaUNR9om+lnAZSkNCTWr/3K9hu/Hk+Vf6t6gBfSdX2g6/O4TW5vmQxBWnYKGYBB +D837Ltfah1LpwcmxeJW4vlqw93NlzZ+PhedXz+gcJUQmLi9YmmKHKMZUndSIhbNo +e9447WxNJgDqM8lGt/Fnm7JSeXbFrJ/VSHhLyAJiU5v47jgfCaIVFB0= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/main/resources/suspected/suspected-swagger.yaml b/src/main/resources/suspected/suspected-swagger.yaml new file mode 100644 index 0000000..6912d83 --- /dev/null +++ b/src/main/resources/suspected/suspected-swagger.yaml @@ -0,0 +1,1122 @@ +openapi: 3.0.3 +info: + title: Suspected Fraud API + description: These APIs allow Issuers and Acquirers to submit transactions as suspected fraud. + contact: + name: API Support + email: apisupport@mastercard.com + url: 'https://developer.mastercard.com/support' + version: 1.2.15 +servers: + - url: 'https://api.mastercard.com/fld/suspected-frauds' + description: Global Production server (uses live data) + - url: 'https://api.mastercard.co.in/fld/suspected-frauds' + description: India Production server (uses live data) + - url: 'https://sandbox.api.mastercard.com/fld/suspected-frauds' + description: Global Sandbox server (testing environment) + - url: 'https://sandbox.api.mastercard.co.in/fld/suspected-frauds' + description: India Sandbox server (testing environment) +tags: + - name: Suspected Fraud Submission + description: Suspected Fraud Submission + - name: Suspected Fraud Management + description: Suspected Fraud Management +paths: + /mastercard-frauds: + post: + tags: + - Suspected Fraud Submission + operationId: submitSuspectedFraud + description: This endpoint allows the initiator to add a new suspected fraud record using minimal input parameters for Mastercard built transactions. To submit a transaction as suspected fraud, a match has to be found in the Mastercard transaction data repository(Data Warehouse). + summary: Add a new suspected fraud record using minimal input parameters for Mastercard built transactions. + x-mastercard-api-encrypted: true + requestBody: + $ref: '#/components/requestBodies/SuspectedFraudRequest' + responses: + '201': + $ref: '#/components/responses/SuspectedFraudResponse' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + put: + tags: + - Suspected Fraud Management + operationId: updateSuspectedFraud + description: This endpoint allows the initiator to change an existing suspected fraud record using minimal input parameters for Mastercard built transactions. The initiator can modify both successful and rejected suspected fraud transactions and also modify transactions which are submitted via other channels Online and API. + summary: Change an existing suspected fraud record using minimal input parameters for Mastercard built transactions. + x-mastercard-api-encrypted: true + requestBody: + $ref: '#/components/requestBodies/SuspectedFraudChangeRequest' + responses: + '200': + $ref: '#/components/responses/SuspectedFraudChangeResponse' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + /fraud-states: + put: + tags: + - Suspected Fraud Management + operationId: fraudState + description: This endpoint allows the initiator to change an existing suspected fraud to confirmed fraud, delete suspected fraud record or mark the suspected transaction as not fraud. + summary: Confirm, Delete or mark record as not fraud for an existing suspected fraud record. + x-mastercard-api-encrypted: true + requestBody: + $ref: '#/components/requestBodies/SuspectedFraudStateChangeRequest' + responses: + '200': + $ref: '#/components/responses/SuspectedFraudStateChangeResponse' + '400': + $ref: '#/components/responses/BadRequestError' + '401': + $ref: '#/components/responses/UnauthorizedError' + '403': + $ref: '#/components/responses/ForbiddenError' + '429': + $ref: '#/components/responses/RateLimitExceededError' + /fraud-statuses/icas/{ica}: + get: + tags: + - Suspected Fraud Management + operationId: fraudRequestStatus + description: This endpoint allows the initiator to get the status of an existing suspected fraud record using combination of ICA and Ref ID or ACN, for Mastercard built transactions. The initiator can get status of the suspected fraud transaction submitted via Online & API channel. + summary: Get status of an existing suspected fraud record for Mastercard built transactions. + parameters: + - $ref: '#/components/parameters/ICA' + - $ref: '#/components/parameters/Ref_Id' + - $ref: '#/components/parameters/ACN' + responses: + '200': + $ref: '#/components/responses/SuspectedFraudStatusResponse' + '400': + $ref: '#/components/responses/SuspectedFraudStatusBadRequestError' + '429': + $ref: '#/components/responses/RateLimitExceededError' +components: + parameters: + ICA: + name: ica + in: path + required: true + schema: + type: string + minLength: 3 + maxLength: 7 + example: '1076' + description: Refers to the ICA of the suspected fraud record which needs to be searched for its status. It is mandatory parameter along with Ref ID or ACN. + Ref_Id: + name: ref_id + in: query + schema: + type: string + minLength: 36 + maxLength: 36 + example: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + description: Refers to the reference ID of the API call which was used to submit suspected fraud record. This is optional parameter if ACN is present in the request. + ACN: + name: acn + in: query + schema: + type: string + minLength: 15 + maxLength: 15 + example: '418142102142002' + description: Refers to the ACN of the suspected fraud record whose status is to be fetched. This is optional parameter for record submitted through APIs. + schemas: + APIDataElement: + type: object + required: + - icaNumber + - refId + - timestamp + properties: + refId: + description: Unique identification generated by the transaction originator using UUID logic to unambiguously link a request and response message. + example: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + maxLength: 36 + minLength: 36 + type: string + timestamp: + description: Timestamp of the request initiation by the originator in the format 'YYYY-MM-DDThh:mm:ss'. + example: '2022-05-24T20:34:37' + maxLength: 19 + minLength: 19 + type: string + icaNumber: + description: ICA number of the Issuer or Acquirer or Provider initiating the fraud submission request. + example: '1076' + maxLength: 7 + minLength: 3 + type: string + SafeFraudProvider: + description: Indicates the originator of the request. Value 10 is for Issuer and 20 for Acquirer. + example: '10' + minLength: 2 + maxLength: 2 + pattern: ^(10|20) + type: string + TransactionIdentifier: + description: Contains the a single or dual message transaction identifier values used for searching the respective transaction. Acquirer Reference Number, Banknet Reference Number, Trace Id and Serial Id values are captured. + type: object + properties: + acqRefNum: + description: Contains Acquirer Reference Number for a transaction. + example: '01111114365000000011327' + minLength: 23 + maxLength: 23 + type: string + banknetRefNum: + description: Contains Banknet Reference Number for a transaction. + example: 756QR7 + minLength: 6 + maxLength: 9 + type: string + traceId: + description: Contains Trace Id for a transaction. + example: '650099' + minLength: 6 + maxLength: 6 + type: string + serialId: + description: Contains Serial Id for a transaction. + example: '550000099' + minLength: 9 + maxLength: 9 + type: string + Initiator: + description: Indicates who has submitted the transaction. If only Issuer submitted the transaction then value of this field will be 'ISSUER'. If only Acquirer submitted the transaction then value of this field will be 'ACQUIRER'. If both the parties have submitted the transaction then the value of this field will be 'BOTH'. + example: BOTH + minLength: 4 + maxLength: 8 + pattern: ^(ISSUER|ACQUIRER|BOTH) + type: string + CardInPossession: + description: Flag to indicate if the card holder was in possession of the card at the time the fraud occurred. Possible values are 'Y', 'N' and 'U' (for Unknown). This field is required for Issuer and optional for Acquirer. This is a conditional parameter and is mandatory when operationType value is CONFIRMED_FRAUD. + example: 'N' + maxLength: 1 + minLength: 1 + pattern: ^(U|Y|N) + type: string + SuspectedFraud: + allOf: + - $ref: '#/components/schemas/APIDataElement' + type: object + required: + - cardNumber + - fraudPostedDate + - fraudTypeCode + - providerId + - transactionAmount + - transactionDate + - transactionIdentifiers + properties: + providerId: + $ref: '#/components/schemas/SafeFraudProvider' + transactionIdentifiers: + $ref: '#/components/schemas/TransactionIdentifier' + cardNumber: + description: Cardholder account number used in the fraudulent transaction. Card number to be verified through Luhn's algorithm. + example: '5505135664572870000' + maxLength: 19 + minLength: 12 + type: string + transactionAmount: + description: Transaction amount at the merchant location (without any decimals). + example: '10350' + maxLength: 12 + minLength: 1 + type: string + transactionDate: + description: Local date at the merchant location when the transaction occurred. Format is 'YYYYMMDD'. + example: '20210115' + maxLength: 8 + minLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + type: string + fraudPostedDate: + description: Date on which the fraud is posted in FLD by the originator. Format is 'YYYYMMDD'. + example: '20210120' + maxLength: 8 + minLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + type: string + fraudTypeCode: + description: Code identifying the reason the originator submitted the transaction as fraud in FLD. Please refer to [TBD - Table 1](https://developer.mastercard.com/) for possible values. + example: '01' + maxLength: 2 + minLength: 2 + type: string + accountDeviceType: + description: Indicates if the account uses a magnetic stripe, chip, pin, contactless or any combination thereof. Please refer to [Table 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) for possible values. This field is required for Issuer and optional for Acquirer. + example: '1' + maxLength: 1 + minLength: 1 + type: string + cardholderReportedDate: + description: Date on which the cardholder had reported the fraud. Format is 'YYYYMMDD'. + example: '20210118' + maxLength: 8 + minLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + type: string + cardInPossession: + $ref: '#/components/schemas/CardInPossession' + memo: + description: Brief description by the originator providing some comment supporting the action. + example: This is a sample FDA minimal request. + maxLength: 1000 + minLength: 1 + type: string + SuspectedFraudChange: + allOf: + - $ref: '#/components/schemas/APIDataElement' + type: object + required: + - providerId + - auditControlNumber + properties: + providerId: + $ref: '#/components/schemas/SafeFraudProvider' + auditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful suspected fraud record submission (FDA event). This is used as a reference to subsequently modify, delete or convert a suspended to a confirmed fraud record. + example: '418142102142002' + minLength: 15 + maxLength: 15 + type: string + fraudPostedDate: + description: Date on which the fraud is posted in FLD by the originator. Format is 'YYYYMMDD'. + example: '20210120' + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + type: string + fraudTypeCode: + description: Code identifying the reason the originator submitted the transaction as fraud in FLD. Please refer to [TBD - Table 1](https://developer.mastercard.com/) for possible values. + example: '04' + minLength: 2 + maxLength: 2 + type: string + accountDeviceType: + description: Indicates if the account uses a magnetic stripe, chip, pin, contactless or any combination thereof. Please refer to [Table 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) for possible values. This field is required for Issuer and optional for Acquirer. + example: '1' + minLength: 1 + maxLength: 1 + type: string + cardholderReportedDate: + description: Date on which the cardholder had reported the fraud. Format is 'YYYYMMDD'. + example: '20210118' + minLength: 8 + maxLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + type: string + cardInPossession: + $ref: '#/components/schemas/CardInPossession' + memo: + description: Brief description by the originator providing some comment supporting the action. + example: This is a sample FDC minimal request. + minLength: 1 + maxLength: 1000 + type: string + FraudState: + description: Indicates the type of operation to be performed for the given audit control number. The value CONFIRM_FRAUD is to indicate confirmed fraud operation, NOT_FRAUD is to indicate transaction is not fraud operation and DELETE is to indicate delete fraud operation. + example: NOT_FRAUD + minLength: 1 + maxLength: 50 + pattern: ^(CONFIRM_FRAUD|NOT_FRAUD|DELETE) + type: string + SuspectedFraudStateChange: + allOf: + - $ref: '#/components/schemas/APIDataElement' + type: object + required: + - providerId + - auditControlNumber + - operationType + properties: + providerId: + $ref: '#/components/schemas/SafeFraudProvider' + auditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful suspected fraud record submission (FDA event). This is used as a reference to subsequently modify, delete or convert a suspended to a confirmed fraud record. + example: '418142102142002' + minLength: 15 + maxLength: 15 + type: string + operationType: + $ref: '#/components/schemas/FraudState' + transactionIdentifiers: + allOf: + - $ref: '#/components/schemas/TransactionIdentifier' + description: Contains the a single or dual message transaction identifier values used for searching the respective transaction. Acquirer Reference Number, Banknet Reference Number, Trace Id and Serial Id values are captured. This is a conditional parameter and is mandatory when operationType value is CONFIRMED_FRAUD. + fraudPostedDate: + description: Date on which the fraud is posted in FLD by the originator. Format is 'YYYYMMDD'. This is a conditional parameter and is mandatory when operationType value is CONFIRMED_FRAUD. + example: '20210120' + maxLength: 8 + minLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + type: string + fraudTypeCode: + description: Code identifying the reason the originator submitted the transaction as fraud in FLD. Please refer to [Table 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) for possible values. This is a conditional parameter and is mandatory when operationType value is CONFIRMED_FRAUD. + example: '01' + maxLength: 2 + minLength: 2 + type: string + fraudSubTypeCode: + description: Code to further identify the reason that the originator submitted the transaction as a fraud in FLD. This attribute is mandatory for the Issuer but optional for the Acquirer. Please refer to [Table 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) for possible values. This is a conditional parameter and is mandatory when operationType value is CONFIRMED_FRAUD. + example: U + minLength: 1 + maxLength: 1 + type: string + accountDeviceType: + description: Indicates if the account uses a magnetic stripe, chip, pin, contactless or any combination thereof. Please refer to [Table 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) for possible values. This field is required for Issuer and optional for Acquirer. This is a conditional parameter and is mandatory when operationType value is CONFIRMED_FRAUD. + example: '1' + maxLength: 1 + minLength: 1 + type: string + cardholderReportedDate: + description: Date on which the cardholder had reported the fraud. Format is 'YYYYMMDD'. This is a conditional parameter and is mandatory when operationType value is CONFIRMED_FRAUD. + example: '20210118' + maxLength: 8 + minLength: 8 + pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' + type: string + cardInPossession: + $ref: '#/components/schemas/CardInPossession' + notFraudTypeCode: + description: Code to further identify the reason that the originator submitted the transaction as a not fraud transaction in FLD. This attribute is mandatory for the Issuer but optional for the Acquirer. Please refer to [Table 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) for possible values. + example: '02' + minLength: 2 + maxLength: 2 + type: string + avsResponseCode: + description: The Address Verification Service response code in the Authorization Request Response. Please refer to [Table 4](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-4-avs-response-codes) for possible values. + example: U + minLength: 1 + maxLength: 1 + type: string + authResponseCode: + description: Indicates the result of the authorization request. Please refer to [Table 5](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-5-authorization-response-codes) for possible values. + example: '40' + minLength: 2 + maxLength: 2 + type: string + memo: + description: Brief description by the originator providing some comment supporting the action. + example: This is a sample FDD / FDE request. + minLength: 1 + maxLength: 1000 + type: string + FraudBase: + type: object + properties: + refId: + description: Unique identification generated by the transaction originator using UUID logic to unambiguously link a request and response message. + example: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + maxLength: 36 + minLength: 36 + type: string + timestamp: + description: Timestamp of the request initiation by the originator in the format 'YYYY-MM-DDThh:mm:ss'. + example: '2022-05-24T20:34:37' + maxLength: 19 + minLength: 19 + type: string + icaNumber: + description: ICA number of the Issuer or Acquirer or Provider initiating the fraud submission request. + example: '1076' + maxLength: 7 + minLength: 3 + type: string + Fraud: + allOf: + - $ref: '#/components/schemas/FraudBase' + type: object + required: + - responseCode + - responseMessage + properties: + responseCode: + description: Response code indicating success or failure of the transaction at an API level. Errors at a record level will be handled through 'errorDetails' element associated with each record. + example: '200' + maxLength: 3 + minLength: 3 + type: string + responseMessage: + description: Transaction response description corresponding to the response code. + example: Success + maxLength: 100 + minLength: 1 + type: string + auditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful suspended fraud record submission ('FDA' event). This is used as a reference in the request API to subsequently modify, delete or convert a suspended to a confirmed fraud record and is echoed back. This attribute will be absent if the request is not processed by FLD application. + example: '418142102142002' + maxLength: 15 + minLength: 15 + type: string + confirmedAuditControlNumber: + description: Unique number generated by FLD application and provided in the response message for a successful fraud record conversion from Suspected to Confirm fraud. This is used as a reference in the request API to subsequently modify, delete and other operations on confirmed fraud record and is echoed back. This attribute will be absent if the request is not processed by FLD application. + example: '418142102142023' + maxLength: 15 + minLength: 15 + type: string + previousStatus: + description: Previous status of the transaction in terms of an FDC, FDD and FDE event. + example: SUSPECTED-SUCCESS + minLength: 1 + maxLength: 50 + type: string + currentStatus: + description: Current status of the transaction in terms of an FDA, FDC, FDD and FDE event. + example: SUSPECTED-CONFIRMED-SUCCESS + minLength: 1 + maxLength: 50 + type: string + channel: + description: Fraud request submission fld channel name. The value of the channel can be API or ONLINE_PORTAL + example: API + minLength: 3 + maxLength: 30 + type: string + submissionStatus: + description: Indicates the submission status of the suspected transaction. + example: NEW + minLength: 1 + maxLength: 50 + type: string + fraudOriginator: + $ref: '#/components/schemas/Initiator' + matchLevelIndicator: + description: Indicates if it is a Mastercard-built or Issuer-built record. Possible values are 'M' for Mastercard built record and 'I' for Issuer built record. This attribute will be absent if the request is not processed by FLD application. + example: M + minLength: 1 + maxLength: 1 + type: string + financialTransactionIndicator: + description: Indicates if the fraud record is being submitted against a financial transaction (having a clearing record) or a declined auth transaction (without a clearing record). Possible values are 'APPROVED' for financial transactions (having a clearing record) and 'DECLINED' for declined auth transactions (without a clearing record). This attribute will be absent if the request is not processed by FLD application. + example: DECLINED + minLength: 1 + maxLength: 20 + type: string + authorizationResponse: + description: Provides the 'Auth Response Code' and 'Auth Response Code Description' combination if 'Financial Transaction Indicator' value is 'DECLINED'. This attribute will be absent for all other scenarios. + example: 05 - Do not honor + minLength: 1 + maxLength: 200 + type: string + errorDetails: + $ref: '#/components/schemas/ErrorWrapper' + Error: + title: ErrorMessage + type: object + required: + - Description + - ReasonCode + - Recoverable + - Source + properties: + Source: + description: The application or component that generated this error. + example: FLD + maxLength: 50 + minLength: 3 + type: string + ReasonCode: + description: Reason code is a unique constant identifying the error case encountered during request processing. + example: VALIDATION_ERROR + maxLength: 100 + minLength: 5 + type: string + Description: + description: Human-readable short description of the reasonCode. + example: Reference Id is not provided. + maxLength: 250 + minLength: 10 + type: string + Details: + description: Optional detailed description provides information about data received and calculated during request processing. This helps the user to diagnose errors. + example: This is mandatory field while requesting for fraud submission. + maxLength: 1000 + minLength: 0 + type: string + Recoverable: + description: Recoverable flag indicates whether this error is always returned for this request, or retrying could change the outcome. For example, 'true' or 'false'. + example: true + type: boolean + Errors: + title: Errors + type: object + required: + - Error + properties: + Error: + description: Errors array wrapped in an error object. + items: + $ref: '#/components/schemas/Error' + type: array + ErrorWrapper: + description: Object containing the list of combination of error reason codes and their corresponding description (can provide up to 5 errors for a record). It will be absent if the request is processed by FLD application successfully. + title: Error Response + type: object + required: + - Errors + properties: + Errors: + $ref: '#/components/schemas/Errors' + requestBodies: + SuspectedFraudRequest: + description: Add a new suspected fraud record using minimal input parameters for Mastercard built transactions. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuspectedFraud' + examples: + SuspectedFraudIssuerCreditExample: + $ref: '#/components/examples/SuspectedFraudIssuerCreditExample' + SuspectedFraudIssuerDebitExample: + $ref: '#/components/examples/SuspectedFraudIssuerDebitExample' + SuspectedFraudAcquirerCreditExample: + $ref: '#/components/examples/SuspectedFraudAcquirerCreditExample' + SuspectedFraudAcquirerDebitExample: + $ref: '#/components/examples/SuspectedFraudAcquirerDebitExample' + SuspectedFraudChangeRequest: + description: Change an existing fraud record using minimal input parameters for Mastercard built transactions. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuspectedFraudChange' + examples: + SuspectedFraudChangeIssuerExample: + $ref: '#/components/examples/SuspectedFraudChangeIssuerExample' + SuspectedFraudChangeAcquirerExample: + $ref: '#/components/examples/SuspectedFraudChangeAcquirerExample' + SuspectedFraudStateChangeRequest: + description: Confirm a fraud, Delete it or Confirm an existing fraud record as not fraud a Mastercard built transactions. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SuspectedFraudStateChange' + examples: + SuspectedConfirmFraudExample: + $ref: '#/components/examples/SuspectedConfirmFraudExample' + SuspectedConfirmNotFraudExample: + $ref: '#/components/examples/SuspectedConfirmNotFraudExample' + SuspectedDeleteFraudExample: + $ref: '#/components/examples/SuspectedDeleteFraudExample' + responses: + SuspectedFraudResponse: + description: Fraud submitted successfully. + headers: + Location: + schema: + type: string + description: Refers to the created resource location. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + SuspectedFraudDataAdded: + $ref: '#/components/examples/SuspectedFraudDataAdded' + SuspectedFraudDataAddedByIssuerFirstFollowedByAcquirer: + $ref: '#/components/examples/SuspectedFraudDataAddedByIssuerFirstFollowedByAcquirer' + SuspectedFraudDataAddedByAcquirerFirstFollowedByIssuer: + $ref: '#/components/examples/SuspectedFraudDataAddedByAcquirerFirstFollowedByIssuer' + SuspectedFraudDataAddError: + $ref: '#/components/examples/SuspectedFraudDataAddError' + SuspectedFraudChangeResponse: + description: Fraud data changed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + SuspectedFraudDataChanged: + $ref: '#/components/examples/SuspectedFraudDataChanged' + SuspectedFraudDataChangeError: + $ref: '#/components/examples/SuspectedFraudDataChangeError' + SuspectedFraudStateChangeResponse: + description: Fraud data changed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + SuspectedFraudDataConfirmedFraud: + $ref: '#/components/examples/SuspectedFraudDataConfirmedFraud' + SuspectedFraudDataConfirmedNotFraud: + $ref: '#/components/examples/SuspectedFraudDataConfirmedNotFraud' + SuspectedDeleteFraud: + $ref: '#/components/examples/SuspectedDeleteFraud' + SuspectedFraudDataConfirmedTxnDateOlder: + $ref: '#/components/examples/SuspectedFraudDataConfirmedTxnDateOlder' + SuspectedFraudStatusResponse: + description: Fraud request status in the system. + content: + application/json: + schema: + $ref: '#/components/schemas/Fraud' + examples: + SuspectedFraudStatusNewByIssuer: + $ref: '#/components/examples/SuspectedFraudStatusNewByIssuer' + SuspectedFraudStatusUnderReviewAcquirer: + $ref: '#/components/examples/SuspectedFraudStatusUnderReviewAcquirer' + SuspectedFraudStatusOverdueBoth: + $ref: '#/components/examples/SuspectedFraudStatusOverdueBoth' + SuspectedFraudStatusPending: + $ref: '#/components/examples/SuspectedFraudStatusPending' + SuspectedFraudStatusCompletedConfirmedSuccessBoth: + $ref: '#/components/examples/SuspectedFraudStatusCompletedConfirmedSuccessIssuer' + SuspectedFraudStatusCompletedConfirmedSuspendedIssuer: + $ref: '#/components/examples/SuspectedFraudStatusCompletedConfirmedSuspendedIssuer' + SuspectedFraudStatusCompletedConfirmedRejectedAcquirer: + $ref: '#/components/examples/SuspectedFraudStatusCompletedConfirmedRejectedAcquirer' + SuspectedFraudStatusNoRecordExample: + $ref: '#/components/examples/SuspectedFraudStatusNoRecordExample' + SuspectedFraudStatusNoParamRefIdAcnExample: + $ref: '#/components/examples/SuspectedFraudStatusNoParamRefIdAcnExample' + SuspectedFraudStatusBadRequestError: + description: Something was wrong with the request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + BadRequestInvalidIca: + $ref: '#/components/examples/BadRequestInvalidIca' + BadRequestInvalidRefId: + $ref: '#/components/examples/BadRequestInvalidRefId' + BadRequestInvalidACN: + $ref: '#/components/examples/BadRequestInvalidACN' + BadRequestError: + description: Something was wrong with the request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + BadRequestRefIdMissing: + $ref: '#/components/examples/BadRequestRefIdMissing' + UnauthorizedError: + description: Unauthorized request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + UnauthorizedExample: + $ref: '#/components/examples/UnauthorizedExample' + ForbiddenError: + description: Consent not given. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + ForbiddenExample: + $ref: '#/components/examples/ForbiddenExample' + RateLimitExceededError: + description: Too Many Requests. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorWrapper' + examples: + RateLimitExceededExample: + $ref: '#/components/examples/RateLimitExceededExample' + examples: + SuspectedFraudIssuerCreditExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + transactionIdentifiers: + acqRefNum: '01111114365000000011327' + banknetRefNum: 756QR7 + cardNumber: '5505135664572870008' + transactionAmount: '5505' + transactionDate: '20200713' + fraudPostedDate: '20210316' + fraudTypeCode: '01' + accountDeviceType: '1' + cardholderReportedDate: '20210314' + cardInPossession: 'U' + memo: This is a sample FDA minimal request. + SuspectedFraudIssuerDebitExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + transactionIdentifiers: + traceId: '650099' + serialId: '550000099' + cardNumber: '5505135664572870008' + transactionAmount: '5505' + transactionDate: '20200713' + fraudPostedDate: '20210316' + fraudTypeCode: '01' + accountDeviceType: '1' + cardholderReportedDate: '20210314' + cardInPossession: 'U' + memo: This is a sample FDA minimal request. + SuspectedFraudAcquirerCreditExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '20' + transactionIdentifiers: + acqRefNum: '01111114365000000011327' + banknetRefNum: 756QR7 + cardNumber: '5505135664572870008' + transactionAmount: '5505' + transactionDate: '20200713' + fraudPostedDate: '20210316' + fraudTypeCode: '01' + memo: This is a sample FDA minimal request. + SuspectedFraudAcquirerDebitExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '20' + transactionIdentifiers: + traceId: '650099' + serialId: '550000099' + cardNumber: '5505135664572870008' + transactionAmount: '5505' + transactionDate: '20200713' + fraudPostedDate: '20210316' + fraudTypeCode: '01' + memo: This is a sample FDA minimal request. + SuspectedFraudDataAdded: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + currentStatus: SUSPECTED-SUCCESS + SuspectedFraudDataAddedByIssuerFirstFollowedByAcquirer: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + currentStatus: SUSPECTED-SUCCESS + fraudOriginator: ISSUER + SuspectedFraudDataAddedByAcquirerFirstFollowedByIssuer: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + auditControlNumber: '123111111000025' + currentStatus: SUSPECTED-SUCCESS + fraudOriginator: ACQUIRER + SuspectedFraudDataAddError: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '100' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '60004' + Description: 'CardNumber attribute value length not in range. Minimum Length:12 and Maximum Length: 19.' + SuspectedFraudChangeIssuerExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + auditControlNumber: '123111111000025' + fraudPostedDate: '20210316' + fraudTypeCode: '01' + accountDeviceType: '1' + cardholderReportedDate: '20210314' + cardInPossession: 'U' + memo: This is a sample FDC minimal request. + SuspectedFraudChangeAcquirerExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '20' + auditControlNumber: '123111111000025' + fraudPostedDate: '20210316' + fraudTypeCode: '08' + memo: This is a sample FDC minimal request. + SuspectedFraudDataChanged: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + currentStatus: SUSPECTED-SUCCESS + SuspectedFraudDataChangeError: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '100' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '60003' + Description: icaNumber incorrect datatype of attribute value. + SuspectedConfirmFraudExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + transactionIdentifiers: + acqRefNum: '01111114365000000011327' + banknetRefNum: 756QR7 + traceId: '650099' + serialId: '550000099' + auditControlNumber: '123111111000025' + operationType: CONFIRM_FRAUD + fraudPostedDate: '20210316' + fraudTypeCode: '01' + fraudSubTypeCode: K + accountDeviceType: '1' + cardholderReportedDate: '20210314' + cardInPossession: 'Y' + avsResponseCode: 'U' + authResponseCode: '40' + memo: This is a sample confirmed fraud request. + SuspectedFraudDataConfirmedFraud: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + confirmedAuditControlNumber: '123111111001253' + previousStatus: SUSPECTED-SUCCESS + currentStatus: SUSPECTED-CONFIRMED-SUCCESS + SuspectedFraudDataConfirmedTxnDateOlder: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '200' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '21508' + Description: Transaction date is older than 18 months. + SuspectedConfirmNotFraudExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '10' + auditControlNumber: '123111111000025' + operationType: NOT_FRAUD + notFraudTypeCode: '00' + memo: This is a sample confirmed not fraud request. + SuspectedFraudDataConfirmedNotFraud: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + previousStatus: SUSPECTED-SUCCESS + currentStatus: SUSPECTED-NOTCONFIRMED-SUCCESS + SuspectedDeleteFraudExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:37' + icaNumber: '1076' + providerId: '20' + auditControlNumber: '123111111000025' + operationType: DELETE + memo: This is a sample FDD request. + SuspectedDeleteFraud: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '000' + responseMessage: Success + icaNumber: '1076' + previousStatus: SUSPECTED-SUCCESS + currentStatus: SUSPECTED-DELETE + SuspectedFraudStatusNewByIssuer: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: Success + auditControlNumber: '123111111000025' + channel: API + submissionStatus: NEW + currentStatus: SUSPECTED-SUCCESS + fraudOriginator: ISSUER + SuspectedFraudStatusUnderReviewAcquirer: + value: + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: Success + auditControlNumber: '123111111000025' + channel: ONLINE_PORTAL + submissionStatus: UNDER-REVIEW + currentStatus: SUSPECTED-SUCCESS + fraudOriginator: ACQUIRER + SuspectedFraudStatusOverdueBoth: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: Success + auditControlNumber: '123111111000025' + channel: API + submissionStatus: OVER-DUE + currentStatus: SUSPECTED-SUCCESS + fraudOriginator: BOTH + SuspectedFraudStatusPending: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: Pending + auditControlNumber: '123111111000025' + SuspectedFraudStatusCompletedConfirmedSuccessIssuer: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: Success + auditControlNumber: '123111111000025' + channel: API + submissionStatus: COMPLETED + currentStatus: SUSPECTED-CONFIRMED-SUCCESS + fraudOriginator: BOTH + SuspectedFraudStatusCompletedConfirmedSuspendedIssuer: + value: + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: Success + auditControlNumber: '123111111000025' + channel: ONLINE_PORTAL + submissionStatus: COMPLETED + currentStatus: SUSPECTED-CONFIRMED-SUSPENDED + fraudOriginator: ISSUER + SuspectedFraudStatusCompletedConfirmedRejectedAcquirer: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + icaNumber: '1076' + responseCode: '000' + responseMessage: Success + auditControlNumber: '123111111000025' + channel: API + submissionStatus: COMPLETED + currentStatus: SUSPECTED-CONFIRMED-REJECTED + fraudOriginator: ACQUIRER + SuspectedFraudStatusNoRecordExample: + value: + refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 + timestamp: '2021-03-16T20:34:40' + responseCode: '200' + responseMessage: Failure + auditControlNumber: '123111111000025' + errorDetails: + Errors: + Error: + - ReasonCode: '60127' + Description: Record searched could not be found. Correct the input parameter and resubmit. + SuspectedFraudStatusNoParamRefIdAcnExample: + value: + ica: '1076' + responseCode: '100' + responseMessage: Failure + errorDetails: + Errors: + Error: + - ReasonCode: '60002' + Description: ref_id or acn (Audit Control Number) attribute or attribute value is missing or incorrect. + BadRequestRefIdMissing: + value: + Errors: + Error: + - Source: FLD + ReasonCode: VALIDATION_ERROR + Description: Reference Id is not provided. + Recoverable: false + BadRequestInvalidIca: + value: + Errors: + Error: + - Source: FLD + ReasonCode: VALIDATION_ERROR + Description: ica incorrect datatype of attribute value. + Recoverable: false + BadRequestInvalidRefId: + value: + Errors: + Error: + - Source: FLD + ReasonCode: VALIDATION_ERROR + Description: ref_id incorrect datatype of attribute value. + Recoverable: false + BadRequestInvalidACN: + value: + Errors: + Error: + - Source: FLD + ReasonCode: VALIDATION_ERROR + Description: acn (Audit Control Number) incorrect datatype of attribute value. + Recoverable: false + ForbiddenExample: + value: + Errors: + Error: + - Source: FLD + ReasonCode: CONSENT_NOT_GIVEN + Description: User Consent Not Given + Recoverable: false + UnauthorizedExample: + value: + Errors: + Error: + - Source: FLD + ReasonCode: UNAUTHORIZED_REQUEST + Description: Unauthorized request + Recoverable: false + RateLimitExceededExample: + value: + Errors: + Error: + - Source: FLD + ReasonCode: RATE_LIMIT_EXCEEDED + Description: You have exceeded the service rate limit. Maximum allowed 10 TPS. + Recoverable: true diff --git a/src/main/resources/swagger.yaml b/src/main/resources/swagger.yaml deleted file mode 100644 index db15196..0000000 --- a/src/main/resources/swagger.yaml +++ /dev/null @@ -1,1886 +0,0 @@ -openapi: 3.0.3 -info: - title: Confirmed Fraud API - description: >- - These APIs allow issuers to submit transactions as confirmed fraud, change - the value/status, and delete an existing fraud transaction. They also allow - users to confirm a suspended fraud transaction and mark it as confirmed - fraud. - contact: - name: API Support - email: apisupport@mastercard.com - url: 'https://developer.mastercard.com/support' - version: 1.1.0 -servers: - - url: 'https://api.mastercard.com/fld/confirm-frauds' - description: Production server (uses live data) - - url: 'https://sandbox.api.mastercard.com/fld/confirm-frauds' - description: Sandbox server (testing environment) -tags: - - name: Confirmed Fraud Submission - description: Confirmed Fraud Submission - - name: Confirmed Fraud Management - description: Confirmed Fraud Management -paths: - /mastercard-frauds: - post: - tags: - - Confirmed Fraud Submission - operationId: submitMastercardFraud - description: >- - This endpoint allows the initiator to add a new fraud record using - minimal input parameters for Mastercard built transactions. To submit a - transaction as fraud, a match has to be found in the Mastercard - transaction data repository(Data Warehouse). - summary: >- - Add a new fraud record using minimal input parameters for Mastercard - built transactions. - x-mastercard-api-encrypted: true - requestBody: - $ref: '#/components/requestBodies/FraudMastercardRequest' - responses: - '201': - $ref: '#/components/responses/FraudAddition' - '202': - $ref: '#/components/responses/FraudAddAccepted' - '400': - $ref: '#/components/responses/BadRequestError' - '401': - $ref: '#/components/responses/UnauthorizedError' - '403': - $ref: '#/components/responses/ForbiddenError' - '404': - $ref: '#/components/responses/NotFoundError' - put: - tags: - - Confirmed Fraud Management - operationId: updateMastercardFraud - description: >- - This endpoint allows the initiator to change an existing fraud record - using minimal input parameters for Mastercard built transactions. The - initiator can modify both successful and rejected fraud transactions and - also modify transactions which are submitted via other channels such as - GFT, file upload, and online. - summary: >- - Change an existing fraud record using minimal input parameters for - Mastercard built transactions. - x-mastercard-api-encrypted: true - requestBody: - $ref: '#/components/requestBodies/FraudRequestChange' - responses: - '200': - $ref: '#/components/responses/FraudDataChanged' - '400': - $ref: '#/components/responses/BadRequestError' - '401': - $ref: '#/components/responses/UnauthorizedError' - '403': - $ref: '#/components/responses/ForbiddenError' - '404': - $ref: '#/components/responses/NotFoundError' - /issuer-frauds: - post: - tags: - - Confirmed Fraud Submission - operationId: submitIssuerFraud - description: >- - This endpoint allows the initiator to add a new fraud record using - complete input parameters for both Mastercard and Issuer built - transactions. The transaction will be looked up in the Mastercard - transaction data repository (Data Warehouse) and if a match is found, it - is submitted as a Mastercard built fraud record. If no match is found, - the transaction will be submitted as an Issuer built fraud record. - summary: >- - Add a new fraud record using complete input parameters for both - Mastercard and Issuer built transactions. - x-mastercard-api-encrypted: true - requestBody: - $ref: '#/components/requestBodies/FraudIssuerRequest' - responses: - '201': - $ref: '#/components/responses/FraudIssuerAddition' - '202': - $ref: '#/components/responses/FraudAddAccepted' - '400': - $ref: '#/components/responses/BadRequestError' - '401': - $ref: '#/components/responses/UnauthorizedError' - '403': - $ref: '#/components/responses/ForbiddenError' - '404': - $ref: '#/components/responses/NotFoundError' - put: - tags: - - Confirmed Fraud Management - operationId: updateIssuerFraud - description: >- - This endpoint allows the initiator to change an existing fraud record - using complete input parameters for both Mastercard and Issuer built - transactions. The initiator can modify both successful and rejected - fraud transactions and also modify transactions which are submitted via - other channels such as GFT, file upload, and online. - summary: >- - Change an existing fraud record using complete input parameters for both - Mastercard and Issuer built transactions. - x-mastercard-api-encrypted: true - requestBody: - $ref: '#/components/requestBodies/FraudIssuerRequestChange' - responses: - '200': - $ref: '#/components/responses/FraudIssuerDataChanged' - '400': - $ref: '#/components/responses/BadRequestError' - '401': - $ref: '#/components/responses/UnauthorizedError' - '403': - $ref: '#/components/responses/ForbiddenError' - '404': - $ref: '#/components/responses/NotFoundError' - /fraud-states: - put: - tags: - - Confirmed Fraud Management - operationId: fraudState - description: >- - This endpoint allows the initiator to delete an existing fraud record or - confirm a suspended fraud record for both Mastercard and Issuer built - transactions. Operation type FDD will delete existing fraud records from - FLD, irrespective of the fraud state i.e., success / rejected / - suspended. And operation type FDE will confirm an existing fraud record - which was suspended due to reasons such as potential duplicates, billing - variance, suspicious amounts, etc. - summary: >- - Delete an existing fraud record or confirm a suspended fraud record for - both Mastercard and Issuer built transactions. - requestBody: - $ref: '#/components/requestBodies/FraudStateRequest' - responses: - '200': - $ref: '#/components/responses/FraudStateChanged' - '400': - $ref: '#/components/responses/BadRequestError' - '401': - $ref: '#/components/responses/UnauthorizedError' - '403': - $ref: '#/components/responses/ForbiddenError' - '404': - $ref: '#/components/responses/NotFoundError' -components: - schemas: - APIDataElement: - required: - - refId - - timestamp - - icaNumber - type: object - properties: - refId: - description: >- - Unique identification generated by the transaction originator using - UUID logic to unambiguously link a request and response message. - type: string - minLength: 36 - maxLength: 36 - example: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: - type: string - description: >- - Timestamp of the request initiation by the originator in the format - 'YYYY-MM-DDThh:mm:ss:mmm+hh:mm'. The value of '+hh:mm' portion - should always be '-06:00' reflecting CST time. - minLength: 25 - maxLength: 25 - example: 2021-02-02T02:34:37.000Z - icaNumber: - description: >- - ICA number of the Issuer or Acquirer initiating the fraud submission - request. - type: string - minLength: 3 - maxLength: 7 - example: 1076 - MastercardFraud: - allOf: - - $ref: '#/components/schemas/APIDataElement' - - type: object - required: - - providerId - - transactionIdentifiers - - cardNumber - - transactionAmount - - transactionDate - - fraudPostedDate - - fraudTypeCode - - accountDeviceType - - cardInPossession - - avsResponseCode - - authResponseCode - properties: - providerId: - $ref: '#/components/schemas/SafeFraudProvider' - transactionIdentifiers: - type: "array" - items: - $ref: '#/components/schemas/TransactionIdentifier' - cardNumber: - description: >- - Cardholder account number used in the fraudulent transaction. - Card number to be verified through Luhn's algorithm. - type: string - minLength: 12 - maxLength: 19 - example: 5505135664572870000 - transactionAmount: - description: >- - Transaction amount at the merchant location (without any - decimals). - type: string - minLength: 1 - maxLength: 12 - example: 10350 - transactionDate: - description: >- - Local date at the merchant location when the transaction - occurred. Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210115 - fraudPostedDate: - description: >- - Date on which the fraud is posted in FLD by the originator. - Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210120 - fraudTypeCode: - description: >- - Code identifying the reason the originator submitted the - transaction as fraud in FLD. Please refer to [Table - 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 4 - fraudSubTypeCode: - description: >- - Code to further identify the reason that the originator - submitted the transaction as a fraud in FLD. This attribute is - mandatory for the Issuer but optional for the Acquirer. Please - refer to [Table - 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: U - accountDeviceType: - description: >- - Indicates if the account uses a magnetic stripe, chip, pin, - contactless or any combination thereof. Please refer to [Table - 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - cardholderReportedDate: - description: >- - Date on which the cardholder had reported the fraud. Format is - 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210118 - cardInPossession: - description: >- - Flag to indicate if the card holder was in possession of the - card at the time the fraud occurred. Possible values are 'Y', - 'N' and 'U' (for Unknown). - type: string - minLength: 1 - maxLength: 1 - example: 'N' - avsResponseCode: - description: >- - The Address Verification Service response code in the - Authorization Request Response. Please refer to [Table - 4](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-4-avs-response-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: U - authResponseCode: - description: >- - Indicates the result of the authorization request. Please refer - to [Table - 5](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-5-authorization-response-codes) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 1 - memo: - description: >- - Brief description by the originator providing some comment - supporting the action. - type: string - minLength: 1 - maxLength: 1000 - example: This is a sample FDA minimal request. - IssuerFraud: - allOf: - - $ref: '#/components/schemas/APIDataElement' - - type: object - required: - - acquirerId - - transactionIdentifiers - - cardNumber - - fraudTypeCode - - fraudSubTypeCode - - cardProductCode - - transactionDate - - settlementDate - - fraudPostedDate - - transactionAmount - - transactionCurrencyCode - - billingAmount - - billingCurrencyCode - - merchantId - - merchantName - - merchantCity - - merchantCountryCode - - merchantPostalCode - - merchantCategoryCode - - terminalAttendanceIndicator - - terminalId - - terminalOperatingEnvironment - - cardholderPresenceIndicator - - cardPresenceIndicator - - cardInPossession - - catLevelIndicator - - terminalCapabilityIndicator - - posEntryMode - - cvcInvalidIndicator - - avsResponseCode - - authResponseCode - - accountDeviceType - properties: - acquirerId: - description: Acquirer identification number (ICA number) for the transaction. - type: string - minLength: 3 - maxLength: 7 - example: 5450 - transactionIdentifiers: - type: "array" - items: - $ref: '#/components/schemas/TransactionIdentifier' - cardNumber: - description: >- - Cardholder account number used in the fraudulent transaction. - Card number to be verified through Luhn's algorithm. - type: string - minLength: 12 - maxLength: 19 - example: 5505135664572870000 - fraudTypeCode: - description: >- - Code identifying the reason the originator submitted the - transaction as fraud in FLD. Please refer to [Table - 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 4 - fraudSubTypeCode: - description: >- - Code to further identify the reason that the originator - submitted the transaction as fraud in FLD. Please refer to - [Table - 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: U - cardProductCode: - description: >- - Value identifying the type of card used in the transaction. - Please refer to [Card Type Codes - table](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-2/) - for possible values. - type: string - minLength: 3 - maxLength: 3 - example: MSI - transactionDate: - description: >- - Local date at the merchant location when the transaction - occurred. Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210115 - settlementDate: - description: Settlement date of transaction reported. Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210116 - fraudPostedDate: - description: >- - Date on which the fraud is posted in FLD by the originator. - Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210120 - cardholderReportedDate: - description: >- - Date on which the cardholder had reported the fraud. Format is - 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210118 - transactionAmount: - description: >- - Transaction amount at the merchant location (without any - decimals). - type: string - minLength: 1 - maxLength: 12 - example: 10350 - transactionCurrencyCode: - description: >- - Code defining the currency used for the transaction amount. The - code should be part of the numeric ISO Standard Currency Codes - list. - type: string - minLength: 3 - maxLength: 3 - example: 826 - billingAmount: - description: >- - Amount appearing on the cardholder statement in the cardholder's - billing currency (without any decimals). - type: string - minLength: 1 - maxLength: 12 - example: 10350 - billingCurrencyCode: - description: >- - Code defining the currency used for the billing amount. The code - should be part of the numeric ISO Standard Currency Codes list. - type: string - minLength: 3 - maxLength: 3 - example: 826 - merchantId: - description: >- - Card acceptor / merchant's unique identification number, - assigned by the Acquirer. - type: string - minLength: 1 - maxLength: 15 - example: A42E51982100100 - merchantName: - description: Name of the card acceptor. - type: string - minLength: 1 - maxLength: 22 - example: BANKNEWPORT - merchantCity: - description: City in which the merchant is located. - type: string - minLength: 1 - maxLength: 13 - example: PHOENIX - merchantStateProvinceCode: - description: >- - If the card acceptor/merchant is in the US, the state in which - it is located. - type: string - minLength: 2 - maxLength: 3 - example: AZ - merchantCountryCode: - description: Indicates the country in which the merchant is located. - type: string - minLength: 3 - maxLength: 3 - example: USA - merchantPostalCode: - description: Postal code at the merchant location. - type: string - minLength: 1 - maxLength: 10 - example: 85001 - merchantCategoryCode: - description: Card acceptor business code / merchant category code. - type: string - minLength: 4 - maxLength: 4 - example: 6011 - terminalAttendanceIndicator: - description: >- - Indicates if the card acceptor was attending the terminal at the - time of transaction. Please refer to [Table - 12](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-12-terminal-attendance-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - terminalId: - description: >- - Unique code identifying a terminal at the card acceptor - (merchant) location. - type: string - minLength: 1 - maxLength: 8 - example: 5055D305 - terminalOperatingEnvironment: - description: >- - Indicates whether the card acceptor is attending the terminal - and the location of the terminal. Please refer to [Table - 13](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-13-terminal-operating-environment) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 4 - cardholderPresenceIndicator: - description: >- - Indicates whether the cardholder is present at the point of - service and explains the condition if the cardholder is not - present. Please refer to [Table - 6](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-6-cardholder-presence-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 5 - cardPresenceIndicator: - description: >- - Indicates whether the card was present at the point of service. - Please refer to [Table - 7](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-7-card-present-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - cardInPossession: - description: >- - Flag to indicate if the card holder was in possession of the - card at the time the fraud occurred. Possible values are 'Y', - 'N' and 'U' (for Unknown). - type: string - minLength: 1 - maxLength: 1 - example: 'N' - catLevelIndicator: - description: >- - Indicates whether the cardholder activated the terminal with the - use of the card and the CAT security level. Please refer to - [Table - 9](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-9-cardholder-activated-terminal-level-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - terminalCapabilityIndicator: - description: >- - Indicates the terminal capability for transferring the data on - the card into the terminal. Please refer to [Table - 14](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-14-terminal-input-capability-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 5 - electronicCommerceIndicator: - description: >- - Indicates the security protocol and authentication of the - transaction. Mandatory if CAT Level = 6. Please refer to [Table - 10](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-10-electronic-commerce-security-level-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 2 - example: 24 - posEntryMode: - description: >- - Indicates how the PAN was entered at the terminal. Please refer - to [Table - 8](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-8-pos-entry-mode) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 5 - cvcInvalidIndicator: - description: >- - Indicates whether the CVC was valid when authorization was - attempted. Please refer to [Table - 15](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-15-card-validation-code-cvc-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: M - avsResponseCode: - description: >- - The Address Verification Service response code in the - Authorization Request Response. Please refer to [Table - 4](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-4-avs-response-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: U - authResponseCode: - description: >- - Indicates the result of the authorization request. Please refer - to [Table - 5](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-5-authorization-response-codes) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 1 - secureCode: - description: >- - Indicates the type of security processing used for the PIN data. - Mandatory if ecommerce indicator = 21 or 22. Please refer to - [Table - 11](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-11-secure-code) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 9 - accountDeviceType: - description: >- - Indicates if the account uses a magnetic stripe, chip, pin, - contactless or any combination thereof. Please refer to [Table - 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - acquirerRoutingTransitNumber: - description: >- - The identification number of the merchant's acquirer. Applicable - for a single message transaction. Mandatory if an acquirer ICA - value is '9999999'. - type: string - minLength: 10 - maxLength: 10 - example: 1790018674 - issuerRoutingTransitNumber: - description: >- - The identification number of the issuing institution. Applicable - for a single message transaction. Mandatory if an issuer ICA - value is '9999999'. - type: string - minLength: 10 - maxLength: 10 - example: 1231380159 - memo: - description: >- - Brief description by the originator providing some comment - supporting the action. - type: string - minLength: 1 - maxLength: 1000 - example: This is a sample FDA complete request. - UpdatedMastercardFraud: - allOf: - - $ref: '#/components/schemas/APIDataElement' - - type: object - required: - - providerId - - auditControlNumber - properties: - providerId: - $ref: '#/components/schemas/SafeFraudProvider' - auditControlNumber: - description: >- - Unique number generated by FLD application and provided in the - response message for a successful fraud record submission (FDA - event). This is used as a reference to subsequently modify, - delete or convert a suspended to a confirmed fraud record. - type: string - minLength: 15 - maxLength: 15 - example: 418142102142002 - fraudPostedDate: - description: >- - Date on which the fraud is posted in FLD by the originator. - Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210120 - fraudTypeCode: - description: >- - Code identifying the reason the originator submitted the - transaction as fraud in FLD. Please refer to [Table - 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 4 - fraudSubTypeCode: - description: >- - Code to further identify the reason why the originator submitted - the transaction as fraud in FLD. This attribute is mandatory for - Issuer but optional for Acquirer. Please refer to [Table - 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: U - accountDeviceType: - description: >- - Indicates if the account uses a magnetic stripe, chip, pin, - contactless or any combination thereof. Please refer to [Table - 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - cardholderReportedDate: - description: >- - Date on which the cardholder had reported the fraud. Format is - 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210118 - cardInPossession: - description: >- - Flag to indicate if the card holder was in possession of the - card at the time the fraud occurred. Possible values are 'Y', - 'N' and 'U' (for Unknown). - type: string - minLength: 1 - maxLength: 1 - example: 'N' - memo: - description: >- - Brief description by the originator providing some comment - supporting the action. - type: string - minLength: 1 - maxLength: 1000 - example: This is a sample FDC minimal request. - UpdatedIssuerFraud: - allOf: - - $ref: '#/components/schemas/APIDataElement' - - type: object - required: - - auditControlNumber - properties: - acquirerId: - description: Acquirer identification number (ICA number) for the transaction. - type: string - minLength: 3 - maxLength: 7 - example: 5450 - auditControlNumber: - description: >- - Unique number generated by FLD application and provided in the - response message for a successful fraud record submission (FDA - event). This is used as a reference to subsequently modify, - delete or convert a suspended to a confirmed fraud record. - type: string - minLength: 15 - maxLength: 15 - example: 418142102142002 - cardNumber: - description: >- - Cardholder account number used in the fraudulent transaction. - Card number to be verified through Luhn's algorithm. - type: string - minLength: 12 - maxLength: 19 - example: 5505135664572870000 - fraudTypeCode: - description: >- - Code identifying the reason the originator submitted the - transaction as fraud in FLD. Please refer to [Table - 1](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-1-fraud-type-codes) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 4 - fraudSubTypeCode: - description: >- - Code to further identify the reason that the originator - submitted the transaction as fraud in FLD. Please refer to - [Table - 2](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-2-fraud-sub-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: U - cardProductCode: - description: >- - Value identifying the type of card used in the transaction. - Please refer to [Card Type Codes - table](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-2/) - for possible values. - type: string - minLength: 3 - maxLength: 3 - example: MSI - transactionDate: - description: >- - Local date at the merchant location when the transaction - occurred. Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210115 - settlementDate: - description: Settlement date of transaction reported. Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210116 - fraudPostedDate: - description: >- - Date on which the fraud is posted in FLD by the originator. - Format is 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210120 - cardholderReportedDate: - description: >- - Date on which the cardholder had reported the fraud. Format is - 'YYYYMMDD'. - type: string - minLength: 8 - maxLength: 8 - pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$' - example: 20210118 - transactionAmount: - description: >- - Transaction amount at the merchant location (without any - decimals). - type: string - minLength: 1 - maxLength: 12 - example: 10350 - transactionCurrencyCode: - description: >- - Code defining the currency used for the transaction amount. The - code should be part of the numeric ISO Standard Currency Codes - list. - type: string - minLength: 3 - maxLength: 3 - example: 826 - billingAmount: - description: >- - Amount appearing on the cardholder statement in the cardholder's - billing currency (without any decimals). - type: string - minLength: 1 - maxLength: 12 - example: 10350 - billingCurrencyCode: - description: >- - Code defining the currency used for the billing amount. The code - should be part of the numeric ISO Standard Currency Codes list. - type: string - minLength: 3 - maxLength: 3 - example: 826 - merchantId: - description: >- - Card acceptor / merchant's unique identification number, - assigned by the Acquirer. - type: string - minLength: 1 - maxLength: 15 - example: A42E51982100100 - merchantName: - description: Name of the card acceptor. - type: string - minLength: 1 - maxLength: 22 - example: BANKNEWPORT - merchantCity: - description: City in which the merchant is located. - type: string - minLength: 1 - maxLength: 13 - example: PHOENIX - merchantStateProvinceCode: - description: >- - If the card acceptor / merchant is in the US, the state in which - it is located. - type: string - minLength: 2 - maxLength: 3 - example: AZ - merchantCountryCode: - description: Indicates the country in which the merchant is located. - type: string - minLength: 3 - maxLength: 3 - example: USA - merchantPostalCode: - description: Postal code at the merchant location. - type: string - minLength: 1 - maxLength: 10 - example: 85001 - merchantCategoryCode: - description: Card acceptor business code / merchant category code. - type: string - minLength: 4 - maxLength: 4 - example: 6011 - terminalAttendanceIndicator: - description: >- - Indicates if the card acceptor was attending the terminal at the - time of transaction. Please refer to [Table - 12](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-12-terminal-attendance-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - terminalId: - description: >- - Unique code identifying a terminal at the card acceptor - (merchant) location. - type: string - minLength: 1 - maxLength: 8 - example: 5055D305 - terminalOperatingEnvironment: - description: >- - Indicates whether the card acceptor is attending the terminal - and the location of the terminal. Please refer to [Table - 13](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-13-terminal-operating-environment) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 4 - cardholderPresenceIndicator: - description: >- - Indicates whether the cardholder is present at the point of - service and explains the condition if the cardholder is not - present. Please refer to [Table - 6](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-6-cardholder-presence-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 5 - cardPresenceIndicator: - description: >- - Indicates whether the card was present at the point of service. - Please refer to [Table - 7](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-7-card-present-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - cardInPossession: - description: >- - Flag to indicate if the card holder was in possession of the - card at the time the fraud occurred. Possible values are 'Y', - 'N' and 'U' (for Unknown). - type: string - minLength: 1 - maxLength: 1 - example: 'N' - catLevelIndicator: - description: >- - Indicates whether the cardholder activated the terminal with the - use of the card and the CAT security level. Please refer to - [Table - 9](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-9-cardholder-activated-terminal-level-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - terminalCapabilityIndicator: - description: >- - Indicates the terminal capability for transferring the data on - the card into the terminal. Please refer to [Table - 14](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-14-terminal-input-capability-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 5 - electronicCommerceIndicator: - description: >- - Indicates the security protocol and authentication of the - transaction. Mandatory if CAT Level = 6. Please refer to [Table - 10](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-10-electronic-commerce-security-level-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 2 - example: 24 - posEntryMode: - description: >- - Indicates how the PAN was entered at the terminal. Please refer - to [Table - 8](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-8-pos-entry-mode) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 5 - cvcInvalidIndicator: - description: >- - Indicates whether the CVC was valid when authorization was - attempted. Please refer to [Table - 15](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-15-card-validation-code-cvc-indicator) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: M - avsResponseCode: - description: >- - The Address Verification Service response code in the - Authorization Request Response. Please refer to [Table - 4](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-4-avs-response-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: U - authResponseCode: - description: >- - Indicates the result of the authorization request. Please refer - to [Table - 5](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-5-authorization-response-codes) - for possible values. - type: string - minLength: 2 - maxLength: 2 - example: 1 - secureCode: - description: >- - Indicates the type of security processing used for the PIN data. - Mandatory if ecommerce indicator = 21 or 22. Please refer to - [Table - 11](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-11-secure-code) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 9 - accountDeviceType: - description: >- - Indicates if the account uses a magnetic stripe, chip, pin, - contactless or any combination thereof. Please refer to [Table - 3](https://developer.mastercard.com/fld-fraud-submission/documentation/parameters/annexure-1/#table-3-account-device-type-codes) - for possible values. - type: string - minLength: 1 - maxLength: 1 - example: 1 - memo: - description: >- - Brief description by the originator providing some comment - supporting the action. - type: string - minLength: 1 - maxLength: 1000 - example: This is a sample FDC complete request. - FraudDeleteAndConfirm: - allOf: - - $ref: '#/components/schemas/APIDataElement' - - type: object - required: - - providerId - - auditControlNumber - - operationType - properties: - providerId: - $ref: '#/components/schemas/SafeFraudProvider' - operationType: - $ref: '#/components/schemas/FraudState' - auditControlNumber: - description: >- - Unique number generated by FLD application and provided in the - response message for a successful fraud record submission (FDA - event). This is used as a reference to subsequently modify, - delete or convert a suspended to a confirmed fraud record. - type: string - minLength: 15 - maxLength: 15 - example: 418142102142002 - memo: - description: >- - Brief description by the originator providing some comment - supporting the action. - type: string - minLength: 1 - maxLength: 1000 - example: This is a sample FDD / FDE request. - Fraud: - allOf: - - $ref: '#/components/schemas/APIDataElement' - - type: object - required: - - responseCode - - responseMessage - properties: - responseCode: - description: >- - Response code indicating success or failure of the transaction - at an API level. Errors at a record level will be handled - through 'errorDetails' element associated with each record. - type: string - minLength: 3 - maxLength: 3 - example: 0 - responseMessage: - description: >- - Transaction response description corresponding to the response - code. - type: string - minLength: 1 - maxLength: 100 - example: Success - icaNumber: - description: >- - ICA number of the originator provided in the request API which - is echoed back. This attribute will be absent if the request is - not processed by FLD application. - type: string - minLength: 3 - maxLength: 7 - example: 1076 - auditControlNumber: - description: >- - Unique number generated by FLD application and provided in the - response message for a successful fraud record submission ('FDA' - event). This is used as a reference in the request API to - subsequently modify, delete or convert a suspended to a - confirmed fraud record and is echoed back. This attribute will - be absent if the request is not processed by FLD application. - type: string - minLength: 15 - maxLength: 15 - example: 418142102142002 - matchLevelIndicator: - description: >- - Indicates if it is a Mastercard-built or Issuer-built record. - Possible values are 'M' for Mastercard built record and 'I' for - Issuer built record. This attribute will be absent if the - request is not processed by FLD application. - type: string - minLength: 1 - maxLength: 1 - example: M - financialTransactionIndicator: - description: >- - Indicates if the fraud record is being submitted against a - financial transaction (having a clearing record) or a declined - auth transaction (without a clearing record). Possible values - are 'APPROVED' for financial transactions (having a clearing - record) and 'DECLINED' for declined auth transactions (without a - clearing record). This attribute will be absent if the request - is not processed by FLD application. - type: string - minLength: 1 - maxLength: 20 - example: DECLINED - authorizationResponse: - description: >- - Provides the 'Auth Response Code' and 'Auth Response Code - Description' combination if 'Financial Transaction Indicator' - value is 'DECLINED'. This attribute will be absent for all other - scenarios. - type: string - minLength: 1 - maxLength: 200 - example: 05 - Do not honor - previousStatus: - description: >- - Previous status of the transaction in terms of an FDC, FDD and - FDE event. - type: string - minLength: 1 - maxLength: 50 - example: CONFIRMED-REJECTED - currentStatus: - description: >- - Current status of the transaction in terms of an FDA, FDC, FDD - and FDE event. - type: string - minLength: 1 - maxLength: 50 - example: CONFIRMED-SUCCESS - reasonCodes: - description: >- - Array list containing the combination of error reason codes and - their corresponding description (can provide up to 5 errors for - a record). It will be absent if the request is processed by FLD - application successfully. - type: array - items: - $ref: '#/components/schemas/ErrorWrapper' - SafeFraudProvider: - description: >- - Indicates the originator of the request. Value 10 is for Issuer and 20 - for Acquirer. - type: integer - enum: - - 10 - - 20 - CfcIndicator: - description: >- - Flag to indicate a single or dual message transaction. Possible values - are - - 'ARN' for Acquirer Reference Number - 'BRN' for Banknet - Reference Number - 'TRC' for Trace ID - 'SER' for Serial ID - type: string - enum: - - ARN - - BRN - - TRC - - SER - FraudState: - description: >- - Indicates the type of operation to be performed for the given audit - control number. The value FDD is to indicate delete operation and FDE is - to indicate confirm operation. - type: string - minLength: 1 - maxLength: 50 - enum: - - FDD - - FDE - TransactionIdentifier: - description: Transaction Identifier containing CFC Indicator the key and value pair. - type: object - properties: - cfcKey: - $ref: '#/components/schemas/CfcIndicator' - cfcValue: - description: >- - Actual value depending on the 'CFC Indicator' subject to the - following validations 1. For ARN, Min Length is 23, Max Length is - 23 and Data Type is N. 2. For BRN, Min Length is 6, Max Length is - 9 and Data Type is AN. 3. For TRC, Min Length is 6, Max Length is - 6 and Data Type is N. 4. For SER, Min Length is 9, Max Length is 9 - and Data Type is N. - type: string - minLength: 6 - maxLength: 23 - example: 0111111111999999999999 - Error: - title: Error - required: - - Description - - ReasonCode - - Recoverable - - Source - type: object - properties: - Source: - type: string - description: The application or component that generated this error. - minLength: 3 - maxLength: 50 - example: FLD - ReasonCode: - type: string - description: >- - Reason code is a unique constant identifying the error case - encountered during request processing. - minLength: 5 - maxLength: 100 - example: VALIDATION_ERROR - Description: - type: string - description: Human-readable short description of the reasonCode - minLength: 10 - maxLength: 250 - example: Reference Id is not provided - Details: - type: string - description: >- - Optional detailed description provides information about data - received and calculated during request processing. This helps the - user to diagnose errors. - minLength: 0 - maxLength: 1000 - example: This is mandatory field while requesting for fraud submission. - Recoverable: - type: boolean - description: >- - Recoverable flag indicates whether this error is always returned for - this request, or retrying could change the outcome. For example, - 'true' or 'false'. - example: false - Errors: - title: Errors - required: - - Error - type: object - properties: - Error: - type: array - description: Errors array wrapped in an error object - items: - $ref: '#/components/schemas/Error' - ErrorWrapper: - title: ErrorWrapper - required: - - Errors - type: object - properties: - Errors: - $ref: '#/components/schemas/Errors' - requestBodies: - FraudMastercardRequest: - description: >- - Add a new fraud record using minimal input parameters for Mastercard - built transactions. This endpoint uses [payload - encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). - Please refer to the [reference - application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) - page for implementation details. - content: - application/json: - schema: - $ref: '#/components/schemas/MastercardFraud' - examples: - MastercardFraudExample: - $ref: '#/components/examples/MastercardFraudExample' - FraudIssuerRequest: - description: >- - Add a new fraud record using complete input parameters for both - Mastercard and Issuer built transactions. This endpoint uses [payload - encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). - Please refer to the [reference - application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) - page for implementation details. - content: - application/json: - schema: - $ref: '#/components/schemas/IssuerFraud' - examples: - IssuerFraudExample: - $ref: '#/components/examples/IssuerFraudExample' - FraudRequestChange: - description: >- - Change an existing fraud record using minimal input parameters for - Mastercard built transactions. This endpoint uses [ payload - encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). - Please refer to the [reference - application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) - page for implementation details. - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatedMastercardFraud' - examples: - FraudChangeExample: - $ref: '#/components/examples/FraudChangeExample' - FraudIssuerRequestChange: - description: >- - Change an existing fraud record using complete input parameters for both - Mastercard and Issuer built transactions. [Mastercard payload - encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). - Please refer to the [reference - application](https://developer.mastercard.com/fld-fraud-submission/documentation/api-reference/) - page for implementation details. - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatedIssuerFraud' - examples: - FraudIssuerChangeExample: - $ref: '#/components/examples/FraudIssuerChangeExample' - FraudStateRequest: - description: >- - Delete an existing fraud record or confirm a suspended fraud record for - both Mastercard and Issuer built transactions. - content: - application/json: - schema: - $ref: '#/components/schemas/FraudDeleteAndConfirm' - examples: - FraudConfirmExample: - $ref: '#/components/examples/FraudConfirmExample' - FraudDeleteExample: - $ref: '#/components/examples/FraudDeleteExample' - responses: - FraudAddition: - description: Fraud submitted successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/Fraud' - examples: - 201FraudAdditonExample: - $ref: '#/components/examples/201FraudAdditionExample' - 201FraudAdditionRejectExample: - $ref: '#/components/examples/201FraudAdditionRejectExample' - 201FraudAdditionSuspendExample: - $ref: '#/components/examples/201FraudAdditionSuspendExample' - FraudIssuerAddition: - description: Fraud submitted successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/Fraud' - examples: - 201FraudAdditonExample: - $ref: '#/components/examples/201FraudIssuerAdditionExample' - 201FraudAdditionRejectExample: - $ref: '#/components/examples/201FraudAdditionRejectExample' - 201FraudAdditionSuspendExample: - $ref: '#/components/examples/201FraudIssuerAdditionSuspendExample' - FraudAddAccepted: - description: Fraud submission accepted successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/Fraud' - examples: - 202FraudAddAcceptedExample: - $ref: '#/components/examples/202FraudAddAcceptedExample' - FraudDataChanged: - description: Fraud data changed successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/Fraud' - examples: - 200FraudDataChanged: - $ref: '#/components/examples/200FraudDataChanged' - 200FraudDataChangedError: - $ref: '#/components/examples/200FraudDataChangedError' - FraudIssuerDataChanged: - description: Fraud data changed successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/Fraud' - examples: - 200FraudDataChanged: - $ref: '#/components/examples/200FraudIssuerDataChanged' - 200FraudDataChangedError: - $ref: '#/components/examples/200FraudDataChangedError' - FraudStateChanged: - description: Fraud data changed successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/Fraud' - examples: - 200FraudDataDeleted: - $ref: '#/components/examples/200FraudDataDeleted' - 200FraudDataDeleteIcaNotAuthorize: - $ref: '#/components/examples/200FraudDataDeleteIcaNotAuthorize' - 200FraudDataConfirmed: - $ref: '#/components/examples/200FraudDataConfirmed' - 200FraudDataConfirmedTxnDateOlder: - $ref: '#/components/examples/200FraudDataConfirmedTxnDateOlder' - NotFoundError: - description: Request did not match an existing resource. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorWrapper' - examples: - NotFoundExample: - $ref: '#/components/examples/NotFoundExample' - BadRequestError: - description: Something was wrong with the request. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorWrapper' - examples: - BadRequestRefIdMissing: - $ref: '#/components/examples/BadRequestRefIdMissing' - UnauthorizedError: - description: Unauthorized request. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorWrapper' - examples: - UnauthorizedExample: - $ref: '#/components/examples/UnauthorizedExample' - ForbiddenError: - description: Consent not given. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorWrapper' - examples: - ForbiddenExample: - $ref: '#/components/examples/ForbiddenExample' - examples: - MastercardFraudExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:37-06:00' - icaNumber: '1076' - providerId: '10' - transactionIdentifiers: - - cfcKey: ARN - cfcValue: 0111111111999999999999 - - cfcKey: BRN - cfcValue: 999RRR - cardNumber: '5505135664572870008' - transactionAmount: '5505' - transactionDate: '20200713' - fraudPostedDate: 20210316" - fraudTypeCode: '01' - fraudSubTypeCode: 'N' - accountDeviceType: '1' - cardholderReportedDate: '20210314' - cardInPossession: 'Y' - avsResponseCode: U - authResponseCode: '00' - memo: This is a sample FDA minimal request. - IssuerFraudExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:37-06:00' - icaNumber: '1076' - transactionIdentifiers: - - cfcKey: ARN - cfcValue: 01111114320000000032087 - - cfcKey: BRN - cfcValue: 543REF - cardNumber: '5587450000000008074' - acquirerId: '2742' - fraudTypeCode: '01' - fraudSubTypeCode: U - cardProductCode: CIR - transactionDate: '20200215' - settlementDate: '20200216' - fraudPostedDate: '20210316' - cardholderReportedDate: '20210314' - transactionAmount: '56823' - transactionCurrencyCode: '840' - billingAmount: '56823' - billingCurrencyCode: '840' - merchantId: '6698696' - merchantName: BANKNEWPORT - merchantCity: Phoenix - merchantStateProvinceCode: AZ - merchantCountryCode: USA - merchantPostalCode: '85001' - merchantCategoryCode: '6011' - terminalAttendanceIndicator: '0' - terminalId: 5055D305 - terminalOperatingEnvironment: '1' - cardholderPresenceIndicator: '0' - cardPresenceIndicator: '1' - cardInPossession: 'Y' - catLevelIndicator: '2' - terminalCapabilityIndicator: '0' - posEntryMode: '00' - cvcInvalidIndicator: M - avsResponseCode: U - authResponseCode: '00' - secureCode: '9' - accountDeviceType: A - memo: This is a sample FDA complete request. - FraudChangeExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:37-06:00' - icaNumber: '1076' - providerId: '10' - auditControlNumber: '123111111000025' - fraudPostedDate: 20210316" - fraudTypeCode: '01' - fraudSubTypeCode: 'N' - accountDeviceType: '1' - cardholderReportedDate: '20210314' - cardInPossession: 'Y' - memo: This is a sample FDC minimal request. - FraudIssuerChangeExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:37-06:00' - icaNumber: '1076' - auditControlNumber: '123111111000025' - acquirerId: '2742' - cardNumber: '5587450000000008074' - fraudTypeCode: '01' - fraudSubTypeCode: U - cardProductCode: CIR - transactionDate: '20200215' - settlementDate: '20200216' - fraudPostedDate: '20210316' - cardholderReportedDate: '20210314' - transactionAmount: '56823' - transactionCurrencyCode: '840' - billingAmount: '56823' - billingCurrencyCode: '840' - merchantId: '6698696' - merchantName: BANKNEWPORT - merchantCity: Phoenix - merchantStateProvinceCode: AZ - merchantCountryCode: USA - merchantPostalCode: '85001' - merchantCategoryCode: '6011' - terminalAttendanceIndicator: '0' - terminalId: 5055D305 - terminalOperatingEnvironment: '1' - cardholderPresenceIndicator: '0' - cardPresenceIndicator: '1' - cardInPossession: 'Y' - catLevelIndicator: '2' - terminalCapabilityIndicator: '0' - posEntryMode: '00' - cvcInvalidIndicator: M - avsResponseCode: U - authResponseCode: '00' - secureCode: '9' - accountDeviceType: A - memo: This is a sample FDC complete request. - FraudDeleteExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:37-06:00' - icaNumber: '1076' - providerId: '10' - auditControlNumber: '123111111000025' - operationType: FDD - memo: This is a sample FDD request. - FraudConfirmExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:37-06:00' - icaNumber: '1076' - providerId: '10' - auditControlNumber: '123111111000025' - operationType: FDE - memo: This is a sample FDE request. - 201FraudAdditionExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '000' - responseMessage: Success - icaNumber: '1076' - auditControlNumber: '123111111000025' - currentStatus: CONFIRMED-SUCCESS - matchLevelIndicator: M - financialTransactionIndicator: DECLINED - authorizationResponse: 05 - Do not honor - 201FraudIssuerAdditionExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '000' - responseMessage: Success - icaNumber: '1076' - auditControlNumber: '123111111000025' - currentStatus: CONFIRMED-SUCCESS - matchLevelIndicator: I - financialTransactionIndicator: APPROVED - 201FraudAdditionRejectExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '100' - responseMessage: Failure - errorDetails: - Errors: - Error: - - ReasonCode: '60004' - Description: >- - cardNumber attribute value length not in range. Minimum - Length:12 and Maximum Length: 19. - 201FraudAdditionSuspendExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '201' - responseMessage: Failure - icaNumber: '1076' - auditControlNumber: '123111111000025' - matchLevelIndicator: M - currentStatus: CONFIRMED-SUSPENDED - errorDetails: - Errors: - Error: - - ReasonCode: '30100' - Description: 'Potential Duplicate Data Found, Record is suspended.' - 201FraudIssuerAdditionSuspendExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '201' - responseMessage: Failure - icaNumber: '1076' - auditControlNumber: '123111111000025' - matchLevelIndicator: I - currentStatus: CONFIRMED-SUSPENDED - errorDetails: - Errors: - Error: - - ReasonCode: '30100' - Description: 'Potential Duplicate Data Found, Record is suspended.' - 202FraudAddAcceptedExample: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '001' - responseMessage: Pending - icaNumber: '1076' - 200FraudDataChanged: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '000' - responseMessage: Success - icaNumber: '1076' - auditControlNumber: '123111111000025' - previousStatus: CONFIRMED-REJECTED - currentStatus: CONFIRMED-SUCCESS - matchLevelIndicator: M - financialTransactionIndicator: DECLINED - authorizationResponse: 05 - Do not honor - 200FraudIssuerDataChanged: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '000' - responseMessage: Success - icaNumber: '1076' - auditControlNumber: '123111111000025' - previousStatus: CONFIRMED-REJECTED - currentStatus: CONFIRMED-SUCCESS - matchLevelIndicator: I - financialTransactionIndicator: APPROVED - 200FraudDataChangedError: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '100' - responseMessage: Failure - errorDetails: - Errors: - Error: - - ReasonCode: '60003' - Description: icaNumber incorrect datatype of attribute value. - 200FraudDataDeleted: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '000' - responseMessage: Success - icaNumber: '1076' - auditControlNumber: '123111111000025' - previousStatus: CONFIRMED-SUCCESS - currentStatus: CONFIRMED-DELETED - 200FraudDataDeleteIcaNotAuthorize: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '200' - responseMessage: Failure - errorDetails: - Errors: - Error: - - ReasonCode: '80207' - Description: The user is not licensed for this particular BIN range. - 200FraudDataConfirmed: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '000' - responseMessage: Success - icaNumber: '1076' - auditControlNumber: '123111111000025' - previousStatus: CONFIRMED-SUSPENDED - currentStatus: CONFIRMED-SUCCESS - 200FraudDataConfirmedTxnDateOlder: - value: - refId: ecb2d942-eabd-42b6-87fd-69c19692bdc6 - timestamp: '2021-03-16T20:34:40-06:00' - responseCode: '200' - responseMessage: Failure - errorDetails: - Errors: - Error: - - ReasonCode: '21508' - Description: Transaction date is older than 18 months. - NotFoundExample: - value: - Errors: - Error: - - Source: fld - ReasonCode: REQUEST_NOT_FOUND - Description: Requested URL/Resource Not Found - Recoverable: false - BadRequestRefIdMissing: - value: - Errors: - Error: - - Source: fld - ReasonCode: VALIDATION_ERROR - Description: Reference Id is not provided - Recoverable: false - ForbiddenExample: - value: - Errors: - Error: - - Source: fld - ReasonCode: CONSENT_NOT_GIVEN - Description: User Consent Not Given - Recoverable: false - UnauthorizedExample: - value: - Errors: - Error: - - Source: fld - ReasonCode: UNAUTHORIZED_REQUEST - Description: Unauthorized request - Recoverable: false \ No newline at end of file diff --git a/src/test/java/com/mastercard/fld/BaseClassUtilTest.java b/src/test/java/com/mastercard/fld/BaseClassUtilTest.java deleted file mode 100644 index 8e02122..0000000 --- a/src/test/java/com/mastercard/fld/BaseClassUtilTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.mastercard.fld; - - -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; - -public class BaseClassUtilTest { - - private static final String BASE_URL = "mastercard.fld.api.url"; - - @Test - public void testGetClient() { - ApiClient client = BaseClassUtil.getClient(); - assertNotNull(client); - } - - @Test - public void testLoadProperties() { - BaseClassUtil.loadProperties(); - assertNotNull(BASE_URL); - } - - @Test - public void testGetProperty() { - String returnurl = BaseClassUtil.getProperty(BASE_URL); - assertNotNull(BASE_URL); - } - - @Test - public void testSetUpEnv() { - BaseClassUtil.setUpEnv(); - assertNotNull(BASE_URL); - } - - @Test - public void testSetUpEncryptionEnv() throws EncryptionException { - BaseClassUtil.setUpEncryptionEnv(); - assertNotNull(BASE_URL); - } - - @Test - public void testGetCallback() throws EncryptionException { - ApiCallback call = BaseClassUtil.getCallback(); - assertNotNull(call); - } - -} diff --git a/src/test/java/com/mastercard/fld/api/manage/DeleteFraudTest.java b/src/test/java/com/mastercard/fld/api/manage/DeleteFraudTest.java deleted file mode 100644 index 8ea13e2..0000000 --- a/src/test/java/com/mastercard/fld/api/manage/DeleteFraudTest.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.mastercard.fld.api.manage; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; - -import java.io.IOException; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.FraudDeleteAndConfirm; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.MediaType; -import okhttp3.Protocol; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -@RunWith(MockitoJUnitRunner.class) -public class DeleteFraudTest { - - @InjectMocks - @Spy - DeleteFraud deleteFraudObj; - - @Mock - RequestHelper helper; - - @Mock - ConfirmedFraudManagementApi fraudApi; - - @Mock - ApiClient apiclient; - - @Mock - ApiCallback callback; - - @Mock - Call call; - - FraudDeleteAndConfirm request; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - request = deleteFraudObj.createRequest(); - } - - @Test - public void deleteFraud() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_2).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.getApiClient()).thenReturn(apiclient); - when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); - deleteFraudObj.deleteFraud(request); - } - - @Test - public void deleteFraudFailuer() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_2).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.getApiClient()).thenReturn(apiclient); - when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); - deleteFraudObj.deleteFraud(request); - } - - @Test - public void testCreateRequest() { - assertNotNull(request); - } -} diff --git a/src/test/java/com/mastercard/fld/api/manage/IssuerFraudChangeTest.java b/src/test/java/com/mastercard/fld/api/manage/IssuerFraudChangeTest.java deleted file mode 100644 index 6c41314..0000000 --- a/src/test/java/com/mastercard/fld/api/manage/IssuerFraudChangeTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.mastercard.fld.api.manage; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; - -import java.io.IOException; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.UpdatedIssuerFraud; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.MediaType; -import okhttp3.Protocol; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuerFraudChangeTest { - - @InjectMocks - @Spy - IssuerFraudChange issuerFraudChange; - - @Mock - RequestHelper helper; - - @Mock - ConfirmedFraudManagementApi fraudApi; - - @Mock - ApiClient apiclient; - - @Mock - ApiCallback callback; - - @Mock - Call call; - - UpdatedIssuerFraud request; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - request = issuerFraudChange.createChangeRequest("292328194169030", "2742"); - } - - @Test - public void testCreateRequest() { - assertNotNull(request); - } - - @Test - public void testSubmitIssuerFraudChange() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.updateIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); - issuerFraudChange.submitIssuerFraudChange(request); - } - - @Test - public void testSubmitIssuerFraudChangeFailure() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.updateIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); - issuerFraudChange.submitIssuerFraudChange(request); - } - -} diff --git a/src/test/java/com/mastercard/fld/api/manage/MastercardFraudChangeTest.java b/src/test/java/com/mastercard/fld/api/manage/MastercardFraudChangeTest.java deleted file mode 100644 index f62c10b..0000000 --- a/src/test/java/com/mastercard/fld/api/manage/MastercardFraudChangeTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.mastercard.fld.api.manage; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; - -import java.io.IOException; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.UpdatedMastercardFraud; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.MediaType; -import okhttp3.Protocol; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class MastercardFraudChangeTest { - - @InjectMocks - @Spy - MastercardFraudChange mastercardFraudChange; - - @Mock - RequestHelper helper; - - @Mock - ConfirmedFraudManagementApi fraudApi; - - @Mock - ApiClient apiclient; - - @Mock - ApiCallback callback; - - @Mock - Call call; - - UpdatedMastercardFraud request; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - MastercardFraudChange call = new MastercardFraudChange(); - request = call.createRequest(); - } - - @Test - public void testCreateRequest() { - assertNotNull(request); - } - - @Test - public void testSubmitFraudChange() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.updateMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); - mastercardFraudChange.submitFraudChange(request); - } - - @Test - public void testSubmitFraudChangeFailure() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.updateMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); - mastercardFraudChange.submitFraudChange(request); - } - -} diff --git a/src/test/java/com/mastercard/fld/api/manage/SuspendToConfirmTest.java b/src/test/java/com/mastercard/fld/api/manage/SuspendToConfirmTest.java deleted file mode 100644 index bc4de43..0000000 --- a/src/test/java/com/mastercard/fld/api/manage/SuspendToConfirmTest.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.mastercard.fld.api.manage; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; - -import java.io.IOException; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudManagementApi; -import com.mastercard.fld.api.fld.model.FraudDeleteAndConfirm; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.MediaType; -import okhttp3.Protocol; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SuspendToConfirmTest { - - @InjectMocks - @Spy - SuspendToConfirm suspendToConfirm; - - @Mock - RequestHelper helper; - - @Mock - ConfirmedFraudManagementApi fraudApi; - - @Mock - ApiClient apiclient; - - @Mock - ApiCallback callback; - - @Mock - Call call; - - FraudDeleteAndConfirm request; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - request = suspendToConfirm.createRequest(); - } - - @Test - public void testCreateRequest() { - assertNotNull(request); - } - - @Test - public void testConfirmFraud() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - suspendToConfirm.confirmFraud(request); - } - - @Test - public void testConfirmFraudFailure() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - suspendToConfirm.confirmFraud(request); - } -} diff --git a/src/test/java/com/mastercard/fld/api/submit/IssuerFraudSubmitTest.java b/src/test/java/com/mastercard/fld/api/submit/IssuerFraudSubmitTest.java deleted file mode 100644 index ee8e45a..0000000 --- a/src/test/java/com/mastercard/fld/api/submit/IssuerFraudSubmitTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.mastercard.fld.api.submit; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; - -import java.io.IOException; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudSubmissionApi; -import com.mastercard.fld.api.fld.model.IssuerFraud; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.MediaType; -import okhttp3.Protocol; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class IssuerFraudSubmitTest { - - @InjectMocks - @Spy - IssuerFraudSubmit issuerFraudSubmit; - - @Mock - RequestHelper helper; - - @Mock - ConfirmedFraudSubmissionApi fraudApi; - - @Mock - ApiClient apiclient; - - @Mock - ApiCallback callback; - - @Mock - Call call; - - IssuerFraud request; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - IssuerFraudSubmit call = new IssuerFraudSubmit(); - request = call.createRequest(); - } - - @Test - public void testCreateRequest() { - assertNotNull(request); - } - - @Test - public void testsubmitIssuerFraud() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.submitIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); - issuerFraudSubmit.submitIssuerFraud(request); - } - - @Test - public void testsubmitIssuerFraudFailure() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.submitIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); - issuerFraudSubmit.submitIssuerFraud(request); - } -} diff --git a/src/test/java/com/mastercard/fld/api/submit/MastercardFraudSubmitTest.java b/src/test/java/com/mastercard/fld/api/submit/MastercardFraudSubmitTest.java deleted file mode 100644 index d17c0e6..0000000 --- a/src/test/java/com/mastercard/fld/api/submit/MastercardFraudSubmitTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.mastercard.fld.api.submit; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; - -import java.io.IOException; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; - -import com.mastercard.fld.api.fld.ApiCallback; -import com.mastercard.fld.api.fld.ApiClient; -import com.mastercard.fld.api.fld.ApiException; -import com.mastercard.fld.api.fld.api.ConfirmedFraudSubmissionApi; -import com.mastercard.fld.api.fld.model.MastercardFraud; -import com.mastercard.fld.utility.RequestHelper; - -import okhttp3.Call; -import okhttp3.MediaType; -import okhttp3.Protocol; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class MastercardFraudSubmitTest { - - @InjectMocks - @Spy - MastercardFraudSubmit mastercardFraudSubmit; - - @Mock - RequestHelper helper; - - @Mock - ConfirmedFraudSubmissionApi fraudApi; - - @Mock - ApiClient apiclient; - - @Mock - ApiCallback callback; - - @Mock - Call call; - - MastercardFraud request; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - MastercardFraudSubmit call = new MastercardFraudSubmit(); - request = call.createRequest(); - } - - @Test - public void testCreateRequest() { - assertNotNull(request); - } - - @Test - public void testsubmitIssuerFraud() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.getApiClient()).thenReturn(apiclient); - when(fraudApi.submitMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); - mastercardFraudSubmit.submitMastercardFraud(request); - } - - @Test - public void testsubmitIssuerFraudFailure() throws ApiException, IOException { - Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) - .protocol(Protocol.HTTP_1_1).code(200).message("") - .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")).build(); - when(helper.getCallback()).thenReturn(callback); - when(helper.getClient()).thenReturn(apiclient); - when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); - when(fraudApi.getApiClient()).thenReturn(apiclient); - when(fraudApi.submitMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); - Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); - mastercardFraudSubmit.submitMastercardFraud(request); - } -} diff --git a/src/test/java/com/mastercard/fld/api/utility/EncryptionHelperTest.java b/src/test/java/com/mastercard/fld/api/utility/EncryptionHelperTest.java deleted file mode 100644 index 50ce2a5..0000000 --- a/src/test/java/com/mastercard/fld/api/utility/EncryptionHelperTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.mastercard.fld.api.utility; - -import static org.junit.Assert.assertNotNull; - -import org.junit.Before; -import org.junit.Test; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.utility.EncryptionHelper; - -public class EncryptionHelperTest { - - @Before - public void init() { - } - - @Test - public void testEncryptionConfig() { - try { - assertNotNull(EncryptionHelper.encryptionConfig("src/test/resources/dummy.pem","571d7e899c5e08f8d31468ef8c81fea65abf70fa31392db6f77e4755b9e574a7")); - } catch (EncryptionException e) { - e.printStackTrace(); - } - } - -} diff --git a/src/test/java/com/mastercard/fld/api/utility/RequestHelperTest.java b/src/test/java/com/mastercard/fld/api/utility/RequestHelperTest.java deleted file mode 100644 index 76431c0..0000000 --- a/src/test/java/com/mastercard/fld/api/utility/RequestHelperTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.mastercard.fld.api.utility; - -import static org.junit.Assert.assertNotNull; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.InjectMocks; -import org.mockito.MockitoAnnotations; -import org.mockito.Spy; - -import com.mastercard.developer.encryption.EncryptionException; -import com.mastercard.fld.utility.RequestHelper; - -public class RequestHelperTest { - - private static final String ASSERT = "true"; - - @InjectMocks - @Spy - RequestHelper helper; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - } - - @Test - public void testInitiateNonEncryptClient() { - helper.initiateNonEncryptClient(); - assertNotNull(ASSERT); - } - - @Test - public void initiateEncryptClient() throws EncryptionException { - helper.initiateEncryptClient(); - assertNotNull(ASSERT); - } - - @Test - public void testGetClient() { - assertNotNull(helper.getClient()); - } - - @Test - public void testgetCallback() { - assertNotNull(helper.getCallback()); - } -} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil1Test.java b/src/test/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil1Test.java new file mode 100644 index 0000000..35de1f1 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/BaseClassUtil1Test.java @@ -0,0 +1,57 @@ +package com.mastercard.fld.fraud.confirmed; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.utility.PropertyFileReader; + +public class BaseClassUtil1Test { + + private static final String BASE_URL = "mastercard.fld.api.url"; + + @Test + public void testGetClient() { + + ApiClient client = BaseClassUtil.getClient(); + assertNotNull(client); + } + + @Test + public void testLoadProperties() { + + PropertyFileReader.loadProperties(); + assertNotNull(PropertyFileReader.getProperty(BASE_URL)); + } + + @Test + public void testGetProperty() { + + assertNotNull(PropertyFileReader.getProperty(BASE_URL)); + } + + @Test + public void testSetUpEnv() { + + BaseClassUtil.setUpEnv(); + assertNotNull(BASE_URL); + } + + @Test + public void testSetUpEncryptionEnv() throws EncryptionException { + + BaseClassUtil.setUpEncryptionEnv(); + assertNotNull(BASE_URL); + } + + @Test + public void testGetCallback() throws EncryptionException { + + ApiCallback call = BaseClassUtil.getCallback(); + assertNotNull(call); + } + +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraudTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraudTest.java new file mode 100644 index 0000000..60ca07c --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/DeleteFraudTest.java @@ -0,0 +1,108 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; +import org.mockito.runners.MockitoJUnitRunner; + +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.FraudDeleteAndConfirm; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +@RunWith(MockitoJUnitRunner.class) +public class DeleteFraudTest { + + @InjectMocks + @Spy + DeleteFraud deleteFraudObj; + + @Mock + RequestHelper helper; + + @Mock + ConfirmedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + FraudDeleteAndConfirm request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = deleteFraudObj.createRequest(); + } + + @Test + public void deleteFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_2) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), + "{\"timestamp\":\"2023-07-15T04:29:49-05:00\",\"refId\":\"aab34943-eabd-42y6-87wd-69c19792bdd6\",\"responseCode\":\"200\",\"responseMessage\":\"Failure\",\"errorDetails\":{\"Errors\":{\"Error\":[{\"ReasonCode\":\"21903\",\"Description\":\"Record to be deleted could not be found. Correct ACN and resubmit.\"}]}}}\r\n" + + "")) + .build(); + + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + deleteFraudObj.deleteFraud(request); + } + + @Test + public void deleteFraudFailuer() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_2) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + deleteFraudObj.deleteFraud(request); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatusTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatusTest.java new file mode 100644 index 0000000..659a9c6 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/FraudStatusTest.java @@ -0,0 +1,98 @@ + +package com.mastercard.fld.fraud.confirmed.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class FraudStatusTest { + + @Spy + FraudStatus fraudStatusObj; + + @Mock + RequestHelper helper; + + @Mock + ConfirmedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + } + + /* + * @Test public void fraudStatus() throws ApiException, IOException { Response + * response = new Response.Builder().request(new + * Request.Builder().url("http://url.com").build()) + * .protocol(Protocol.HTTP_2).code(200).message("") + * .body(ResponseBody.create(MediaType.parse("application/json"), + * "{\"timestamp\":\"2023-07-16T08:52:28-05:00\",\"refId\":\"aab34943-eabd-42y6-87wd-69c19792bdd6\",\"responseCode\":\"200\",\"responseMessage\":\"Failure\",\"auditControlNumber\":\"292328194169030\",\"errorDetails\":{\"Errors\":{\"Error\":[{\"ReasonCode\":\"60127\",\"Description\":\"Record searched could not be found. Correct the input parameter and resubmit\"}]}}}" + * )) .build(); + * + * when(helper.getCallback()).thenReturn(callback); + * when(helper.getClient()).thenReturn(apiclient); + * when(apiclient.getBasePath()).thenReturn( + * "https://sandbox.api.mastercard.com/fld/fraud-statuses/icas/"); + * when(fraudApi.getApiClient()).thenReturn(apiclient); + * when(fraudApi.fraudRequestStatusCall(Mockito.any(), Mockito.any(), + * Mockito.any(), Mockito.any())) .thenReturn(call); + * Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); Fraud fraud = + * fraudStatusObj.fraudStatus("ica", "refId", "acn"); assertNotNull(fraud); + * assertThrows(IllegalStateException.class, runnable) } + */ + + @Test + public void fraudStatusFailuer() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_2) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/fraud-statuses/icas/"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.fraudRequestStatusCall(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + try { + fraudStatusObj.fraudStatus("ica", "refId", "acn"); + } catch (Exception ex) { + assertNotNull(ex); + } + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChangeTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChangeTest.java new file mode 100644 index 0000000..1b39b42 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/IssuerFraudChangeTest.java @@ -0,0 +1,101 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.UpdatedIssuerFraud; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class IssuerFraudChangeTest { + + @InjectMocks + @Spy + IssuerFraudChange issuerFraudChange; + + @Mock + RequestHelper helper; + + @Mock + ConfirmedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + UpdatedIssuerFraud request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = issuerFraudChange.createChangeRequest("292328194169030", "2742"); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testSubmitIssuerFraudChange() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), + "{\"timestamp\":\"2023-07-15T04:34:30-05:00\",\"refId\":\"ecb2d943-eabd-42y6-87wd-69c19792vjg1\",\"responseCode\":\"200\",\"responseMessage\":\"Failure\",\"errorDetails\":{\"Errors\":{\"Error\":[{\"ReasonCode\":\"60128\",\"Description\":\"CIT/MIT value does not exist in the system\"},{\"ReasonCode\":\"60012\",\"Description\":\"Timestamp value in request should be same as current date.\"},{\"ReasonCode\":\"60027\",\"Description\":\"Fraud posted date cannot be before current date -1.\"},{\"ReasonCode\":\"60025\",\"Description\":\"Transaction date cannot be 18 months before current date.\"},{\"ReasonCode\":\"60039\",\"Description\":\"Cardholder reported date cannot be 18 months before current date.\"},{\"ReasonCode\":\"60013\",\"Description\":\"Duplicate Reference ID ecb2d943-eabd-42y6-87wd-69c19792vjg1 for the initiator and service combination.\"}]}}}")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + issuerFraudChange.submitIssuerFraudChange(request); + } + + @Test + public void testSubmitIssuerFraudChangeFailure() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + issuerFraudChange.submitIssuerFraudChange(request); + } + +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChangeTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChangeTest.java new file mode 100644 index 0000000..2da207f --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/MastercardFraudChangeTest.java @@ -0,0 +1,102 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.UpdatedMastercardFraud; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class MastercardFraudChangeTest { + + @InjectMocks + @Spy + MastercardFraudChange mastercardFraudChange; + + @Mock + RequestHelper helper; + + @Mock + ConfirmedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + UpdatedMastercardFraud request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + MastercardFraudChange call = new MastercardFraudChange(); + request = call.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testSubmitFraudChange() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), + "{\"timestamp\":\"2023-07-15T04:37:04-05:00\",\"refId\":\"nnnd943-eabd-42y6-87wd-69c19792bded6\",\"responseCode\":\"200\",\"responseMessage\":\"Failure\",\"errorDetails\":{\"Errors\":{\"Error\":[{\"ReasonCode\":\"60039\",\"Description\":\"Cardholder reported date cannot be 18 months before current date.\"},{\"ReasonCode\":\"60012\",\"Description\":\"Timestamp value in request should be same as current date.\"}]}}}")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + mastercardFraudChange.submitFraudChange(request); + } + + @Test + public void testSubmitFraudChangeFailure() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + mastercardFraudChange.submitFraudChange(request); + } + +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirmTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirmTest.java new file mode 100644 index 0000000..4662988 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/manage/SuspendToConfirmTest.java @@ -0,0 +1,100 @@ +package com.mastercard.fld.fraud.confirmed.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudManagementApi; +import com.mastercard.fld.api.fld.confirmed.model.FraudDeleteAndConfirm; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SuspendToConfirmTest { + + @InjectMocks + @Spy + SuspendToConfirm suspendToConfirm; + + @Mock + RequestHelper helper; + + @Mock + ConfirmedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + FraudDeleteAndConfirm request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = suspendToConfirm.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testConfirmFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), + "{\"timestamp\":\"2023-07-15T04:38:48-05:00\",\"responseCode\":\"200\",\"responseMessage\":\"Failure\",\"errorDetails\":{\"Errors\":{\"Error\":[{\"ReasonCode\":\"60128\",\"Description\":\"CIT/MIT value does not exist in the system\"},{\"ReasonCode\":\"21803\",\"Description\":\"Record to be changed could not be found. Correct ACN and resubmit.\"}]}}}")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToConfirm.confirmFraud(request); + } + + @Test + public void testConfirmFraudFailure() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToConfirm.confirmFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmitTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmitTest.java new file mode 100644 index 0000000..385adf0 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/IssuerFraudSubmitTest.java @@ -0,0 +1,101 @@ +package com.mastercard.fld.fraud.confirmed.api.submit; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudSubmissionApi; +import com.mastercard.fld.api.fld.confirmed.model.IssuerFraud; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class IssuerFraudSubmitTest { + + @InjectMocks + @Spy + IssuerFraudSubmit issuerFraudSubmit; + + @Mock + RequestHelper helper; + + @Mock + ConfirmedFraudSubmissionApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + IssuerFraud request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + IssuerFraudSubmit call = new IssuerFraudSubmit(); + request = call.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testsubmitIssuerFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), + "{\"timestamp\":\"2023-07-15T04:38:24-05:00\",\"refId\":\"ecb2d943-eabd-42y6-87wd-69c19792vjg1\",\"responseCode\":\"200\",\"responseMessage\":\"Failure\",\"errorDetails\":{\"Errors\":{\"Error\":[{\"ReasonCode\":\"60128\",\"Description\":\"CIT/MIT value does not exist in the system\"},{\"ReasonCode\":\"60012\",\"Description\":\"Timestamp value in request should be same as current date.\"},{\"ReasonCode\":\"60027\",\"Description\":\"Fraud posted date cannot be before current date -1.\"},{\"ReasonCode\":\"60025\",\"Description\":\"Transaction date cannot be 18 months before current date.\"},{\"ReasonCode\":\"60039\",\"Description\":\"Cardholder reported date cannot be 18 months before current date.\"},{\"ReasonCode\":\"60013\",\"Description\":\"Duplicate Reference ID ecb2d943-eabd-42y6-87wd-69c19792vjg1 for the initiator and service combination.\"}]}}}")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.submitIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + issuerFraudSubmit.submitIssuerFraud(request); + } + + @Test + public void testsubmitIssuerFraudFailure() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.submitIssuerFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + issuerFraudSubmit.submitIssuerFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmitTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmitTest.java new file mode 100644 index 0000000..35730f4 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/submit/MastercardFraudSubmitTest.java @@ -0,0 +1,103 @@ +package com.mastercard.fld.fraud.confirmed.api.submit; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.confirmed.ApiCallback; +import com.mastercard.fld.api.fld.confirmed.ApiClient; +import com.mastercard.fld.api.fld.confirmed.ApiException; +import com.mastercard.fld.api.fld.confirmed.api.ConfirmedFraudSubmissionApi; +import com.mastercard.fld.api.fld.confirmed.model.MastercardFraud; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class MastercardFraudSubmitTest { + + @InjectMocks + @Spy + MastercardFraudSubmit mastercardFraudSubmit; + + @Mock + RequestHelper helper; + + @Mock + ConfirmedFraudSubmissionApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + MastercardFraud request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + MastercardFraudSubmit call = new MastercardFraudSubmit(); + request = call.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testsubmitIssuerFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), + "{\"timestamp\":\"2023-07-15T04:34:59-05:00\",\"refId\":\"ecb2d816-eabd-42y6-87wd-69c19792bdd6\",\"responseCode\":\"200\",\"responseMessage\":\"Failure\",\"errorDetails\":{\"Errors\":{\"Error\":[{\"ReasonCode\":\"60012\",\"Description\":\"Timestamp value in request should be same as current date.\"},{\"ReasonCode\":\"60027\",\"Description\":\"Fraud posted date cannot be before current date -1.\"},{\"ReasonCode\":\"60025\",\"Description\":\"Transaction date cannot be 18 months before current date.\"}]}}}")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.submitMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + mastercardFraudSubmit.submitMastercardFraud(request); + } + + @Test + public void testsubmitIssuerFraudFailure() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.submitMastercardFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + mastercardFraudSubmit.submitMastercardFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/EncryptionHelperTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/EncryptionHelperTest.java new file mode 100644 index 0000000..dad9606 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/EncryptionHelperTest.java @@ -0,0 +1,29 @@ +package com.mastercard.fld.fraud.confirmed.api.utility; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Before; +import org.junit.Test; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.utility.EncryptionHelper; + +public class EncryptionHelperTest { + + @Before + public void init() { + + } + + @Test + public void testEncryptionConfig() { + + try { + assertNotNull(EncryptionHelper.encryptionConfig("src/test/resources/confirmed/dummy.pem", + "571d7e899c5e08f8d31468ef8c81fea65abf70fa31392db6f77e4755b9e574a7")); + } catch (EncryptionException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/RequestHelperTest.java b/src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/RequestHelperTest.java new file mode 100644 index 0000000..b507831 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/confirmed/api/utility/RequestHelperTest.java @@ -0,0 +1,53 @@ +package com.mastercard.fld.fraud.confirmed.api.utility; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.fraud.confirmed.helper.RequestHelper; + +public class RequestHelperTest { + + private static final String ASSERT = "true"; + + @InjectMocks + @Spy + RequestHelper helper; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + } + + @Test + public void testInitiateNonEncryptClient() { + + helper.initiateNonEncryptClient(); + assertNotNull(ASSERT); + } + + @Test + public void initiateEncryptClient() throws EncryptionException { + + helper.initiateEncryptClient(); + assertNotNull(ASSERT); + } + + @Test + public void testGetClient() { + + assertNotNull(helper.getClient()); + } + + @Test + public void testgetCallback() { + + assertNotNull(helper.getCallback()); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/BaseClassUtilTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/BaseClassUtilTest.java new file mode 100644 index 0000000..4a58eb0 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/BaseClassUtilTest.java @@ -0,0 +1,57 @@ +package com.mastercard.fld.fraud.suspected; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.utility.PropertyFileReader; + +public class BaseClassUtilTest { + + private static final String BASE_URL = "mastercard.fld.api.url"; + + @Test + public void testGetClient() { + + ApiClient client = BaseClassUtil.getClient(); + assertNotNull(client); + } + + @Test + public void testLoadProperties() { + + PropertyFileReader.loadProperties(); + assertNotNull(PropertyFileReader.getProperty(BASE_URL)); + } + + @Test + public void testGetProperty() { + + assertNotNull(PropertyFileReader.getProperty(BASE_URL)); + } + + @Test + public void testSetUpEnv() { + + BaseClassUtil.setUpEnv(); + assertNotNull(BASE_URL); + } + + @Test + public void testSetUpEncryptionEnv() throws EncryptionException { + + BaseClassUtil.setUpEncryptionEnv(); + assertNotNull(BASE_URL); + } + + @Test + public void testGetCallback() throws EncryptionException { + + ApiCallback call = BaseClassUtil.getCallback(); + assertNotNull(call); + } + +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedMastercardFraudChangeTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedMastercardFraudChangeTest.java new file mode 100644 index 0000000..86e431c --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedMastercardFraudChangeTest.java @@ -0,0 +1,104 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudChange; +import com.mastercard.fld.fraud.suspected.api.manage.acquirer.AcquirerSuspectedMastercardFraudChange; +import com.mastercard.fld.fraud.suspected.api.manage.issuer.IssuerSuspectedMastercardFraudChange; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class AcquirerSuspectedMastercardFraudChangeTest { + + @InjectMocks + @Spy + AcquirerSuspectedMastercardFraudChange mastercardFraudChange; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraudChange request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + IssuerSuspectedMastercardFraudChange call = new IssuerSuspectedMastercardFraudChange(); + request = call.createRequest(); + } + + @Test + public void testCreateRequest() { + + request = mastercardFraudChange.createRequest(); + assertNotNull(request); + } + + @Test + public void testSubmitFraudChange() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateSuspectedFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + mastercardFraudChange.submitFraudChange(request); + } + + @Test + public void testSubmitFraudChangeFailure() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateSuspectedFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + mastercardFraudChange.submitFraudChange(request); + } + +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToConfirmTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToConfirmTest.java new file mode 100644 index 0000000..e8f2ce2 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToConfirmTest.java @@ -0,0 +1,100 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.suspected.api.manage.acquirer.AcquirerSuspectedToConfirm; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class AcquirerSuspectedToConfirmTest { + + @InjectMocks + @Spy + AcquirerSuspectedToConfirm suspendToConfirm; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraudStateChange request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = suspendToConfirm.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testConfirmFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToConfirm.confirmFraud(request); + } + + @Test + public void testConfirmFraudFailure() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToConfirm.confirmFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToNotConfirmTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToNotConfirmTest.java new file mode 100644 index 0000000..e22ac77 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/AcquirerSuspectedToNotConfirmTest.java @@ -0,0 +1,100 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.suspected.api.manage.acquirer.AcquirerSuspectedToNotConfirm; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class AcquirerSuspectedToNotConfirmTest { + + @InjectMocks + @Spy + AcquirerSuspectedToNotConfirm suspendToNotConfirm; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraudStateChange request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = suspendToNotConfirm.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testConfirmFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToNotConfirm.confirmNotFraud(request); + } + + @Test + public void testConfirmFraudFailure() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToNotConfirm.confirmNotFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedMastercardFraudChangeTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedMastercardFraudChangeTest.java new file mode 100644 index 0000000..a23e1b8 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedMastercardFraudChangeTest.java @@ -0,0 +1,102 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudChange; +import com.mastercard.fld.fraud.suspected.api.manage.issuer.IssuerSuspectedMastercardFraudChange; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SuspectedMastercardFraudChangeTest { + + @InjectMocks + @Spy + IssuerSuspectedMastercardFraudChange mastercardFraudChange; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraudChange request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + IssuerSuspectedMastercardFraudChange call = new IssuerSuspectedMastercardFraudChange(); + request = call.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testSubmitFraudChange() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateSuspectedFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + mastercardFraudChange.submitFraudChange(request); + } + + @Test + public void testSubmitFraudChangeFailure() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.updateSuspectedFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + mastercardFraudChange.submitFraudChange(request); + } + +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToConfirmTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToConfirmTest.java new file mode 100644 index 0000000..6a9002f --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToConfirmTest.java @@ -0,0 +1,100 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.suspected.api.manage.issuer.IssuerSuspectedToConfirm; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SuspectedToConfirmTest { + + @InjectMocks + @Spy + IssuerSuspectedToConfirm suspendToConfirm; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraudStateChange request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = suspendToConfirm.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testConfirmFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToConfirm.confirmFraud(request); + } + + @Test + public void testConfirmFraudFailure() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToConfirm.confirmFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToDeleteTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToDeleteTest.java new file mode 100644 index 0000000..35d67dc --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToDeleteTest.java @@ -0,0 +1,107 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; +import org.mockito.runners.MockitoJUnitRunner; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.suspected.api.manage.acquirer.SuspectedToDelete; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +@RunWith(MockitoJUnitRunner.class) +public class SuspectedToDeleteTest { + + @InjectMocks + @Spy + SuspectedToDelete deleteFraudObj; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraudStateChange request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = deleteFraudObj.createRequest(); + } + + @Test + public void deleteFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_2) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + deleteFraudObj.deleteFraud(request); + } + + @Test + public void deleteFraudFailuer() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_2) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + deleteFraudObj.deleteFraud(request); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToNotConfirmTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToNotConfirmTest.java new file mode 100644 index 0000000..b708d5c --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/manage/SuspectedToNotConfirmTest.java @@ -0,0 +1,100 @@ +package com.mastercard.fld.fraud.suspected.api.manage; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudManagementApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraudStateChange; +import com.mastercard.fld.fraud.suspected.api.manage.issuer.IssuerSuspectedToNotConfirm; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SuspectedToNotConfirmTest { + + @InjectMocks + @Spy + IssuerSuspectedToNotConfirm suspendToNotConfirm; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudManagementApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraudStateChange request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + request = suspendToNotConfirm.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testConfirmFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToNotConfirm.confirmNotFraud(request); + } + + @Test + public void testConfirmFraudFailure() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(fraudApi.fraudStateCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + suspendToNotConfirm.confirmNotFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmitTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmitTest.java new file mode 100644 index 0000000..6986912 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/submit/SuspectedMastercardFraudSubmitTest.java @@ -0,0 +1,102 @@ +package com.mastercard.fld.fraud.suspected.api.submit; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.fld.api.fld.suspected.ApiCallback; +import com.mastercard.fld.api.fld.suspected.ApiClient; +import com.mastercard.fld.api.fld.suspected.ApiException; +import com.mastercard.fld.api.fld.suspected.api.SuspectedFraudSubmissionApi; +import com.mastercard.fld.api.fld.suspected.model.SuspectedFraud; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +import okhttp3.Call; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class SuspectedMastercardFraudSubmitTest { + + @InjectMocks + @Spy + SuspectedMastercardFraudSubmit mastercardFraudSubmit; + + @Mock + RequestHelper helper; + + @Mock + SuspectedFraudSubmissionApi fraudApi; + + @Mock + ApiClient apiclient; + + @Mock + ApiCallback callback; + + @Mock + Call call; + + SuspectedFraud request; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + SuspectedMastercardFraudSubmit call = new SuspectedMastercardFraudSubmit(); + request = call.createRequest(); + } + + @Test + public void testCreateRequest() { + + assertNotNull(request); + } + + @Test + public void testsubmitIssuerFraud() throws ApiException, IOException { + + Response response = new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.submitSuspectedFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doReturn(response).when(helper).apiCall(Mockito.any()); + mastercardFraudSubmit.submitMastercardFraud(request); + } + + @Test + public void testsubmitIssuerFraudFailure() throws ApiException, IOException { + + new Response.Builder().request(new Request.Builder().url("http://url.com").build()) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("") + .body(ResponseBody.create(MediaType.parse("application/json"), "aaa")) + .build(); + when(helper.getCallback()).thenReturn(callback); + when(helper.getClient()).thenReturn(apiclient); + when(apiclient.getBasePath()).thenReturn("https://sandbox.api.mastercard.com/fld/confirmed-frauds"); + when(fraudApi.getApiClient()).thenReturn(apiclient); + when(fraudApi.submitSuspectedFraudCall(Mockito.any(), Mockito.any())).thenReturn(call); + Mockito.doThrow(new IOException()).when(helper).apiCall(Mockito.any()); + mastercardFraudSubmit.submitMastercardFraud(request); + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/utility/EncryptionHelperTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/utility/EncryptionHelperTest.java new file mode 100644 index 0000000..875ab8b --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/utility/EncryptionHelperTest.java @@ -0,0 +1,28 @@ +package com.mastercard.fld.fraud.suspected.api.utility; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Before; +import org.junit.Test; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.utility.EncryptionHelper; + +public class EncryptionHelperTest { + + @Before + public void init() { + + } + + @Test + public void testEncryptionConfig() { + + try { + assertNotNull(EncryptionHelper.encryptionConfig("src/test/resources/suspected/dummy.pem", + "571d7e899c5e08f8d31468ef8c81fea65abf70fa31392db6f77e4755b9e574a7")); + } catch (EncryptionException e) { + e.printStackTrace(); + } + } +} diff --git a/src/test/java/com/mastercard/fld/fraud/suspected/api/utility/RequestHelperTest.java b/src/test/java/com/mastercard/fld/fraud/suspected/api/utility/RequestHelperTest.java new file mode 100644 index 0000000..0211773 --- /dev/null +++ b/src/test/java/com/mastercard/fld/fraud/suspected/api/utility/RequestHelperTest.java @@ -0,0 +1,53 @@ +package com.mastercard.fld.fraud.suspected.api.utility; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; + +import com.mastercard.developer.encryption.EncryptionException; +import com.mastercard.fld.fraud.suspected.helper.RequestHelper; + +public class RequestHelperTest { + + private static final String ASSERT = "true"; + + @InjectMocks + @Spy + RequestHelper helper; + + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + } + + @Test + public void testInitiateNonEncryptClient() { + + helper.initiateNonEncryptClient(); + assertNotNull(ASSERT); + } + + @Test + public void initiateEncryptClient() throws EncryptionException { + + helper.initiateEncryptClient(); + assertNotNull(ASSERT); + } + + @Test + public void testGetClient() { + + assertNotNull(helper.getClient()); + } + + @Test + public void testgetCallback() { + + assertNotNull(helper.getCallback()); + } +} diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 0b62c0f..e2e079f 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -1,7 +1,14 @@ mastercard.fld.api.url=https://sandbox.api.mastercard.com/fld/confirmed-frauds -mastercard.fld.client.p12.path=src/test/resources/dummy.p12 -mastercard.fld.client.ref.app.consumer.key=dummyconsumerkey -mastercard.fld.client.ref.app.keystore.alias=dummyalias -mastercard.fld.client.ref.app.keystore.password=dummykeystorepass -mastercard.fld.client.ref.app.encryption.file=src/test/resources/dummy.pem -mastercard.fld.client.ref.app.encryption.key=dummyencryptkey \ No newline at end of file +mastercard.fld.confirmed.client.p12.path=src/test/resources/confirmed/dummy.p12 +mastercard.fld.confirmed.client.ref.app.consumer.key=dummyconsumerkey +mastercard.fld.confirmed.client.ref.app.keystore.alias=dummyalias +mastercard.fld.confirmed.client.ref.app.keystore.password=dummykeystorepass +mastercard.fld.confirmed.client.ref.app.encryption.file=src/test/resources/confirmed/dummy.pem +mastercard.fld.confirmed.client.ref.app.encryption.key=dummyencryptkey + +mastercard.fld.suspected.client.p12.path=src/test/resources/suspected/dummy.p12 +mastercard.fld.suspected.client.ref.app.consumer.key=dummyconsumerkey +mastercard.fld.suspected.client.ref.app.keystore.alias=dummyalias +mastercard.fld.suspected.client.ref.app.keystore.password=dummykeystorepass +mastercard.fld.suspected.client.ref.app.encryption.file=src/test/resources/suspected/dummy.pem +mastercard.fld.suspected.client.ref.app.encryption.key=dummyencryptkey \ No newline at end of file diff --git a/src/test/resources/dummy.p12 b/src/test/resources/confirmed/dummy.p12 similarity index 100% rename from src/test/resources/dummy.p12 rename to src/test/resources/confirmed/dummy.p12 diff --git a/src/test/resources/dummy.pem b/src/test/resources/confirmed/dummy.pem similarity index 100% rename from src/test/resources/dummy.pem rename to src/test/resources/confirmed/dummy.pem diff --git a/src/test/resources/key.p12 b/src/test/resources/key.p12 new file mode 100644 index 0000000000000000000000000000000000000000..28568b3cf783d02a81713a4154acbb5865d4bd76 GIT binary patch literal 2388 zcmb`Hc|6qX7suy2GmII=zEq6e&(4f%2~B0qkfkiio(Rd+@UsqS#!guViDB*_TemQj zU1VQETw5_oWXV#NP*Qh#z3!{}{rXi*`g8V0Scb{wOL!DwI{n6BC{?!R^p36T7? z1%L$vApu+?JjoFnTKQoJ6()Nr=?j(McACU6V~N0mPmMU->4$R)TW({EYz zJ^kWpvuLwzKX|lDYA=2w)Kp=(xXZ+$Bs%@zpq}Ap7lgwe3X__|tafWN-Vq)Z@^#$` z+H0&3-r?FE{g^wLuS=0qsbu>&oA-c}_*5B8BjYCP>F5-_)n>lMIJ-lkZ@(nl-&iIucWT>IT-0iBPaCT0ztIedpm;C@0R8_XGj9k089m!RR|Tem{7payr4;)VAxmL9o6ZLmf2$X;(_B-y zfo7f})?EKw_tv7lY9)OJ!6{xDk8I-Jgw!{=iDG@X`WOU;uG?qlp_x5eg}1mEWw`fF zQiAmF3DMbK+6G;*V97aYcir1Q!J1sCMz_gYABm?eUZLwvSi_r(%ViO`W67aOC5p(W zuy8$}s!n2ai%Z#C&=o&Tw6e*%9Agrmx@c;}eR~5SL^voR;%yEyRCq;D=Qlox`#Wh} zYCpL%aanu@C&k1GAyuW$~zM&Nk2D5>nBxtXOS%3;HS-RpO`AA`_av$^!iRIBqrcn{W=hFkP z{rgm(JJt=TwDy&I`Yv86*p-aMOdNe*R>(SfcS$Tvt^)77FL44qD6W(KdfuowMJVD< zSKew($g5Bxx|EFw)&kP`*;6BBC)!xa(E<82x?an$dmc^1I&4H7!P)woQe1i^5{F!3 zk*`sD#V228&?Eb6r_C$64!tYS;rgIM&PCLM;GiC2b>C91YvWuw=G6X|!mz~}act7j znCD!9h6bqQcGS#!3967qsgbyqtNzMB>1p0zhQW*3hH53`Zoie;E+i`(kR-E;*XX_9 z^IW@94Kvq=Keob0#8cnYXj2z#<=b@i*=}vmPZ>X<4fzo6P^#L4Oj<|%@qO3br(}1u z<_R^x>A_rW4wbpW86jT<@B%sf4YlVUqMTQEZskf9_I7xX;9HvlE}Uw6gDSr!W41dF zm)9@e6G+6@7r4qXsBQ_{^)P<9&bU+fs)CVNYIo5A;Xa$o3?-W+w_C?5b1A=hYoj*u zqV`Uz!15z5X<5Z?Ct`Mzh9!j57XzuJ3{E#_4{#PsWjU)kN@w|ds$F=l2t-EdB^^3e zH}WQoa16*dg1|y!DJjR|C-4*Y+Fz6Ad323f_X+11ny0ILWP5-dOS04s1fekbh}_OGEC#wee4gF^tr>L?1AEPVve}a>~E=;mO#k z7(EXco?vaXa){WO%=@-Fuh`E+76Q8kjz$LPMJtj;OMy{C4wIEC)8!5RvHDQMWP9gN z5VHFEw1E2>^@IF;RNwjc@;Zb@_X#iZ-uhG}+f4 z20h!Uf2ad>nFwaY6hz1cS5n-g71cH?!Ul$qgvRYZlBRW}JoDJEc}X-Lk;+%^%(HVe zn&UIfI=VF}BEMv|X18UbNemMqH?)Y9<+fSXycK{93L`=sWQ@O-%{9x?Kh6#1x=X#E zZIxM-LhziPFL8&x*xPi9aSmEJ{(Fi2Imh9zmFsNMk~-4P9A80o>o=woB6gQ&$>LXsaqW67?oQPb(!OTIyw$LZor>M@DZ7H8*I>*&vtYTM*_ul{RO z7K4^R!&zArIU(RXi*`g8V0Scb{wOL!DwI{n6BC{?!R^p36T7? z1%L$vApu+?JjoFnTKQoJ6()Nr=?j(McACU6V~N0mPmMU->4$R)TW({EYz zJ^kWpvuLwzKX|lDYA=2w)Kp=(xXZ+$Bs%@zpq}Ap7lgwe3X__|tafWN-Vq)Z@^#$` z+H0&3-r?FE{g^wLuS=0qsbu>&oA-c}_*5B8BjYCP>F5-_)n>lMIJ-lkZ@(nl-&iIucWT>IT-0iBPaCT0ztIedpm;C@0R8_XGj9k089m!RR|Tem{7payr4;)VAxmL9o6ZLmf2$X;(_B-y zfo7f})?EKw_tv7lY9)OJ!6{xDk8I-Jgw!{=iDG@X`WOU;uG?qlp_x5eg}1mEWw`fF zQiAmF3DMbK+6G;*V97aYcir1Q!J1sCMz_gYABm?eUZLwvSi_r(%ViO`W67aOC5p(W zuy8$}s!n2ai%Z#C&=o&Tw6e*%9Agrmx@c;}eR~5SL^voR;%yEyRCq;D=Qlox`#Wh} zYCpL%aanu@C&k1GAyuW$~zM&Nk2D5>nBxtXOS%3;HS-RpO`AA`_av$^!iRIBqrcn{W=hFkP z{rgm(JJt=TwDy&I`Yv86*p-aMOdNe*R>(SfcS$Tvt^)77FL44qD6W(KdfuowMJVD< zSKew($g5Bxx|EFw)&kP`*;6BBC)!xa(E<82x?an$dmc^1I&4H7!P)woQe1i^5{F!3 zk*`sD#V228&?Eb6r_C$64!tYS;rgIM&PCLM;GiC2b>C91YvWuw=G6X|!mz~}act7j znCD!9h6bqQcGS#!3967qsgbyqtNzMB>1p0zhQW*3hH53`Zoie;E+i`(kR-E;*XX_9 z^IW@94Kvq=Keob0#8cnYXj2z#<=b@i*=}vmPZ>X<4fzo6P^#L4Oj<|%@qO3br(}1u z<_R^x>A_rW4wbpW86jT<@B%sf4YlVUqMTQEZskf9_I7xX;9HvlE}Uw6gDSr!W41dF zm)9@e6G+6@7r4qXsBQ_{^)P<9&bU+fs)CVNYIo5A;Xa$o3?-W+w_C?5b1A=hYoj*u zqV`Uz!15z5X<5Z?Ct`Mzh9!j57XzuJ3{E#_4{#PsWjU)kN@w|ds$F=l2t-EdB^^3e zH}WQoa16*dg1|y!DJjR|C-4*Y+Fz6Ad323f_X+11ny0ILWP5-dOS04s1fekbh}_OGEC#wee4gF^tr>L?1AEPVve}a>~E=;mO#k z7(EXco?vaXa){WO%=@-Fuh`E+76Q8kjz$LPMJtj;OMy{C4wIEC)8!5RvHDQMWP9gN z5VHFEw1E2>^@IF;RNwjc@;Zb@_X#iZ-uhG}+f4 z20h!Uf2ad>nFwaY6hz1cS5n-g71cH?!Ul$qgvRYZlBRW}JoDJEc}X-Lk;+%^%(HVe zn&UIfI=VF}BEMv|X18UbNemMqH?)Y9<+fSXycK{93L`=sWQ@O-%{9x?Kh6#1x=X#E zZIxM-LhziPFL8&x*xPi9aSmEJ{(Fi2Imh9zmFsNMk~-4P9A80o>o=woB6gQ&$>LXsaqW67?oQPb(!OTIyw$LZor>M@DZ7H8*I>*&vtYTM*_ul{RO z7K4^R!&zArIU(R