Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
[change] (MAGE2-311) Fix minor style issues and problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
sixer1182 committed May 8, 2020
1 parent 426e244 commit b784bf7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Helper/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function getDataFromResponse(Response $response)
$data = [];

foreach ($response->toArray() as $parameterKey => $value) {
$data[str_replace('.', '_', $parameterKey)] = $value;
$data[str_replace('.', '_', (string)$parameterKey)] = $value;
}

return $data;
Expand Down Expand Up @@ -377,7 +377,7 @@ public function saveHeidelpayTransaction(Response $response, array $data, $sourc
}

/**
* Create an order by submitting the quote. If Order for that qoute already exist this order will be returned.
* Create an order by submitting the quote. If Order for that quote already exist this order will be returned.
* @param Quote $quote
* @return AbstractExtensibleModel|OrderInterface|Order|object|null
* @throws LocalizedException
Expand All @@ -403,10 +403,12 @@ public function handleOrderCreation($quote, $context = null)
->setCustomerGroupId(Group::NOT_LOGGED_IN_ID);
}
$order = $this->_cartManagement->submit($quote);
if($context) {
$order->addStatusHistoryComment('heidelpay - Order created via ' . $context);

if ($context) {
$order->addCommentToStatusHistory('heidelpay - Order created via ' . $context);
}
}

} finally {
$this->lockManager->unlock($lockName);
}
Expand Down Expand Up @@ -434,7 +436,7 @@ public function getPaymentMethodAndType(Response $response)
public function isNewOrderType($paymentMethod, $paymentType)
{
// Order should be created for incoming payments
if(in_array($paymentType, self::NEW_ORDER_TRANSACTION_TYPE_ARRAY, true)){
if(\in_array($paymentType, self::NEW_ORDER_TRANSACTION_TYPE_ARRAY, true)){
return true;
}
// Reservation should only create order if its not online transfer payment method.
Expand Down

0 comments on commit b784bf7

Please sign in to comment.