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 a1cfbcc3 authored by rikterbeek's avatar rikterbeek

cleanup code, removed test log statements

parent b0117bac
......@@ -52,8 +52,6 @@ class Cc extends \Magento\Payment\Block\Form
parent::__construct($context, $data);
$this->_paymentConfig = $paymentConfig;
$this->logger = $logger;
$this->logger->critical("IN FORM PHP FILE");
}
/**
......@@ -64,7 +62,6 @@ class Cc extends \Magento\Payment\Block\Form
*/
public function getCcAvailableTypes()
{
$this->logger->critical("TEST");
$types = $this->_paymentConfig->getCcTypes();
if ($method = $this->getMethod()) {
$availableTypes = $method->getConfigData('cctypes');
......
......@@ -73,8 +73,6 @@ class PaymentRequest extends \Magento\Framework\Object
$orderCurrencyCode = $order->getOrderCurrencyCode();
$merchantAccount = $this->getConfigData("merchant_account");
$this->_logger->critical("fullApiRequest1 ");
$request = array(
"action" => "Payment.authorise",
"paymentRequest.merchantAccount" => $merchantAccount,
......@@ -89,8 +87,6 @@ class PaymentRequest extends \Magento\Framework\Object
"paymentRequest.browserInfo.acceptHeader" => $_SERVER['HTTP_ACCEPT']
);
$billingAddress = $order->getBillingAddress();
if($billingAddress)
......@@ -135,10 +131,6 @@ class PaymentRequest extends \Magento\Framework\Object
);
$request = array_merge($request, $requestCreditCardDetails);
}
$this->_logger->critical("fullApiRequest");
$this->_logger->critical(print_r($request, true));
return $this->_apiRequest($request);
}
......@@ -178,9 +170,6 @@ class PaymentRequest extends \Magento\Framework\Object
}
parse_str($results, $results);
$this->_logger->critical("result is" . print_r($results,true));
curl_close($ch);
return $results;
......
......@@ -54,7 +54,7 @@ class AdyenAbstract extends \Magento\Payment\Model\Method\AbstractMethod impleme
*/
public function postRequest(Object $request, ConfigInterface $config)
{
// TODO: Implement postRequest() method.
// Not needed only used for global configuration settings
}
......
......@@ -136,21 +136,12 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{
parent::assignData($data);
$infoInstance = $this->getInfoInstance();
$this->_logger->critical("Assign data!!:" . print_r($data, true));
$infoInstance->setAdditionalInformation('encrypted_data', $data['encrypted_data']);
$this->_logger->critical("encrypted dat:" . $data['encrypted_data']);
return $this;
}
public function authorize(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
$this->_logger->critical("TEST in authorize FUNTION !!:");
if (!$this->canAuthorize()) {
throw new \Magento\Framework\Exception\LocalizedException(__('The authorize action is not available.'));
}
......@@ -174,40 +165,21 @@ class Cc extends \Magento\Payment\Model\Method\Cc
public function getConfigPaymentAction()
{
// return $this->getConfigData('payment_action');
$this->_logger->critical("TEST getConfigPaymentAction !!:");
return \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE;
}
protected function _processRequest(\Magento\Framework\Object $payment, $amount, $request)
{
switch ($request) {
case "authorise":
$response = $this->_paymentRequest->fullApiRequest($payment);
break;
}
$this->_logger->critical("HIERRR result is " . print_r($response,true));
if (!empty($response)) {
$this->_logger->critical("NOT EMPTY ");
$this->_processResponse($payment, $response);
// print_r($response);die();
// $this->_processResponse($payment, $response, $request);
} else {
$this->_logger->critical(" EMPTY response");
throw new \Magento\Framework\Exception\LocalizedException(__('Empty result.'));
}
......@@ -305,7 +277,6 @@ class Cc extends \Magento\Payment\Model\Method\Cc
*/
public function getCheckoutRedirectUrl()
{
$this->_logger->critical("CHECKOUT URL" . $this->_urlBuilder->getUrl('adyen/process/validate3d/'));
return $this->_urlBuilder->getUrl('adyen/process/validate3d/');
}
......
......@@ -127,52 +127,13 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
return $this->_paymentMethodType;
}
public function isAvailable($quote = null)
{
$this->_logger->critical("HPP IS AVAILABLE!! IS TRUE");
return true;
}
public function initialize($paymentAction, $stateObject)
{
$this->_logger->critical("initialize FROPM HPP Payment action is:". $paymentAction);
$requestType = null;
switch ($paymentAction) {
case self::ACTION_AUTHORIZE:
$requestType = self::REQUEST_TYPE_AUTH_ONLY;
//intentional
case self::ACTION_AUTHORIZE_CAPTURE:
// $requestType = $requestType ?: self::REQUEST_TYPE_AUTH_CAPTURE;
$payment = $this->getInfoInstance();
$order = $payment->getOrder();
$order->setCanSendNewEmailFlag(false);
$payment->setBaseAmountAuthorized($order->getBaseTotalDue());
$payment->setAmountAuthorized($order->getTotalDue());
// $payment->setAnetTransType($requestType);
break;
default:
break;
}
$state = \Magento\Sales\Model\Order::STATE_NEW;
$stateObject->setState($state);
$stateObject->setStatus($this->_adyenHelper->getAdyenAbstractConfigData('order_status'));
}
/**
* Get config payment action url
* Used to universalize payment actions when processing payment place
*
* @return string
* @api
*/
// public function getConfigPaymentAction()
// {
// // IMPORTANT need to set authorize_capture in config as well
// $this->_logger->critical("TEST getConfigPaymentAction FROM HPP!!:");
// return \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE_CAPTURE;
// }
/**
* Checkout redirect URL getter for onepage checkout (hardcode)
*
......@@ -182,7 +143,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
*/
public function getCheckoutRedirectUrl()
{
// return $this->_urlBuilder->getUrl('paypal/payflowexpress/start');
return $this->_urlBuilder->getUrl('adyen/process/redirect');
}
......@@ -199,8 +159,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
*/
public function postRequest(Object $request, ConfigInterface $config)
{
$this->_logger->critical("postRequest");
// TODO: Implement postRequest() method.
// Implement postRequest() method.
}
/**
......@@ -285,7 +244,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
mktime(date("H"), date("i"), date("s"), date("m"), date("j") + $deliveryDays, date("Y"))
);
$formFields['skinCode'] = $skinCode;
// $formFields['shopperLocale'] = $shopperLocale;
$formFields['shopperLocale'] = $shopperLocale;
$formFields['countryCode'] = $countryCode;
$formFields['shopperIP'] = $shopperIP;
$formFields['browserInfo'] = $browserInfo;
......@@ -301,14 +260,10 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
//blocked methods
$formFields['blockedMethods'] = "";
$baseUrl = $this->storeManager->getStore($this->getStore())
->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK);
$formFields['resURL'] = $baseUrl . 'adyen/process/result';
// echo $adyFields['resURL'];die();
// $password = Mage::helper('core')->decrypt($this->_getConfigData('notification_password'));
$hmacKey = $this->_adyenHelper->getHmac();
$brandCode = $this->getInfoInstance()->getCcType();
......@@ -316,7 +271,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$formFields['brandCode'] = $brandCode;
}
// Sort the array by key using SORT_STRING order
ksort($formFields, SORT_STRING);
......
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