diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dcd104b..dc4a79d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,19 @@ # Changelog ## Latest version +- Send "x-gp-sdk" in the header with the SDK programming language and release version used +- Send headers to GP-API that are dynamically set through configuration, like: + - x-gp-platform: "prestashop;version=1.7.2" + - x-gp-extension: "coccinet;version=2.4.1" +- Fix some GP-ECOM unit tests for APM, certifications and add Secure3dServiceTest to realex test suite +- Add support for Propay timezone and device details + +## v2.3.8 (07/27/2021) #### Enhancements: - Add new HPP example for GP-ECOM - Add file medatada.xml - ## v2.3.7 (07/20/2021) #### Enhancements: diff --git a/metadata.xml b/metadata.xml index 44f1d64f..a7786ef7 100644 --- a/metadata.xml +++ b/metadata.xml @@ -1,3 +1,3 @@ - 2.3.8 + 2.3.9 \ No newline at end of file diff --git a/src/Builders/PayFacBuilder.php b/src/Builders/PayFacBuilder.php index 2f76e419..4626b1e2 100644 --- a/src/Builders/PayFacBuilder.php +++ b/src/Builders/PayFacBuilder.php @@ -42,6 +42,7 @@ class PayFacBuilder extends BaseBuilder public $flashFundsPaymentCardData; public $externalId; public $sourceEmail; + public $deviceDetails; const UPLOAD_FILE_TYPES = [ 'tif', 'tiff', 'bmp', 'jpg', 'jpeg', 'gif', 'png', 'doc', 'docx' @@ -166,7 +167,6 @@ protected function setupValidations() ->check('transNum')->isNotNull() ->check('requireCCRefund')->isNotNull() ->check('ccAmount')->isNotNull(); - } /* @@ -384,4 +384,11 @@ public function withSourceEmail($sourceEmail) $this->sourceEmail = $sourceEmail; return $this; } + + public function withDeviceDetails($deviceDetails) + { + $this->deviceDetails = $deviceDetails; + return $this; + } + } diff --git a/src/Entities/Enums/TimeZone.php b/src/Entities/Enums/TimeZone.php new file mode 100644 index 00000000..03984b5e --- /dev/null +++ b/src/Entities/Enums/TimeZone.php @@ -0,0 +1,19 @@ +headers = []; + $this->dynamicHeaders = []; $this->contentType = $contentType; } @@ -83,7 +89,7 @@ protected function sendRequest( $queryString = $this->buildQueryString($queryStringParams); $request = curl_init($this->serviceUrl . $endpoint . $queryString); - $this->headers = array_merge($this->headers, [ + $this->headers = array_merge($this->dynamicHeaders, $this->headers, [ 'Content-Type' => sprintf('%s; charset=UTF-8', $this->contentType), 'Content-Length' => empty($data) ? 0 : strlen($data), ]); diff --git a/src/Gateways/GpApiConnector.php b/src/Gateways/GpApiConnector.php index fa013df6..89366e9b 100644 --- a/src/Gateways/GpApiConnector.php +++ b/src/Gateways/GpApiConnector.php @@ -40,6 +40,23 @@ public function __construct(GpApiConfig $gpApiConfig) $this->headers['X-GP-Version'] = self::GP_API_VERSION; $this->headers['Accept'] = 'application/json'; $this->headers['Accept-Encoding'] = 'gzip'; + $this->headers['x-gp-sdk'] = 'php;version=' . $this->getReleaseVersion(); + } + + /** + * Get the SDK release version + * + * @return string|null + */ + private function getReleaseVersion() + { + $filename = dirname(__FILE__) . "/../../metadata.xml"; + if (!file_exists($filename)) { + return null; + } + $xml = simplexml_load_string(file_get_contents($filename)); + + return !empty($xml->releaseNumber) ? $xml->releaseNumber : null; } public function getVersion() diff --git a/src/Gateways/ProPayConnector.php b/src/Gateways/ProPayConnector.php index f71667bd..6b1cbd0b 100644 --- a/src/Gateways/ProPayConnector.php +++ b/src/Gateways/ProPayConnector.php @@ -17,6 +17,7 @@ use GlobalPayments\Api\Entities\PayFac\RenewAccountData; use GlobalPayments\Api\Entities\PayFac\SingleSignOnData; use GlobalPayments\Api\Entities\PayFac\OwnerDetailsResponseData; +use GlobalPayments\Api\Entities\PayFac\DeviceDetails; class ProPayConnector extends XmlGateway implements IPayFacProvider { @@ -62,16 +63,16 @@ public function processPayFac(PayFacBuilder $builder) $this->hydrateFlashFundsData($xml, $xmlTrans, $builder->flashFundsPaymentCardData); } elseif ($builder->transactionType === TransactionType::GET_ACCOUNT_DETAILS && empty($builder->accountNumber)) { - if(!empty($builder->externalId)){ + if (!empty($builder->externalId)) { $xmlTrans->appendChild($xml->createElement('externalId', $builder->externalId)); - } elseif(!empty($builder->sourceEmail)){ + } elseif (!empty($builder->sourceEmail)) { $xmlTrans->appendChild($xml->createElement('sourceEmail', $builder->sourceEmail)); } } $transaction->appendChild($xmlTrans); - $requestXML = $xml->saveXML($transaction); + $requestXML = $xml->saveXML($transaction); $response = $this->doTransaction($requestXML); return $this->mapResponse($builder, $response); @@ -186,6 +187,10 @@ private function hydrateAccountDetails($xml, $xmlTrans, PayFacBuilder $builder) if (!empty($builder->grossBillingInformation)) { $this->hydrateGrossBillingData($xml, $xmlTrans, $builder->grossBillingInformation); } + + if (!empty($builder->deviceDetails)) { + $this->hydrateDeviceQuantity($xml, $xmlTrans, $builder->deviceDetails); + } $this->hydrateBankDetails($xml, $xmlTrans, $builder); $this->hydratOtherDetails($xml, $xmlTrans, $builder); @@ -205,6 +210,8 @@ private function hydrateAccountEditDetails($xml, $xmlTrans, PayFacBuilder $build $this->hydrateBusinessData($xml, $xmlTrans, $builder->businessData); } elseif (!empty($builder->grossBillingInformation)) { $this->hydrateGrossBillingData($xml, $xmlTrans, $builder->grossBillingInformation); + } elseif (!empty($builder->deviceQuantity)) { + $this->hydrateDeviceQuantity($xml, $xmlTrans, $builder->deviceQuantity); } //update bank details if any $this->hydrateBankDetails($xml, $xmlTrans, $builder); @@ -248,7 +255,7 @@ private function hydrateBeneficialOwnerData($xml, $xmLtransaction, $beneficialOw 'City' => !empty($ownerInfo->ownerAddress->city) ? $ownerInfo->ownerAddress->city : '', 'State' => !empty($ownerInfo->ownerAddress->state) ? $ownerInfo->ownerAddress->state : '', 'Zip' => !empty($ownerInfo->ownerAddress->postalCode) ? $ownerInfo->ownerAddress->postalCode : '', - 'Country' => !empty($ownerInfo->ownerAddress->country) ? $ownerInfo->ownerAddress->country : '', + 'Country' => !is_null($ownerInfo->ownerAddress->country) ? $ownerInfo->ownerAddress->country : '', 'Title' => !empty($ownerInfo->title) ? $ownerInfo->title : '', 'Percentage' => !empty($ownerInfo->percentage) ? $ownerInfo->percentage : '' ]; @@ -277,7 +284,7 @@ private function hydrateBusinessData($xml, $transaction, BusinessData $businessD 'BusinessAddress' => !empty($businessData->businessAddress->streetAddress1) ? $businessData->businessAddress->streetAddress1 : '', 'BusinessAddress2' => !empty($businessData->businessAddress->streetAddress2) ? $businessData->businessAddress->streetAddress2 : '', 'BusinessCity' => !empty($businessData->businessAddress->city) ? $businessData->businessAddress->city : '', - 'BusinessCountry' => !empty($businessData->businessAddress->country) ? $businessData->businessAddress->country : '', + 'BusinessCountry' => !is_null($businessData->businessAddress->country) ? $businessData->businessAddress->country : '', 'BusinessState' => !empty($businessData->businessAddress->state) ? $businessData->businessAddress->state : '', 'BusinessZip' => !empty($businessData->businessAddress->postalCode) ? $businessData->businessAddress->postalCode : '' ]; @@ -310,13 +317,13 @@ private function hydrateUserPersonalData($xml, $transaction, UserPersonalData $u 'city' => !empty($merchantAddress->city) ? $merchantAddress->city : '', 'state' => !empty($merchantAddress->state) ? $merchantAddress->state : '', 'zip' => !empty($merchantAddress->postalCode) ? $merchantAddress->postalCode : '', - 'country' => !empty($merchantAddress->country) ? $merchantAddress->country : '', + 'country' => !is_null($merchantAddress->country) ? $merchantAddress->country : '', 'mailAddr' => !empty($mailingAddress->streetAddress1) ? $mailingAddress->streetAddress1 : '', 'mailApt' => !empty($mailingAddress->streetAddress2) ? $mailingAddress->streetAddress2: '', 'mailAddr3' => !empty($mailingAddress->streetAddress3) ? $mailingAddress->streetAddress3 : '', 'mailCity' => !empty($mailingAddress->city) ? $mailingAddress->city : '', - 'mailCountry' => !empty($mailingAddress->country) ? $mailingAddress->country : '', + 'mailCountry' => !is_null($mailingAddress->country) ? $mailingAddress->country : '', 'mailState' => !empty($mailingAddress->state) ? $mailingAddress->state : '' , 'mailZip' => !empty($mailingAddress->postalCode) ? $mailingAddress->postalCode : '', ]; @@ -401,7 +408,7 @@ private function hydratOtherDetails($xml, $xmlTrans, $builder) 'SignificantOwnerCityName' => !empty($significantOwnerData->ownerAddress->city) ? $significantOwnerData->ownerAddress->city : '', 'SignificantOwnerRegionCode' => !empty($significantOwnerData->ownerAddress->state) ? $significantOwnerData->ownerAddress->state : '', 'SignificantOwnerPostalCode' => !empty($significantOwnerData->ownerAddress->postalCode) ? $significantOwnerData->ownerAddress->postalCode : '', - 'SignificantOwnerCountryCode' => !empty($significantOwnerData->ownerAddress->country) ? $significantOwnerData->ownerAddress->country : '', + 'SignificantOwnerCountryCode' => !is_null($significantOwnerData->ownerAddress->countryCode) ? $significantOwnerData->ownerAddress->countryCode : '', 'SignificantOwnerTitle' => !empty($significantOwnerData->title) ? $significantOwnerData->title : '', 'SignificantOwnerPercentage' => !empty($significantOwnerData->percentage) ? $significantOwnerData->percentage : '', ]); @@ -417,13 +424,13 @@ private function hydrateGrossBillingData($xml, $transaction, $grossBilling) 'GrossSettleCity' => !empty($grossBilling->grossSettleAddress->city) ? $grossBilling->grossSettleAddress->city : '', 'GrossSettleState' => !empty($grossBilling->grossSettleAddress->state) ? $grossBilling->grossSettleAddress->state : '', 'GrossSettleZipCode' => !empty($grossBilling->grossSettleAddress->postalCode) ? $grossBilling->grossSettleAddress->postalCode : '', - 'GrossSettleCountry' => !empty($grossBilling->grossSettleAddress->country) ? $grossBilling->grossSettleAddress->country : '', + 'GrossSettleCountry' => !is_null($grossBilling->grossSettleAddress->country) ? $grossBilling->grossSettleAddress->country : '', 'GrossSettleCreditCardNumber' => !empty($grossBilling->grossSettleCreditCardData->number) ? $grossBilling->grossSettleCreditCardData->number : '', 'GrossSettleNameOnCard' => !empty($grossBilling->grossSettleCreditCardData->cardHolderName) ? $grossBilling->grossSettleCreditCardData->cardHolderName : '', 'GrossSettleCreditCardExpDate' => $grossBilling->grossSettleCreditCardData->getShortExpiry(), - 'GrossSettleAccountCountryCode' => !empty($grossBilling->grossSettleBankData->accountCountryCode) ? $grossBilling->grossSettleBankData->accountCountryCode : '', + 'GrossSettleAccountCountryCode' => !is_null($grossBilling->grossSettleBankData->accountCountryCode) ? $grossBilling->grossSettleBankData->accountCountryCode : '', 'GrossSettleAccountHolderName' => !empty($grossBilling->grossSettleBankData->accountName) ? $grossBilling->grossSettleBankData->accountName : '', 'GrossSettleAccountNumber' => !empty($grossBilling->grossSettleBankData->accountNumber) ? $grossBilling->grossSettleBankData->accountNumber : '', 'GrossSettleAccountType' => !empty($grossBilling->grossSettleBankData->accountType) ? $grossBilling->grossSettleBankData->accountType : '', @@ -533,7 +540,7 @@ private function updateBankAccountOwnershipInfo($xml, $xmLtransaction, $benefici 'City' => !empty($ownerInfo->ownerAddress->city) ? $ownerInfo->ownerAddress->city : '', 'StateProvince' => !empty($ownerInfo->ownerAddress->state) ? $ownerInfo->ownerAddress->state : '', 'PostalCode' => !empty($ownerInfo->ownerAddress->postalCode) ? $ownerInfo->ownerAddress->postalCode : '', - 'Country' => !empty($ownerInfo->ownerAddress->country) ? $ownerInfo->ownerAddress->country : '', + 'Country' => !is_null($ownerInfo->ownerAddress->country) ? $ownerInfo->ownerAddress->country : '', 'Phone' => !empty($ownerInfo->phone) ? $ownerInfo->phone : '', ]; @@ -633,7 +640,7 @@ private function populateProPayResponse($root) if (!empty($root->beneficialOwnerDataResult->Owner)) { foreach ($root->beneficialOwnerDataResult->Owner as $owner) { - $ownerDetails = new OwnerDetailsResponseData(); + $ownerDetails = new OwnerDetailsResponseData(); $ownerDetails->firstName = (string) $owner->FirstName; $ownerDetails->lastName = (string) $owner->LastName; $ownerDetails->validationStatus = (string) $owner->Status; @@ -643,4 +650,16 @@ private function populateProPayResponse($root) return $propayResponse; } + + private function hydrateDeviceQuantity($xml, $xmlTrans, DeviceDetails $deviceDetails) + { + $devicesList = $xml->createElement('Devices'); + $device = $xml->createElement('Device'); + $device->appendChild($xml->createElement('Quantity', $deviceDetails->quantity)); + $devicesList->appendChild($device); + + $xmlTrans->appendChild($devicesList); + + $xmlTrans->appendChild($xml->createElement('TimeZone', $deviceDetails->timezone)); + } } diff --git a/src/Gateways/RealexConnector.php b/src/Gateways/RealexConnector.php index b176e2d8..e62cea35 100644 --- a/src/Gateways/RealexConnector.php +++ b/src/Gateways/RealexConnector.php @@ -144,15 +144,13 @@ public function processAuthorization(AuthorizationBuilder $builder) $request->setAttribute("type", $transactionType); $request->appendChild($xml->createElement("merchantid", $this->merchantId)); - + if ($this->accountId !== null) { $request->appendChild($xml->createElement("account", $this->accountId)); } if ($this->channel !== null) { $request->appendChild($xml->createElement("channel", $this->channel)); } - - $request->appendChild($xml->createElement("orderid", $orderId)); if (isset($builder->amount)) { $amount = $xml->createElement("amount", preg_replace('/[^0-9]/', '', sprintf('%01.2f', $builder->amount))); @@ -168,6 +166,8 @@ public function processAuthorization(AuthorizationBuilder $builder) $request->appendChild($element); } + $request->appendChild($xml->createElement("orderid", $orderId)); + // For Fraud Decision Manager if (!empty($builder->customerData)) { $customerValue = $builder->customerData; @@ -463,8 +463,8 @@ public function processAuthorization(AuthorizationBuilder $builder) } // mpi - $secureEcom = $builder->paymentMethod->threeDSecure; - if (!empty($secureEcom)) { + if (!empty($builder->paymentMethod->threeDSecure)) { + $secureEcom = $builder->paymentMethod->threeDSecure; $mpi = $xml->createElement("mpi"); $mpi->appendChild($xml->createElement("eci", $secureEcom->eci)); $mpi->appendChild($xml->createElement("cavv", $secureEcom->cavv)); @@ -596,6 +596,7 @@ public function serializeRequest(AuthorizationBuilder $builder) $this->setSerializeData('CUST_NUM', $builder->customerId); } if (!empty($builder->shippingAddress)) { + $countryCode = CountryUtils::getCountryCodeByCountry($builder->shippingAddress->country); $shippingCode = $this->generateCode($builder->shippingAddress); @@ -1451,7 +1452,7 @@ private function mapAcceptedCodes($paymentMethodType) case "3ds-verifysig": case "3ds-verifyenrolled": return ["00", "110"]; - case PaymentMethodType::APM: + case "payment-set": return ["01"]; default: return ["00"]; diff --git a/src/ServiceConfigs/Configuration.php b/src/ServiceConfigs/Configuration.php index d9bd3dea..7bfe12fd 100644 --- a/src/ServiceConfigs/Configuration.php +++ b/src/ServiceConfigs/Configuration.php @@ -36,6 +36,11 @@ abstract public function configureContainer(ConfiguredServices $services); /** @var bool */ public $forceGatewayTimeout; + /** + * @var array + */ + public $dynamicHeaders = []; + public function validate() { $this->validated = true; diff --git a/src/ServiceConfigs/Gateways/GpApiConfig.php b/src/ServiceConfigs/Gateways/GpApiConfig.php index 5f1ddc5b..633071ea 100644 --- a/src/ServiceConfigs/Gateways/GpApiConfig.php +++ b/src/ServiceConfigs/Gateways/GpApiConfig.php @@ -88,6 +88,7 @@ public function configureContainer(ConfiguredServices $services) $gateway->serviceUrl = $this->serviceUrl; $gateway->requestLogger = $this->requestLogger; $gateway->webProxy = $this->webProxy; + $gateway->dynamicHeaders = $this->dynamicHeaders; $services->gatewayConnector = $gateway; $services->reportingService = $gateway; diff --git a/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.php b/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.php index b55aa528..3561a4cb 100644 --- a/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.php +++ b/test/Integration/Gateways/GpApiConnector/CreditCardNotPresentTest.php @@ -1034,6 +1034,11 @@ public function setUpConfig() $config->environment = Environment::TEST; $config->channel = Channels::CardNotPresent; $config->country = 'GB'; + //DO NO DELETE - usage example for some settings +// $config->dynamicHeaders = [ +// 'x-gp-platform' => 'prestashop;version=1.7.2', +// 'x-gp-extension' => 'coccinet;version=2.4.1', +// ]; // $config->permissions = ['TRN_POST_Authorize']; // $config->webProxy = new CustomWebProxy('127.0.0.1:8866'); // $config->requestLogger = new SampleRequestLogger(new Logger("logs")); diff --git a/test/Integration/Gateways/ProPay/ProPayAccountTests.php b/test/Integration/Gateways/ProPay/ProPayAccountTests.php index e82c17de..f86309ea 100644 --- a/test/Integration/Gateways/ProPay/ProPayAccountTests.php +++ b/test/Integration/Gateways/ProPay/ProPayAccountTests.php @@ -10,6 +10,8 @@ use GlobalPayments\Api\Entities\PayFac\UploadDocumentData; use GlobalPayments\Api\Entities\PayFac\SingleSignOnData; use GlobalPayments\Api\Tests\Integration\Gateways\ProPay\TestData\TestAccountData; +use GlobalPayments\Api\Entities\Enums\TimeZone; +use GlobalPayments\Api\Entities\PayFac\DeviceDetails; class ProPayAccountTests extends TestCase { @@ -287,4 +289,39 @@ public function testUpdateGrossBillingInfo() $this->assertNotNull($response); $this->assertEquals('00', $response->responseCode); } + + public function testCreateAccountWithTimeZone() + { + $bankAccountInformation = TestAccountData::getBankAccountData(); + $userBusinessInformation = TestAccountData::getBusinessData(); + $accountPersonalInformation = TestAccountData::getUserPersonalData(); + $threatRiskData = TestAccountData::getThreatRiskData(); + $significantOwnerData = TestAccountData::getSignificantOwnerData(); + $ownersInformation = TestAccountData::getBeneficialOwnerData(); + $creditCardInformation = TestAccountData::getCreditCardData(); + $achInformation = TestAccountData::getACHData(); + $secondaryBankInformation = TestAccountData::getSecondaryBankAccountData(); + $deviceDetails = new DeviceDetails(); + $deviceDetails->quantity = 2; + $deviceDetails->timezone = TimeZone::ET; + + $response = PayFacService::createAccount() + ->withBankAccountData($bankAccountInformation) + ->withBusinessData($userBusinessInformation) + ->withUserPersonalData($accountPersonalInformation) + ->withThreatRiskData($threatRiskData) + ->withSignificantOwnerData($significantOwnerData) + ->withBeneficialOwnerData($ownersInformation) + ->withCreditCardData($creditCardInformation) + ->withACHData($achInformation) + ->withSecondaryBankAccountData($secondaryBankInformation) + ->withDeviceDetails($deviceDetails) + ->execute(); + + $this->assertNotNull($response); + $this->assertEquals('00', $response->responseCode); + $this->assertNotNull($response->payFacData->accountNumber); + $this->assertNotNull($response->payFacData->password); + $this->assertNotNull($response->payFacData->sourceEmail); + } } diff --git a/test/Integration/Gateways/ProPay/ProPayGetInformationTests.php b/test/Integration/Gateways/ProPay/ProPayGetInformationTests.php index 0d14ea3e..6cfb33db 100644 --- a/test/Integration/Gateways/ProPay/ProPayGetInformationTests.php +++ b/test/Integration/Gateways/ProPay/ProPayGetInformationTests.php @@ -69,5 +69,4 @@ public function testGetAccountInfoSourceEmail() $this->assertNotNull($response); $this->assertEquals("00", $response->responseCode); } - } diff --git a/test/Integration/Gateways/RealexConnector/Certifications/SdkTest.php b/test/Integration/Gateways/RealexConnector/Certifications/SdkTest.php index e0456410..e9c2097f 100644 --- a/test/Integration/Gateways/RealexConnector/Certifications/SdkTest.php +++ b/test/Integration/Gateways/RealexConnector/Certifications/SdkTest.php @@ -2940,7 +2940,7 @@ public function testValidation003g() // create card $card = $this->getBaseCardData(); $card->expMonth = 12; - $card->expYear = 20; // magic number? + $card->expYear = TestCards::validCardExpYear(); // request $response = $card->charge(100.01) @@ -10945,6 +10945,9 @@ public function testCredit014c() $this->assertEquals("00", $response->responseCode); } + /** + * @expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function testCredit014d() { $config = $this->getBaseConfig(); @@ -16388,6 +16391,9 @@ public function testManual031b() $this->assertEquals("00", $response->responseCode); } + /** + * @expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function testManual031c1() { $config = $this->getBaseConfig(); @@ -16414,6 +16420,9 @@ public function testManual031c1() $this->assertEquals("00", $response->responseCode); } + /** + * @expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function testManual031c2() { $config = $this->getBaseConfig(); @@ -16572,6 +16581,9 @@ public function testManual033b2() $this->assertEquals("00", $response->responseCode); } + /** + * @expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function testManual033c1() { $config = $this->getBaseConfig(); @@ -16602,6 +16614,9 @@ public function testManual033c1() $this->assertEquals("00", $response->responseCode); } + /** + * @expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function testManual033c2() { $config = $this->getBaseConfig(); @@ -16727,6 +16742,9 @@ public function testManual034b2() $this->assertEquals("00", $response->responseCode); } + /** + * @expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function testManual034c1() { $config = $this->getBaseConfig(); @@ -16757,6 +16775,9 @@ public function testManual034c1() $this->assertEquals("00", $response->responseCode); } + /** + * @expectedException GlobalPayments\Api\Entities\Exceptions\GatewayException + */ public function testManual034c2() { $config = $this->getBaseConfig(); diff --git a/test/Integration/Gateways/RealexConnector/Secure3DSExemptionsTest.php b/test/Integration/Gateways/RealexConnector/Secure3DSExemptionsTest.php index 4a3122ba..a8d0a61a 100644 --- a/test/Integration/Gateways/RealexConnector/Secure3DSExemptionsTest.php +++ b/test/Integration/Gateways/RealexConnector/Secure3DSExemptionsTest.php @@ -266,7 +266,7 @@ public function testFullCycle_v2_EOS_Block() ->withEnableExemptionOptimization(true) ->execute(); } catch (GatewayException $exception) { - $this->assertEquals('Status Code: 202 - Blocked by Transaction Risk Analysis.' , $exception->getMessage()); + $this->assertContains('Status Code: 202 - Blocked by Transaction Risk Analysis' , $exception->getMessage()); } } } \ No newline at end of file diff --git a/test/Integration/Gateways/RealexConnector/Secure3dServiceTests.php b/test/Integration/Gateways/RealexConnector/Secure3dServiceTest.php similarity index 99% rename from test/Integration/Gateways/RealexConnector/Secure3dServiceTests.php rename to test/Integration/Gateways/RealexConnector/Secure3dServiceTest.php index 7a5245ff..147f19a5 100644 --- a/test/Integration/Gateways/RealexConnector/Secure3dServiceTests.php +++ b/test/Integration/Gateways/RealexConnector/Secure3dServiceTest.php @@ -3,9 +3,7 @@ namespace GlobalPayments\Api\Tests\Integration\Gateways\RealexConnector; use GlobalPayments\Api\Entities\CustomWebProxy; -use GlobalPayments\Api\Entities\Enums\DecoupledFlowRequest; use GlobalPayments\Api\Entities\Enums\MerchantInitiatedRequestType; -use GlobalPayments\Api\Entities\Enums\WhiteListStatus; use GlobalPayments\Api\ServicesContainer; use GlobalPayments\Api\Entities\MerchantDataCollection; use GlobalPayments\Api\Entities\Enums\Secure3dVersion; @@ -37,7 +35,7 @@ use GlobalPayments\Api\Entities\Enums\ChallengeRequestIndicator; use GlobalPayments\Api\ServiceConfigs\Gateways\GpEcomConfig; -class Secure3dServiceTests extends TestCase +class Secure3dServiceTest extends TestCase { private $card; private $stored; @@ -145,7 +143,7 @@ public function testFullCycle_v1() ->withMerchantData($md) ->execute(); $card->threeDSecure = $secureEcom; - if ($secureEcom->status == 'Y') { + if (in_array($secureEcom->status, ['Y', 'A'])) { $response = $card->charge()->execute(); $this->assertNotNull($response); $this->assertEquals('00', $response->responseCode);