Skip to content

Commit

Permalink
OctopusDeploy release: 2.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Nov 18, 2021
1 parent 3e936b4 commit 641274b
Show file tree
Hide file tree
Showing 31 changed files with 1,976 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ composer
/docs/
/docs-cache/

.idea
.idea
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

## Latest version

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

## v2.4.2 (11/16/2021)

#### Enhancements:
- Add LPMs HPP on GP-ECOM
- Add PAYPAL on GP-ECOM
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.2</releaseNumber>
<releaseNumber>2.4.3</releaseNumber>
</xml>
8 changes: 5 additions & 3 deletions src/Terminals/Builders/TerminalAuthBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ class TerminalAuthBuilder extends TerminalBuilder

public $transactionId;

public $clerkId;

public $shiftId;

public $taxType;

public $clientTransactionId;

public $tokenRequest;

public $tokenValue;

/**
*
Expand Down Expand Up @@ -246,5 +248,5 @@ public function withClientTransactionId($clientTransactionId)
{
$this->clientTransactionId = $clientTransactionId;
return $this;
}
}
}
15 changes: 14 additions & 1 deletion src/Terminals/Builders/TerminalBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

abstract class TerminalBuilder extends TransactionBuilder
{

/**
* Request transaction type
*
Expand All @@ -23,6 +23,13 @@ abstract class TerminalBuilder extends TransactionBuilder
* @var int
*/
public $requestId;

/*
* ID of the clerk if in retail mode, and ID of the server if in restaurant mode
*
* @var int
*/
public $clerkId;

public function __construct($type, $paymentMethodType)
{
Expand All @@ -35,4 +42,10 @@ public function withRequestId($requestId)
$this->requestId = $requestId;
return $this;
}

public function withClerkId($clerkId)
{
$this->clerkId = $clerkId;
return $this;
}
}
10 changes: 8 additions & 2 deletions src/Terminals/Builders/TerminalManageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace GlobalPayments\Api\Terminals\Builders;

use GlobalPayments\Api\Terminals\Builders\TerminalBuilder;
use GlobalPayments\Api\Entities\Enums\TransactionModifier;
use GlobalPayments\Api\Entities\Enums\TransactionType;
use GlobalPayments\Api\Terminals\ConnectionContainer;
Expand All @@ -14,6 +13,7 @@ class TerminalManageBuilder extends TerminalBuilder
public $currency;
public $gratuity;
public $transactionId;
public $terminalRefNumber;

/**
* {@inheritdoc}
Expand Down Expand Up @@ -71,7 +71,7 @@ public function withPaymentMethod($method)
*
* @param string $transactionId Transaction ID
*
* @return AuthorizationBuilder
* @return TerminalManageBuilder
*/
public function withTransactionId($transactionId)
{
Expand All @@ -98,4 +98,10 @@ protected function setupValidations()
->with(TransactionModifier::NONE)
->check('transactionId')->isNotNull();
}

public function withTerminalRefNumber($terminalRefNumber)
{
$this->terminalRefNumber = $terminalRefNumber;
return $this;
}
}
4 changes: 4 additions & 0 deletions src/Terminals/ConnectionContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use GlobalPayments\Api\Terminals\Enums\DeviceType;
use GlobalPayments\Api\Terminals\HPA\HpaController;
use GlobalPayments\Api\Terminals\PAX\PaxController;
use GlobalPayments\Api\Terminals\UPA\UpaController;

class ConnectionContainer
{
Expand Down Expand Up @@ -64,6 +65,9 @@ public static function configure(ConnectionConfig $config)
case DeviceType::PAX_PX7:
static::$instance = new PaxController($config);
break;
case DeviceType::UPA_SATURN_1000:
static::$instance = new UpaController($config);
break;
}
}
}
1 change: 1 addition & 0 deletions src/Terminals/Enums/ControlCodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ControlCodes extends Enum
const FS = 0x1C; // Field separator
const GS = 0x1D; // Message ID follows (for non-PIN entry prompts)
const RS = 0x1E; // Message ID follows (for PIN entry prompts)
const LF = 0x0A; //new line

// PAX Specific ??
const US = 0x1F;
Expand Down
1 change: 1 addition & 0 deletions src/Terminals/Enums/DeviceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ class DeviceType extends Enum
const PAX_D210 = 'PAX_D210';
const PAX_PX5 = 'PAX_PX5';
const PAX_PX7 = 'PAX_PX7';
const UPA_SATURN_1000 = 'UPA_SATURN_1000';
}
13 changes: 12 additions & 1 deletion src/Terminals/HPA/HpaInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function closeLane()
* Reset - Admin mode message - Transition SIP to idle state
*/

public function cancel()
public function cancel($cancelParams = null)
{
return $this->reset();
}
Expand Down Expand Up @@ -425,4 +425,15 @@ public function getLastResponse()
HpaMessageId::GET_LAST_RESPONSE
);
}

