diff --git a/generator/cybersource-php-template/ApiClient.mustache b/generator/cybersource-php-template/ApiClient.mustache index a07736288..6a1b09751 100644 --- a/generator/cybersource-php-template/ApiClient.mustache +++ b/generator/cybersource-php-template/ApiClient.mustache @@ -22,6 +22,7 @@ use CyberSource\Authentication\Core\Authentication as Authentication; use CyberSource\Authentication\Util\GlobalParameter as GlobalParameter; use CyberSource\Authentication\PayloadDigest\PayloadDigest as PayloadDigest; use \{{invokerPackage}}\Logging\LogFactory as LogFactory; +use \CyberSource\Authentication\Util\MLEUtility; $stream_headers = array(); @@ -206,7 +207,7 @@ class ApiClient * @throws \{{invokerPackage}}\ApiException on a non 2xx response * @return mixed */ - public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) + public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null, $isResponseMLEForAPI=false) { self::$logger->info("CALLING API \"$resourcePath\" STARTED"); $headers = []; @@ -243,7 +244,7 @@ class ApiClient if($this->merchantConfig->getAuthenticationType() != GlobalParameter::MUTUAL_AUTH) { - $authHeader = $this->callAuthenticationHeader($method, $postData, $resourcePath); + $authHeader = $this->callAuthenticationHeader($method, $postData, $resourcePath, $isResponseMLEForAPI); } $requestHeaders=[]; @@ -480,12 +481,34 @@ class ApiClient self::$logger->close(); return [$http_body, $response_info['http_code'], $http_header]; } + + // Decrypt BEFORE json_decode + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + $error_message = "Response MLE decryption failed: " . $e->getMessage(); + self::$logger->error("ApiException : " . $error_message); + self::$logger->close(); + throw new ApiException($error_message); + } + } $data = json_decode($http_body); if (json_last_error() > 0) { // if response is a string $data = $http_body; } } else { + // Error path: still attempt decryption so error payload can be read + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + // Ignore; proceeding with encrypted body for error case + } + } + $data = json_decode($http_body); if (json_last_error() > 0) { // if response is a string $data = $http_body; @@ -533,11 +556,38 @@ class ApiClient self::$logger->close(); throw $exception; } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + self::$logger->debug("[MLE][ApiClient][FileDownload] Encrypted response detected for file download"); + + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + $exceptionMessage = $e->getMessage() ?: 'Unknown error'; + $exceptionClass = get_class($e); + $error_message = "File download MLE decryption failed [{$exceptionClass}]: {$exceptionMessage}"; + self::$logger->error("ApiException : " . $error_message); + self::$logger->close(); + + $statusCode = isset($response_info['http_code']) ? $response_info['http_code'] : 0; + throw new ApiException($error_message, $statusCode, $stream_headers ?? [], null); + } + } + $stream_headers['http_code'] = $response_info['http_code']; self::$logger->close(); return [$http_body, $stream_headers['http_code'], $stream_headers]; } else { + // Error path: attempt decryption for file downloads too + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + // Ignore; proceed with encrypted body for error case + } + } + self::$logger->error("ApiException : [".$response_info['http_code']."] Error connecting to the API ($url)"); self::$logger->close(); throw new ApiException( @@ -636,11 +686,11 @@ class ApiClient * Purpose : This function calling the Authentication and making an Auth Header * */ - public function callAuthenticationHeader($method, $postData, $resourcePath) + public function callAuthenticationHeader($method, $postData, $resourcePath, $isResponseMLEForAPI) { $merchantConfig = $this->merchantConfig; $authentication = new Authentication($merchantConfig->getLogConfiguration()); - $getToken = $authentication->generateToken($resourcePath, $postData, $method, $merchantConfig); + $getToken = $authentication->generateToken($resourcePath, $postData, $method, $merchantConfig, $isResponseMLEForAPI); if($merchantConfig->getAuthenticationType() == GlobalParameter::HTTP_SIGNATURE){ $host = "Host:".$merchantConfig->getHost(); $vcMerchant = "v-c-merchant-id:".$merchantConfig->getMerchantID(); diff --git a/generator/cybersource-php-template/api.mustache b/generator/cybersource-php-template/api.mustache index 8f67253da..02e8b1973 100644 --- a/generator/cybersource-php-template/api.mustache +++ b/generator/cybersource-php-template/api.mustache @@ -283,6 +283,10 @@ use \Exception; {{^returnType}} self::$logger->debug("Return Type : null"); {{/returnType}} + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "{{operationId}},{{operationId}}WithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -297,7 +301,8 @@ use \Exception; {{^returnType}} null, {{/returnType}} - '{{{path}}}' + '{{{path}}}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/BatchesApi.php b/lib/Api/BatchesApi.php index 511d7ba0e..e7ff9a0cb 100644 --- a/lib/Api/BatchesApi.php +++ b/lib/Api/BatchesApi.php @@ -188,6 +188,10 @@ public function getBatchReportWithHttpInfo($batchId) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse20012"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getBatchReport,getBatchReportWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function getBatchReportWithHttpInfo($batchId) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse20012', - '/accountupdater/v1/batches/{batchId}/report' + '/accountupdater/v1/batches/{batchId}/report', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -312,6 +317,10 @@ public function getBatchStatusWithHttpInfo($batchId) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse20011"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getBatchStatus,getBatchStatusWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -321,7 +330,8 @@ public function getBatchStatusWithHttpInfo($batchId) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse20011', - '/accountupdater/v1/batches/{batchId}/status' + '/accountupdater/v1/batches/{batchId}/status', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -449,6 +459,10 @@ public function getBatchesListWithHttpInfo($offset = '0', $limit = '20', $fromDa } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse20010"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getBatchesList,getBatchesListWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -458,7 +472,8 @@ public function getBatchesListWithHttpInfo($offset = '0', $limit = '20', $fromDa $httpBody, $headerParams, '\CyberSource\Model\InlineResponse20010', - '/accountupdater/v1/batches' + '/accountupdater/v1/batches', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -576,6 +591,10 @@ public function postBatchWithHttpInfo($body) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse202"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postBatch,postBatchWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -585,7 +604,8 @@ public function postBatchWithHttpInfo($body) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse202', - '/accountupdater/v1/batches' + '/accountupdater/v1/batches', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/BillingAgreementsApi.php b/lib/Api/BillingAgreementsApi.php index dec509a84..5a56ac72d 100644 --- a/lib/Api/BillingAgreementsApi.php +++ b/lib/Api/BillingAgreementsApi.php @@ -202,6 +202,10 @@ public function billingAgreementsDeRegistrationWithHttpInfo($modifyBillingAgreem } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2ModifyBillingAgreementPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "billingAgreementsDeRegistration,billingAgreementsDeRegistrationWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function billingAgreementsDeRegistrationWithHttpInfo($modifyBillingAgreem $httpBody, $headerParams, '\CyberSource\Model\PtsV2ModifyBillingAgreementPost201Response', - '/pts/v2/billing-agreements/{id}' + '/pts/v2/billing-agreements/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -344,6 +349,10 @@ public function billingAgreementsIntimationWithHttpInfo($intimateBillingAgreemen } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2CreditsPost201Response1"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "billingAgreementsIntimation,billingAgreementsIntimationWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -353,7 +362,8 @@ public function billingAgreementsIntimationWithHttpInfo($intimateBillingAgreemen $httpBody, $headerParams, '\CyberSource\Model\PtsV2CreditsPost201Response1', - '/pts/v2/billing-agreements/{id}/intimations' + '/pts/v2/billing-agreements/{id}/intimations', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -471,6 +481,10 @@ public function billingAgreementsRegistrationWithHttpInfo($createBillingAgreemen } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2CreateBillingAgreementPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "billingAgreementsRegistration,billingAgreementsRegistrationWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -480,7 +494,8 @@ public function billingAgreementsRegistrationWithHttpInfo($createBillingAgreemen $httpBody, $headerParams, '\CyberSource\Model\PtsV2CreateBillingAgreementPost201Response', - '/pts/v2/billing-agreements' + '/pts/v2/billing-agreements', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/BinLookupApi.php b/lib/Api/BinLookupApi.php index 152044b03..64a763ca3 100644 --- a/lib/Api/BinLookupApi.php +++ b/lib/Api/BinLookupApi.php @@ -189,6 +189,10 @@ public function getAccountInfoWithHttpInfo($createBinLookupRequest) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2012"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getAccountInfo,getAccountInfoWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -198,7 +202,8 @@ public function getAccountInfoWithHttpInfo($createBinLookupRequest) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2012', - '/bin/v1/binlookup' + '/bin/v1/binlookup', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/CaptureApi.php b/lib/Api/CaptureApi.php index 3a470348b..0b498a0cf 100644 --- a/lib/Api/CaptureApi.php +++ b/lib/Api/CaptureApi.php @@ -202,6 +202,10 @@ public function capturePaymentWithHttpInfo($capturePaymentRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsCapturesPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "capturePayment,capturePaymentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function capturePaymentWithHttpInfo($capturePaymentRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsCapturesPost201Response', - '/pts/v2/payments/{id}/captures' + '/pts/v2/payments/{id}/captures', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ChargebackDetailsApi.php b/lib/Api/ChargebackDetailsApi.php index 2024e96f2..014b6559c 100644 --- a/lib/Api/ChargebackDetailsApi.php +++ b/lib/Api/ChargebackDetailsApi.php @@ -204,6 +204,10 @@ public function getChargebackDetailsWithHttpInfo($startTime, $endTime, $organiza } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ChargebackDetailsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getChargebackDetails,getChargebackDetailsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -213,7 +217,8 @@ public function getChargebackDetailsWithHttpInfo($startTime, $endTime, $organiza $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ChargebackDetailsGet200Response', - '/reporting/v3/chargeback-details' + '/reporting/v3/chargeback-details', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ChargebackSummariesApi.php b/lib/Api/ChargebackSummariesApi.php index 17310e0d2..b497da5cd 100644 --- a/lib/Api/ChargebackSummariesApi.php +++ b/lib/Api/ChargebackSummariesApi.php @@ -204,6 +204,10 @@ public function getChargebackSummariesWithHttpInfo($startTime, $endTime, $organi } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ChargebackSummariesGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getChargebackSummaries,getChargebackSummariesWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -213,7 +217,8 @@ public function getChargebackSummariesWithHttpInfo($startTime, $endTime, $organi $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ChargebackSummariesGet200Response', - '/reporting/v3/chargeback-summaries' + '/reporting/v3/chargeback-summaries', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ConversionDetailsApi.php b/lib/Api/ConversionDetailsApi.php index 663e43def..e8c3c0bfe 100644 --- a/lib/Api/ConversionDetailsApi.php +++ b/lib/Api/ConversionDetailsApi.php @@ -204,6 +204,10 @@ public function getConversionDetailWithHttpInfo($startTime, $endTime, $organizat } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ConversionDetailsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getConversionDetail,getConversionDetailWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -213,7 +217,8 @@ public function getConversionDetailWithHttpInfo($startTime, $endTime, $organizat $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ConversionDetailsGet200Response', - '/reporting/v3/conversion-details' + '/reporting/v3/conversion-details', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/CreateNewWebhooksApi.php b/lib/Api/CreateNewWebhooksApi.php index 99e48e8a6..066dbd152 100644 --- a/lib/Api/CreateNewWebhooksApi.php +++ b/lib/Api/CreateNewWebhooksApi.php @@ -188,6 +188,10 @@ public function findProductsToSubscribeWithHttpInfo($organizationId) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2004[]"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "findProductsToSubscribe,findProductsToSubscribeWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function findProductsToSubscribeWithHttpInfo($organizationId) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2004[]', - '/notification-subscriptions/v2/products/{organizationId}' + '/notification-subscriptions/v2/products/{organizationId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -302,6 +307,10 @@ public function notificationSubscriptionsV2WebhooksPostWithHttpInfo($createWebho } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2015"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "notificationSubscriptionsV2WebhooksPost,notificationSubscriptionsV2WebhooksPostWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -311,7 +320,8 @@ public function notificationSubscriptionsV2WebhooksPostWithHttpInfo($createWebho $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2015', - '/notification-subscriptions/v2/webhooks' + '/notification-subscriptions/v2/webhooks', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -444,6 +454,10 @@ public function saveSymEgressKeyWithHttpInfo($vCSenderOrganizationId, $vCPermiss } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2014"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "saveSymEgressKey,saveSymEgressKeyWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -453,7 +467,8 @@ public function saveSymEgressKeyWithHttpInfo($vCSenderOrganizationId, $vCPermiss $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2014', - '/kms/egress/v2/keys-sym' + '/kms/egress/v2/keys-sym', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/CreditApi.php b/lib/Api/CreditApi.php index 23e08f428..a95caed81 100644 --- a/lib/Api/CreditApi.php +++ b/lib/Api/CreditApi.php @@ -187,6 +187,10 @@ public function createCreditWithHttpInfo($createCreditRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2CreditsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createCredit,createCreditWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function createCreditWithHttpInfo($createCreditRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2CreditsPost201Response', - '/pts/v2/credits' + '/pts/v2/credits', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/CustomerApi.php b/lib/Api/CustomerApi.php index 5b0c635e1..008bbed4c 100644 --- a/lib/Api/CustomerApi.php +++ b/lib/Api/CustomerApi.php @@ -194,6 +194,10 @@ public function deleteCustomerWithHttpInfo($customerId, $profileId = null) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteCustomer,deleteCustomerWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -203,7 +207,8 @@ public function deleteCustomerWithHttpInfo($customerId, $profileId = null) $httpBody, $headerParams, null, - '/tms/v2/customers/{customerId}' + '/tms/v2/customers/{customerId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -340,6 +345,10 @@ public function getCustomerWithHttpInfo($customerId, $profileId = null) } self::$logger->debug("Return Type : \CyberSource\Model\PostCustomerRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getCustomer,getCustomerWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -349,7 +358,8 @@ public function getCustomerWithHttpInfo($customerId, $profileId = null) $httpBody, $headerParams, '\CyberSource\Model\PostCustomerRequest', - '/tms/v2/customers/{customerId}' + '/tms/v2/customers/{customerId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -510,6 +520,10 @@ public function patchCustomerWithHttpInfo($customerId, $patchCustomerRequest, $p } self::$logger->debug("Return Type : \CyberSource\Model\PatchCustomerRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "patchCustomer,patchCustomerWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -519,7 +533,8 @@ public function patchCustomerWithHttpInfo($customerId, $patchCustomerRequest, $p $httpBody, $headerParams, '\CyberSource\Model\PatchCustomerRequest', - '/tms/v2/customers/{customerId}' + '/tms/v2/customers/{customerId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -663,6 +678,10 @@ public function postCustomerWithHttpInfo($postCustomerRequest, $profileId = null } self::$logger->debug("Return Type : \CyberSource\Model\PostCustomerRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postCustomer,postCustomerWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -672,7 +691,8 @@ public function postCustomerWithHttpInfo($postCustomerRequest, $profileId = null $httpBody, $headerParams, '\CyberSource\Model\PostCustomerRequest', - '/tms/v2/customers' + '/tms/v2/customers', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/CustomerPaymentInstrumentApi.php b/lib/Api/CustomerPaymentInstrumentApi.php index a53c2544f..895cecc7e 100644 --- a/lib/Api/CustomerPaymentInstrumentApi.php +++ b/lib/Api/CustomerPaymentInstrumentApi.php @@ -209,6 +209,10 @@ public function deleteCustomerPaymentInstrumentWithHttpInfo($customerId, $paymen } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteCustomerPaymentInstrument,deleteCustomerPaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -218,7 +222,8 @@ public function deleteCustomerPaymentInstrumentWithHttpInfo($customerId, $paymen $httpBody, $headerParams, null, - '/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}' + '/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -374,6 +379,10 @@ public function getCustomerPaymentInstrumentWithHttpInfo($customerId, $paymentIn } self::$logger->debug("Return Type : \CyberSource\Model\PostCustomerPaymentInstrumentRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getCustomerPaymentInstrument,getCustomerPaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -383,7 +392,8 @@ public function getCustomerPaymentInstrumentWithHttpInfo($customerId, $paymentIn $httpBody, $headerParams, '\CyberSource\Model\PostCustomerPaymentInstrumentRequest', - '/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}' + '/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -538,6 +548,10 @@ public function getCustomerPaymentInstrumentsListWithHttpInfo($customerId, $prof } self::$logger->debug("Return Type : \CyberSource\Model\PaymentInstrumentList"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getCustomerPaymentInstrumentsList,getCustomerPaymentInstrumentsListWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -547,7 +561,8 @@ public function getCustomerPaymentInstrumentsListWithHttpInfo($customerId, $prof $httpBody, $headerParams, '\CyberSource\Model\PaymentInstrumentList', - '/tms/v2/customers/{customerId}/payment-instruments' + '/tms/v2/customers/{customerId}/payment-instruments', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -723,6 +738,10 @@ public function patchCustomersPaymentInstrumentWithHttpInfo($customerId, $paymen } self::$logger->debug("Return Type : \CyberSource\Model\PatchCustomerPaymentInstrumentRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "patchCustomersPaymentInstrument,patchCustomersPaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -732,7 +751,8 @@ public function patchCustomersPaymentInstrumentWithHttpInfo($customerId, $paymen $httpBody, $headerParams, '\CyberSource\Model\PatchCustomerPaymentInstrumentRequest', - '/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}' + '/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -891,6 +911,10 @@ public function postCustomerPaymentInstrumentWithHttpInfo($customerId, $postCust } self::$logger->debug("Return Type : \CyberSource\Model\PostCustomerPaymentInstrumentRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postCustomerPaymentInstrument,postCustomerPaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -900,7 +924,8 @@ public function postCustomerPaymentInstrumentWithHttpInfo($customerId, $postCust $httpBody, $headerParams, '\CyberSource\Model\PostCustomerPaymentInstrumentRequest', - '/tms/v2/customers/{customerId}/payment-instruments' + '/tms/v2/customers/{customerId}/payment-instruments', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/CustomerShippingAddressApi.php b/lib/Api/CustomerShippingAddressApi.php index c9ffd4658..b38d395e9 100644 --- a/lib/Api/CustomerShippingAddressApi.php +++ b/lib/Api/CustomerShippingAddressApi.php @@ -209,6 +209,10 @@ public function deleteCustomerShippingAddressWithHttpInfo($customerId, $shipping } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteCustomerShippingAddress,deleteCustomerShippingAddressWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -218,7 +222,8 @@ public function deleteCustomerShippingAddressWithHttpInfo($customerId, $shipping $httpBody, $headerParams, null, - '/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}' + '/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -374,6 +379,10 @@ public function getCustomerShippingAddressWithHttpInfo($customerId, $shippingAdd } self::$logger->debug("Return Type : \CyberSource\Model\PostCustomerShippingAddressRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getCustomerShippingAddress,getCustomerShippingAddressWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -383,7 +392,8 @@ public function getCustomerShippingAddressWithHttpInfo($customerId, $shippingAdd $httpBody, $headerParams, '\CyberSource\Model\PostCustomerShippingAddressRequest', - '/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}' + '/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -538,6 +548,10 @@ public function getCustomerShippingAddressesListWithHttpInfo($customerId, $profi } self::$logger->debug("Return Type : \CyberSource\Model\ShippingAddressListForCustomer"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getCustomerShippingAddressesList,getCustomerShippingAddressesListWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -547,7 +561,8 @@ public function getCustomerShippingAddressesListWithHttpInfo($customerId, $profi $httpBody, $headerParams, '\CyberSource\Model\ShippingAddressListForCustomer', - '/tms/v2/customers/{customerId}/shipping-addresses' + '/tms/v2/customers/{customerId}/shipping-addresses', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -723,6 +738,10 @@ public function patchCustomersShippingAddressWithHttpInfo($customerId, $shipping } self::$logger->debug("Return Type : \CyberSource\Model\PatchCustomerShippingAddressRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "patchCustomersShippingAddress,patchCustomersShippingAddressWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -732,7 +751,8 @@ public function patchCustomersShippingAddressWithHttpInfo($customerId, $shipping $httpBody, $headerParams, '\CyberSource\Model\PatchCustomerShippingAddressRequest', - '/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}' + '/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -891,6 +911,10 @@ public function postCustomerShippingAddressWithHttpInfo($customerId, $postCustom } self::$logger->debug("Return Type : \CyberSource\Model\PostCustomerShippingAddressRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postCustomerShippingAddress,postCustomerShippingAddressWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -900,7 +924,8 @@ public function postCustomerShippingAddressWithHttpInfo($customerId, $postCustom $httpBody, $headerParams, '\CyberSource\Model\PostCustomerShippingAddressRequest', - '/tms/v2/customers/{customerId}/shipping-addresses' + '/tms/v2/customers/{customerId}/shipping-addresses', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/DecisionManagerApi.php b/lib/Api/DecisionManagerApi.php index 4731489ae..b953458d2 100644 --- a/lib/Api/DecisionManagerApi.php +++ b/lib/Api/DecisionManagerApi.php @@ -202,6 +202,10 @@ public function actionDecisionManagerCaseWithHttpInfo($id, $caseManagementAction } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2001"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "actionDecisionManagerCase,actionDecisionManagerCaseWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function actionDecisionManagerCaseWithHttpInfo($id, $caseManagementAction $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2001', - '/risk/v1/decisions/{id}/actions' + '/risk/v1/decisions/{id}/actions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -360,6 +365,10 @@ public function addNegativeWithHttpInfo($type, $addNegativeListRequest) } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1UpdatePost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "addNegative,addNegativeWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -369,7 +378,8 @@ public function addNegativeWithHttpInfo($type, $addNegativeListRequest) $httpBody, $headerParams, '\CyberSource\Model\RiskV1UpdatePost201Response', - '/risk/v1/lists/{type}/entries' + '/risk/v1/lists/{type}/entries', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -498,6 +508,10 @@ public function commentDecisionManagerCaseWithHttpInfo($id, $caseManagementComme } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2011"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "commentDecisionManagerCase,commentDecisionManagerCaseWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -507,7 +521,8 @@ public function commentDecisionManagerCaseWithHttpInfo($id, $caseManagementComme $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2011', - '/risk/v1/decisions/{id}/comments' + '/risk/v1/decisions/{id}/comments', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -641,6 +656,10 @@ public function createBundledDecisionManagerCaseWithHttpInfo($createBundledDecis } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1DecisionsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createBundledDecisionManagerCase,createBundledDecisionManagerCaseWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -650,7 +669,8 @@ public function createBundledDecisionManagerCaseWithHttpInfo($createBundledDecis $httpBody, $headerParams, '\CyberSource\Model\RiskV1DecisionsPost201Response', - '/risk/v1/decisions' + '/risk/v1/decisions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -783,6 +803,10 @@ public function fraudUpdateWithHttpInfo($id, $fraudMarkingActionRequest) } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1UpdatePost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "fraudUpdate,fraudUpdateWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -792,7 +816,8 @@ public function fraudUpdateWithHttpInfo($id, $fraudMarkingActionRequest) $httpBody, $headerParams, '\CyberSource\Model\RiskV1UpdatePost201Response', - '/risk/v1/decisions/{id}/marking' + '/risk/v1/decisions/{id}/marking', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/DeviceDeAssociationApi.php b/lib/Api/DeviceDeAssociationApi.php index 255d7151b..3d96c1056 100644 --- a/lib/Api/DeviceDeAssociationApi.php +++ b/lib/Api/DeviceDeAssociationApi.php @@ -187,6 +187,10 @@ public function deleteTerminalAssociationWithHttpInfo($deAssociationRequestBody) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteTerminalAssociation,deleteTerminalAssociationWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function deleteTerminalAssociationWithHttpInfo($deAssociationRequestBody) $httpBody, $headerParams, null, - '/dms/v2/devices/deassociate' + '/dms/v2/devices/deassociate', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -322,6 +327,10 @@ public function postDeAssociateV3TerminalWithHttpInfo($deviceDeAssociateV3Reques } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2008[]"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postDeAssociateV3Terminal,postDeAssociateV3TerminalWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -331,7 +340,8 @@ public function postDeAssociateV3TerminalWithHttpInfo($deviceDeAssociateV3Reques $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2008[]', - '/dms/v3/devices/deassociate' + '/dms/v3/devices/deassociate', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/DeviceSearchApi.php b/lib/Api/DeviceSearchApi.php index 75ba3bb92..ff1381e0a 100644 --- a/lib/Api/DeviceSearchApi.php +++ b/lib/Api/DeviceSearchApi.php @@ -187,6 +187,10 @@ public function postSearchQueryWithHttpInfo($postDeviceSearchRequest) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2007"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postSearchQuery,postSearchQueryWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function postSearchQueryWithHttpInfo($postDeviceSearchRequest) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2007', - '/dms/v2/devices/search' + '/dms/v2/devices/search', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -326,6 +331,10 @@ public function postSearchQueryV3WithHttpInfo($postDeviceSearchRequestV3) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2009"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postSearchQueryV3,postSearchQueryV3WithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -335,7 +344,8 @@ public function postSearchQueryV3WithHttpInfo($postDeviceSearchRequestV3) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2009', - '/dms/v3/devices/search' + '/dms/v3/devices/search', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/DownloadDTDApi.php b/lib/Api/DownloadDTDApi.php index b21d5895a..9b5b75c4a 100644 --- a/lib/Api/DownloadDTDApi.php +++ b/lib/Api/DownloadDTDApi.php @@ -188,6 +188,10 @@ public function getDTDV2WithHttpInfo($reportDefinitionNameVersion) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getDTDV2,getDTDV2WithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function getDTDV2WithHttpInfo($reportDefinitionNameVersion) $httpBody, $headerParams, null, - '/reporting/v3/dtds/{reportDefinitionNameVersion}' + '/reporting/v3/dtds/{reportDefinitionNameVersion}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/DownloadXSDApi.php b/lib/Api/DownloadXSDApi.php index 2b16eb3ad..26e1ae6a7 100644 --- a/lib/Api/DownloadXSDApi.php +++ b/lib/Api/DownloadXSDApi.php @@ -188,6 +188,10 @@ public function getXSDV2WithHttpInfo($reportDefinitionNameVersion) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getXSDV2,getXSDV2WithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function getXSDV2WithHttpInfo($reportDefinitionNameVersion) $httpBody, $headerParams, null, - '/reporting/v3/xsds/{reportDefinitionNameVersion}' + '/reporting/v3/xsds/{reportDefinitionNameVersion}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/EMVTagDetailsApi.php b/lib/Api/EMVTagDetailsApi.php index ce1814940..cd9fe43e8 100644 --- a/lib/Api/EMVTagDetailsApi.php +++ b/lib/Api/EMVTagDetailsApi.php @@ -173,6 +173,10 @@ public function getEmvTagsWithHttpInfo() } self::$logger->debug("Return Type : \CyberSource\Model\TssV2GetEmvTags200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getEmvTags,getEmvTagsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -182,7 +186,8 @@ public function getEmvTagsWithHttpInfo() $httpBody, $headerParams, '\CyberSource\Model\TssV2GetEmvTags200Response', - '/tss/v2/transactions/emvTagDetails' + '/tss/v2/transactions/emvTagDetails', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -292,6 +297,10 @@ public function parseEmvTagsWithHttpInfo($body) } self::$logger->debug("Return Type : \CyberSource\Model\TssV2PostEmvTags200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "parseEmvTags,parseEmvTagsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -301,7 +310,8 @@ public function parseEmvTagsWithHttpInfo($body) $httpBody, $headerParams, '\CyberSource\Model\TssV2PostEmvTags200Response', - '/tss/v2/transactions/emvTagDetails' + '/tss/v2/transactions/emvTagDetails', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/FlexAPIApi.php b/lib/Api/FlexAPIApi.php index 80a8021db..16d99c1fd 100644 --- a/lib/Api/FlexAPIApi.php +++ b/lib/Api/FlexAPIApi.php @@ -187,6 +187,10 @@ public function generateFlexAPICaptureContextWithHttpInfo($generateFlexAPICaptur } self::$logger->debug("Return Type : string"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "generateFlexAPICaptureContext,generateFlexAPICaptureContextWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function generateFlexAPICaptureContextWithHttpInfo($generateFlexAPICaptur $httpBody, $headerParams, 'string', - '/flex/v2/sessions' + '/flex/v2/sessions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/InstrumentIdentifierApi.php b/lib/Api/InstrumentIdentifierApi.php index d39ca3e6c..fb754d656 100644 --- a/lib/Api/InstrumentIdentifierApi.php +++ b/lib/Api/InstrumentIdentifierApi.php @@ -194,6 +194,10 @@ public function deleteInstrumentIdentifierWithHttpInfo($instrumentIdentifierId, } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteInstrumentIdentifier,deleteInstrumentIdentifierWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -203,7 +207,8 @@ public function deleteInstrumentIdentifierWithHttpInfo($instrumentIdentifierId, $httpBody, $headerParams, null, - '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}' + '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -347,6 +352,10 @@ public function getInstrumentIdentifierWithHttpInfo($instrumentIdentifierId, $pr } self::$logger->debug("Return Type : \CyberSource\Model\PostInstrumentIdentifierRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getInstrumentIdentifier,getInstrumentIdentifierWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -356,7 +365,8 @@ public function getInstrumentIdentifierWithHttpInfo($instrumentIdentifierId, $pr $httpBody, $headerParams, '\CyberSource\Model\PostInstrumentIdentifierRequest', - '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}' + '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -518,6 +528,10 @@ public function getInstrumentIdentifierPaymentInstrumentsListWithHttpInfo($instr } self::$logger->debug("Return Type : \CyberSource\Model\PaymentInstrumentList1"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getInstrumentIdentifierPaymentInstrumentsList,getInstrumentIdentifierPaymentInstrumentsListWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -527,7 +541,8 @@ public function getInstrumentIdentifierPaymentInstrumentsListWithHttpInfo($instr $httpBody, $headerParams, '\CyberSource\Model\PaymentInstrumentList1', - '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/paymentinstruments' + '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/paymentinstruments', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -695,6 +710,10 @@ public function patchInstrumentIdentifierWithHttpInfo($instrumentIdentifierId, $ } self::$logger->debug("Return Type : \CyberSource\Model\PatchInstrumentIdentifierRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "patchInstrumentIdentifier,patchInstrumentIdentifierWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -704,7 +723,8 @@ public function patchInstrumentIdentifierWithHttpInfo($instrumentIdentifierId, $ $httpBody, $headerParams, '\CyberSource\Model\PatchInstrumentIdentifierRequest', - '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}' + '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -855,6 +875,10 @@ public function postInstrumentIdentifierWithHttpInfo($postInstrumentIdentifierRe } self::$logger->debug("Return Type : \CyberSource\Model\PostInstrumentIdentifierRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postInstrumentIdentifier,postInstrumentIdentifierWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -864,7 +888,8 @@ public function postInstrumentIdentifierWithHttpInfo($postInstrumentIdentifierRe $httpBody, $headerParams, '\CyberSource\Model\PostInstrumentIdentifierRequest', - '/tms/v1/instrumentidentifiers' + '/tms/v1/instrumentidentifiers', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -1019,6 +1044,10 @@ public function postInstrumentIdentifierEnrollmentWithHttpInfo($instrumentIdenti } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postInstrumentIdentifierEnrollment,postInstrumentIdentifierEnrollmentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -1028,7 +1057,8 @@ public function postInstrumentIdentifierEnrollmentWithHttpInfo($instrumentIdenti $httpBody, $headerParams, null, - '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/enrollment' + '/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/enrollment', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/InterchangeClearingLevelDetailsApi.php b/lib/Api/InterchangeClearingLevelDetailsApi.php index 3746a9c0e..a929bc1d9 100644 --- a/lib/Api/InterchangeClearingLevelDetailsApi.php +++ b/lib/Api/InterchangeClearingLevelDetailsApi.php @@ -204,6 +204,10 @@ public function getInterchangeClearingLevelDetailsWithHttpInfo($startTime, $endT } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3InterchangeClearingLevelDetailsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getInterchangeClearingLevelDetails,getInterchangeClearingLevelDetailsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -213,7 +217,8 @@ public function getInterchangeClearingLevelDetailsWithHttpInfo($startTime, $endT $httpBody, $headerParams, '\CyberSource\Model\ReportingV3InterchangeClearingLevelDetailsGet200Response', - '/reporting/v3/interchange-clearing-level-details' + '/reporting/v3/interchange-clearing-level-details', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/InvoiceSettingsApi.php b/lib/Api/InvoiceSettingsApi.php index ef34266f8..ed1688c24 100644 --- a/lib/Api/InvoiceSettingsApi.php +++ b/lib/Api/InvoiceSettingsApi.php @@ -173,6 +173,10 @@ public function getInvoiceSettingsWithHttpInfo() } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoiceSettingsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getInvoiceSettings,getInvoiceSettingsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -182,7 +186,8 @@ public function getInvoiceSettingsWithHttpInfo() $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoiceSettingsGet200Response', - '/invoicing/v2/invoiceSettings' + '/invoicing/v2/invoiceSettings', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -300,6 +305,10 @@ public function updateInvoiceSettingsWithHttpInfo($invoiceSettingsRequest) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoiceSettingsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "updateInvoiceSettings,updateInvoiceSettingsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -309,7 +318,8 @@ public function updateInvoiceSettingsWithHttpInfo($invoiceSettingsRequest) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoiceSettingsGet200Response', - '/invoicing/v2/invoiceSettings' + '/invoicing/v2/invoiceSettings', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/InvoicesApi.php b/lib/Api/InvoicesApi.php index d09181ce4..93eaa931d 100644 --- a/lib/Api/InvoicesApi.php +++ b/lib/Api/InvoicesApi.php @@ -187,6 +187,10 @@ public function createInvoiceWithHttpInfo($createInvoiceRequest) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoicesPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createInvoice,createInvoiceWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function createInvoiceWithHttpInfo($createInvoiceRequest) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoicesPost201Response', - '/invoicing/v2/invoices' + '/invoicing/v2/invoices', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -339,6 +344,10 @@ public function getAllInvoicesWithHttpInfo($offset, $limit, $status = null) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoicesAllGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getAllInvoices,getAllInvoicesWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -348,7 +357,8 @@ public function getAllInvoicesWithHttpInfo($offset, $limit, $status = null) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoicesAllGet200Response', - '/invoicing/v2/invoices' + '/invoicing/v2/invoices', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -471,6 +481,10 @@ public function getInvoiceWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoicesGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getInvoice,getInvoiceWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -480,7 +494,8 @@ public function getInvoiceWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoicesGet200Response', - '/invoicing/v2/invoices/{id}' + '/invoicing/v2/invoices/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -603,6 +618,10 @@ public function performCancelActionWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoicesCancel200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "performCancelAction,performCancelActionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -612,7 +631,8 @@ public function performCancelActionWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoicesCancel200Response', - '/invoicing/v2/invoices/{id}/cancelation' + '/invoicing/v2/invoices/{id}/cancelation', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -735,6 +755,10 @@ public function performPublishActionWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoicesPublish200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "performPublishAction,performPublishActionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -744,7 +768,8 @@ public function performPublishActionWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoicesPublish200Response', - '/invoicing/v2/invoices/{id}/publication' + '/invoicing/v2/invoices/{id}/publication', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -867,6 +892,10 @@ public function performSendActionWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoicesSend200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "performSendAction,performSendActionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -876,7 +905,8 @@ public function performSendActionWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoicesSend200Response', - '/invoicing/v2/invoices/{id}/delivery' + '/invoicing/v2/invoices/{id}/delivery', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -1013,6 +1043,10 @@ public function updateInvoiceWithHttpInfo($id, $updateInvoiceRequest) } self::$logger->debug("Return Type : \CyberSource\Model\InvoicingV2InvoicesPut200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "updateInvoice,updateInvoiceWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -1022,7 +1056,8 @@ public function updateInvoiceWithHttpInfo($id, $updateInvoiceRequest) $httpBody, $headerParams, '\CyberSource\Model\InvoicingV2InvoicesPut200Response', - '/invoicing/v2/invoices/{id}' + '/invoicing/v2/invoices/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ManageWebhooksApi.php b/lib/Api/ManageWebhooksApi.php index b8f198d10..03c8381c5 100644 --- a/lib/Api/ManageWebhooksApi.php +++ b/lib/Api/ManageWebhooksApi.php @@ -188,6 +188,10 @@ public function deleteWebhookSubscriptionWithHttpInfo($webhookId) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteWebhookSubscription,deleteWebhookSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function deleteWebhookSubscriptionWithHttpInfo($webhookId) $httpBody, $headerParams, null, - '/notification-subscriptions/v2/webhooks/{webhookId}' + '/notification-subscriptions/v2/webhooks/{webhookId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -304,6 +309,10 @@ public function getWebhookSubscriptionByIdWithHttpInfo($webhookId) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2015"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getWebhookSubscriptionById,getWebhookSubscriptionByIdWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -313,7 +322,8 @@ public function getWebhookSubscriptionByIdWithHttpInfo($webhookId) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2015', - '/notification-subscriptions/v2/webhooks/{webhookId}' + '/notification-subscriptions/v2/webhooks/{webhookId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -435,6 +445,10 @@ public function getWebhookSubscriptionsByOrgWithHttpInfo($organizationId, $produ } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2005[]"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getWebhookSubscriptionsByOrg,getWebhookSubscriptionsByOrgWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -444,7 +458,8 @@ public function getWebhookSubscriptionsByOrgWithHttpInfo($organizationId, $produ $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2005[]', - '/notification-subscriptions/v2/webhooks' + '/notification-subscriptions/v2/webhooks', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -555,6 +570,10 @@ public function notificationSubscriptionsV1WebhooksWebhookIdPostWithHttpInfo($we } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2016"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "notificationSubscriptionsV1WebhooksWebhookIdPost,notificationSubscriptionsV1WebhooksWebhookIdPostWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -564,7 +583,8 @@ public function notificationSubscriptionsV1WebhooksWebhookIdPostWithHttpInfo($we $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2016', - '/notification-subscriptions/v1/webhooks/{webhookId}' + '/notification-subscriptions/v1/webhooks/{webhookId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -684,6 +704,10 @@ public function notificationSubscriptionsV2WebhooksWebhookIdPatchWithHttpInfo($w } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2006"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "notificationSubscriptionsV2WebhooksWebhookIdPatch,notificationSubscriptionsV2WebhooksWebhookIdPatchWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -693,7 +717,8 @@ public function notificationSubscriptionsV2WebhooksWebhookIdPatchWithHttpInfo($w $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2006', - '/notification-subscriptions/v2/webhooks/{webhookId}' + '/notification-subscriptions/v2/webhooks/{webhookId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -817,6 +842,10 @@ public function notificationSubscriptionsV2WebhooksWebhookIdStatusPutWithHttpInf } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "notificationSubscriptionsV2WebhooksWebhookIdStatusPut,notificationSubscriptionsV2WebhooksWebhookIdStatusPutWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -826,7 +855,8 @@ public function notificationSubscriptionsV2WebhooksWebhookIdStatusPutWithHttpInf $httpBody, $headerParams, null, - '/notification-subscriptions/v2/webhooks/{webhookId}/status' + '/notification-subscriptions/v2/webhooks/{webhookId}/status', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -964,6 +994,10 @@ public function saveAsymEgressKeyWithHttpInfo($vCSenderOrganizationId, $vCPermis } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2017"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "saveAsymEgressKey,saveAsymEgressKeyWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -973,7 +1007,8 @@ public function saveAsymEgressKeyWithHttpInfo($vCSenderOrganizationId, $vCPermis $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2017', - '/kms/egress/v2/keys-asym' + '/kms/egress/v2/keys-asym', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/MerchantBoardingApi.php b/lib/Api/MerchantBoardingApi.php index 4bf939b96..106d1b98c 100644 --- a/lib/Api/MerchantBoardingApi.php +++ b/lib/Api/MerchantBoardingApi.php @@ -188,6 +188,10 @@ public function getRegistrationWithHttpInfo($registrationId) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2003"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getRegistration,getRegistrationWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function getRegistrationWithHttpInfo($registrationId) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2003', - '/boarding/v1/registrations/{registrationId}' + '/boarding/v1/registrations/{registrationId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -325,6 +330,10 @@ public function postRegistrationWithHttpInfo($postRegistrationBody, $vCIdempoten } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse2013"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postRegistration,postRegistrationWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -334,7 +343,8 @@ public function postRegistrationWithHttpInfo($postRegistrationBody, $vCIdempoten $httpBody, $headerParams, '\CyberSource\Model\InlineResponse2013', - '/boarding/v1/registrations' + '/boarding/v1/registrations', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/MicroformIntegrationApi.php b/lib/Api/MicroformIntegrationApi.php index 9f21ca62f..c1ac0ea9b 100644 --- a/lib/Api/MicroformIntegrationApi.php +++ b/lib/Api/MicroformIntegrationApi.php @@ -187,6 +187,10 @@ public function generateCaptureContextWithHttpInfo($generateCaptureContextReques } self::$logger->debug("Return Type : string"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "generateCaptureContext,generateCaptureContextWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function generateCaptureContextWithHttpInfo($generateCaptureContextReques $httpBody, $headerParams, 'string', - '/microform/v2/sessions' + '/microform/v2/sessions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/NetFundingsApi.php b/lib/Api/NetFundingsApi.php index 0c7d5ea92..00fa91bbe 100644 --- a/lib/Api/NetFundingsApi.php +++ b/lib/Api/NetFundingsApi.php @@ -211,6 +211,10 @@ public function getNetFundingDetailsWithHttpInfo($startTime, $endTime, $organiza } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3NetFundingsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getNetFundingDetails,getNetFundingDetailsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -220,7 +224,8 @@ public function getNetFundingDetailsWithHttpInfo($startTime, $endTime, $organiza $httpBody, $headerParams, '\CyberSource\Model\ReportingV3NetFundingsGet200Response', - '/reporting/v3/net-fundings' + '/reporting/v3/net-fundings', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/NotificationOfChangesApi.php b/lib/Api/NotificationOfChangesApi.php index 6633d5de1..e11b148c6 100644 --- a/lib/Api/NotificationOfChangesApi.php +++ b/lib/Api/NotificationOfChangesApi.php @@ -197,6 +197,10 @@ public function getNotificationOfChangeReportWithHttpInfo($startTime, $endTime) } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3NotificationofChangesGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getNotificationOfChangeReport,getNotificationOfChangeReportWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -206,7 +210,8 @@ public function getNotificationOfChangeReportWithHttpInfo($startTime, $endTime) $httpBody, $headerParams, '\CyberSource\Model\ReportingV3NotificationofChangesGet200Response', - '/reporting/v3/notification-of-changes' + '/reporting/v3/notification-of-changes', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/OrdersApi.php b/lib/Api/OrdersApi.php index cb7454c75..79dc9de21 100644 --- a/lib/Api/OrdersApi.php +++ b/lib/Api/OrdersApi.php @@ -187,6 +187,10 @@ public function createOrderWithHttpInfo($createOrderRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2CreateOrderPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createOrder,createOrderWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function createOrderWithHttpInfo($createOrderRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2CreateOrderPost201Response', - '/pts/v2/intents' + '/pts/v2/intents', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -329,6 +334,10 @@ public function updateOrderWithHttpInfo($id, $updateOrderRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2UpdateOrderPatch201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "updateOrder,updateOrderWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -338,7 +347,8 @@ public function updateOrderWithHttpInfo($id, $updateOrderRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2UpdateOrderPatch201Response', - '/pts/v2/intents/{id}' + '/pts/v2/intents/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PayerAuthenticationApi.php b/lib/Api/PayerAuthenticationApi.php index f4baeaccd..1c4d9b0ae 100644 --- a/lib/Api/PayerAuthenticationApi.php +++ b/lib/Api/PayerAuthenticationApi.php @@ -187,6 +187,10 @@ public function checkPayerAuthEnrollmentWithHttpInfo($checkPayerAuthEnrollmentRe } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1AuthenticationsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "checkPayerAuthEnrollment,checkPayerAuthEnrollmentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function checkPayerAuthEnrollmentWithHttpInfo($checkPayerAuthEnrollmentRe $httpBody, $headerParams, '\CyberSource\Model\RiskV1AuthenticationsPost201Response', - '/risk/v1/authentications' + '/risk/v1/authentications', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -314,6 +319,10 @@ public function payerAuthSetupWithHttpInfo($payerAuthSetupRequest) } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1AuthenticationSetupsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "payerAuthSetup,payerAuthSetupWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -323,7 +332,8 @@ public function payerAuthSetupWithHttpInfo($payerAuthSetupRequest) $httpBody, $headerParams, '\CyberSource\Model\RiskV1AuthenticationSetupsPost201Response', - '/risk/v1/authentication-setups' + '/risk/v1/authentication-setups', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -441,6 +451,10 @@ public function validateAuthenticationResultsWithHttpInfo($validateRequest) } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1AuthenticationResultsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "validateAuthenticationResults,validateAuthenticationResultsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -450,7 +464,8 @@ public function validateAuthenticationResultsWithHttpInfo($validateRequest) $httpBody, $headerParams, '\CyberSource\Model\RiskV1AuthenticationResultsPost201Response', - '/risk/v1/authentication-results' + '/risk/v1/authentication-results', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PaymentBatchSummariesApi.php b/lib/Api/PaymentBatchSummariesApi.php index ba1f1fedb..2cc9465b0 100644 --- a/lib/Api/PaymentBatchSummariesApi.php +++ b/lib/Api/PaymentBatchSummariesApi.php @@ -225,6 +225,10 @@ public function getPaymentBatchSummaryWithHttpInfo($startTime, $endTime, $organi } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3PaymentBatchSummariesGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPaymentBatchSummary,getPaymentBatchSummaryWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -234,7 +238,8 @@ public function getPaymentBatchSummaryWithHttpInfo($startTime, $endTime, $organi $httpBody, $headerParams, '\CyberSource\Model\ReportingV3PaymentBatchSummariesGet200Response', - '/reporting/v3/payment-batch-summaries' + '/reporting/v3/payment-batch-summaries', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PaymentInstrumentApi.php b/lib/Api/PaymentInstrumentApi.php index faf67917f..c21142bac 100644 --- a/lib/Api/PaymentInstrumentApi.php +++ b/lib/Api/PaymentInstrumentApi.php @@ -194,6 +194,10 @@ public function deletePaymentInstrumentWithHttpInfo($paymentInstrumentId, $profi } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deletePaymentInstrument,deletePaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -203,7 +207,8 @@ public function deletePaymentInstrumentWithHttpInfo($paymentInstrumentId, $profi $httpBody, $headerParams, null, - '/tms/v1/paymentinstruments/{paymentInstrumentId}' + '/tms/v1/paymentinstruments/{paymentInstrumentId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -343,6 +348,10 @@ public function getPaymentInstrumentWithHttpInfo($paymentInstrumentId, $profileI } self::$logger->debug("Return Type : \CyberSource\Model\PostPaymentInstrumentRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPaymentInstrument,getPaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -352,7 +361,8 @@ public function getPaymentInstrumentWithHttpInfo($paymentInstrumentId, $profileI $httpBody, $headerParams, '\CyberSource\Model\PostPaymentInstrumentRequest', - '/tms/v1/paymentinstruments/{paymentInstrumentId}' + '/tms/v1/paymentinstruments/{paymentInstrumentId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -520,6 +530,10 @@ public function patchPaymentInstrumentWithHttpInfo($paymentInstrumentId, $patchP } self::$logger->debug("Return Type : \CyberSource\Model\PatchPaymentInstrumentRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "patchPaymentInstrument,patchPaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -529,7 +543,8 @@ public function patchPaymentInstrumentWithHttpInfo($paymentInstrumentId, $patchP $httpBody, $headerParams, '\CyberSource\Model\PatchPaymentInstrumentRequest', - '/tms/v1/paymentinstruments/{paymentInstrumentId}' + '/tms/v1/paymentinstruments/{paymentInstrumentId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -680,6 +695,10 @@ public function postPaymentInstrumentWithHttpInfo($postPaymentInstrumentRequest, } self::$logger->debug("Return Type : \CyberSource\Model\PostPaymentInstrumentRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postPaymentInstrument,postPaymentInstrumentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -689,7 +708,8 @@ public function postPaymentInstrumentWithHttpInfo($postPaymentInstrumentRequest, $httpBody, $headerParams, '\CyberSource\Model\PostPaymentInstrumentRequest', - '/tms/v1/paymentinstruments' + '/tms/v1/paymentinstruments', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PaymentLinksApi.php b/lib/Api/PaymentLinksApi.php index 09ed9a083..f865389b3 100644 --- a/lib/Api/PaymentLinksApi.php +++ b/lib/Api/PaymentLinksApi.php @@ -187,6 +187,10 @@ public function createPaymentLinkWithHttpInfo($createPaymentLinkRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PblPaymentLinksPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createPaymentLink,createPaymentLinkWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function createPaymentLinkWithHttpInfo($createPaymentLinkRequest) $httpBody, $headerParams, '\CyberSource\Model\PblPaymentLinksPost201Response', - '/ipl/v2/payment-links' + '/ipl/v2/payment-links', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -335,6 +340,10 @@ public function getAllPaymentLinksWithHttpInfo($offset, $limit, $status = null) } self::$logger->debug("Return Type : \CyberSource\Model\PblPaymentLinksAllGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getAllPaymentLinks,getAllPaymentLinksWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -344,7 +353,8 @@ public function getAllPaymentLinksWithHttpInfo($offset, $limit, $status = null) $httpBody, $headerParams, '\CyberSource\Model\PblPaymentLinksAllGet200Response', - '/ipl/v2/payment-links' + '/ipl/v2/payment-links', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -467,6 +477,10 @@ public function getPaymentLinkWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\PblPaymentLinksGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPaymentLink,getPaymentLinkWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -476,7 +490,8 @@ public function getPaymentLinkWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\PblPaymentLinksGet200Response', - '/ipl/v2/payment-links/{id}' + '/ipl/v2/payment-links/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -613,6 +628,10 @@ public function updatePaymentLinkWithHttpInfo($id, $updatePaymentLinkRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PblPaymentLinksPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "updatePaymentLink,updatePaymentLinkWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -622,7 +641,8 @@ public function updatePaymentLinkWithHttpInfo($id, $updatePaymentLinkRequest) $httpBody, $headerParams, '\CyberSource\Model\PblPaymentLinksPost201Response', - '/ipl/v2/payment-links/{id}' + '/ipl/v2/payment-links/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PaymentTokensApi.php b/lib/Api/PaymentTokensApi.php index 29f2c35b9..97925f13b 100644 --- a/lib/Api/PaymentTokensApi.php +++ b/lib/Api/PaymentTokensApi.php @@ -187,6 +187,10 @@ public function retrieveOrDeletePaymentTokenWithHttpInfo($request) } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse201"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "retrieveOrDeletePaymentToken,retrieveOrDeletePaymentTokenWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function retrieveOrDeletePaymentTokenWithHttpInfo($request) $httpBody, $headerParams, '\CyberSource\Model\InlineResponse201', - '/pts/v2/payment-tokens' + '/pts/v2/payment-tokens', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PaymentsApi.php b/lib/Api/PaymentsApi.php index 71f5754d4..ecc2dac93 100644 --- a/lib/Api/PaymentsApi.php +++ b/lib/Api/PaymentsApi.php @@ -202,6 +202,10 @@ public function createOrderRequestWithHttpInfo($orderPaymentRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsOrderPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createOrderRequest,createOrderRequestWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function createOrderRequestWithHttpInfo($orderPaymentRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsOrderPost201Response', - '/pts/v2/payment-references/{id}/intents' + '/pts/v2/payment-references/{id}/intents', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -329,6 +334,10 @@ public function createPaymentWithHttpInfo($createPaymentRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createPayment,createPaymentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -338,7 +347,8 @@ public function createPaymentWithHttpInfo($createPaymentRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsPost201Response', - '/pts/v2/payments' + '/pts/v2/payments', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -456,6 +466,10 @@ public function createSessionRequestWithHttpInfo($createSessionReq) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsPost201Response2"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createSessionRequest,createSessionRequestWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -465,7 +479,8 @@ public function createSessionRequestWithHttpInfo($createSessionReq) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsPost201Response2', - '/pts/v2/payment-references' + '/pts/v2/payment-references', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -598,6 +613,10 @@ public function incrementAuthWithHttpInfo($id, $incrementAuthRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2IncrementalAuthorizationPatch201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "incrementAuth,incrementAuthWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -607,7 +626,8 @@ public function incrementAuthWithHttpInfo($id, $incrementAuthRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2IncrementalAuthorizationPatch201Response', - '/pts/v2/payments/{id}' + '/pts/v2/payments/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -740,6 +760,10 @@ public function refreshPaymentStatusWithHttpInfo($id, $refreshPaymentStatusReque } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsPost201Response1"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "refreshPaymentStatus,refreshPaymentStatusWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -749,7 +773,8 @@ public function refreshPaymentStatusWithHttpInfo($id, $refreshPaymentStatusReque $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsPost201Response1', - '/pts/v2/refresh-payment-status/{id}' + '/pts/v2/refresh-payment-status/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -882,6 +907,10 @@ public function updateSessionReqWithHttpInfo($createSessionRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsPost201Response2"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "updateSessionReq,updateSessionReqWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -891,7 +920,8 @@ public function updateSessionReqWithHttpInfo($createSessionRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsPost201Response2', - '/pts/v2/payment-references/{id}' + '/pts/v2/payment-references/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PayoutsApi.php b/lib/Api/PayoutsApi.php index 55d2057c6..3ebed3829 100644 --- a/lib/Api/PayoutsApi.php +++ b/lib/Api/PayoutsApi.php @@ -187,6 +187,10 @@ public function octCreatePaymentWithHttpInfo($octCreatePaymentRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PayoutsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "octCreatePayment,octCreatePaymentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function octCreatePaymentWithHttpInfo($octCreatePaymentRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PayoutsPost201Response', - '/pts/v2/payouts' + '/pts/v2/payouts', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PlansApi.php b/lib/Api/PlansApi.php index 342a514c3..9a3db3924 100644 --- a/lib/Api/PlansApi.php +++ b/lib/Api/PlansApi.php @@ -188,6 +188,10 @@ public function activatePlanWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\ActivateDeactivatePlanResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "activatePlan,activatePlanWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function activatePlanWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\ActivateDeactivatePlanResponse', - '/rbs/v1/plans/{id}/activate' + '/rbs/v1/plans/{id}/activate', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -319,6 +324,10 @@ public function createPlanWithHttpInfo($createPlanRequest) } self::$logger->debug("Return Type : \CyberSource\Model\CreatePlanResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createPlan,createPlanWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -328,7 +337,8 @@ public function createPlanWithHttpInfo($createPlanRequest) $httpBody, $headerParams, '\CyberSource\Model\CreatePlanResponse', - '/rbs/v1/plans' + '/rbs/v1/plans', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -447,6 +457,10 @@ public function deactivatePlanWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\ActivateDeactivatePlanResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deactivatePlan,deactivatePlanWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -456,7 +470,8 @@ public function deactivatePlanWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\ActivateDeactivatePlanResponse', - '/rbs/v1/plans/{id}/deactivate' + '/rbs/v1/plans/{id}/deactivate', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -579,6 +594,10 @@ public function deletePlanWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\DeletePlanResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deletePlan,deletePlanWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -588,7 +607,8 @@ public function deletePlanWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\DeletePlanResponse', - '/rbs/v1/plans/{id}' + '/rbs/v1/plans/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -711,6 +731,10 @@ public function getPlanWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\GetPlanResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPlan,getPlanWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -720,7 +744,8 @@ public function getPlanWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\GetPlanResponse', - '/rbs/v1/plans/{id}' + '/rbs/v1/plans/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -828,6 +853,10 @@ public function getPlanCodeWithHttpInfo() } self::$logger->debug("Return Type : \CyberSource\Model\GetPlanCodeResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPlanCode,getPlanCodeWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -837,7 +866,8 @@ public function getPlanCodeWithHttpInfo() $httpBody, $headerParams, '\CyberSource\Model\GetPlanCodeResponse', - '/rbs/v1/plans/code' + '/rbs/v1/plans/code', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -976,6 +1006,10 @@ public function getPlansWithHttpInfo($offset = null, $limit = null, $code = null } self::$logger->debug("Return Type : \CyberSource\Model\GetAllPlansResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPlans,getPlansWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -985,7 +1019,8 @@ public function getPlansWithHttpInfo($offset = null, $limit = null, $code = null $httpBody, $headerParams, '\CyberSource\Model\GetAllPlansResponse', - '/rbs/v1/plans' + '/rbs/v1/plans', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -1118,6 +1153,10 @@ public function updatePlanWithHttpInfo($id, $updatePlanRequest) } self::$logger->debug("Return Type : \CyberSource\Model\UpdatePlanResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "updatePlan,updatePlanWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -1127,7 +1166,8 @@ public function updatePlanWithHttpInfo($id, $updatePlanRequest) $httpBody, $headerParams, '\CyberSource\Model\UpdatePlanResponse', - '/rbs/v1/plans/{id}' + '/rbs/v1/plans/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PurchaseAndRefundDetailsApi.php b/lib/Api/PurchaseAndRefundDetailsApi.php index b21854bf4..3346b860c 100644 --- a/lib/Api/PurchaseAndRefundDetailsApi.php +++ b/lib/Api/PurchaseAndRefundDetailsApi.php @@ -239,6 +239,10 @@ public function getPurchaseAndRefundDetailsWithHttpInfo($startTime, $endTime, $o } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3PurchaseRefundDetailsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPurchaseAndRefundDetails,getPurchaseAndRefundDetailsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -248,7 +252,8 @@ public function getPurchaseAndRefundDetailsWithHttpInfo($startTime, $endTime, $o $httpBody, $headerParams, '\CyberSource\Model\ReportingV3PurchaseRefundDetailsGet200Response', - '/reporting/v3/purchase-refund-details' + '/reporting/v3/purchase-refund-details', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/PushFundsApi.php b/lib/Api/PushFundsApi.php index d6a9d574b..9ecbb0d48 100644 --- a/lib/Api/PushFundsApi.php +++ b/lib/Api/PushFundsApi.php @@ -253,6 +253,10 @@ public function createPushFundsTransferWithHttpInfo($pushFundsRequest, $contentT } self::$logger->debug("Return Type : \CyberSource\Model\PushFunds201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createPushFundsTransfer,createPushFundsTransferWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -262,7 +266,8 @@ public function createPushFundsTransferWithHttpInfo($pushFundsRequest, $contentT $httpBody, $headerParams, '\CyberSource\Model\PushFunds201Response', - '/pts/v1/push-funds-transfer' + '/pts/v1/push-funds-transfer', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/RefundApi.php b/lib/Api/RefundApi.php index 6572db3a8..db828b491 100644 --- a/lib/Api/RefundApi.php +++ b/lib/Api/RefundApi.php @@ -202,6 +202,10 @@ public function refundCaptureWithHttpInfo($refundCaptureRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsRefundPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "refundCapture,refundCaptureWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function refundCaptureWithHttpInfo($refundCaptureRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsRefundPost201Response', - '/pts/v2/captures/{id}/refunds' + '/pts/v2/captures/{id}/refunds', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -344,6 +349,10 @@ public function refundPaymentWithHttpInfo($refundPaymentRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsRefundPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "refundPayment,refundPaymentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -353,7 +362,8 @@ public function refundPaymentWithHttpInfo($refundPaymentRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsRefundPost201Response', - '/pts/v2/payments/{id}/refunds' + '/pts/v2/payments/{id}/refunds', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ReportDefinitionsApi.php b/lib/Api/ReportDefinitionsApi.php index a8252c0ce..a01fddab4 100644 --- a/lib/Api/ReportDefinitionsApi.php +++ b/lib/Api/ReportDefinitionsApi.php @@ -209,6 +209,10 @@ public function getResourceInfoByReportDefinitionWithHttpInfo($reportDefinitionN } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ReportDefinitionsNameGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getResourceInfoByReportDefinition,getResourceInfoByReportDefinitionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -218,7 +222,8 @@ public function getResourceInfoByReportDefinitionWithHttpInfo($reportDefinitionN $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ReportDefinitionsNameGet200Response', - '/reporting/v3/report-definitions/{reportDefinitionName}' + '/reporting/v3/report-definitions/{reportDefinitionName}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -332,6 +337,10 @@ public function getResourceV2InfoWithHttpInfo($subscriptionType = null, $organiz } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ReportDefinitionsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getResourceV2Info,getResourceV2InfoWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -341,7 +350,8 @@ public function getResourceV2InfoWithHttpInfo($subscriptionType = null, $organiz $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ReportDefinitionsGet200Response', - '/reporting/v3/report-definitions' + '/reporting/v3/report-definitions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ReportDownloadsApi.php b/lib/Api/ReportDownloadsApi.php index c8ac491b8..8d9d6a862 100644 --- a/lib/Api/ReportDownloadsApi.php +++ b/lib/Api/ReportDownloadsApi.php @@ -204,6 +204,10 @@ public function downloadReportWithHttpInfo($reportDate, $reportName, $organizati } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "downloadReport,downloadReportWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -213,7 +217,8 @@ public function downloadReportWithHttpInfo($reportDate, $reportName, $organizati $httpBody, $headerParams, null, - '/reporting/v3/report-downloads' + '/reporting/v3/report-downloads', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ReportSubscriptionsApi.php b/lib/Api/ReportSubscriptionsApi.php index 750dcc441..e972f69a2 100644 --- a/lib/Api/ReportSubscriptionsApi.php +++ b/lib/Api/ReportSubscriptionsApi.php @@ -194,6 +194,10 @@ public function createStandardOrClassicSubscriptionWithHttpInfo($predefinedSubsc } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createStandardOrClassicSubscription,createStandardOrClassicSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -203,7 +207,8 @@ public function createStandardOrClassicSubscriptionWithHttpInfo($predefinedSubsc $httpBody, $headerParams, null, - '/reporting/v3/predefined-report-subscriptions' + '/reporting/v3/predefined-report-subscriptions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -320,6 +325,10 @@ public function createSubscriptionWithHttpInfo($createReportSubscriptionRequest, } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createSubscription,createSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -329,7 +338,8 @@ public function createSubscriptionWithHttpInfo($createReportSubscriptionRequest, $httpBody, $headerParams, null, - '/reporting/v3/report-subscriptions' + '/reporting/v3/report-subscriptions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -447,6 +457,10 @@ public function deleteSubscriptionWithHttpInfo($reportName, $organizationId = nu } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteSubscription,deleteSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -456,7 +470,8 @@ public function deleteSubscriptionWithHttpInfo($reportName, $organizationId = nu $httpBody, $headerParams, null, - '/reporting/v3/report-subscriptions/{reportName}' + '/reporting/v3/report-subscriptions/{reportName}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -563,6 +578,10 @@ public function getAllSubscriptionsWithHttpInfo($organizationId = null) } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ReportSubscriptionsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getAllSubscriptions,getAllSubscriptionsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -572,7 +591,8 @@ public function getAllSubscriptionsWithHttpInfo($organizationId = null) $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ReportSubscriptionsGet200Response', - '/reporting/v3/report-subscriptions' + '/reporting/v3/report-subscriptions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -694,6 +714,10 @@ public function getSubscriptionWithHttpInfo($reportName, $organizationId = null) } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ReportSubscriptionsGet200ResponseSubscriptions"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getSubscription,getSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -703,7 +727,8 @@ public function getSubscriptionWithHttpInfo($reportName, $organizationId = null) $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ReportSubscriptionsGet200ResponseSubscriptions', - '/reporting/v3/report-subscriptions/{reportName}' + '/reporting/v3/report-subscriptions/{reportName}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ReportsApi.php b/lib/Api/ReportsApi.php index 465d3249a..0539b099d 100644 --- a/lib/Api/ReportsApi.php +++ b/lib/Api/ReportsApi.php @@ -194,6 +194,10 @@ public function createReportWithHttpInfo($createAdhocReportRequest, $organizatio } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createReport,createReportWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -203,7 +207,8 @@ public function createReportWithHttpInfo($createAdhocReportRequest, $organizatio $httpBody, $headerParams, null, - '/reporting/v3/reports' + '/reporting/v3/reports', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -321,6 +326,10 @@ public function getReportByReportIdWithHttpInfo($reportId, $organizationId = nul } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ReportsIdGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getReportByReportId,getReportByReportIdWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -330,7 +339,8 @@ public function getReportByReportIdWithHttpInfo($reportId, $organizationId = nul $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ReportsIdGet200Response', - '/reporting/v3/reports/{reportId}' + '/reporting/v3/reports/{reportId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -508,6 +518,10 @@ public function searchReportsWithHttpInfo($startTime, $endTime, $timeQueryType, } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3ReportsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "searchReports,searchReportsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -517,7 +531,8 @@ public function searchReportsWithHttpInfo($startTime, $endTime, $timeQueryType, $httpBody, $headerParams, '\CyberSource\Model\ReportingV3ReportsGet200Response', - '/reporting/v3/reports' + '/reporting/v3/reports', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/RetrievalDetailsApi.php b/lib/Api/RetrievalDetailsApi.php index 4b4fb9e4e..9b3e45a13 100644 --- a/lib/Api/RetrievalDetailsApi.php +++ b/lib/Api/RetrievalDetailsApi.php @@ -204,6 +204,10 @@ public function getRetrievalDetailsWithHttpInfo($startTime, $endTime, $organizat } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3RetrievalDetailsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getRetrievalDetails,getRetrievalDetailsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -213,7 +217,8 @@ public function getRetrievalDetailsWithHttpInfo($startTime, $endTime, $organizat $httpBody, $headerParams, '\CyberSource\Model\ReportingV3RetrievalDetailsGet200Response', - '/reporting/v3/retrieval-details' + '/reporting/v3/retrieval-details', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/RetrievalSummariesApi.php b/lib/Api/RetrievalSummariesApi.php index bfeb76bfa..0d594592c 100644 --- a/lib/Api/RetrievalSummariesApi.php +++ b/lib/Api/RetrievalSummariesApi.php @@ -204,6 +204,10 @@ public function getRetrievalSummaryWithHttpInfo($startTime, $endTime, $organizat } self::$logger->debug("Return Type : \CyberSource\Model\ReportingV3RetrievalSummariesGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getRetrievalSummary,getRetrievalSummaryWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -213,7 +217,8 @@ public function getRetrievalSummaryWithHttpInfo($startTime, $endTime, $organizat $httpBody, $headerParams, '\CyberSource\Model\ReportingV3RetrievalSummariesGet200Response', - '/reporting/v3/retrieval-summaries' + '/reporting/v3/retrieval-summaries', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/ReversalApi.php b/lib/Api/ReversalApi.php index 5ac3b6cf1..d8a7a8b88 100644 --- a/lib/Api/ReversalApi.php +++ b/lib/Api/ReversalApi.php @@ -202,6 +202,10 @@ public function authReversalWithHttpInfo($id, $authReversalRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsReversalsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "authReversal,authReversalWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function authReversalWithHttpInfo($id, $authReversalRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsReversalsPost201Response', - '/pts/v2/payments/{id}/reversals' + '/pts/v2/payments/{id}/reversals', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -329,6 +334,10 @@ public function mitReversalWithHttpInfo($mitReversalRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsReversalsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "mitReversal,mitReversalWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -338,7 +347,8 @@ public function mitReversalWithHttpInfo($mitReversalRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsReversalsPost201Response', - '/pts/v2/reversals' + '/pts/v2/reversals', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/SearchTransactionsApi.php b/lib/Api/SearchTransactionsApi.php index 01da666be..606357816 100644 --- a/lib/Api/SearchTransactionsApi.php +++ b/lib/Api/SearchTransactionsApi.php @@ -187,6 +187,10 @@ public function createSearchWithHttpInfo($createSearchRequest) } self::$logger->debug("Return Type : \CyberSource\Model\TssV2TransactionsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createSearch,createSearchWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function createSearchWithHttpInfo($createSearchRequest) $httpBody, $headerParams, '\CyberSource\Model\TssV2TransactionsPost201Response', - '/tss/v2/searches' + '/tss/v2/searches', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -315,6 +320,10 @@ public function getSearchWithHttpInfo($searchId) } self::$logger->debug("Return Type : \CyberSource\Model\TssV2TransactionsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getSearch,getSearchWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -324,7 +333,8 @@ public function getSearchWithHttpInfo($searchId) $httpBody, $headerParams, '\CyberSource\Model\TssV2TransactionsPost201Response', - '/tss/v2/searches/{searchId}' + '/tss/v2/searches/{searchId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/SecureFileShareApi.php b/lib/Api/SecureFileShareApi.php index f755e8e3b..4066a018a 100644 --- a/lib/Api/SecureFileShareApi.php +++ b/lib/Api/SecureFileShareApi.php @@ -195,6 +195,10 @@ public function getFileWithHttpInfo($fileId, $organizationId = null) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getFile,getFileWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -204,7 +208,8 @@ public function getFileWithHttpInfo($fileId, $organizationId = null) $httpBody, $headerParams, null, - '/sfs/v1/files/{fileId}' + '/sfs/v1/files/{fileId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -338,6 +343,10 @@ public function getFileDetailWithHttpInfo($startDate, $endDate, $organizationId } self::$logger->debug("Return Type : \CyberSource\Model\V1FileDetailsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getFileDetail,getFileDetailWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -347,7 +356,8 @@ public function getFileDetailWithHttpInfo($startDate, $endDate, $organizationId $httpBody, $headerParams, '\CyberSource\Model\V1FileDetailsGet200Response', - '/sfs/v1/file-details' + '/sfs/v1/file-details', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/SubscriptionsApi.php b/lib/Api/SubscriptionsApi.php index 633d7fa7d..1cd50e7e4 100644 --- a/lib/Api/SubscriptionsApi.php +++ b/lib/Api/SubscriptionsApi.php @@ -195,6 +195,10 @@ public function activateSubscriptionWithHttpInfo($id, $processSkippedPayments = } self::$logger->debug("Return Type : \CyberSource\Model\ActivateSubscriptionResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "activateSubscription,activateSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -204,7 +208,8 @@ public function activateSubscriptionWithHttpInfo($id, $processSkippedPayments = $httpBody, $headerParams, '\CyberSource\Model\ActivateSubscriptionResponse', - '/rbs/v1/subscriptions/{id}/activate' + '/rbs/v1/subscriptions/{id}/activate', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -327,6 +332,10 @@ public function cancelSubscriptionWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\CancelSubscriptionResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "cancelSubscription,cancelSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -336,7 +345,8 @@ public function cancelSubscriptionWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\CancelSubscriptionResponse', - '/rbs/v1/subscriptions/{id}/cancel' + '/rbs/v1/subscriptions/{id}/cancel', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -458,6 +468,10 @@ public function createSubscriptionWithHttpInfo($createSubscriptionRequest) } self::$logger->debug("Return Type : \CyberSource\Model\CreateSubscriptionResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createSubscription,createSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -467,7 +481,8 @@ public function createSubscriptionWithHttpInfo($createSubscriptionRequest) $httpBody, $headerParams, '\CyberSource\Model\CreateSubscriptionResponse', - '/rbs/v1/subscriptions' + '/rbs/v1/subscriptions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -599,6 +614,10 @@ public function getAllSubscriptionsWithHttpInfo($offset = null, $limit = null, $ } self::$logger->debug("Return Type : \CyberSource\Model\GetAllSubscriptionsResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getAllSubscriptions,getAllSubscriptionsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -608,7 +627,8 @@ public function getAllSubscriptionsWithHttpInfo($offset = null, $limit = null, $ $httpBody, $headerParams, '\CyberSource\Model\GetAllSubscriptionsResponse', - '/rbs/v1/subscriptions' + '/rbs/v1/subscriptions', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -727,6 +747,10 @@ public function getSubscriptionWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\GetSubscriptionResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getSubscription,getSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -736,7 +760,8 @@ public function getSubscriptionWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\GetSubscriptionResponse', - '/rbs/v1/subscriptions/{id}' + '/rbs/v1/subscriptions/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -844,6 +869,10 @@ public function getSubscriptionCodeWithHttpInfo() } self::$logger->debug("Return Type : \CyberSource\Model\GetSubscriptionCodeResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getSubscriptionCode,getSubscriptionCodeWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -853,7 +882,8 @@ public function getSubscriptionCodeWithHttpInfo() $httpBody, $headerParams, '\CyberSource\Model\GetSubscriptionCodeResponse', - '/rbs/v1/subscriptions/code' + '/rbs/v1/subscriptions/code', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -972,6 +1002,10 @@ public function suspendSubscriptionWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\SuspendSubscriptionResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "suspendSubscription,suspendSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -981,7 +1015,8 @@ public function suspendSubscriptionWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\SuspendSubscriptionResponse', - '/rbs/v1/subscriptions/{id}/suspend' + '/rbs/v1/subscriptions/{id}/suspend', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -1118,6 +1153,10 @@ public function updateSubscriptionWithHttpInfo($id, $updateSubscription) } self::$logger->debug("Return Type : \CyberSource\Model\UpdateSubscriptionResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "updateSubscription,updateSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -1127,7 +1166,8 @@ public function updateSubscriptionWithHttpInfo($id, $updateSubscription) $httpBody, $headerParams, '\CyberSource\Model\UpdateSubscriptionResponse', - '/rbs/v1/subscriptions/{id}' + '/rbs/v1/subscriptions/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/SubscriptionsFollowOnsApi.php b/lib/Api/SubscriptionsFollowOnsApi.php index 2d885c3c0..4458d987e 100644 --- a/lib/Api/SubscriptionsFollowOnsApi.php +++ b/lib/Api/SubscriptionsFollowOnsApi.php @@ -202,6 +202,10 @@ public function createFollowOnSubscriptionWithHttpInfo($requestId, $createSubscr } self::$logger->debug("Return Type : \CyberSource\Model\CreateSubscriptionResponse"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "createFollowOnSubscription,createFollowOnSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function createFollowOnSubscriptionWithHttpInfo($requestId, $createSubscr $httpBody, $headerParams, '\CyberSource\Model\CreateSubscriptionResponse', - '/rbs/v1/subscriptions/follow-ons/{requestId}' + '/rbs/v1/subscriptions/follow-ons/{requestId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -330,6 +335,10 @@ public function getFollowOnSubscriptionWithHttpInfo($requestId) } self::$logger->debug("Return Type : \CyberSource\Model\GetSubscriptionResponse1"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getFollowOnSubscription,getFollowOnSubscriptionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -339,7 +348,8 @@ public function getFollowOnSubscriptionWithHttpInfo($requestId) $httpBody, $headerParams, '\CyberSource\Model\GetSubscriptionResponse1', - '/rbs/v1/subscriptions/follow-ons/{requestId}' + '/rbs/v1/subscriptions/follow-ons/{requestId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/TaxesApi.php b/lib/Api/TaxesApi.php index 80bfa0631..aa056f640 100644 --- a/lib/Api/TaxesApi.php +++ b/lib/Api/TaxesApi.php @@ -187,6 +187,10 @@ public function calculateTaxWithHttpInfo($taxRequest) } self::$logger->debug("Return Type : \CyberSource\Model\VasV2PaymentsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "calculateTax,calculateTaxWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function calculateTaxWithHttpInfo($taxRequest) $httpBody, $headerParams, '\CyberSource\Model\VasV2PaymentsPost201Response', - '/vas/v2/tax' + '/vas/v2/tax', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -329,6 +334,10 @@ public function voidTaxWithHttpInfo($voidTaxRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\VasV2TaxVoid200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "voidTax,voidTaxWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -338,7 +347,8 @@ public function voidTaxWithHttpInfo($voidTaxRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\VasV2TaxVoid200Response', - '/vas/v2/tax/{id}' + '/vas/v2/tax/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/TokenApi.php b/lib/Api/TokenApi.php index befdefcca..76cd00f69 100644 --- a/lib/Api/TokenApi.php +++ b/lib/Api/TokenApi.php @@ -218,6 +218,10 @@ public function getCardArtAssetWithHttpInfo($instrumentIdentifierId, $tokenProvi } self::$logger->debug("Return Type : \CyberSource\Model\InlineResponse200"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getCardArtAsset,getCardArtAssetWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -227,7 +231,8 @@ public function getCardArtAssetWithHttpInfo($instrumentIdentifierId, $tokenProvi $httpBody, $headerParams, '\CyberSource\Model\InlineResponse200', - '/tms/v2/tokens/{instrumentIdentifierId}/{tokenProvider}/assets/{assetType}' + '/tms/v2/tokens/{instrumentIdentifierId}/{tokenProvider}/assets/{assetType}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -358,6 +363,10 @@ public function postTokenPaymentCredentialsWithHttpInfo($tokenId, $postPaymentCr } self::$logger->debug("Return Type : string"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postTokenPaymentCredentials,postTokenPaymentCredentialsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -367,7 +376,8 @@ public function postTokenPaymentCredentialsWithHttpInfo($tokenId, $postPaymentCr $httpBody, $headerParams, 'string', - '/tms/v2/tokens/{tokenId}/payment-credentials' + '/tms/v2/tokens/{tokenId}/payment-credentials', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/TokenizedCardApi.php b/lib/Api/TokenizedCardApi.php index 66540df3f..d764f512e 100644 --- a/lib/Api/TokenizedCardApi.php +++ b/lib/Api/TokenizedCardApi.php @@ -194,6 +194,10 @@ public function deleteTokenizedCardWithHttpInfo($tokenizedCardId, $profileId = n } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "deleteTokenizedCard,deleteTokenizedCardWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -203,7 +207,8 @@ public function deleteTokenizedCardWithHttpInfo($tokenizedCardId, $profileId = n $httpBody, $headerParams, null, - '/tms/v2/tokenized-cards/{tokenizedCardId}' + '/tms/v2/tokenized-cards/{tokenizedCardId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -340,6 +345,10 @@ public function getTokenizedCardWithHttpInfo($tokenizedCardId, $profileId = null } self::$logger->debug("Return Type : \CyberSource\Model\TokenizedcardRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getTokenizedCard,getTokenizedCardWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -349,7 +358,8 @@ public function getTokenizedCardWithHttpInfo($tokenizedCardId, $profileId = null $httpBody, $headerParams, '\CyberSource\Model\TokenizedcardRequest', - '/tms/v2/tokenized-cards/{tokenizedCardId}' + '/tms/v2/tokenized-cards/{tokenizedCardId}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -642,6 +652,10 @@ public function postTokenizedCardWithHttpInfo($tokenizedcardRequest, $profileId } self::$logger->debug("Return Type : \CyberSource\Model\TokenizedcardRequest"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "postTokenizedCard,postTokenizedCardWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -651,7 +665,8 @@ public function postTokenizedCardWithHttpInfo($tokenizedcardRequest, $profileId $httpBody, $headerParams, '\CyberSource\Model\TokenizedcardRequest', - '/tms/v2/tokenized-cards' + '/tms/v2/tokenized-cards', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/TransactionBatchesApi.php b/lib/Api/TransactionBatchesApi.php index 511ae83a6..ece98b898 100644 --- a/lib/Api/TransactionBatchesApi.php +++ b/lib/Api/TransactionBatchesApi.php @@ -202,6 +202,10 @@ public function getTransactionBatchDetailsWithHttpInfo($id, $uploadDate = null, } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getTransactionBatchDetails,getTransactionBatchDetailsWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -211,7 +215,8 @@ public function getTransactionBatchDetailsWithHttpInfo($id, $uploadDate = null, $httpBody, $headerParams, null, - '/pts/v1/transaction-batch-details/{id}' + '/pts/v1/transaction-batch-details/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -338,6 +343,10 @@ public function getTransactionBatchIdWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV1TransactionBatchesIdGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getTransactionBatchId,getTransactionBatchIdWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -347,7 +356,8 @@ public function getTransactionBatchIdWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\PtsV1TransactionBatchesIdGet200Response', - '/pts/v1/transaction-batches/{id}' + '/pts/v1/transaction-batches/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -487,6 +497,10 @@ public function getTransactionBatchesWithHttpInfo($startTime, $endTime) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV1TransactionBatchesGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getTransactionBatches,getTransactionBatchesWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -496,7 +510,8 @@ public function getTransactionBatchesWithHttpInfo($startTime, $endTime) $httpBody, $headerParams, '\CyberSource\Model\PtsV1TransactionBatchesGet200Response', - '/pts/v1/transaction-batches' + '/pts/v1/transaction-batches', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -624,6 +639,10 @@ public function uploadTransactionBatchWithHttpInfo($file) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "uploadTransactionBatch,uploadTransactionBatchWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -633,7 +652,8 @@ public function uploadTransactionBatchWithHttpInfo($file) $httpBody, $headerParams, null, - '/pts/v1/transaction-batch-upload' + '/pts/v1/transaction-batch-upload', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/TransactionDetailsApi.php b/lib/Api/TransactionDetailsApi.php index 79a5a4da0..df6b85262 100644 --- a/lib/Api/TransactionDetailsApi.php +++ b/lib/Api/TransactionDetailsApi.php @@ -188,6 +188,10 @@ public function getTransactionWithHttpInfo($id) } self::$logger->debug("Return Type : \CyberSource\Model\TssV2TransactionsGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getTransaction,getTransactionWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function getTransactionWithHttpInfo($id) $httpBody, $headerParams, '\CyberSource\Model\TssV2TransactionsGet200Response', - '/tss/v2/transactions/{id}' + '/tss/v2/transactions/{id}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/TransientTokenDataApi.php b/lib/Api/TransientTokenDataApi.php index 08439209e..b531827c4 100644 --- a/lib/Api/TransientTokenDataApi.php +++ b/lib/Api/TransientTokenDataApi.php @@ -188,6 +188,10 @@ public function getPaymentCredentialsForTransientTokenWithHttpInfo($paymentCrede } self::$logger->debug("Return Type : string"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getPaymentCredentialsForTransientToken,getPaymentCredentialsForTransientTokenWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -197,7 +201,8 @@ public function getPaymentCredentialsForTransientTokenWithHttpInfo($paymentCrede $httpBody, $headerParams, 'string', - '/flex/v2/payment-credentials/{paymentCredentialsReference}' + '/flex/v2/payment-credentials/{paymentCredentialsReference}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -308,6 +313,10 @@ public function getTransactionForTransientTokenWithHttpInfo($transientToken) } self::$logger->debug("Return Type : null"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getTransactionForTransientToken,getTransactionForTransientTokenWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -317,7 +326,8 @@ public function getTransactionForTransientTokenWithHttpInfo($transientToken) $httpBody, $headerParams, null, - '/up/v1/payment-details/{transientToken}' + '/up/v1/payment-details/{transientToken}', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/UnifiedCheckoutCaptureContextApi.php b/lib/Api/UnifiedCheckoutCaptureContextApi.php index 8c8eb7f86..709fe31a5 100644 --- a/lib/Api/UnifiedCheckoutCaptureContextApi.php +++ b/lib/Api/UnifiedCheckoutCaptureContextApi.php @@ -187,6 +187,10 @@ public function generateUnifiedCheckoutCaptureContextWithHttpInfo($generateUnifi } self::$logger->debug("Return Type : string"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "generateUnifiedCheckoutCaptureContext,generateUnifiedCheckoutCaptureContextWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function generateUnifiedCheckoutCaptureContextWithHttpInfo($generateUnifi $httpBody, $headerParams, 'string', - '/up/v1/capture-contexts' + '/up/v1/capture-contexts', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/UserManagementApi.php b/lib/Api/UserManagementApi.php index cd5f37524..ff5e9e945 100644 --- a/lib/Api/UserManagementApi.php +++ b/lib/Api/UserManagementApi.php @@ -201,6 +201,10 @@ public function getUsersWithHttpInfo($organizationId = null, $userName = null, $ } self::$logger->debug("Return Type : \CyberSource\Model\UmsV1UsersGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "getUsers,getUsersWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -210,7 +214,8 @@ public function getUsersWithHttpInfo($organizationId = null, $userName = null, $ $httpBody, $headerParams, '\CyberSource\Model\UmsV1UsersGet200Response', - '/ums/v1/users' + '/ums/v1/users', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/UserManagementSearchApi.php b/lib/Api/UserManagementSearchApi.php index 1b6be2ccc..212c73427 100644 --- a/lib/Api/UserManagementSearchApi.php +++ b/lib/Api/UserManagementSearchApi.php @@ -187,6 +187,10 @@ public function searchUsersWithHttpInfo($searchRequest) } self::$logger->debug("Return Type : \CyberSource\Model\UmsV1UsersGet200Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "searchUsers,searchUsersWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function searchUsersWithHttpInfo($searchRequest) $httpBody, $headerParams, '\CyberSource\Model\UmsV1UsersGet200Response', - '/ums/v1/users/search' + '/ums/v1/users/search', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/VerificationApi.php b/lib/Api/VerificationApi.php index c777b28bc..ea3ad51b7 100644 --- a/lib/Api/VerificationApi.php +++ b/lib/Api/VerificationApi.php @@ -187,6 +187,10 @@ public function validateExportComplianceWithHttpInfo($validateExportComplianceRe } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1ExportComplianceInquiriesPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "validateExportCompliance,validateExportComplianceWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function validateExportComplianceWithHttpInfo($validateExportComplianceRe $httpBody, $headerParams, '\CyberSource\Model\RiskV1ExportComplianceInquiriesPost201Response', - '/risk/v1/export-compliance-inquiries' + '/risk/v1/export-compliance-inquiries', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -314,6 +319,10 @@ public function verifyCustomerAddressWithHttpInfo($verifyCustomerAddressRequest) } self::$logger->debug("Return Type : \CyberSource\Model\RiskV1AddressVerificationsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "verifyCustomerAddress,verifyCustomerAddressWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -323,7 +332,8 @@ public function verifyCustomerAddressWithHttpInfo($verifyCustomerAddressRequest) $httpBody, $headerParams, '\CyberSource\Model\RiskV1AddressVerificationsPost201Response', - '/risk/v1/address-verifications' + '/risk/v1/address-verifications', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/Api/VoidApi.php b/lib/Api/VoidApi.php index 6062508de..0cd303c3a 100644 --- a/lib/Api/VoidApi.php +++ b/lib/Api/VoidApi.php @@ -187,6 +187,10 @@ public function mitVoidWithHttpInfo($mitVoidRequest) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsVoidsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "mitVoid,mitVoidWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -196,7 +200,8 @@ public function mitVoidWithHttpInfo($mitVoidRequest) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsVoidsPost201Response', - '/pts/v2/voids' + '/pts/v2/voids', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -329,6 +334,10 @@ public function voidCaptureWithHttpInfo($voidCaptureRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsVoidsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "voidCapture,voidCaptureWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -338,7 +347,8 @@ public function voidCaptureWithHttpInfo($voidCaptureRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsVoidsPost201Response', - '/pts/v2/captures/{id}/voids' + '/pts/v2/captures/{id}/voids', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -471,6 +481,10 @@ public function voidCreditWithHttpInfo($voidCreditRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsVoidsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "voidCredit,voidCreditWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -480,7 +494,8 @@ public function voidCreditWithHttpInfo($voidCreditRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsVoidsPost201Response', - '/pts/v2/credits/{id}/voids' + '/pts/v2/credits/{id}/voids', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -613,6 +628,10 @@ public function voidPaymentWithHttpInfo($voidPaymentRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsVoidsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "voidPayment,voidPaymentWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -622,7 +641,8 @@ public function voidPaymentWithHttpInfo($voidPaymentRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsVoidsPost201Response', - '/pts/v2/payments/{id}/voids' + '/pts/v2/payments/{id}/voids', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); @@ -755,6 +775,10 @@ public function voidRefundWithHttpInfo($voidRefundRequest, $id) } self::$logger->debug("Return Type : \CyberSource\Model\PtsV2PaymentsVoidsPost201Response"); + + // Response MLE check + $isResponseMLEForAPI = MLEUtility::checkIsResponseMLEForAPI($this->apiClient->merchantConfig, "voidRefund,voidRefundWithHttpInfo"); + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -764,7 +788,8 @@ public function voidRefundWithHttpInfo($voidRefundRequest, $id) $httpBody, $headerParams, '\CyberSource\Model\PtsV2PaymentsVoidsPost201Response', - '/pts/v2/refunds/{id}/voids' + '/pts/v2/refunds/{id}/voids', + $isResponseMLEForAPI ); self::$logger->debug("Response Headers :\n" . \CyberSource\Utilities\Helpers\ListHelper::toString($httpHeader)); diff --git a/lib/ApiClient.php b/lib/ApiClient.php index 1f4c40f18..4296358b0 100755 --- a/lib/ApiClient.php +++ b/lib/ApiClient.php @@ -32,6 +32,7 @@ use CyberSource\Authentication\Util\GlobalParameter as GlobalParameter; use CyberSource\Authentication\PayloadDigest\PayloadDigest as PayloadDigest; use \CyberSource\Logging\LogFactory as LogFactory; +use \CyberSource\Authentication\Util\MLEUtility; $stream_headers = array(); @@ -226,7 +227,7 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) * @throws \CyberSource\ApiException on a non 2xx response * @return mixed */ - public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) + public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null, $isResponseMLEForAPI=false) { self::$logger->info("CALLING API \"$resourcePath\" STARTED"); $headers = []; @@ -263,7 +264,7 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header if($this->merchantConfig->getAuthenticationType() != GlobalParameter::MUTUAL_AUTH) { - $authHeader = $this->callAuthenticationHeader($method, $postData, $resourcePath); + $authHeader = $this->callAuthenticationHeader($method, $postData, $resourcePath, $isResponseMLEForAPI); } $requestHeaders=[]; @@ -500,12 +501,34 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header self::$logger->close(); return [$http_body, $response_info['http_code'], $http_header]; } - + + // Decrypt BEFORE json_decode + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + $error_message = "Response MLE decryption failed: " . $e->getMessage(); + self::$logger->error("ApiException : " . $error_message); + self::$logger->close(); + throw new ApiException($error_message); + } + } + $data = json_decode($http_body); if (json_last_error() > 0) { // if response is a string $data = $http_body; } } else { + // Error path: still attempt decryption so error payload can be read + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + // Ignore; proceeding with encrypted body + } + } + $data = json_decode($http_body); if (json_last_error() > 0) { // if response is a string $data = $http_body; @@ -520,6 +543,7 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header $data ); } + self::$logger->close(); return [$data, $response_info['http_code'], $http_header]; } else { @@ -552,12 +576,31 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header $exception->setResponseObject($response_info); self::$logger->close(); throw $exception; - } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { + } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + $error_message = "File download MLE decryption failed: " . $e->getMessage(); + self::$logger->error("ApiException : " . $error_message); + self::$logger->close(); + throw new ApiException($error_message); + } + } + $stream_headers['http_code'] = $response_info['http_code']; self::$logger->close(); return [$http_body, $stream_headers['http_code'], $stream_headers]; } else { + // Error path: attempt decryption for file downloads too + if (MLEUtility::checkIsMleEncryptedResponse($http_body)) { + try { + $http_body = MLEUtility::decryptMleResponsePayload($this->merchantConfig, $http_body); + } catch (\Exception $e) { + // Ignore; proceeding with encrypted body for error case + } + } self::$logger->error("ApiException : [".$response_info['http_code']."] Error connecting to the API ($url)"); self::$logger->close(); throw new ApiException( @@ -656,11 +699,11 @@ protected function httpParseHeaders($raw_headers) * Purpose : This function calling the Authentication and making an Auth Header * */ - public function callAuthenticationHeader($method, $postData, $resourcePath) + public function callAuthenticationHeader($method, $postData, $resourcePath, $isResponseMLEForAPI) { $merchantConfig = $this->merchantConfig; $authentication = new Authentication($merchantConfig->getLogConfiguration()); - $getToken = $authentication->generateToken($resourcePath, $postData, $method, $merchantConfig); + $getToken = $authentication->generateToken($resourcePath, $postData, $method, $merchantConfig, $isResponseMLEForAPI); if($merchantConfig->getAuthenticationType() == GlobalParameter::HTTP_SIGNATURE){ $host = "Host:".$merchantConfig->getHost(); $vcMerchant = "v-c-merchant-id:".$merchantConfig->getMerchantID(); diff --git a/lib/Authentication/Core/Authentication.php b/lib/Authentication/Core/Authentication.php index 077cb4dae..a54f8c007 100644 --- a/lib/Authentication/Core/Authentication.php +++ b/lib/Authentication/Core/Authentication.php @@ -26,7 +26,7 @@ public function __construct(\CyberSource\Logging\LogConfiguration $logConfig = n } //call http signature and jwt - function generateToken($resourcePath, $inputData, $method, $merchantConfig) + function generateToken($resourcePath, $inputData, $method, $merchantConfig, $isResponseMLEForAPI) { if(is_null($merchantConfig)) { @@ -37,7 +37,7 @@ function generateToken($resourcePath, $inputData, $method, $merchantConfig) $tokenGenerator = $this->getTokenGenerator($merchantConfig); if (null !== self::$logger) { self::$logger->close(); } - return $tokenGenerator->generateToken($resourcePath, $inputData, $method, $merchantConfig); + return $tokenGenerator->generateToken($resourcePath, $inputData, $method, $merchantConfig, $isResponseMLEForAPI); } function getTokenGenerator($merchantConfig) { diff --git a/lib/Authentication/Core/MerchantConfiguration.php b/lib/Authentication/Core/MerchantConfiguration.php index d9bdd90e5..0a9d00da9 100644 --- a/lib/Authentication/Core/MerchantConfiguration.php +++ b/lib/Authentication/Core/MerchantConfiguration.php @@ -206,7 +206,7 @@ class MerchantConfiguration */ protected $useMLEGlobally=null; - /** + /** * Enable MLE for optional APIs globally (alias for useMLEGlobally) * * @var bool @@ -223,17 +223,48 @@ class MerchantConfiguration /** * Curl mapToControlMLEonAPI * - * @var array - */ + * Expected values (strings or booleans): + * "apiFunctionName1" => "true::true" + * "apiFunctionName2" => "false::false" + * "apiFunctionName3" => "true::false" + * "apiFunctionName4" => "false::true" + * "apiFunctionName5" => "true" (request only; response uses global flag) + * "apiFunctionName6" => "false" (request only; response uses global flag) + * "apiFunctionName7" => "::true" (response only; request uses global flag) + * "apiFunctionName8" => "true::" (request true; response uses global flag) + * + * A bare boolean (true/false) acts like "true"/"false" string (request only). + * + * @var array + */ protected $mapToControlMLEonAPI = []; /** - * Curl mleKeyAlias + * Internal parsed per-API Request MLE flags. + * @var array + */ + protected $internalMapToControlRequestMLEonAPI = []; + + /** + * Internal parsed per-API Response MLE flags. + * @var array + */ + protected $internalMapToControlResponseMLEonAPI = []; + + /** + * @deprecated Use requestMleKeyAlias instead. Retained for backward compatibility. * * @var string */ protected $mleKeyAlias = GlobalParameter::DEFAULT_MLE_ALIAS_FOR_CERT; + /** + * Optional parameter. User can pass a custom requestMleKeyAlias to fetch from the certificate. + * + * @var string + */ + protected $requestMleKeyAlias = GlobalParameter::DEFAULT_MLE_ALIAS_FOR_CERT; + /** * Curl DefaultDeveloperId * @@ -276,6 +307,44 @@ class MerchantConfiguration */ protected $mleForRequestPublicCertPath; + /** + * Enable Response (Outbound) MLE globally (encrypted responses if API supports it) + * + * @var bool + */ + protected $enableResponseMleGlobally = false; + + /** + * KID value for the Response MLE public certificate (returned by CyberSource portal) + * + * @var string + */ + protected $responseMleKID = ''; + + /** + * Private key file path used to decrypt Response MLE payloads (e.g. .p12 / .pem) + * + * @var string + */ + protected $responseMlePrivateKeyFilePath = ''; + + /** + * Private key object used to decrypt Response MLE payloads. + * Provide an OpenSSLAsymmetricKey object (PHP 8.0+). + * Mutually exclusive with responseMlePrivateKeyFilePath. + * + * @var \OpenSSLAsymmetricKey|null + */ + protected $responseMlePrivateKey = null; + + /** + * Password for the private key file (e.g. .p12 or encrypted .pem) used for Response MLE decryption. + * Optional. Required only when the key file is password-protected. + * + * @var string + */ + protected $responseMlePrivateKeyFilePassword = ''; + /** * Constructor */ @@ -1012,7 +1081,7 @@ public function setEnableRequestMLEForOptionalApisGlobally($enableRequestMLEForO $this->enableRequestMLEForOptionalApisGlobally = (bool)$enableRequestMLEForOptionalApisGlobally || (bool)$this->useMLEGlobally; } - /** + /** * Get the value of disableRequestMLEForMandatoryApisGlobally * * @return bool @@ -1033,9 +1102,9 @@ public function setDisableRequestMLEForMandatoryApisGlobally($disableRequestMLEF } /** - * Get the value of mapToControlMLEonAPI + * Get the value of mapToControlMLEonAPI (raw user-supplied) * - * @return array + * @return array */ public function getMapToControlMLEonAPI() { @@ -1043,19 +1112,98 @@ public function getMapToControlMLEonAPI() } /** - * Set the value of mapToControlMLEonAPI + * Set the value of mapToControlMLEonAPI. + * Accepts associative array or stdClass whose values are string|bool. * - * @param array $mapToControlMLEonAPI + * Parsing to internal request/response maps happens immediately. + * + * @param array|object $mapToControlMLEonAPI + * @return void + * @throws AuthException if validation fails */ public function setMapToControlMLEonAPI($mapToControlMLEonAPI) { - if ($mapToControlMLEonAPI !== null) { - if (is_array($mapToControlMLEonAPI) && $this->isAssocArrayOfStringBool($mapToControlMLEonAPI)) { - $this->mapToControlMLEonAPI = $mapToControlMLEonAPI; - } else { - throw new InvalidArgumentException("mapToControlMLEonAPI in merchantConfig must be an array type."); + if ($mapToControlMLEonAPI === null) { + return; + } + + if (!is_array($mapToControlMLEonAPI)) { + $error_message = "mapToControlMLEonAPI must be an associative array."; + $exception = new AuthException($error_message, 0); + if (self::$logger) { + self::$logger->error($error_message); + } + throw $exception; + } + + foreach ($mapToControlMLEonAPI as $k => $v) { + if (!is_string($k)) { + $error_message = "mapToControlMLEonAPI keys must be strings."; + $exception = new AuthException($error_message, 0); + if (self::$logger) { self::$logger->error($error_message); } + throw $exception; + } + if (!is_string($v) && !is_bool($v)) { + $error_message = "mapToControlMLEonAPI values must be string or bool."; + $exception = new AuthException($error_message, 0); + if (self::$logger) { self::$logger->error($error_message); } + throw $exception; } } + + // Validate the map value format - allowed values are true::true, false::false, ::true, true::, ::false, false::, true, false + $this->validateMapToControlMLEonAPIValues($mapToControlMLEonAPI); + + // Populate internal maps from the main map + // Initialize internal maps + $this->internalMapToControlRequestMLEonAPI = []; + $this->internalMapToControlResponseMLEonAPI = []; + + foreach ($mapToControlMLEonAPI as $apiName => $value) { + // Convert boolean to string for processing + if (is_bool($value)) { + $value = $value ? 'true' : 'false'; + } + + if (strpos($value, '::') !== false) { + // Format: "requestMLE::responseMLE" + $parts = explode('::', $value, 2); // Limit to 2 parts + $requestMLE = $parts[0]; + $responseMLE = $parts[1]; + + // Set request MLE value + if ($requestMLE !== '') { + $this->internalMapToControlRequestMLEonAPI[$apiName] = ($requestMLE === 'true'); + } + + // Set response MLE value + if ($responseMLE !== '') { + $this->internalMapToControlResponseMLEonAPI[$apiName] = ($responseMLE === 'true'); + } + } else { + // Format: "true" or "false" - applies to request MLE only + $this->internalMapToControlRequestMLEonAPI[$apiName] = ($value === 'true'); + } + } + $this->mapToControlMLEonAPI = $mapToControlMLEonAPI; + } + + /** + * (Optional) expose parsed request MLE map. + * @return array + */ + public function getInternalMapToControlRequestMLEonAPI() + { + return $this->internalMapToControlRequestMLEonAPI; + } + + /** + * (Optional) expose parsed response MLE map. + * @return array + */ + public function getInternalMapToControlResponseMLEonAPI() + { + return $this->internalMapToControlResponseMLEonAPI; } /** @@ -1076,38 +1224,140 @@ public function getMleForRequestPublicCertPath() { return $this->mleForRequestPublicCertPath; } - - private function isAssocArrayOfStringBool($array) { - foreach ($array as $key => $value) { - if (!is_string($key) || !is_bool($value)) { - return false; - } - } - return true; + + /** + * Set enableResponseMleGlobally + * + * @param bool $enableResponseMleGlobally + * @return void + */ + public function setEnableResponseMleGlobally($enableResponseMleGlobally) + { + $this->enableResponseMleGlobally = (bool)$enableResponseMleGlobally; } /** - * Get the value of mleKeyAlias + * Get enableResponseMleGlobally + * + * @return bool + */ + public function getEnableResponseMleGlobally() + { + return $this->enableResponseMleGlobally; + } + + /** + * Set responseMleKID + * + * @param string $responseMleKID + * @return void + */ + public function setResponseMleKID($responseMleKID) + { + $this->responseMleKID = is_string($responseMleKID) ? trim($responseMleKID) : ''; + } + + /** + * Get responseMleKID * * @return string */ + public function getResponseMleKID() + { + return $this->responseMleKID; + } + + /** + * Set responseMlePrivateKeyFilePath + * + * @param string $responseMlePrivateKeyFilePath + * @return void + */ + public function setResponseMlePrivateKeyFilePath($responseMlePrivateKeyFilePath) + { + $this->responseMlePrivateKeyFilePath = is_string($responseMlePrivateKeyFilePath) ? trim($responseMlePrivateKeyFilePath) : ''; + } + + /** + * Get responseMlePrivateKeyFilePath + * + * @return string + */ + public function getResponseMlePrivateKeyFilePath() + { + return $this->responseMlePrivateKeyFilePath; + } + + public function setResponseMlePrivateKey($responseMlePrivateKey) + { + // Accept OpenSSLAsymmetricKey (PHP 8+) + if (is_object($responseMlePrivateKey) && get_class($responseMlePrivateKey) === 'OpenSSLAsymmetricKey') { + $this->responseMlePrivateKey = $responseMlePrivateKey; + } + } + + public function getResponseMlePrivateKey() + { + return $this->responseMlePrivateKey; + } + + public function setResponseMlePrivateKeyFilePassword($responseMlePrivateKeyFilePassword) + { + $this->responseMlePrivateKeyFilePassword = is_string($responseMlePrivateKeyFilePassword) ? $responseMlePrivateKeyFilePassword : ''; + } + + public function getResponseMlePrivateKeyFilePassword() + { + return $this->responseMlePrivateKeyFilePassword; + } + + /** + * Get the value of mleKeyAlias (legacy) + * @deprecated Use getRequestMleKeyAlias() + * @return string + */ public function getMleKeyAlias() { return $this->mleKeyAlias; } /** - * Set the value of mleKeyAlias + * Get requestMleKeyAlias + * + * @return string + */ + public function getRequestMleKeyAlias() + { + return $this->requestMleKeyAlias; + } + + /** + * Set requestMleKeyAlias (canonical). Empty or whitespace -> default constant. + * Keeps legacy mleKeyAlias in sync every time. * + * @param string $requestMleKeyAlias + * @return $this + */ + public function setRequestMleKeyAlias($requestMleKeyAlias) + { + $alias = trim((string) $requestMleKeyAlias); + if ($alias === '') { + $alias = GlobalParameter::DEFAULT_MLE_ALIAS_FOR_CERT; + } + $this->requestMleKeyAlias = $alias; + $this->mleKeyAlias = $alias; // keep legacy field synchronized + return $this; + } + + /** + * Legacy setter for mleKeyAlias. + * Delegates to setRequestMleKeyAlias to ensure synchronization * * @param string $mleKeyAlias + * @return $this */ public function setMleKeyAlias($mleKeyAlias) { - if (!is_null($mleKeyAlias) & !empty(trim($mleKeyAlias)) ) { - $this->mleKeyAlias = $mleKeyAlias; - }else{ - $this->mleKeyAlias = GlobalParameter::DEFAULT_MLE_ALIAS_FOR_CERT; - } + return $this->setRequestMleKeyAlias($mleKeyAlias); } /** @@ -1223,7 +1473,7 @@ public static function setMerchantCredentials($connectionDet) // If both are set, they must be equal if ($useMLE !== null && $enableMLE !== null && $useMLE !== $enableMLE) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( "useMLEGlobally and enableRequestMLEForOptionalApisGlobally must have the same value if both are set." ); } @@ -1237,14 +1487,41 @@ public static function setMerchantCredentials($connectionDet) $config = $config->setMapToControlMLEonAPI($connectionDet->mapToControlMLEonAPI); } - if (isset($connectionDet->mleKeyAlias)) { - $config = $config->setMleKeyAlias($connectionDet->mleKeyAlias); - } - if (isset($connectionDet->mleForRequestPublicCertPath)) { $config = $config->setMleForRequestPublicCertPath($connectionDet->mleForRequestPublicCertPath); } + // Prefer new field; fall back to legacy mleKeyAlias for backward compatibility. + $rawAlias = null; + if (isset($connectionDet->requestMleKeyAlias) && trim((string) $connectionDet->requestMleKeyAlias) !== '') { + $rawAlias = $connectionDet->requestMleKeyAlias; + } elseif (isset($connectionDet->mleKeyAlias) && trim((string) $connectionDet->mleKeyAlias) !== '') { + $rawAlias = $connectionDet->mleKeyAlias; + $config = $config->setMleKeyAlias($rawAlias); // keep legacy field in sync + }else{ + $rawAlias = GlobalParameter::DEFAULT_MLE_ALIAS_FOR_CERT; + } + if ($rawAlias !== null) { + $config=$config->setRequestMleKeyAlias($rawAlias); + } + + // Response MLE (outbound) new fields + if (isset($connectionDet->enableResponseMleGlobally)) { + $config = $config->setEnableResponseMleGlobally($connectionDet->enableResponseMleGlobally); + } + if (isset($connectionDet->responseMleKID)) { + $config = $config->setResponseMleKID($connectionDet->responseMleKID); + } + if (isset($connectionDet->responseMlePrivateKeyFilePath)) { + $config = $config->setResponseMlePrivateKeyFilePath($connectionDet->responseMlePrivateKeyFilePath); + } + if (isset($connectionDet->responseMlePrivateKeyFilePassword)) { + $config = $config->setResponseMlePrivateKeyFilePassword($connectionDet->responseMlePrivateKeyFilePassword); + } + if (isset($connectionDet->responseMlePrivateKey)) { + $config = $config->setResponseMlePrivateKey($connectionDet->responseMlePrivateKey); + } + $config->validateMerchantData(); if($error_message != null){ $error_message = GlobalParameter::NOT_ENTERED. $error_message; @@ -1413,16 +1690,14 @@ public function validateMerchantData() } private function validateMLEConfiguration(){ - $requestMleConfigured = $this->enableRequestMLEForOptionalApisGlobally; - if ($this->mapToControlMLEonAPI !== null && !empty($this->mapToControlMLEonAPI)) { - foreach ($this->mapToControlMLEonAPI as $value) { - if ($value) { - $requestMleConfigured = true; - break; - } - } + /* + * REQUEST MLE VALIDATION + */ + $requestMleConfigured = $this->enableRequestMLEForOptionalApisGlobally===true; + foreach ($this->internalMapToControlRequestMLEonAPI as $flag) { + if ($flag) { $requestMleConfigured = true; break; } } - // if MLE=true then check for auth Type + if ($requestMleConfigured && strcasecmp($this->authenticationType, GlobalParameter::JWT) !== 0) { $error_message = GlobalParameter::REQUEST_MLE_AUTH_ERROR; $exception = new AuthException($error_message, 0); @@ -1441,6 +1716,131 @@ private function validateMLEConfiguration(){ throw $exception; } } + + /* + * RESPONSE (OUTBOUND) MLE VALIDATION + * Trigger if global flag OR any per-API response flag is true. + */ + $responseMleConfigured = (bool)$this->enableResponseMleGlobally; + foreach ($this->internalMapToControlResponseMLEonAPI as $flag) { + if ($flag) { $responseMleConfigured = true; break; } + } + + if ($responseMleConfigured) { + if (strcasecmp($this->authenticationType, GlobalParameter::JWT) !== 0) { + $error_message = "Response MLE is only supported for JWT authentication type."; + $exception = new AuthException($error_message, 0); + self::$logger->error($error_message); + throw $exception; + } + + // Validate responseMleKID + if (empty(trim($this->responseMleKID))) { + $error_message = "Response MLE enabled but responseMleKID is not set."; + $exception = new AuthException($error_message, 0); + self::$logger->error($error_message); + throw $exception; + } + + $hasFilePath = !empty($this->responseMlePrivateKeyFilePath); + $hasInMemoryKey = !empty($this->responseMlePrivateKey); + + if (!$hasFilePath && !$hasInMemoryKey) { + $error_message = "Response MLE enabled but neither responseMlePrivateKeyFilePath nor responseMlePrivateKey provided. Provide exactly one."; + $exception = new AuthException($error_message, 0); + self::$logger->error($error_message); + throw $exception; + } + + if ($hasFilePath && $hasInMemoryKey) { + $error_message = "Both responseMlePrivateKeyFilePath and responseMlePrivateKey supplied. Provide only one."; + $exception = new AuthException($error_message, 0); + self::$logger->error($error_message); + throw $exception; + } + + if ($hasFilePath) { + if ( + !file_exists($this->responseMlePrivateKeyFilePath) || + !is_readable($this->responseMlePrivateKeyFilePath) || + !is_file($this->responseMlePrivateKeyFilePath) + ) { + $error_message = "Response MLE private key file not found or not readable at " . $this->responseMlePrivateKeyFilePath; + $exception = new AuthException($error_message, 0); + self::$logger->error($error_message); + throw $exception; + } + } else { + if (!is_object($this->responseMlePrivateKey) || get_class($this->responseMlePrivateKey) !== 'OpenSSLAsymmetricKey') { + $error_message = "Response MLE private key object is invalid. Expected OpenSSLAsymmetricKey"; + $exception = new AuthException($error_message, 0); + self::$logger->error($error_message); + throw $exception; + } + } + } + } + + /** + * Validates the map values for MLE control API configuration. + * Allowed formats: "true::true", "false::false", "::true", "true::", "::false", "false::", "true", "false" + * + * @param array $mapToControlMLEonAPI the map to validate + * @throws AuthException if any value in the map has invalid format + */ + private function validateMapToControlMLEonAPIValues($mapToControlMLEonAPI) { + + foreach ($mapToControlMLEonAPI as $apiName => $value) { + if (is_bool($value)) { + continue; // Boolean values are always valid + } + + if (!is_string($value)) { + $error_message = "Invalid value type for API '{$apiName}' in mapToControlMLEonAPI. Expected string or boolean, got " . gettype($value); + $exception = new AuthException($error_message, 0); + if (self::$logger) { self::$logger->error($error_message); } + throw $exception; + } + + $trimmedValue = trim($value); + + // Valid single boolean strings + if (in_array($trimmedValue, ['true', 'false'], true)) { + continue; + } + + // Valid :: format strings + if (strpos($trimmedValue, '::') !== false) { + $parts = explode('::', $trimmedValue); + if (count($parts) !== 2) { + $error_message = "Invalid format for API '{$apiName}' in mapToControlMLEonAPI. Multiple '::' separators not allowed. Value: '{$value}'"; + $exception = new AuthException($error_message, 0); + if (self::$logger) { self::$logger->error($error_message); } + throw $exception; + } + + $requestPart = trim($parts[0]); + $responsePart = trim($parts[1]); + + // Validate individual parts (can be empty, 'true', or 'false') + foreach ([$requestPart, $responsePart] as $index => $part) { + if (!empty($part) && !in_array($part, ['true', 'false'], true)) { + $partName = $index === 0 ? 'request' : 'response'; + $error_message = "Invalid {$partName} value for API '{$apiName}' in mapToControlMLEonAPI. Expected 'true', 'false', or empty. Value: '{$part}'"; + $exception = new AuthException($error_message, 0); + if (self::$logger) { self::$logger->error($error_message); } + throw $exception; + } + } + continue; + } + + // If we reach here, the format is invalid + $error_message = "Invalid format for API '{$apiName}' in mapToControlMLEonAPI. Expected formats: 'true', 'false', 'true::true', 'false::false', '::true', 'true::', etc. Value: '{$value}'"; + $exception = new AuthException($error_message, 0); + if (self::$logger) { self::$logger->error($error_message); } + throw $exception; + } } } diff --git a/lib/Authentication/Core/TokenGenerator.php b/lib/Authentication/Core/TokenGenerator.php index 2b627c372..9bea6a823 100644 --- a/lib/Authentication/Core/TokenGenerator.php +++ b/lib/Authentication/Core/TokenGenerator.php @@ -4,7 +4,7 @@ interface TokenGenerator { - public function generateToken($resourcePath, $payloadData, $method, $merchantConfig); + public function generateToken($resourcePath, $payloadData, $method, $merchantConfig, $isResponseMLEForAPI=false); } ?> \ No newline at end of file diff --git a/lib/Authentication/Http/HttpSignatureGenerator.php b/lib/Authentication/Http/HttpSignatureGenerator.php index 03ec1b243..8ba4ea4fc 100644 --- a/lib/Authentication/Http/HttpSignatureGenerator.php +++ b/lib/Authentication/Http/HttpSignatureGenerator.php @@ -24,7 +24,7 @@ public function __construct(\CyberSource\Logging\LogConfiguration $logConfig) } //Signature Creation function - public function generateToken($resourcePath, $payloadData, $method, $merchantConfig) //add + public function generateToken($resourcePath, $payloadData, $method, $merchantConfig, $isResponseMLEForAPI = false) { $host = $merchantConfig->getHost(); $date = date("D, d M Y G:i:s ").GlobalParameter::GMT; diff --git a/lib/Authentication/Jwt/JsonWebTokenGenerator.php b/lib/Authentication/Jwt/JsonWebTokenGenerator.php index 022e9dee3..8e7fd5b62 100644 --- a/lib/Authentication/Jwt/JsonWebTokenGenerator.php +++ b/lib/Authentication/Jwt/JsonWebTokenGenerator.php @@ -26,18 +26,24 @@ public function __construct(\CyberSource\Logging\LogConfiguration $logConfig) } //calling Signature - public function generateToken($resourcePath, $payloadData, $method, $merchantConfig) + public function generateToken($resourcePath, $payloadData, $method, $merchantConfig, $isResponseMLEForAPI=false) { $date = gmdate("D, d M Y G:i:s ").GlobalParameter::GMT; if($method==GlobalParameter::GET || $method==GlobalParameter::DELETE) { $jwtBody = array("iat"=>$date); + if (!empty($isResponseMLEForAPI)) { + $jwtBody['v-c-response-mle-kid'] = $merchantConfig->getResponseMleKID(); + } } else if($method==GlobalParameter::POST || $method==GlobalParameter::PUT || $method==GlobalParameter::PATCH) { $digestObj = new PayloadDigest($merchantConfig->getLogConfiguration()); $digest = $digestObj->generateDigest($payloadData); $jwtBody = array("digest"=>$digest,"digestAlgorithm"=>"SHA-256","iat"=>$date); + if (!empty($isResponseMLEForAPI)) { + $jwtBody['v-c-response-mle-kid'] = $merchantConfig ->getResponseMleKID(); + } } else { diff --git a/lib/Authentication/OAuth/OAuthTokenGenerator.php b/lib/Authentication/OAuth/OAuthTokenGenerator.php index 08ec6d920..461df17db 100644 --- a/lib/Authentication/OAuth/OAuthTokenGenerator.php +++ b/lib/Authentication/OAuth/OAuthTokenGenerator.php @@ -22,7 +22,7 @@ public function __construct() } //Generate OAuth Token Function - public function generateToken($resourcePath, $payloadData, $method, $merchantConfig) //add + public function generateToken($resourcePath, $payloadData, $method, $merchantConfig, $isResponseMLEForAPI = false) { $accessToken = $merchantConfig->getAccessToken(); if(isset($accessToken)) diff --git a/lib/Authentication/Util/Cache.php b/lib/Authentication/Util/Cache.php index e47b4d286..eef3d6222 100644 --- a/lib/Authentication/Util/Cache.php +++ b/lib/Authentication/Util/Cache.php @@ -12,7 +12,6 @@ class Cache private static $file_cache = array(); private static $logger = null; - public function __construct() { if (self::$logger === null) { @@ -171,13 +170,41 @@ private function setupMLECache($merchantConfig, $cacheKey, $mleCertPath) { $configCertIdentifier = strtolower(GlobalParameter::MLE_CACHE_IDENTIFIER_FOR_CONFIG_CERT); $p12CertIdentifier = strtolower(GlobalParameter::MLE_CACHE_IDENTIFIER_FOR_P12_CERT); + $respPrivKeyIdentifier = strtolower(GlobalParameter::MLE_CACHE_IDENTIFIER_FOR_RESPONSE_PRIVATE_KEY); + // --- Response MLE Private Key handling with early return --- + if (substr($lowercaseCacheKey, -strlen($respPrivKeyIdentifier)) === $respPrivKeyIdentifier) { + $password = $merchantConfig->getResponseMlePrivateKeyFilePassword(); + try { + $loaded = Utility::loadResponseMlePrivateKey($mleCertPath, $password); + self::$file_cache[$cacheKey] = [ + 'response_mle_private_key' => $loaded, + 'file_mod_time' => $fileModTime + ]; + } catch (\Exception $e) { + if (self::$logger) { + self::$logger->error("Response MLE private key load failed: ".$e->getMessage()); + } + self::$file_cache[$cacheKey] = [ + 'response_mle_private_key' => null, + 'file_mod_time' => $fileModTime + ]; + } + return; + } + // --- End Response MLE block --- + if (str_ends_with($lowercaseCacheKey, $configCertIdentifier)) { $mleCert = $this->loadCertificateFromPEM($mleCertPath, $merchantConfig); } elseif (str_ends_with($lowercaseCacheKey, $p12CertIdentifier)) { $mleCert = $this->loadCertificateFromP12($mleCertPath, $merchantConfig); + } else { + if (self::$logger) { + self::$logger->warning("Unrecognized MLE cache key pattern: " . $cacheKey); + } + return; } - self::validateCertificateExpiry($mleCert, $merchantConfig->getMleKeyAlias(), $cacheKey); + self::validateCertificateExpiry($mleCert, $merchantConfig->getRequestMleKeyAlias(), $cacheKey); self::$file_cache[$cacheKey] = [ 'mle_cert' => $mleCert, @@ -203,9 +230,9 @@ private function loadCertificateFromPEM($filePath, $merchantConfig) { } try { - $mleCert = Utility::findCertByAlias(array("extracerts" => $certs), $merchantConfig->getMleKeyAlias()); + $mleCert = Utility::findCertByAlias(array("extracerts" => $certs), $merchantConfig->getRequestMleKeyAlias()); } catch (\Exception $e) { - self::$logger->warning("No certificate found for the specified mleKeyAlias '{$merchantConfig->getMleKeyAlias()}'. Using the first certificate from file {$filePath} as the MLE request certificate."); + self::$logger->warning("No certificate found for the specified RequestMleKeyAlias '{$merchantConfig->getRequestMleKeyAlias()}'. Using the first certificate from file {$filePath} as the MLE request certificate."); $mleCert = $certs[0]; } @@ -237,10 +264,10 @@ private function loadCertificateFromP12($filePath, $merchantConfig) { throw $exception; } - $mleCert = Utility::findCertByAlias($certs, $merchantConfig->getMleKeyAlias()); + $mleCert = Utility::findCertByAlias($certs, $merchantConfig->getRequestMleKeyAlias()); if ($mleCert == null) { - throw new MLEException("No certificate found with alias " . $merchantConfig->getMleKeyAlias() . " in " . $filePath); + throw new MLEException("No certificate found with alias " . $merchantConfig->getRequestMleKeyAlias() . " in " . $filePath); } return $mleCert; @@ -299,4 +326,33 @@ public static function validateCertificateExpiry($certificate, $keyAlias, $cache // throw new MLEException("Error validating certificate expiry: " . $e->getMessage()); } } + + public function getMleResponsePrivateKeyFromFilePath($merchantConfig) + { + $merchantId = $merchantConfig->getMerchantID(); + $filePath = $merchantConfig->getResponseMlePrivateKeyFilePath(); + + if (empty($filePath) || !file_exists($filePath)) { + self::$logger->debug("Response MLE private key file not found: " . $filePath); + return null; + } + + $cacheKey = $merchantId . GlobalParameter::MLE_CACHE_IDENTIFIER_FOR_RESPONSE_PRIVATE_KEY; + $modTime = filemtime($filePath); + + if ($modTime === false) { + self::$logger->error("Unable to obtain modification time for response MLE private key file: " . $filePath); + return null; + } + + if (!isset(self::$file_cache[$cacheKey]) || + self::$file_cache[$cacheKey]['file_mod_time'] !== $modTime) { + $this->setupMLECache($merchantConfig, $cacheKey, $filePath); + } else { + self::$logger->debug("Response MLE private key retrieved from cache."); + } + + return self::$file_cache[$cacheKey]['response_mle_private_key'] ?? null; + + } } diff --git a/lib/Authentication/Util/GlobalParameter.php b/lib/Authentication/Util/GlobalParameter.php index f6e61914f..ac3391b0b 100644 --- a/lib/Authentication/Util/GlobalParameter.php +++ b/lib/Authentication/Util/GlobalParameter.php @@ -75,6 +75,7 @@ class GlobalParameter const DEFAULT_PROXY_PORT = 443; const MLE_CACHE_IDENTIFIER_FOR_CONFIG_CERT = "_mleCertFromMerchantConfig"; const MLE_CACHE_IDENTIFIER_FOR_P12_CERT = "_mleCertFromP12"; + const MLE_CACHE_IDENTIFIER_FOR_RESPONSE_PRIVATE_KEY = "_mleResponsePrivateKey"; const MERCHANT_SECRET_KEY_REQ = " MerchantSecretKey is Mandatory\n"; const KEY_PASSWORD_EMPTY = "KeyPassword Empty/Null. Assigining merchantID value\n"; diff --git a/lib/Authentication/Util/MLEUtility.php b/lib/Authentication/Util/MLEUtility.php index 8b2956b88..3d77bd7e6 100644 --- a/lib/Authentication/Util/MLEUtility.php +++ b/lib/Authentication/Util/MLEUtility.php @@ -16,6 +16,7 @@ use Jose\Component\Encryption\Compression\CompressionMethodManager; use Jose\Component\Encryption\Compression\Deflate; use CyberSource\Authentication\Util\MLEException; +use \CyberSource\Authentication\Util\JWE\JWEUtility; /* Purpose : MLE encryption for request body @@ -48,10 +49,10 @@ public static function checkIsMLEForAPI($merchantConfig, $inboundMLEStatus, $ope $operationArray = array_map('trim', explode(',', $operationIds)); - if (!empty($merchantConfig->getMapToControlMLEonAPI())) { + if (!empty($merchantConfig->getInternalMapToControlRequestMLEonAPI())) { foreach ($operationArray as $operationId) { - if (array_key_exists($operationId, $merchantConfig->getMapToControlMLEonAPI())) { - $isMLEForAPI = $merchantConfig->getMapToControlMLEonAPI()[$operationId]; + if (array_key_exists($operationId, $merchantConfig->getInternalMapToControlRequestMLEonAPI())) { + $isMLEForAPI = $merchantConfig->getInternalMapToControlRequestMLEonAPI()[$operationId]; break; } } @@ -59,6 +60,33 @@ public static function checkIsMLEForAPI($merchantConfig, $inboundMLEStatus, $ope return $isMLEForAPI; } + public static function checkIsResponseMLEForAPI($merchantConfig, $operationIds) + { + // default false + $isResponseMLEForAPI = false; + + // Global flag + if ($merchantConfig->getEnableResponseMleGlobally()) { + $isResponseMLEForAPI = true; + } + + // Multiple operation ids (e.g., apiCall, apiCallAsync) + $operationArray = array_map('trim', explode(',', (string)$operationIds)); + + // Per-operation override map (internal response map) + $map = $merchantConfig->getInternalMapToControlResponseMLEonAPI(); + if (is_array($map) && !empty($map)) { + foreach ($operationArray as $operationId) { + if (array_key_exists($operationId, $map)) { + $isResponseMLEForAPI = (bool)$map[$operationId]; + break; + } + } + } + + return $isResponseMLEForAPI; + } + public static function encryptRequestPayload($merchantConfig, $requestBody) { if ($requestBody === null || $requestBody === '') { @@ -91,6 +119,62 @@ public static function encryptRequestPayload($merchantConfig, $requestBody) return $mleRequest; } + public static function checkIsMleEncryptedResponse($responseBody) + { + if ($responseBody === null) { return false; } + $trim = trim($responseBody); + if ($trim === '' || $trim[0] !== '{') { return false; } + try { + $decoded = json_decode($responseBody, true); + if (!is_array($decoded)) { return false; } + if (count($decoded) !== 1) { return false; } + return array_key_exists('encryptedResponse', $decoded) && is_string($decoded['encryptedResponse']); + } catch (\Exception $e) { + return false; + } + } + + public static function decryptMleResponsePayload($merchantConfig, $mleResponseBody) + { + if (self::$logger === null) { + self::$logger = (new LogFactory())->getLogger(\CyberSource\Utilities\Helpers\ClassHelper::getClassName(static::class), $merchantConfig->getLogConfiguration()); + } + + if (!self::checkIsMleEncryptedResponse($mleResponseBody)) { + throw new MLEException("Response body is not MLE encrypted."); + } + $jweToken = self::getResponseMleToken($mleResponseBody); + if (empty($jweToken)) { + // when mle token is empty or null then fall back to non mle encrypted response + return $mleResponseBody; + } + $privateKey = self::getMleResponsePrivateKey($merchantConfig); + if (empty($privateKey)) { + throw new MLEException("Response MLE private key not available for decryption."); + } + if ($merchantConfig->getLogConfiguration()->isMaskingEnabled()) { + $maskedResponseBody = \CyberSource\Utilities\Helpers\DataMasker::maskData($mleResponseBody); + self::$logger->debug("LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION: " . $maskedResponseBody); + } else { + self::$logger->debug("LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION: " . $mleResponseBody); + } + try { + $decrypted = JWEUtility::decryptJWEUsingPrivateKey($privateKey, $jweToken); + if ($decrypted === null) { + throw new MLEException("Failed to decrypt MLE response payload."); + } + if ($merchantConfig->getLogConfiguration()->isMaskingEnabled()) { + $maskedDecrypted = \CyberSource\Utilities\Helpers\DataMasker::maskData($decrypted); + self::$logger->debug("LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION: " . $maskedDecrypted); + } else { + self::$logger->debug("LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION: " . $decrypted); + } + return $decrypted; + } catch (\Exception $e) { + throw new MLEException("MLE Response decryption error: " . $e->getMessage()); + } + } + private static function generateToken($cert, $requestBody) { try { @@ -140,6 +224,39 @@ private static function generateToken($cert, $requestBody) } } + private static function getResponseMleToken($mleResponseBody) + { + try { + $decoded = json_decode($mleResponseBody, true); + return $decoded['encryptedResponse'] ?? null; + } catch (\Exception $e) { + self::$logger->error("Failed to extract Response MLE token: " . $e->getMessage()); + return null; + } + } + + private static function getMleResponsePrivateKey($merchantConfig) + { + if (null != $merchantConfig->getResponseMlePrivateKey()) { + $privateKey = $merchantConfig->getResponseMlePrivateKey(); + if ($privateKey !== null && !is_string($privateKey)) { + try { + $privateKey = Utility::convertKeyObjectToPem($privateKey); + } catch (\Exception $e) { + self::$logger->error("Failed to convert key object to PEM: " . $e->getMessage()); + throw new MLEException("Failed to convert key object to PEM: " . $e->getMessage()); + } + return $privateKey; + } + } + + if (!isset(self::$cache)) { + + self::$cache = new Cache(); + } + return self::$cache->getMleResponsePrivateKeyFromFilePath($merchantConfig); + } + public static function getMLECert($merchantConfig) { try { diff --git a/lib/Authentication/Util/Utility.php b/lib/Authentication/Util/Utility.php index abdee1c36..434418995 100644 --- a/lib/Authentication/Util/Utility.php +++ b/lib/Authentication/Util/Utility.php @@ -49,5 +49,285 @@ public static function extractAllCertificates($certContent) } return $certs; } + + /** + * Load Response MLE private key supporting: + * - PKCS#12 (.p12, .pfx) + * - PEM / KEY / P8 + * + * @param string $filePath Path to the private key file + * @param string|null $password Password for encrypted keys + * @return string Unencrypted PEM string + * @throws \Exception If key cannot be loaded or decrypted + */ + public static function loadResponseMlePrivateKey(string $filePath, ?string $password): string + { + self::validateOpenSslExtension(); + + $ext = strtolower(pathinfo($filePath, PATHINFO_EXTENSION)); + + if (in_array($ext, ['p12', 'pfx'], true)) { + return self::loadPrivateKeyFromPkcs12($filePath, $password); + } + + if (in_array($ext, ['pem', 'key', 'p8'], true)) { + return self::loadPrivateKeyFromPem($filePath, $password); + } + + throw new \Exception("Unsupported Response MLE Private Key file format: {$ext}. Supported: .p12, .pfx, .pem, .key, .p8"); + } + + /** + * Load private key from PKCS#12 file + * + * @param string $filePath Path to the PKCS#12 file + * @param string|null $password Password for the PKCS#12 file + * @return string Unencrypted PEM string + * @throws \Exception If key cannot be loaded + */ + public static function loadPrivateKeyFromPkcs12(string $filePath, ?string $password): string + { + $pkcs12 = file_get_contents($filePath); + if ($pkcs12 === false) { + throw new \Exception("Unable to read PKCS#12 file: {$filePath}"); + } + + $certs = []; + if (!openssl_pkcs12_read($pkcs12, $certs, (string)$password)) { + $err = openssl_error_string(); + throw new \Exception("Unable to parse PKCS#12: {$filePath}. OpenSSL: {$err}"); + } + + if (empty($certs['pkey'])) { + throw new \Exception("No private key found in PKCS#12: {$filePath}"); + } + + return self::exportPrivateKey($certs['pkey'], (string)$password); + } + + /** + * Load private key from PEM file + * + * @param string $filePath Path to the PEM file + * @param string|null $password Password for encrypted PEM + * @return string Unencrypted PEM string + * @throws \Exception If key cannot be loaded + */ + public static function loadPrivateKeyFromPem(string $filePath, ?string $password): string + { + if (!is_file($filePath) || !is_readable($filePath)) { + throw new \Exception("PEM file not found or not readable: {$filePath}"); + } + + $pem = file_get_contents($filePath); + if ($pem === false || $pem === '') { + throw new \Exception('Failed to read PEM file contents.'); + } + + $isEncrypted = self::isPemEncrypted($pem); + + if ($isEncrypted) { + return self::decryptEncryptedPem($pem, $filePath, $password); + } + + return self::normalizeUnencryptedPem($pem, $filePath); + } + + /** + * Export private key to PEM format with cross-platform compatibility + * + * @param mixed $key OpenSSL key resource or PEM string + * @param string $password Password for the key + * @return string Exported PEM string + * @throws \Exception If export fails + */ + private static function exportPrivateKey($key, string $password): string + { + $exported = ''; + + self::clearOpenSslErrors(); + + // Try export without config first (cross-platform) + $exportOk = @openssl_pkey_export($key, $exported, null); + + // Fallback: try with Windows config + if (!$exportOk || trim($exported) === '') { + $configArgs = ['config' => 'NUL']; + $exportOk = @openssl_pkey_export($key, $exported, null, $configArgs); + } + + // Fallback: check if key is already a PEM string + if (!$exportOk || trim($exported) === '') { + if (is_string($key) && preg_match('/BEGIN\\s.+PRIVATE KEY/', $key)) { + return $key; + } + + $errors = self::collectOpenSslErrors(); + throw new \Exception("Failed exporting private key. OpenSSL: " . ($errors ?: 'Unknown error')); + } + + return $exported; + } + + /** + * Normalize unencrypted PEM to standard format + * + * @param string $pem PEM string + * @param string $pemPath Path to PEM file (for error messages) + * @return string Normalized PEM string + * @throws \Exception If normalization fails + */ + public static function normalizeUnencryptedPem(string $pem, string $pemPath): string + { + self::clearOpenSslErrors(); + + $priv = @openssl_pkey_get_private($pem); + if ($priv === false) { + $errors = self::collectOpenSslErrors(); + throw new \Exception("Unable to load unencrypted private key from {$pemPath}. OpenSSL errors: " . ($errors ?: 'No specific error')); + } + + $normalized = ''; + self::clearOpenSslErrors(); + + // Try export without config first + $success = @openssl_pkey_export($priv, $normalized, null); + + // Fallback: try with Windows config + if (!$success) { + $configArgs = ['config' => 'NUL']; + $success = @openssl_pkey_export($priv, $normalized, null, $configArgs); + } + + if (!$success) { + $errors = self::collectOpenSslErrors(); + throw new \Exception("Failed to normalize unencrypted key. OpenSSL errors: " . ($errors ?: 'Unknown error')); + } + + return $normalized; + } + + /** + * Decrypt encrypted PEM file + * + * @param string $pem PEM file contents + * @param string $pemPath Path to PEM file (for error messages) + * @param string|null $passphrase Password for encrypted PEM + * @return string Decrypted PEM string + * @throws \Exception If decryption fails + */ + public static function decryptEncryptedPem(string $pem, string $pemPath, ?string $passphrase): string + { + if ($passphrase === null || $passphrase === '') { + throw new \Exception('Private key is encrypted but no passphrase provided'); + } + + $key = openssl_pkey_get_private($pem, $passphrase); + if ($key === false) { + $errors = self::collectOpenSslErrors(); + throw new \Exception('Unable to decrypt private key. ' . ($errors ?: 'Check passphrase and key format.')); + } + + $unencryptedPem = ''; + + // Try without config first (cross-platform) + $success = @openssl_pkey_export($key, $unencryptedPem, null); + + // Fallback: try with Windows config + if (!$success) { + $configArgs = ['config' => 'NUL']; + $success = @openssl_pkey_export($key, $unencryptedPem, null, $configArgs); + } + + if (!$success) { + $errors = self::collectOpenSslErrors(); + throw new \Exception('Failed to export unencrypted private key. ' . ($errors ?: 'Unknown error')); + } + + return $unencryptedPem; + } + + /** + * Check if PEM is encrypted + * + * @param string $pem PEM string + * @return bool True if encrypted + */ + private static function isPemEncrypted(string $pem): bool + { + return strpos($pem, 'BEGIN ENCRYPTED PRIVATE KEY') !== false || + strpos($pem, 'Proc-Type: 4,ENCRYPTED') !== false; + } + + /** + * Clear OpenSSL error queue + * + * @return void + */ + private static function clearOpenSslErrors(): void + { + while (openssl_error_string() !== false); + } + + /** + * Collect all OpenSSL errors from the error queue + * + * @return string Concatenated error messages + */ + private static function collectOpenSslErrors(): string + { + $errors = ''; + while ($msg = openssl_error_string()) { + $errors .= ($errors ? ' | ' : '') . $msg; + } + return $errors; + } + + /** + * Validate OpenSSL extension is loaded + * + * @return void + * @throws \Exception If OpenSSL extension is not loaded + */ + private static function validateOpenSslExtension(): void + { + if (!extension_loaded('openssl')) { + throw new \Exception("OpenSSL extension not loaded; cannot read private key."); + } + } + + /** + * Convert OpenSSL key object to PEM string + * + * @param \OpenSSLAsymmetricKey|resource $key OpenSSL key object or resource + * @return string PEM string + * @throws \Exception If conversion fails + */ + public static function convertKeyObjectToPem($key): string + { + if (is_string($key)) { + // Already a PEM string + return $key; + } + + self::clearOpenSslErrors(); + + $pemString = ''; + + // Try export without config first + $success = @openssl_pkey_export($key, $pemString, null); + + // Fallback: try with Windows config + if (!$success || trim($pemString) === '') { + $configArgs = ['config' => 'NUL']; + $success = @openssl_pkey_export($key, $pemString, null, $configArgs); + } + + if (!$success || trim($pemString) === '') { + $errors = self::collectOpenSslErrors(); + throw new \Exception('Failed to convert OpenSSL key object to PEM string. OpenSSL: ' . ($errors ?: 'Unknown error')); + } + + return $pemString; + } } -?> \ No newline at end of file