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