Skip to content

Commit

Permalink
OctopusDeploy release: 2.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Dec 7, 2021
1 parent 641274b commit 792fc4a
Show file tree
Hide file tree
Showing 18 changed files with 458 additions and 104 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

## Latest version

#### Enhancements:
- Added avs/cvv mapping and support for findTransaction method
- Added batch Close response to return GSAP-specific data
- Added support for split tender GiftCardSale transactions
- Fix some GP-API unit tests

## v2.4.3 (11/17/2021)

#### Enhancements:
- Add Unified Payments Application support

Expand Down
2 changes: 1 addition & 1 deletion metadata.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<xml>
<releaseNumber>2.4.3</releaseNumber>
<releaseNumber>2.4.4</releaseNumber>
</xml>
20 changes: 20 additions & 0 deletions src/Entities/BatchSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,24 @@ class BatchSummary
* @var string
*/
public $batchReference;

/**
* @var integer
*/
public $hostBatchNbr;

/**
* @var integer
*/
public $hostTotalCnt;

/**
* @var decimal
*/
public $hostTotalAmt;

/**
* @var integer
*/
public $processedDeviceId;
}
38 changes: 32 additions & 6 deletions src/Entities/Reporting/TransactionSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ class TransactionSummary
*/
public $authCode;

/** @var string */
public $avsResponseCode;

/** @var string */
public $avsResponseMessage;

/**
* @var DateTime
*/
Expand Down Expand Up @@ -76,6 +82,26 @@ class TransactionSummary
*/
public $cardHolderLastName;

/**
* @var string
*/
public $cardHolderAddr;

/**
* @var string
*/
public $cardHolderCity;

/**
* @var string
*/
public $cardHolderState;

/**
* @var string
*/
public $cardHolderZip;

/**
* @var string
*/
Expand Down Expand Up @@ -145,6 +171,12 @@ class TransactionSummary
*/
public $customerLastName;

/** @var string */
public $cvnResponseCode;

/** @var string */
public $cvnResponseMessage;

/**
* @var bool
*/
Expand Down Expand Up @@ -482,12 +514,6 @@ class TransactionSummary
/** @var string */
public $orderId;

/** @var string */
public $avsResponseCode;

/** @var string */
public $cvnResponseCode;

/** @var string */
public $eciIndicator;

Expand Down
3 changes: 3 additions & 0 deletions src/Entities/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ class Transaction
*/
public $responseMessage;

/** @var array */
public $splitTenderBalanceDueAmt;

/** @var array */
public $responseValues;

Expand Down
85 changes: 78 additions & 7 deletions src/Gateways/PorticoConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,15 @@ protected function mapResponse($rawResponse, BaseBuilder $builder, $request)
? (string)$item->RspText
: $gatewayRspText;

if (isset($item) && isset($item->AuthAmt)) {
$result->authorizedAmount = (string)$item->AuthAmt;
if (isset($item) && (isset($item->AuthAmt) || isset($item->SplitTenderCardAmt))) {
$result->authorizedAmount =
isset($item->SplitTenderCardAmt)
? (string)$item->SplitTenderCardAmt
: (string)$item->AuthAmt;
}

if (isset($item) && isset($item->SplitTenderBalanceDueAmt)) {
$result->splitTenderBalanceDueAmt = (string)$item->SplitTenderBalanceDueAmt;
}

if (isset($item) && isset($item->AvailableBalance)) {
Expand Down Expand Up @@ -1360,6 +1367,19 @@ protected function mapResponse($rawResponse, BaseBuilder $builder, $request)
$result->batchSummary->transactionCount = (string)$item->TxnCnt;
$result->batchSummary->totalAmount = (string)$item->TotalAmt;
$result->batchSummary->sequenceNumber = (string)$item->BatchSeqNbr;

if (isset($item->HostBatchNbr)) {
$result->batchSummary->hostBatchNbr = (string)$item->HostBatchNbr;
}
if (isset($item->HostTotalCnt)) {
$result->batchSummary->hostTotalCnt = (string)$item->HostTotalCnt;
}
if (isset($item->HostTotalAmt)) {
$result->batchSummary->hostTotalAmt = (string)$item->HostTotalAmt;
}
if (isset($item->ProcessedDeviceId)) {
$result->batchSummary->processedDeviceId = (string)$item->ProcessedDeviceId;
}
}

if (isset($item) && isset($item->CardBrandTxnId)) {
Expand All @@ -1371,7 +1391,7 @@ protected function mapResponse($rawResponse, BaseBuilder $builder, $request)
$result->payFacData->transactionId = !empty($root->PaymentFacilitatorTxnId) ? (string) $root->PaymentFacilitatorTxnId : '';
$result->payFacData->transactionNumber = !empty($root->PaymentFacilitatorTxnNbr) ? (string) $root->PaymentFacilitatorTxnNbr : '';
}

return $result;
}

Expand All @@ -1391,7 +1411,8 @@ protected function mapReportResponse($rawResponse, ReportBuilder $builder)
}

if ($builder->reportType === ReportType::TRANSACTION_DETAIL) {
return $this->hydrateTransactionSummary($doc->Transactions);
if(isset($doc->Data))
return $this->hydrateTransactionSummary($doc->Data);
}

return null;
Expand All @@ -1417,6 +1438,14 @@ protected function hydrateTransactionSummary($item)
$summary->authCode = (string)$item->AuthCode;
}

if (isset($item) && isset($item->AVSRsltCode)) {
$summary->avsResponseCode = (string)$item->AVSRsltCode;
}

if (isset($item) && isset($item->AVSRsltText)) {
$summary->avsResponseMessage = (string)$item->AVSRsltText;
}

if (isset($item) && isset($item->BatchCloseDT)) {
$summary->batchCloseDate = (string)$item->BatchCloseDT;
}
Expand All @@ -1427,10 +1456,43 @@ protected function hydrateTransactionSummary($item)

if (isset($item) && isset($item->CardHolderData)) {
if (isset($item->CardHolderData->CardHolderFirstName)) {
$summary->cardHolderFirstName = $item->CardHolderData->CardHolderFirstName;
$summary->cardHolderFirstName = (string)$item->CardHolderData->CardHolderFirstName;
}
if (isset($item->CardHolderData->CardHolderLastName)) {
$summary->cardHolderLastName = $item->CardHolderData->CardHolderLastName;
$summary->cardHolderLastName = (string)$item->CardHolderData->CardHolderLastName;
}
if (isset($item->CardHolderData->CardHolderAddr)) {
$summary->cardHolderAddr = (string)$item->CardHolderData->CardHolderAddr;
}
if (isset($item->CardHolderData->CardHolderCity)) {
$summary->cardHolderCity = (string)$item->CardHolderData->CardHolderCity;
}
if (isset($item->CardHolderData->CardHolderState)) {
$summary->cardHolderState = (string)$item->CardHolderData->CardHolderState;
}
if (isset($item->CardHolderData->CardHolderZip)) {
$summary->cardHolderZip = (string)$item->CardHolderData->CardHolderZip;
}
}
else
{
if (isset($item->CardHolderFirstName)) {
$summary->cardHolderFirstName = (string)$item->CardHolderFirstName;
}
if (isset($item->CardHolderLastName)) {
$summary->cardHolderLastName = (string)$item->CardHolderLastName;
}
if (isset($item->CardHolderAddr)) {
$summary->cardHolderAddr = (string)$item->CardHolderAddr;
}
if (isset($item->CardHolderCity)) {
$summary->cardHolderCity = (string)$item->CardHolderCity;
}
if (isset($item->CardHolderState)) {
$summary->cardHolderState = (string)$item->CardHolderState;
}
if (isset($item->CardHolderZip)) {
$summary->cardHolderZip = (string)$item->CardHolderZip;
}
}

Expand All @@ -1454,6 +1516,14 @@ protected function hydrateTransactionSummary($item)
$summary->convenienceAmount = (string)$item->ConvenienceAmtInfo;
}

if (isset($item) && isset($item->CVVRsltCode)) {
$summary->cvnResponseCode = (string)$item->CVVRsltCode;
}

if (isset($item) && isset($item->CVVRsltText)) {
$summary->cvnResponseMessage = (string)$item->CVVRsltText;
}

if (isset($item) && isset($item->DeviceId)) {
$summary->deviceId = (string)$item->DeviceId;
}
Expand Down Expand Up @@ -1860,9 +1930,10 @@ protected function mapReportType(ReportBuilder $builder)
{
switch ($builder->reportType) {
case ReportType::ACTIVITY:
case ReportType::TRANSACTION_DETAIL:
case ReportType::FIND_TRANSACTIONS:
return 'FindTransactions';
case ReportType::TRANSACTION_DETAIL:
return 'ReportTxnDetail';
default:
throw new UnsupportedTransactionException();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/GpApiMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public static function mapDisputeSummary($response)
$summary = new DisputeSummary();
$summary->caseId = $response->id;
$summary->caseIdTime = !empty($response->time_created) ? new \DateTime($response->time_created) :
(!empty($response->stage_time_created) ? $response->stage_time_created : '');
(!empty($response->stage_time_created) ? new \DateTime($response->stage_time_created) : '');
$summary->caseStatus = $response->status;
$summary->caseStage = $response->stage;
$summary->caseAmount = StringUtils::toAmount($response->amount);
Expand Down
11 changes: 11 additions & 0 deletions test/Integration/Gateways/GpApiConnector/CreditCardPresentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ public function testRefundOnCardPresentChipCard()
$this->assertTransactionResponse($response, 'SUCCESS', TransactionStatus::CAPTURED);
}

public function testCardPresentWithManualEntryModeTransaction()
{
$card = $this->initCreditCardData();

$response = $card->charge($this->amount)
->withCurrency($this->currency)
->execute();

$this->assertTransactionResponse($response, 'SUCCESS', TransactionStatus::CAPTURED);
}

public function testCreditVerification_CardPresent()
{
$card = $this->initCreditTrackData();
Expand Down
9 changes: 8 additions & 1 deletion test/Integration/Gateways/GpApiConnector/GpApi3DS2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
use GlobalPayments\Api\Utils\GenerationUtils;
use GlobalPayments\Api\Entities\Enums\Secure3dStatus;
use PHPUnit\Framework\TestCase;
use GlobalPayments\Api\Utils\Logging\Logger;
use GlobalPayments\Api\Utils\Logging\SampleRequestLogger;

class GpApi3DS2Test extends TestCase
{
Expand Down Expand Up @@ -109,6 +111,7 @@ public function setUpConfig()
$config->challengeNotificationUrl = 'https://ensi808o85za.x.pipedream.net/';
$config->methodNotificationUrl = 'https://ensi808o85za.x.pipedream.net/';
$config->merchantContactUrl = 'https://enp4qhvjseljg.x.pipedream.net/';
$config->requestLogger = new SampleRequestLogger(new Logger("logs"));

return $config;
}
Expand Down Expand Up @@ -1000,7 +1003,11 @@ public function testCardHolderEnrolled_ChallengeRequired_v2_Initiate_AllPreferen

public function testCardHolderEnrolled_ChallengeRequired_v2_Initiate_AllSourceValues()
{
$source = array(AuthenticationSource::BROWSER, AuthenticationSource::MERCHANT_INITIATED, AuthenticationSource::MOBILE_SDK);
$source = [
AuthenticationSource::BROWSER,
AuthenticationSource::MERCHANT_INITIATED,
AuthenticationSource::MOBILE_SDK
];
foreach ($source as $value) {
$secureEcom = Secure3dService::checkEnrollment($this->card)
->withCurrency($this->currency)
Expand Down
Loading

0 comments on commit 792fc4a

Please sign in to comment.