public function creditTipAdjust($tipAmount = null)
{
throw new UnsupportedTransactionException('');
}
public function safSummaryReport($safIndicator = null)
{
throw new UnsupportedTransactionException('');
}


}
5 changes: 4 additions & 1 deletion src/Terminals/Interfaces/IDeviceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface IDeviceInterface
{

// Admin Calls
public function cancel();
public function cancel($cancelParams = null);

public function closeLane();

Expand Down Expand Up @@ -42,6 +42,8 @@ public function creditSale($amount = null);
public function creditVerify();

public function creditVoid();

public function creditTipAdjust($tipAmount = null);

//Debit Calls
public function debitSale($amount = null);
Expand Down Expand Up @@ -72,6 +74,7 @@ public function giftBalance();
public function setSafMode($paramValue);
public function sendSaf($safIndicator = null);
public function safDelete($safIndicator);
public function safSummaryReport($safIndicator = null);

//send file request
public function sendFile($sendFileData);
Expand Down
10 changes: 8 additions & 2 deletions src/Terminals/PAX/PaxInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function batchClose()
return new BatchResponse($rawResponse);
}

public function cancel()
public function cancel($cancelParams = null)
{
if ($this->paxController->deviceConfig->connectionMode === ConnectionModes::HTTP) {
throw new ApiException("The cancel command is not available in HTTP mode");
Expand Down Expand Up @@ -308,12 +308,18 @@ public function safDelete($safIndicator)
return new SafDeleteResponse($rawResponse);
}

public function safSummaryReport($safIndicator)
public function safSummaryReport($safIndicator = null)
{
$message = TerminalUtils::buildAdminMessage(PaxMessageId::R10_SAF_SUMMARY_REPORT, [$safIndicator]);

$rawResponse = $this->paxController->send($message);
return new SafSummaryReport($rawResponse);
}

public function creditTipAdjust($tipAmount = null)
{
throw new UnsupportedTransactionException('');
}

#endregion
}
25 changes: 25 additions & 0 deletions src/Terminals/TerminalUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,29 @@ public static function manageLog($logProvider, $message = '', $backTrace = false
$logProvider->setLog($message, $trace);
}
}

public static function buildUPAMessage($messageType, $requestId, $otherData = null)
{
$requestMessage = [
'message' => 'MSG',
'data' => [
'command' => $messageType,
'requestId' => $requestId,
'EcrId' => 13
]
];

if(!empty($otherData)){
$requestMessage['data']['data'] = $otherData;
}

$message = chr(ControlCodes::STX);
$message .= chr(ControlCodes::LF);
$message .= json_encode($requestMessage);
$message .= chr(ControlCodes::LF);
$message .= chr(ControlCodes::ETX);
$message .= chr(ControlCodes::LF);

return $message;
}
}
39 changes: 39 additions & 0 deletions src/Terminals/UPA/Builders/UpaTerminalManageBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace GlobalPayments\Api\Terminals\UPA\Builders;

use GlobalPayments\Api\Entities\Enums\TransactionModifier;
use GlobalPayments\Api\Entities\Enums\TransactionType;
use GlobalPayments\Api\Terminals\Builders\TerminalManageBuilder;

class UpaTerminalManageBuilder extends TerminalManageBuilder
{
/**
* {@inheritdoc}
*
* @param TransactionType $transactionType Request transaction type
* @param PaymentMethodType $paymentMethodType Request payment method
*
* @return
*/
public function __construct($transactionType, $paymentMethodType = null)
{
parent::__construct($transactionType, $paymentMethodType);
}

protected function setupValidations()
{
$this->validations->of(
TransactionType::CAPTURE
)
->with(TransactionModifier::NONE)
->check('amount')->isNotNull()
->check('terminalRefNumber')->isNotNull();

$this->validations->of(
TransactionType::VOID
)
->with(TransactionModifier::NONE)
->check('terminalRefNumber')->isNotNull();
}
}
13 changes: 13 additions & 0 deletions src/Terminals/UPA/Entities/CancelParameters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace GlobalPayments\Api\Terminals\UPA\Entities;

class CancelParameters
{

/*
* Display change after exiting the screen currently displayed (e.g. timeout
* or cancel).
*/
public $displayOption;
}
24 changes: 24 additions & 0 deletions src/Terminals/UPA/Entities/Enums/UpaMessageId.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace GlobalPayments\Api\Terminals\UPA\Entities\Enums;

use GlobalPayments\Api\Entities\Enum;

class UpaMessageId extends Enum
{

const SALE = "Sale";
const VOID = "Void";
const REFUND = "Refund";
const EOD = "EODProcessing";
const SENDSAF = "SendSAF";
const TIPADJUST = "TipAdjust";
const CARD_VERIFY = "CardVerify";
const GET_SAF_REPORT = "GetSAFReport";
const CANCEL = "CancelTransaction";
const REBOOT = "Reboot";
const LINEITEM = "LineItemDisplay";
const REVERSAL = "Reversal";
const GET_BATCH_REPORT = "GetBatchReport";
const BALANCE_INQUIRY = "BalanceInquiry";
}
19 changes: 19 additions & 0 deletions src/Terminals/UPA/Entities/LineItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace GlobalPayments\Api\Terminals\UPA\Entities;

class LineItem
{

/*
* Left justified text to display for each line item (Mandatory)
* Contains the left-justified display characters, for example, the purchased
* items.
*/
public $lineItemLeft;

/*
* Contains the right-justified display characters, for example, the item’s price.(Optional)s
*/
public $lineItemRight = null;
}
Loading

0 comments on commit 641274b

Please sign in to comment.