We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 264b2264 authored by Aleffio's avatar Aleffio

formatting

parent bdb6d949
......@@ -67,8 +67,7 @@ class TransactionPosCloudSync implements ClientInterface
*
* @param \Magento\Payment\Gateway\Http\TransferInterface $transferObject
* @return array
* @throws \Magento\Payment\Gateway\Http\ClientException
* @throws \Magento\Payment\Gateway\Http\ConverterException
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject)
{
......
......@@ -58,8 +58,9 @@ class PaymentPosCloudHandler implements HandlerInterface
* Handles response
*
* @param array $handlingSubject
* @param array $response
* @param array $paymentResponse
* @return void
* @throws Exception
*/
public function handle(array $handlingSubject, array $paymentResponse)
{
......@@ -71,7 +72,7 @@ class PaymentPosCloudHandler implements HandlerInterface
// set transaction not to processing by default wait for notification
$payment->setIsTransactionPending(true);
// no not send order confirmation mail
// do not send order confirmation mail
$payment->getOrder()->setCanSendNewEmailFlag(false);
// set transaction(status)
......
......@@ -72,13 +72,15 @@ class PosCloudResponseValidator extends AbstractValidator
// Check for errors
if (!empty($response['error'])) {
if (!empty($response['code']) && $response['code'] == CURLE_OPERATION_TIMEOUTED) {
// Do the status call(try to place an order)
// If the initiate call resulted in a timeout, do a status call(try to place an order)
return $this->createResult($isValid, $errorMessages);
} else {
// There is an error which is not a timeout, stop the transaction and show the error
$this->adyenLogger->error(json_encode($response));
throw new \Magento\Framework\Exception\LocalizedException(__($response['error']));
}
} else {
// We have a paymentResponse from the terminal
$paymentResponse = $response;
}
......
......@@ -42,31 +42,22 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
/**
* AdyenInitiateTerminalApi constructor.
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType
* @param \Magento\Checkout\Model\Session $_checkoutSession
* @param \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerCollectionFactory
* @param array $data
*/
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Model\RecurringType $recurringType,
\Magento\Checkout\Model\Session $_checkoutSession,
\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerCollectionFactory,
array $data = []
)
{
$this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
$this->_recurringType = $recurringType;
$this->_appState = $context->getAppState();
$this->_checkoutSession = $_checkoutSession;
$this->_customerCollectionFactory = $customerCollectionFactory;
......@@ -95,9 +86,8 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
/**
* Trigger sync call on terminal
*
* @return mixed
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Exception
*/
public function initiate()
{
......@@ -207,4 +197,4 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
$quote->save();
return $response;
}
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment