Skip to content

Commit

Permalink
OctopusDeploy release: 12.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Jul 16, 2024
1 parent fcd8e4a commit 5dcd2a0
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 101 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@

# Changelog

## Latest Version - v12.0.5 (06/18/24)
## Latest Version - v12.0.7 (07/16/24)
### Enhancements:
- [GP-API] Adds avs data to "/transaction" request for digital wallet
- [GP-API] Adds brand reference and stage time to the DisputeSummary

### Bug Fixes:
- [PAX] Correction to tip/gratuity handling in the request to device

## Latest Version - v12.0.6 (06/18/24)
### Enhancements:
- [GP-ECOM] Add Multi-Capture

Expand Down
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8.5 || ~9.4",
"brianium/paratest": "4.0.0 || ^v6.6",
"squizlabs/php_codesniffer": "2.*",
"phpstan/phpstan": "^0.12"
},
Expand All @@ -39,7 +38,6 @@
"scripts": {
"docs": "@php sami.phar update docs-config.php",
"pretest": "@composer test:lint",
"test": "@composer pretest && paratest --coverage-html=coverage.html --colors -f --stop-on-failure",
"test:lint": "phpcs"
},
"config": {
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>12.0.6</releaseNumber>
<releaseNumber>12.0.7</releaseNumber>
</xml>
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@ private function createPaymentMethodParam($builder, $config)
/* digital wallet */
switch ($builder->transactionModifier) {
case TransactionModifier::ENCRYPTED_MOBILE:
$paymentToken = null;
switch ($paymentMethodContainer->mobileType){
case EncyptedMobileType::CLICK_TO_PAY:
$paymentToken = ['data' => $paymentMethodContainer->token];
Expand All @@ -601,6 +600,10 @@ private function createPaymentMethodParam($builder, $config)
$digitalWallet['cryptogram'] = $paymentMethodContainer->cryptogram;
$digitalWallet['eci'] = !empty($paymentMethodContainer->eci) ?
$paymentMethodContainer->eci : $this->getEciCode($paymentMethodContainer);
$digitalWallet['avs_address'] =
(!empty($builder->billingAddress) ? $builder->billingAddress->streetAddress1 : '');
$digitalWallet['avs_postal_code'] =
(!empty($builder->billingAddress) ? $builder->billingAddress->postalCode : '');
break;
default:
break;
Expand Down
107 changes: 23 additions & 84 deletions src/Entities/Reporting/DisputeSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,9 @@ class DisputeSummary
* @var string
*/
public $merchantHierarchy;
/**
* @var string
*/
public $merchantName;
/**
* @var string
*/
public $merchantDbaName;
/**
* @var string
*/
public $merchantNumber;
/**
* @var string
*/
public $merchantCategory;

public ?string $merchantName;

/**
* @var \DateTime
*/
Expand All @@ -38,14 +25,7 @@ class DisputeSummary
* @var string
*/
public $depositReference;
/**
* @var string
*/
public $depositType;
/**
* @var string
*/
public $type;

/**
* @var integer
*/
Expand All @@ -54,26 +34,16 @@ class DisputeSummary
* @var string
*/
public $caseCurrency;
/**
* @var string
*/
public $caseStage;

/** This field indicates the distinct step a dispute is at, within the dispute lifecycle. */
public ?string $caseStage;

/** Time the current Dispute stage was created. */
public ?\DateTime $disputeStageTime;
/**
* @var string
*/
public $caseStatus;
/**
* @var string
*/
public $caseDescription;
/**
* @var string
*/
public $transactionOrderId;
/**
* @var \DateTime
*/
public $transactionLocalTime;
/**
* @var \DateTime
*/
Expand All @@ -90,18 +60,9 @@ class DisputeSummary
* @var string
*/
public $transactionCurrency;
/**
* @var string
*/
public $caseNumber;
/**
* @var \DateTime
*/
public $caseTime;
/**
* @var string
*/
public $caseId;

/** Unique identifier for the Dispute on the Global Payments system. */
public string $caseId;
/**
* @var \DateTime
*/
Expand All @@ -110,10 +71,7 @@ class DisputeSummary
* @var string
*/
public $caseMerchantId;
/**
* @var string
*/
public $caseTerminalId;

/**
* @var string
*/
Expand All @@ -122,10 +80,7 @@ class DisputeSummary
* @var string
*/
public $transactionReferenceNumber;
/**
* @var string
*/
public $transactionSRD;

/**
* @var string
*/
Expand All @@ -150,38 +105,20 @@ class DisputeSummary
* @var string
*/
public $result;
/**
* @var string
*/
public $issuerComment;
/**
* @var string
*/
public $issuerCaseNumber;
/**
* @var integer
*/
public $disputeAmount;
/**
* @var string
*/
public $disputeCurrency;
public array $issuerComment = [];
public array $issuerCaseNumber = [];

/**
* @var integer
*/
public $disputeCustomerAmount;
/**
* @var string
*/
public $disputeCustomerCurrency;

public ?string $disputeCustomerCurrency;
/**
* @var \DateTime
*/
public $respondByDate;
/**
* @var string
*/
public $caseOriginalReference;

/**
* @var integer
*/
Expand All @@ -198,6 +135,8 @@ class DisputeSummary
/** @var array<DisputeDocument> */
public $documents;

public ?string $transactionBrandReference;

/**
* @return ManagementBuilder
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Gateways/GpApiConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function doTransaction(
);
} catch (GatewayException $exception) {
if (
strpos($exception->getMessage(), 'NOT_AUTHENTICATED') !== false &&
in_array($exception->responseCode, ['NOT_AUTHENTICATED', '401']) &&
!empty($this->gpApiConfig->appKey) &&
!empty($this->gpApiConfig->appKey)
) {
Expand Down
31 changes: 21 additions & 10 deletions src/Mapping/GpApiMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,11 @@ 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) ? new \DateTime($response->stage_time_created) : '');
$summary->caseIdTime = !empty($response->time_created) ? new \DateTime($response->time_created) : null;
$summary->caseStatus = $response->status;
$summary->caseStage = $response->stage;
$summary->disputeStageTime =
(!empty($response->stage_time_created) ? new \DateTime($response->stage_time_created) : null);
$summary->caseAmount = StringUtils::toAmount($response->amount);
$summary->caseCurrency = $response->currency;
if (isset($response->system)) {
Expand All @@ -610,24 +611,21 @@ public static function mapDisputeSummary($response)
$summary->merchantName = !empty($system->name) ? $system->name : null;
}

if (
isset($response->payment_method) &&
isset($response->payment_method->card)
) {
if (!empty($response->payment_method->card)) {
$card = $response->payment_method->card;
$summary->transactionMaskedCardNumber = $card->number;
$summary->transactionMaskedCardNumber = $card->number ?? null;
}
if (isset($response->transaction)) {
if (!empty($response->transaction)) {
$summary->transactionTime = $response->transaction->time_created;
$summary->transactionType = $response->transaction->type;
$summary->transactionAmount = StringUtils::toAmount($response->transaction->amount);
$summary->transactionCurrency = $response->transaction->currency;
$summary->transactionReferenceNumber = $response->transaction->reference;
if (isset($response->transaction->payment_method->card)) {
$card = $response->transaction->payment_method->card;
$summary->transactionMaskedCardNumber = !empty($card->masked_number_first6last4) ?
$card->masked_number_first6last4 : '';
$summary->transactionMaskedCardNumber = $card->masked_number_first6last4 ?? null;
$summary->transactionAuthCode = $card->authcode;
$summary->transactionBrandReference = $card->brand_reference ?? null;
}
}
if (!empty($response->documents)) {
Expand All @@ -654,6 +652,19 @@ public static function mapDisputeSummary($response)
$summary->lastAdjustmentFunding = $response->last_adjustment_funding;
$summary->depositDate = !empty($response->deposit_time_created) ? $response->deposit_time_created : null;
$summary->depositReference = !empty($response->deposit_id) ? $response->deposit_id : null;
$summary->disputeCustomerAmount = !empty($response->payer_amount) ?
StringUtils::toAmount($response->payer_amount) : null;
$summary->disputeCustomerCurrency = $response->payer_currency ?? null;
if (!empty($response->payment_method_provider)) {
foreach ($response->payment_method_provider as $providerPaymentMethod) {
if (!empty($providerPaymentMethod->comment)) {
$summary->issuerComment[] = $providerPaymentMethod->comment;
}
if (!empty($providerPaymentMethod->reference)) {
$summary->issuerCaseNumber[] = $providerPaymentMethod->reference;
}
}
}

return $summary;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Terminals/PAX/PaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ public function processTransaction(TerminalAuthBuilder $builder) : TerminalRespo
if ($builder->signatureCapture !== null) {
$extData->details[PaxExtData::SIGNATURE_CAPTURE] = $builder->signatureCapture;
}

if (empty($builder->gratuity)) {
$extData->details[PaxExtData::TIP_REQUEST] = 1;
}

$transactionType = $this->mapTransactionType($builder->transactionType, $builder->requestMultiUseToken);
switch ($builder->paymentMethodType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Gateways\GpApiConnector;

use GlobalPayments\Api\Entities\Address;
use GlobalPayments\Api\Entities\Enums\AddressType;
use GlobalPayments\Api\Entities\Enums\Channel;
use GlobalPayments\Api\Entities\Enums\EncyptedMobileType;
use GlobalPayments\Api\Entities\Enums\TransactionModifier;
Expand Down Expand Up @@ -167,6 +169,10 @@ public function testPayWithApplePayEncrypted()
public function testPayWithDecryptedFlow()
{
$encryptedProviders = [EncyptedMobileType::GOOGLE_PAY, EncyptedMobileType::APPLE_PAY];
$address = new Address();
$address->streetAddress1 = "123 Main St.";
$address->postalCode = "12345";

foreach ($encryptedProviders as $encryptedProvider) {
$this->card->token = '5167300431085507';
$this->card->mobileType = $encryptedProvider;
Expand All @@ -177,6 +183,7 @@ public function testPayWithDecryptedFlow()
$response = $this->card->charge($this->amount)
->withCurrency($this->currency)
->withModifier(TransactionModifier::DECRYPTED_MOBILE)
->withAddress($address)
->execute();

$this->assertTransactionResponse($response, TransactionStatus::CAPTURED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ public static function tearDownAfterClass(): void
public function testReportDisputeDetail()
{
$disputeId = 'DIS_SAND_abcd1234';
/** @var DisputeSummary $response */
$response = ReportingService::disputeDetail($disputeId)
->execute();
$this->assertNotNull($response);
$this->assertInstanceOf(DisputeSummary::class, $response);
$this->assertEquals($disputeId, $response->caseId);
$this->assertNotNull($response->transactionBrandReference);
$this->assertNotNull($response->disputeStageTime);
$this->arn = $response->transactionARN;
}

Expand Down Expand Up @@ -648,8 +651,9 @@ public function testReportFindSettlementDisputes_FilterBy_FromAndToStageTimeCrea

$this->assertNotNull($summary);
$this->assertInstanceOf(PagedResult::class, $summary);
/** @var DisputeSummary $dispute */
foreach ($summary->result as $dispute) {
$this->assertTrue($dispute->caseTime <= $this->endDate);
$this->assertTrue($dispute->caseIdTime <= $this->endDate);
}
}

Expand Down
Loading

0 comments on commit 5dcd2a0

Please sign in to comment.