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