Skip to content

Commit

Permalink
[PW-7234] - CS code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
candemiralp committed Oct 5, 2022
1 parent 68347c7 commit 75bb422
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Gateway/Http/Client/TransactionPosCloudSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ public function placeRequest(TransferInterface $transferObject): array
$terminalId = $request['terminalID'];

if (array_key_exists('chainCalls', $request)) {
$quote = $this->initiatePosPayment($terminalId, $request['fundingSource'], $request['numberOfInstallments']);
$quote = $this->initiatePosPayment(
$terminalId,
$request['fundingSource'],
$request['numberOfInstallments']
);
$quoteInfoInstance = $quote->getPayment()->getMethodInstance()->getInfoInstance();
$timeDiff = (int)$statusDate - (int)$quoteInfoInstance->getAdditionalInformation('initiateDate');
$serviceId = $quoteInfoInstance->getAdditionalInformation('serviceID');
Expand All @@ -118,7 +122,6 @@ public function placeRequest(TransferInterface $transferObject): array
$serviceId = $request['serviceID'];
}


$totalTimeout = $this->adyenHelper->getAdyenPosCloudConfigData('total_timeout', $this->storeId);
if ($timeDiff > $totalTimeout) {
throw new LocalizedException(__("POS connection timed out."));
Expand Down Expand Up @@ -188,8 +191,11 @@ public function placeRequest(TransferInterface $transferObject): array
* @throws LocalizedException
* @throws NoSuchEntityException
*/
public function initiatePosPayment(string $terminalId, string $fundingSource, ?string $numberOfInstallments): CartInterface
{
public function initiatePosPayment(
string $terminalId,
string $fundingSource,
?string $numberOfInstallments
): CartInterface {
// Validate JSON that has just been parsed if it was in a valid format
if (json_last_error() !== JSON_ERROR_NONE) {
throw new LocalizedException(
Expand Down Expand Up @@ -261,8 +267,7 @@ public function initiatePosPayment(string $terminalId, string $fundingSource, ?s
"TotalNbOfPayments" => intval($numberOfInstallments)
]
];
}
else {
} else {
$request['SaleToPOIRequest']['PaymentData'] = [
'PaymentType' => $transactionType,
];
Expand Down

0 comments on commit 75bb422

Please sign in to comment.