Skip to content

Commit

Permalink
OctopusDeploy release: 11.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Jan 9, 2024
1 parent 05a4aeb commit fdc738f
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 13 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

# Changelog

## Latest Version - v11.0.4 (12/07/23)
## Latest Version - v11.0.5 (01/09/24)
#### Bug Fixes:
- [Portico] Fixed null CustomerData exception
- [A35_PAX] Fixed long transaction processing times

## v11.0.4 (12/07/23)
### Enhancements:
- [GP-API] Add QR code payment example with Alipay
- [GP-API] File Processing
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>11.0.4</releaseNumber>
<releaseNumber>11.0.5</releaseNumber>
</xml>
8 changes: 4 additions & 4 deletions src/Gateways/PorticoConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function processAuthorization(AuthorizationBuilder $builder)
$isCheck
|| $builder->billingAddress !== null
|| isset($builder->paymentMethod->{$propertyName})
|| $builder->customerData->email !== null
|| ($builder->customerData !== null && $builder->customerData->email !== null)
) {
if ($builder->transactionType !== TransactionType::REVERSAL) {
$holder = $this->hydrateHolder($xml, $builder, $isCheck);
Expand Down Expand Up @@ -2059,12 +2059,12 @@ protected function normalizeResponse($input)
* Serializes builder information into XML
*
* @param DOMDocument $xml XML instance
* @param BaseBuilder $builder Request builder
* @param AuthorizationBuilder $builder Request builder
* @param bool $isCheck If payment method is ACH
*
* @return DOMElement
*/
protected function hydrateHolder(DOMDocument $xml, BaseBuilder $builder, $isCheck = false)
protected function hydrateHolder(DOMDocument $xml, AuthorizationBuilder $builder, $isCheck = false)
{
$address = new Address();
$holder = $xml->createElement($isCheck ? 'ConsumerInfo' : 'CardHolderData');
Expand All @@ -2088,7 +2088,7 @@ protected function hydrateHolder(DOMDocument $xml, BaseBuilder $builder, $isChec
);
}

if ($builder->customerData->email !== null) {
if ($builder->customerData !== null && $builder->customerData->email !== null) {
$holder->appendChild(
$xml->createElement($isCheck ? 'EmailAddress' : 'CardHolderEmail',$builder->customerData->email));
}
Expand Down
34 changes: 27 additions & 7 deletions src/Terminals/PAX/Interfaces/PaxTcpInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,38 @@ private function getTerminalResponse()
}
}

private function awaitResponse($readString = false)
/**
*
* @param bool $readString
* @return string
* @throws GatewayException
*/
private function awaitResponse(bool $readString = false) : string
{
$startTime = time();

do {
$part = ($readString === true) ? fgets($this->tcpConnection) : fgetc($this->tcpConnection);
if (!empty($part)) {
if ($readString) {
return substr($part, 0, strpos($part, chr(0x03)) + 2);
}
return $part;
if ($readString) {
$buffer = '';

do {
$buffer = $buffer . fgetc($this->tcpConnection);

if (
strpos($buffer, chr(0x03))
&& strlen($buffer) === strpos($buffer, chr(0x03)) + 2
)
break;
} while (true);
} else {
$buffer = fgetc($this->tcpConnection);
}

if (!empty($buffer))
return $buffer;

$timeDiff = time() - $startTime;

if ($timeDiff >= $this->deviceDetails->timeout) {
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/Terminals/PAX/Responses/PaxTerminalResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class PaxTerminalResponse extends PaxBaseResponse implements IDeviceResponseHand
public $taxExemptId;
public $ticketNumber;
public $paymentType;
public $transactionNumber;

// EMV
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
use PHPUnit\Framework\TestCase;
use GlobalPayments\Api\ServiceConfigs\Gateways\PorticoConfig;
use GlobalPayments\Api\Services\{BatchService, ReportingService};
use SebastianBergmann\RecursionContext\InvalidArgumentException;
use PHPUnit\Framework\ExpectationFailedException;

class TestCards
{
Expand Down Expand Up @@ -2134,6 +2136,7 @@ public function testCardHolderEmail()

$response = $card->charge()
->withCurrency('USD')
->withAllowDuplicates(true)
->withCustomerData($customerData)
->withAddress($address)
->withAmount(15.01)
Expand All @@ -2147,6 +2150,40 @@ public function testCardHolderEmail()
$this->assertEquals($customerEmail, $transactionSummary->email);
}

/**
*
* @return void
* @throws ApiException
* @throws InvalidArgumentException
* @throws ExpectationFailedException
*
* This will verify an empty string can be returned
* for email property in TransactionSummary object
*/
public function testCardHolderEmailWithoutEmail()
{
$customerEmail = '';
$address = new Address();
$address->streetAddress1 = '6860 Dallas Pkwy';
$address->postalCode = '75024';

$card = TestCards::visaManual();

$response = $card->charge()
->withCurrency('USD')
->withAllowDuplicates(true)
->withAddress($address)
->withAmount(15.01)
->execute();

$this->assertEquals(true, $response != null);
$this->assertEquals('00', $response->responseCode);

$transactionSummary = ReportingService::transactionDetail($response->transactionId)->execute();
$this->assertNotNull($transactionSummary);
$this->assertEquals($customerEmail, $transactionSummary->email);
}

/**
*
* @param string $pubKey
Expand Down

0 comments on commit fdc738f

Please sign in to comment.