From 0988d2ffc2e75e29b860a028648439277a096024 Mon Sep 17 00:00:00 2001 From: Tomasz Regdos Date: Sun, 27 Aug 2017 20:54:43 +0200 Subject: [PATCH 1/7] Separate cart payment --- .../Block/System/Config/Form/Fieldset.php | 24 +++ .../community/PayU/Account/Block/Form.php | 60 ------- .../PayU/Account/Block/Form/Abstract.php | 43 +++++ .../PayU/Account/Block/Form/PayuAccount.php | 14 ++ .../PayU/Account/Block/Form/PayuCard.php | 14 ++ .../PayU/Account/Block/UpdateInfo.php | 3 +- .../community/PayU/Account/Model/Config.php | 33 ++-- .../{Payment.php => Method/Abstract.php} | 139 +++++++-------- .../PayU/Account/Model/Method/PayuAccount.php | 20 +++ .../PayU/Account/Model/Method/PayuCard.php | 20 +++ .../community/PayU/Account/Model/Session.php | 15 -- .../Account/controllers/PaymentController.php | 33 ++-- .../community/PayU/Account/etc/config.xml | 41 +++-- .../community/PayU/Account/etc/system.xml | 97 +++++++++- app/etc/modules/PayU_Account.xml | 3 - app/locale/pl_PL/PayU_Account.csv | 4 +- lib/PayU/OpenPayU/Configuration.php | 168 +++++++++++++++++- lib/PayU/OpenPayU/Http.php | 2 +- lib/PayU/OpenPayU/HttpCurl.php | 19 ++ lib/PayU/OpenPayU/Oauth/Oauth.php | 7 +- lib/PayU/OpenPayU/Oauth/OauthGrantType.php | 3 +- lib/PayU/OpenPayU/OpenPayU.php | 6 + modman | 1 + .../default/default/images/payu/payu_logo.png | Bin 0 -> 5790 bytes skin/frontend/base/default/css/payu/payu.css | 4 +- .../base/default/images/payu/payu_cards.png | Bin 0 -> 2970 bytes 26 files changed, 548 insertions(+), 225 deletions(-) create mode 100644 app/code/community/PayU/Account/Block/Adminhtml/Block/System/Config/Form/Fieldset.php delete mode 100644 app/code/community/PayU/Account/Block/Form.php create mode 100644 app/code/community/PayU/Account/Block/Form/Abstract.php create mode 100644 app/code/community/PayU/Account/Block/Form/PayuAccount.php create mode 100644 app/code/community/PayU/Account/Block/Form/PayuCard.php rename app/code/community/PayU/Account/Model/{Payment.php => Method/Abstract.php} (85%) create mode 100644 app/code/community/PayU/Account/Model/Method/PayuAccount.php create mode 100644 app/code/community/PayU/Account/Model/Method/PayuCard.php delete mode 100644 app/code/community/PayU/Account/Model/Session.php create mode 100644 skin/adminhtml/default/default/images/payu/payu_logo.png create mode 100644 skin/frontend/base/default/images/payu/payu_cards.png diff --git a/app/code/community/PayU/Account/Block/Adminhtml/Block/System/Config/Form/Fieldset.php b/app/code/community/PayU/Account/Block/Adminhtml/Block/System/Config/Form/Fieldset.php new file mode 100644 index 0000000..a98448c --- /dev/null +++ b/app/code/community/PayU/Account/Block/Adminhtml/Block/System/Config/Form/Fieldset.php @@ -0,0 +1,24 @@ +'; + + $html .= ' '; + $html .= $element->getLegend(); + + $html .= ''; + return $html; + } +} diff --git a/app/code/community/PayU/Account/Block/Form.php b/app/code/community/PayU/Account/Block/Form.php deleted file mode 100644 index 3eeea8e..0000000 --- a/app/code/community/PayU/Account/Block/Form.php +++ /dev/null @@ -1,60 +0,0 @@ -getLayout()->getBlock('head')) { - $head->addCss('css/payu/payu.css'); - } - return parent::_prepareLayout(); - } - - /** - * Set template and redirect message - */ - protected function _construct() - { - $this->setTemplate('payu_account/form.phtml'); - $this->setMethodTitle($this->__('Pay with PayU')); - $this->setMethodLabelAfterHtml(''); - - return parent::_construct(); - } - - /** - * Payment method code getter - * @return string - */ - public function getMethodCode() - { - return $this->_methodCode; - } - - /** - * @return string - */ - private function getPayuLogo() - { - return $this->getSkinUrl('images/payu/payu_logo.png'); - } -} diff --git a/app/code/community/PayU/Account/Block/Form/Abstract.php b/app/code/community/PayU/Account/Block/Form/Abstract.php new file mode 100644 index 0000000..c91edb0 --- /dev/null +++ b/app/code/community/PayU/Account/Block/Form/Abstract.php @@ -0,0 +1,43 @@ +setTemplate('payu_account/form.phtml'); + + parent::_construct(); + } + + /** + * Prepare layout. + * Add files to use PayU + * + * @return Mage_Core_Block_Abstract + */ + protected function _prepareLayout() + { + if ($head = $this->getLayout()->getBlock('head')) { + $head->addCss('css/payu/payu.css'); + } + return parent::_prepareLayout(); + } + + /** + * @return string + */ + protected function getPayuLogo() + { + return $this->getSkinUrl('images/payu/payu_logo.png'); + } + + /** + * @return string + */ + protected function getCardLogos() + { + return $this->getSkinUrl('images/payu/payu_cards.png'); + } + +} diff --git a/app/code/community/PayU/Account/Block/Form/PayuAccount.php b/app/code/community/PayU/Account/Block/Form/PayuAccount.php new file mode 100644 index 0000000..a24dcd7 --- /dev/null +++ b/app/code/community/PayU/Account/Block/Form/PayuAccount.php @@ -0,0 +1,14 @@ +setMethodTitle($this->__('Pay with PayU')); + $this->setMethodLabelAfterHtml(''); + + return parent::_construct(); + } + +} diff --git a/app/code/community/PayU/Account/Block/Form/PayuCard.php b/app/code/community/PayU/Account/Block/Form/PayuCard.php new file mode 100644 index 0000000..0c93a87 --- /dev/null +++ b/app/code/community/PayU/Account/Block/Form/PayuCard.php @@ -0,0 +1,14 @@ +setMethodTitle($this->__('Pay by card with PayU')); + $this->setMethodLabelAfterHtml(''); + + return parent::_construct(); + } + +} diff --git a/app/code/community/PayU/Account/Block/UpdateInfo.php b/app/code/community/PayU/Account/Block/UpdateInfo.php index 7adebce..5e88a35 100644 --- a/app/code/community/PayU/Account/Block/UpdateInfo.php +++ b/app/code/community/PayU/Account/Block/UpdateInfo.php @@ -14,8 +14,7 @@ class PayU_Account_Block_UpdateInfo extends Mage_Adminhtml_Block_System_Config_F */ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) { - $html = Mage::helper('payu_account')->__('You are currently using version') . ":
"; - $html .= Mage::getModel('payu_account/config')->getPluginVersion() . " " . Mage::helper('payu_account')->__('for') . " magento " . Mage::getModel('payu_account/config')->getMinimumMageVersion() . "+"; + $html = '' . Mage::getModel('payu/config')->getPluginVersion() . ' ' . Mage::helper('payu')->__('for') . ' magento ' . Mage::getModel('payu/config')->getMinimumMageVersion() . '+'; return $html; } diff --git a/app/code/community/PayU/Account/Model/Config.php b/app/code/community/PayU/Account/Model/Config.php index 0104257..76a8676 100644 --- a/app/code/community/PayU/Account/Model/Config.php +++ b/app/code/community/PayU/Account/Model/Config.php @@ -11,7 +11,7 @@ class PayU_Account_Model_Config /** * @var string self version */ - protected $_pluginVersion = '2.2.1'; + protected $_pluginVersion = '2.3.0'; /** * @var string minimum Magento e-commerce version @@ -23,6 +23,11 @@ class PayU_Account_Model_Config */ protected $_storeId; + /** + * @var string + */ + private $_method; + /** * Constructor * @@ -32,6 +37,8 @@ public function __construct($params = array()) { // assign current store id $this->setStoreId(Mage::app()->getStore()->getId()); + + $this->_method = $params['method']; } /** @@ -47,7 +54,7 @@ public function setStoreId($storeId) /** @return string get Merchant POS Id */ public function getMerchantPosId() { - return $this->getStoreConfig('payment/payu_account/pos_id'); + return $this->getStoreConfig('payment/' . $this->_method . '/pos_id'); } /** @@ -55,7 +62,7 @@ public function getMerchantPosId() */ public function getSignatureKey() { - return $this->getStoreConfig('payment/payu_account/signature_key'); + return $this->getStoreConfig('payment/' . $this->_method . '/signature_key'); } /** @@ -63,7 +70,7 @@ public function getSignatureKey() */ public function getClientId() { - return $this->getStoreConfig('payment/payu_account/oauth_client_id'); + return $this->getStoreConfig('payment/' . $this->_method . '/oauth_client_id'); } /** @@ -71,7 +78,7 @@ public function getClientId() */ public function getClientSecret() { - return $this->getStoreConfig('payment/payu_account/oauth_client_secret'); + return $this->getStoreConfig('payment/' . $this->_method . '/oauth_client_secret'); } /** @@ -83,19 +90,15 @@ public function getButtonSrc() } /** + * @param string $action + * @param array $params + * * @return string base module url */ - public function getUrl($action) - { - return Mage::getUrl("payu_account/payment/$action", array('_secure' => true)); - } - - /** - * @return string check if is one step checkout method enabled - */ - public function getIsOneStepCheckoutEnabled() + public function getUrl($action, $params = array()) { - return $this->getStoreConfig('payment/payu_account/onestepcheckoutenabled'); + $params['_secure'] = true; + return Mage::getUrl("payu/payment/$action", $params); } /** diff --git a/app/code/community/PayU/Account/Model/Payment.php b/app/code/community/PayU/Account/Model/Method/Abstract.php similarity index 85% rename from app/code/community/PayU/Account/Model/Payment.php rename to app/code/community/PayU/Account/Model/Method/Abstract.php index 256236c..1d387c7 100644 --- a/app/code/community/PayU/Account/Model/Payment.php +++ b/app/code/community/PayU/Account/Model/Method/Abstract.php @@ -11,23 +11,14 @@ require_once(Mage::getBaseDir('lib') . '/PayU/openpayu.php'); -class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract +abstract class PayU_Account_Model_Method_Abstract extends Mage_Payment_Model_Method_Abstract { const DELIMITER = '-'; /** - * Payment method code - * - * @var string + * Module identifiers */ - protected $_code = 'payu_account'; - - /** - * Block type - * - * @var string - */ - protected $_formBlockType = 'payu_account/form'; + protected $_code = 'payu_abstract'; /** * Transaction id @@ -57,10 +48,14 @@ class PayU_Account_Model_Payment extends Mage_Payment_Model_Method_Abstract protected $_payUOrderResult = null; + /** @var PayU_Account_Model_Config */ + protected $_payuConfig; + public function __construct() { parent::__construct(); - $this->initializeOpenPayUConfiguration(); + $this->_payuConfig = Mage::getSingleton('payu/config', array('method' => $this->_code)); + $this->_initializeOpenPayUConfiguration(); } /** @@ -68,39 +63,13 @@ public function __construct() */ protected function _helper() { - return Mage::helper('payu_account'); - } - - /** - * Initialize PayU configuration - */ - protected function initializeOpenPayUConfiguration() - { - OpenPayU_Configuration::setEnvironment('secure'); - OpenPayU_Configuration::setMerchantPosId($this->getConfig()->getMerchantPosId()); - OpenPayU_Configuration::setSignatureKey($this->getConfig()->getSignatureKey()); - if ($this->getConfig()->getClientId() && $this->getConfig()->getClientSecret()) { - OpenPayU_Configuration::setOauthClientId($this->getConfig()->getClientId()); - OpenPayU_Configuration::setOauthClientSecret($this->getConfig()->getClientSecret()); - } - OpenPayU_Configuration::setOauthTokenCache(new OauthCacheFile(Mage::getBaseDir('cache'))); - OpenPayU_Configuration::setSender('Magento ver ' . Mage::getVersion() . '/Plugin ver ' . $this->getConfig()->getPluginVersion()); - } - - /** - * Get PayU configuration - * - * @return PayU_Account_Model_Config - */ - public function getConfig() - { - return Mage::getSingleton('payu_account/config'); + return Mage::helper('payu'); } /** * @param string $extOrderId */ - private function _setOrderByOrderId($extOrderId) + protected function _setOrderByOrderId($extOrderId) { $this->_order = Mage::getModel('sales/order')->load($extOrderId); } @@ -121,16 +90,6 @@ public function setOrder(Mage_Sales_Model_Order $order) $this->_order = $order; } - /** - * Get PayU session namespace - * - * @return PayU_Account_Model_Session - */ - public function getSession() - { - return Mage::getSingleton('payu_account/session'); - } - /** * Redirection url * @@ -138,7 +97,7 @@ public function getSession() */ public function getOrderPlaceRedirectUrl() { - return Mage::getUrl('payu_account/payment/new', array('_secure' => true)); + return Mage::getUrl('payu/payment/new', array('_secure' => true)); } /** @@ -170,6 +129,7 @@ public function getCheckoutSession() public function orderCreateRequest(Mage_Sales_Model_Order $order) { $this->setOrder($order); + $response = array(); $items = array(); $items[] = array( 'quantity' => 1, @@ -178,7 +138,6 @@ public function orderCreateRequest(Mage_Sales_Model_Order $order) ); $orderItems = $order->getAllVisibleItems(); - $response = array(); foreach ($orderItems as $key => $item) { $itemInfo = $item->getData(); @@ -190,22 +149,13 @@ public function orderCreateRequest(Mage_Sales_Model_Order $order) ); } - if ($order->getDiscountAmount()) { - $items[] = array( - 'quantity' => 1, - 'name' => $this->_helper()->__('Discount'), - 'unitPrice' => $this->_toAmount($order->getDiscountAmount()) - ); - } - $OCReq = array( - 'merchantPosId' => OpenPayU_Configuration::getMerchantPosId(), - 'orderUrl' => Mage::getUrl('sales/order/view', array('order_id' => $order->getId())), + 'merchantPosId' => $this->_payuConfig->getMerchantPosId(), 'description' => $this->_helper()->__('Order #%s', $order->getRealOrderId()), 'products' => $items, 'customerIp' => trim(strtok(Mage::app()->getFrontController()->getRequest()->getClientIp(), ',')), - 'notifyUrl' => $this->getConfig()->getUrl('orderNotifyRequest'), - 'continueUrl' => $this->getConfig()->getUrl('continuePayment'), + 'notifyUrl' => $this->_payuConfig->getUrl('orderNotifyRequest', array('method' => $this->_code)), + 'continueUrl' => $this->_payuConfig->getUrl('continuePayment'), 'currencyCode' => $order->getOrderCurrencyCode(), 'totalAmount' => $this->_toAmount($order->getGrandTotal()), 'extOrderId' => uniqid($order->getId() . self::DELIMITER, true), @@ -224,7 +174,8 @@ public function orderCreateRequest(Mage_Sales_Model_Order $order) 'email' => $billingAddress->getEmail(), 'phone' => $billingAddress->getTelephone(), 'firstName' => $billingAddress->getFirstname(), - 'lastName' => $billingAddress->getLastname() + 'lastName' => $billingAddress->getLastname(), + 'language' => $this->_getLanguageCode() ); if (!$order->getIsVirtual() && !empty($order->getShippingAddressId())) { @@ -246,7 +197,17 @@ public function orderCreateRequest(Mage_Sales_Model_Order $order) } } + if ($this->_code === 'payu_card') { + $OCReq['payMethods'] = array( + 'payMethod' => array( + 'type' => 'PBL', + 'value' => 'c' + ) + ); + } + try { + $result = OpenPayU_Order::create($OCReq); if ($result->getStatus() == OpenPayU_Order::SUCCESS) { @@ -260,10 +221,8 @@ public function orderCreateRequest(Mage_Sales_Model_Order $order) $this->_updatePaymentStatusNew($payment); - $locale = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId()); - $langCode = explode('_', $locale, 2); $response = array( - 'redirectUri' => $result->getResponse()->redirectUri . '&lang=' . strtolower($langCode[1]), + 'redirectUri' => $result->getResponse()->redirectUri ); } else { @@ -387,7 +346,7 @@ public function orderNotifyRequest() * * @param $paymentStatus */ - private function _updatePaymentStatus($paymentStatus) + protected function _updatePaymentStatus($paymentStatus) { $payment = $this->getOrder()->getPayment(); @@ -429,7 +388,7 @@ private function _updatePaymentStatus($paymentStatus) * * @param Mage_Sales_Model_Order_Payment $payment */ - private function _updatePaymentStatusNew(Mage_Sales_Model_Order_Payment $payment) + protected function _updatePaymentStatusNew(Mage_Sales_Model_Order_Payment $payment) { $comment = $this->_helper()->__('New transaction started.'); @@ -453,7 +412,7 @@ private function _updatePaymentStatusNew(Mage_Sales_Model_Order_Payment $payment * * @param Mage_Sales_Model_Order_Payment $payment */ - private function _updatePaymentStatusCanceled(Mage_Sales_Model_Order_Payment $payment) + protected function _updatePaymentStatusCanceled(Mage_Sales_Model_Order_Payment $payment) { $comment = $this->_helper()->__('The transaction has been canceled.'); @@ -478,7 +437,7 @@ private function _updatePaymentStatusCanceled(Mage_Sales_Model_Order_Payment $pa * * @param Mage_Sales_Model_Order_Payment $payment */ - private function _updatePaymentStatusRejected(Mage_Sales_Model_Order_Payment $payment) + protected function _updatePaymentStatusRejected(Mage_Sales_Model_Order_Payment $payment) { $comment = $this->_helper()->__('The transaction is to be accepted or rejected.'); @@ -496,7 +455,7 @@ private function _updatePaymentStatusRejected(Mage_Sales_Model_Order_Payment $pa * * @param Mage_Sales_Model_Order_Payment $payment */ - private function _updatePaymentStatusCompleted(Mage_Sales_Model_Order_Payment $payment) + protected function _updatePaymentStatusCompleted(Mage_Sales_Model_Order_Payment $payment) { $comment = $this->_helper()->__('The transaction completed successfully.'); @@ -528,7 +487,7 @@ private function _updatePaymentStatusCompleted(Mage_Sales_Model_Order_Payment $p * @param $sessionId * @return bool OpenPayU_Result */ - private function _orderStatusUpdateRequest($status, $sessionId) + protected function _orderStatusUpdateRequest($status, $sessionId) { if (empty($sessionId)) { $sessionId = $this->getOrder()->getPayment()->getLastTransId(); @@ -565,9 +524,37 @@ private function _orderStatusUpdateRequest($status, $sessionId) * @param $val * @return int */ - private function _toAmount($val) + protected function _toAmount($val) { return $this->_helper()->toAmount($val); } + /** + * Returns current language code + * + * @return string + */ + protected function _getLanguageCode() + { + $locale = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId()); + $langCode = explode('_', $locale, 2); + return strtolower($langCode[1]); + } + + /** + * Initialize PayU configuration + */ + protected function _initializeOpenPayUConfiguration() + { + OpenPayU_Configuration::setEnvironment('secure'); + OpenPayU_Configuration::setMerchantPosId($this->_payuConfig->getMerchantPosId()); + OpenPayU_Configuration::setSignatureKey($this->_payuConfig->getSignatureKey()); + if ($this->_payuConfig->getClientId() && $this->_payuConfig->getClientSecret()) { + OpenPayU_Configuration::setOauthClientId($this->_payuConfig->getClientId()); + OpenPayU_Configuration::setOauthClientSecret($this->_payuConfig->getClientSecret()); + } + OpenPayU_Configuration::setOauthTokenCache(new OauthCacheFile(Mage::getBaseDir('cache'))); + OpenPayU_Configuration::setSender('Magento ver ' . Mage::getVersion() . '/Plugin ver ' . $this->_payuConfig->getPluginVersion()); + } + } diff --git a/app/code/community/PayU/Account/Model/Method/PayuAccount.php b/app/code/community/PayU/Account/Model/Method/PayuAccount.php new file mode 100644 index 0000000..5ff8d9f --- /dev/null +++ b/app/code/community/PayU/Account/Model/Method/PayuAccount.php @@ -0,0 +1,20 @@ +init('payu_account'); - } -} diff --git a/app/code/community/PayU/Account/controllers/PaymentController.php b/app/code/community/PayU/Account/controllers/PaymentController.php index 8e62882..3d0d5c2 100644 --- a/app/code/community/PayU/Account/controllers/PaymentController.php +++ b/app/code/community/PayU/Account/controllers/PaymentController.php @@ -1,11 +1,11 @@ __('No order for processing found')); } - $redirectData = $this->getPayment()->orderCreateRequest($order); + $redirectData = $this->getPayuModel($order->getPayment()->getMethod())->orderCreateRequest($order); $this->_redirectUrl($redirectData['redirectUri']); @@ -54,7 +53,7 @@ public function newAction() } - $this->_errorAction(); + $this->_redirectAction('failure'); } /** @@ -63,7 +62,7 @@ public function newAction() public function orderNotifyRequestAction() { try { - $this->getPayment()->orderNotifyRequest(); + $this->getPayuModel($this->getRequest()->getParam('method'))->orderNotifyRequest(); } catch (Exception $e) { Mage::logException($e); } @@ -80,18 +79,16 @@ public function continuePaymentAction() Mage::logException($e); } - if (isset($_GET['error'])) { - $this->_redirect('checkout/onepage/failure', array('_secure' => true)); - } else { - $this->_redirect('checkout/onepage/success', array('_secure' => true)); - } + $this->_redirectAction($this->getRequest()->getParam('error') ? 'failure' : 'success'); + } /** - * Error payment action + * @param string $action */ - public function _errorAction() + private function _redirectAction($action) { - $this->_redirect('checkout/onepage/failure', array('_secure' => true)); + echo $action; + $this->_redirect('checkout/onepage/' . $action, array('_secure' => true)); } } diff --git a/app/code/community/PayU/Account/etc/config.xml b/app/code/community/PayU/Account/etc/config.xml index c91f420..5d571d2 100644 --- a/app/code/community/PayU/Account/etc/config.xml +++ b/app/code/community/PayU/Account/etc/config.xml @@ -2,28 +2,30 @@ - 2.2.1 - - - + 2.3.0 - + PayU_Account_Model - + - + PayU_Account_Helper - + - + PayU_Account_Block - + + + + PayU + + @@ -38,21 +40,21 @@ - + standard PayU_Account - payu_account + payu - + - + PayU_Account.csv - + @@ -61,8 +63,15 @@ 0 PayU - payu_account/payment + payu/method_payuAccount + payu + + 0 + PayU - Cards + payu/method_payuCard + payu + diff --git a/app/code/community/PayU/Account/etc/system.xml b/app/code/community/PayU/Account/etc/system.xml index 2d14381..0f2a1e2 100644 --- a/app/code/community/PayU/Account/etc/system.xml +++ b/app/code/community/PayU/Account/etc/system.xml @@ -6,11 +6,12 @@ text - 670 + 680 1 1 1 Important: This plugin works only with REST (Checkout) points of sales (POS). + payu/adminhtml_block_system_config_form_fieldset @@ -30,7 +31,7 @@ 1 - + adminhtml/system_config_form_field_heading 70 1 @@ -39,7 +40,6 @@ - Point of Sale identifier text 80 1 @@ -48,7 +48,6 @@ - Symmetrical key for encrypting communication text 90 1 @@ -80,9 +79,9 @@ 0 - + multiline - payu_account/updateInfo + payu/updateInfo 240 1 0 @@ -90,6 +89,92 @@ + + + text + 681 + 1 + 1 + 1 + Important: This plugin works only with REST (Checkout) points of sales (POS). + payu/adminhtml_block_system_config_form_fieldset + + + + adminhtml/system_config_form_field_heading + 0 + 1 + 1 + 1 + + + + select + adminhtml/system_config_source_yesno + 10 + 1 + 1 + 1 + + + + adminhtml/system_config_form_field_heading + 70 + 1 + 1 + 1 + + + + text + 80 + 1 + 1 + 1 + + + + text + 90 + 1 + 1 + 1 + + + + text + 100 + 1 + 1 + 1 + + + + text + 110 + 1 + 1 + 1 + + + + adminhtml/system_config_form_field_heading + 230 + 1 + 0 + 0 + + + + multiline + payu/updateInfo + 240 + 1 + 0 + 0 + + + diff --git a/app/etc/modules/PayU_Account.xml b/app/etc/modules/PayU_Account.xml index 11162ae..76ee7a7 100644 --- a/app/etc/modules/PayU_Account.xml +++ b/app/etc/modules/PayU_Account.xml @@ -4,9 +4,6 @@ true community - - - diff --git a/app/locale/pl_PL/PayU_Account.csv b/app/locale/pl_PL/PayU_Account.csv index ab3fc3a..0e6e6ae 100644 --- a/app/locale/pl_PL/PayU_Account.csv +++ b/app/locale/pl_PL/PayU_Account.csv @@ -1,13 +1,12 @@ "PayU","PayU" +"PayU - Cards","PayU - karty" "Enable plugin?","Czy włączyć wtyczkę?" "Main parameters","Główne parametry" "POS parameters","Parametry punktu płatności (POS)" "POS ID (pos_id)","Id punktu płatności (pos_id)" -"Point of Sale identifier","Identyfikator punktu płatności" "Second key (MD5)","Drugi klucz (MD5)" "OAuth protocol - client_id","Protokół OAuth - client_id" "OAuth protocol - client_secret","Protokół OAuth - client_secret" -"Symmetrical key for encrypting communication","Symetryczny klucz do szyfrowania komunikacji" "PayU Plugin Information","Informacja o wtyczce PayU" "You are currently using version","Aktualnie zainstalowana wersja" "for","dla" @@ -15,6 +14,7 @@ "No","Nie" "Important: This plugin works only with REST (Checkout) points of sales (POS).","WAŻNE: Plugin działa tylko z POS-ami typu REST (Checkout)." "Pay with PayU","Zapłać przez PayU" +"Pay by card with PayU","Zapłać kartą przez PayU" "Order #%s","Zamówienie #%s" "Discount","Rabat" "Shipping","Dostawa" diff --git a/lib/PayU/OpenPayU/Configuration.php b/lib/PayU/OpenPayU/Configuration.php index 5778afb..9c80c91 100644 --- a/lib/PayU/OpenPayU/Configuration.php +++ b/lib/PayU/OpenPayU/Configuration.php @@ -3,14 +3,14 @@ /** * OpenPayU Standard Library * - * @copyright Copyright (c) 2011-2016 PayU + * @copyright Copyright (c) 2011-2017 PayU * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0) * http://www.payu.com * http://developers.payu.com */ class OpenPayU_Configuration { - private static $_availableEnvironment = array('custom', 'secure'); + private static $_availableEnvironment = array('custom', 'secure', 'sandbox'); private static $_availableHashAlgorithm = array('SHA', 'SHA-256', 'SHA-384', 'SHA-512'); private static $env = 'secure'; @@ -25,6 +25,10 @@ class OpenPayU_Configuration */ private static $signatureKey = ''; + /** + * OAuth protocol - default type + */ + private static $oauthGrantType = OauthGrantType::CLIENT_CREDENTIAL; /** * OAuth protocol - client_id */ @@ -35,6 +39,16 @@ class OpenPayU_Configuration */ private static $oauthClientSecret = ''; + /** + * OAuth protocol - email + */ + private static $oauthEmail = ''; + + /** + * OAuth protocol - extCustomerId + */ + private static $oauthExtCustomerId; + /** * OAuth protocol - endpoint address */ @@ -45,6 +59,26 @@ class OpenPayU_Configuration */ private static $oauthTokenCache = null; + /** + * Proxy - host + */ + private static $proxyHost = null; + + /** + * Proxy - port + */ + private static $proxyPort = null; + + /** + * Proxy - user + */ + private static $proxyUser = null; + + /** + * Proxy - password + */ + private static $proxyPassword = null; + private static $serviceUrl = ''; private static $hashAlgorithm = 'SHA-256'; @@ -52,7 +86,7 @@ class OpenPayU_Configuration const API_VERSION = '2.1'; const COMPOSER_JSON = "/composer.json"; - const DEFAULT_SDK_VERSION = 'PHP SDK 2.2.2'; + const DEFAULT_SDK_VERSION = 'PHP SDK 2.2.4'; const OAUTH_CONTEXT = 'pl/standard/user/oauth/authorize'; /** @@ -100,12 +134,15 @@ public static function setEnvironment($environment = 'secure', $domain = 'payu.c throw new OpenPayU_Exception_Configuration($environment . ' - is not valid environment'); } + self::$env = $environment; + if ($environment == 'secure') { - self::$env = $environment; self::$serviceUrl = 'https://' . $environment . '.' . $domain . $api . $version; self::$oauthEndpoint = 'https://' . $environment . '.' . $domain . self::OAUTH_CONTEXT; + } else if ($environment == 'sandbox') { + self::$serviceUrl = 'https://secure.snd.' . $domain . $api . $version; + self::$oauthEndpoint = 'https://secure.snd.' . $domain . self::OAUTH_CONTEXT; } else if ($environment == 'custom') { - self::$env = $environment; self::$serviceUrl = $domain . $api . $version; self::$oauthEndpoint = $domain . self::OAUTH_CONTEXT; } @@ -167,6 +204,27 @@ public static function getSignatureKey() return self::$signatureKey; } + /** + * @return string + */ + public static function getOauthGrantType() + { + return self::$oauthGrantType; + } + + /** + * @param string $oauthGrantType + * @throws OpenPayU_Exception_Configuration + */ + public static function setOauthGrantType($oauthGrantType) + { + if ($oauthGrantType !== OauthGrantType::CLIENT_CREDENTIAL && $oauthGrantType !== OauthGrantType::TRUSTED_MERCHANT) { + throw new OpenPayU_Exception_Configuration('Oauth grand type "' . $oauthGrantType . '"" is not available'); + } + + self::$oauthGrantType = $oauthGrantType; + } + /** * @return string */ @@ -188,7 +246,7 @@ public static function getOauthClientSecret() */ public static function setOauthClientId($oauthClientId) { - self::$oauthClientId = $oauthClientId; + self::$oauthClientId = trim($oauthClientId); } /** @@ -196,7 +254,39 @@ public static function setOauthClientId($oauthClientId) */ public static function setOauthClientSecret($oauthClientSecret) { - self::$oauthClientSecret = $oauthClientSecret; + self::$oauthClientSecret = trim($oauthClientSecret); + } + + /** + * @return mixed + */ + public static function getOauthEmail() + { + return self::$oauthEmail; + } + + /** + * @param mixed $oauthEmail + */ + public static function setOauthEmail($oauthEmail) + { + self::$oauthEmail = $oauthEmail; + } + + /** + * @return mixed + */ + public static function getOauthExtCustomerId() + { + return self::$oauthExtCustomerId; + } + + /** + * @param mixed $oauthExtCustomerId + */ + public static function setOauthExtCustomerId($oauthExtCustomerId) + { + self::$oauthExtCustomerId = $oauthExtCustomerId; } /** @@ -219,6 +309,70 @@ public static function setOauthTokenCache($oauthTokenCache) self::$oauthTokenCache = $oauthTokenCache; } + /** + * @return string | null + */ + public static function getProxyHost() + { + return self::$proxyHost; + } + + /** + * @param string | null $proxyHost + */ + public static function setProxyHost($proxyHost) + { + self::$proxyHost = $proxyHost; + } + + /** + * @return int | null + */ + public static function getProxyPort() + { + return self::$proxyPort; + } + + /** + * @param int | null $proxyPort + */ + public static function setProxyPort($proxyPort) + { + self::$proxyPort = $proxyPort; + } + + /** + * @return string | null + */ + public static function getProxyUser() + { + return self::$proxyUser; + } + + /** + * @param string | null $proxyUser + */ + public static function setProxyUser($proxyUser) + { + self::$proxyUser = $proxyUser; + } + + /** + * @return string | null + */ + public static function getProxyPassword() + { + return self::$proxyPassword; + } + + /** + * @param string | null $proxyPassword + */ + public static function setProxyPassword($proxyPassword) + { + self::$proxyPassword = $proxyPassword; + } + /** * @param string $sender */ diff --git a/lib/PayU/OpenPayU/Http.php b/lib/PayU/OpenPayU/Http.php index a231369..758ab2e 100644 --- a/lib/PayU/OpenPayU/Http.php +++ b/lib/PayU/OpenPayU/Http.php @@ -82,7 +82,7 @@ public static function throwHttpStatusException($statusCode, $message = null) { $response = $message->getResponse(); - $statusDesc = ($response->status && $response->status->statusDesc) ? $response->status->statusDesc : ''; + $statusDesc = isset($response->status->statusDesc) ? $response->status->statusDesc : ''; switch ($statusCode) { case 400: diff --git a/lib/PayU/OpenPayU/HttpCurl.php b/lib/PayU/OpenPayU/HttpCurl.php index 1dc8c6c..729b4b5 100644 --- a/lib/PayU/OpenPayU/HttpCurl.php +++ b/lib/PayU/OpenPayU/HttpCurl.php @@ -46,6 +46,13 @@ public static function doPayuRequest($requestType, $pathUrl, $auth, $data = null curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 60); + if ($proxy = self::getProxy()) { + curl_setopt($ch, CURLOPT_PROXY, $proxy); + if ($proxyAuth = self::getProxyAuth()) { + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth); + } + } + $response = curl_exec($ch); $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); @@ -87,4 +94,16 @@ public static function readHeader($ch, $header) return strlen($header); } + private static function getProxy() + { + return OpenPayU_Configuration::getProxyHost() != null ? OpenPayU_Configuration::getProxyHost() + . (OpenPayU_Configuration::getProxyPort() ? ':' . OpenPayU_Configuration::getProxyPort() : '') : false; + } + + private static function getProxyAuth() + { + return OpenPayU_Configuration::getProxyUser() != null ? OpenPayU_Configuration::getProxyUser() + . (OpenPayU_Configuration::getProxyPassword() ? ':' . OpenPayU_Configuration::getProxyPassword() : '') : false; + } + } diff --git a/lib/PayU/OpenPayU/Oauth/Oauth.php b/lib/PayU/OpenPayU/Oauth/Oauth.php index 4571b51..268fccc 100644 --- a/lib/PayU/OpenPayU/Oauth/Oauth.php +++ b/lib/PayU/OpenPayU/Oauth/Oauth.php @@ -33,11 +33,16 @@ public static function getAccessToken($clientId = null, $clientSecret = null) $oauthUrl = OpenPayU_Configuration::getOauthEndpoint(); $data = array( - 'grant_type' => OauthGrantType::CLIENT_CREDENTIAL, + 'grant_type' => OpenPayU_Configuration::getOauthGrantType(), 'client_id' => $clientId ? $clientId : OpenPayU_Configuration::getOauthClientId(), 'client_secret' => $clientSecret ? $clientSecret : OpenPayU_Configuration::getOauthClientSecret() ); + if (OpenPayU_Configuration::getOauthGrantType() === OauthGrantType::TRUSTED_MERCHANT) { + $data['email'] = OpenPayU_Configuration::getOauthEmail(); + $data['ext_customer_id'] = OpenPayU_Configuration::getOauthExtCustomerId(); + } + $response = self::parseResponse(OpenPayU_Http::doPost($oauthUrl, http_build_query($data), $authType)); self::$oauthTokenCache->set($cacheKey, $response); diff --git a/lib/PayU/OpenPayU/Oauth/OauthGrantType.php b/lib/PayU/OpenPayU/Oauth/OauthGrantType.php index 8ef99da..880b69e 100644 --- a/lib/PayU/OpenPayU/Oauth/OauthGrantType.php +++ b/lib/PayU/OpenPayU/Oauth/OauthGrantType.php @@ -3,4 +3,5 @@ abstract class OauthGrantType { const CLIENT_CREDENTIAL = 'client_credentials'; -} \ No newline at end of file + const TRUSTED_MERCHANT = 'trusted_merchant'; +} diff --git a/lib/PayU/OpenPayU/OpenPayU.php b/lib/PayU/OpenPayU/OpenPayU.php index 8f107eb..6088cb4 100644 --- a/lib/PayU/OpenPayU/OpenPayU.php +++ b/lib/PayU/OpenPayU/OpenPayU.php @@ -13,6 +13,12 @@ class OpenPayU protected static function build($data) { $instance = new OpenPayU_Result(); + + if (array_key_exists('status', $data) && $data['status'] == 'WARNING_CONTINUE_REDIRECT') { + $data['status'] = 'SUCCESS'; + $data['response']['status']['statusCode'] = 'SUCCESS'; + } + $instance->init($data); return $instance; diff --git a/modman b/modman index c8d22e9..a9a6207 100644 --- a/modman +++ b/modman @@ -9,3 +9,4 @@ app/design/frontend/base/default/template/payu_account/* app/design/frontend/ skin/frontend/base/default/css/payu skin/frontend/base/default/css/payu skin/frontend/base/default/images/payu skin/frontend/base/default/images/payu +skin/adminhtml/default/default/images/payu skin/adminhtml/default/default/images/payu diff --git a/skin/adminhtml/default/default/images/payu/payu_logo.png b/skin/adminhtml/default/default/images/payu/payu_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d67e5e37a3d967288ee176c71fb7a2da043f2a0e GIT binary patch literal 5790 zcmV;P7Gdd$P);Jf*^8jQ35P$&01Z|5V`lDsZy}2OT3I!4} z;pofuU1X8_o`4$9Wa0$?>w{=39Abq`L}m%}5(fZO2|7NghC+daOhmF698%>=4}?%4 zArldnnO-oVKtd)W!|iSdw)-6lBxE8IL;hYO8dO7}Ktd)S#124R#F76EYK9qt+W_E^ zXU;GC`DW;g6*3W7ovu9>)#DPo2Z=zCV2qz*0al02cX|WDUW60`FSc(DSR-bmAHdodh7mq2(yR zG2r^fWcLgC><9%CGA?OJRe##T{ZR=;y9~{urets42ft9lIY`L3#KJwN#G*9<&JD_r zK<6Nn~Rsom^sItK7ig7i` zOCSPiNmpNPWj{*b-2zUAY{C|IXhj$t7v=!<(W>7f_xh?-ac?8k0R8!P-#$UMu@~0_O{w z0jLr}gfMqhIEf3hZePThNR3tY6f3(B&=&>0BS;(aQPvz}O-EfkYqQ^$?56=Z!I|X+ zcaXe?a(>>_(DlcWZENz=noi8Mavv6STA^hKb{aY#XiRoL6O0Wt3#@Vv3#uF1migMs zhTd-sEt9y=Rqhc0L&_W~OS58SvUhb5HkLI9$-3FQB>NeRxHtenb0quE7P*bhsp@}u z@QIURBj4uaMY1;+BMt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8X&(UL~DBL>bw%tbT9LNZHoXUVX8(x(3j@0Mr3+0PP{o ztCGDMhuz?NI1Zc@jSW4kN6IcQR<}=`?J9GgWX}X}f`C~Bj}vSKfJ(wR03awwXaFz+ zg53%5EdsBT&WjGBzrQZIXWU0#DN7)efmNGoVliuCf{b-d&V`$uJMBHW1!rv-vtLZx z#wnG6%N2{d`c`+;osn}hn+4SzosZ<(F%v&y+2YPobKc9xy{Y4!T%;%JC}IG>bzu{z z%wEy(*D;-wmcubGknv7)D*kVR{gPK2!Bs08`pR~p3GruA?W9jO?ron^1!#qT4qwmU zkbnpUGLFgE>}Lg?;+@J}hR%bdYS1xAD3EbV+s2xcE$kQl(h1(*nCvR(cx_1OOe$Zj z$wFKEv>I2ryWxNL2T1diQ8ek8CG0`Q8LjEWX|C;GBYEE(1ptIu+m!4sIM7^3>4ZJV zIN;vY^r|ce&b6}31^f5NcNaX+>%jc$D4BN56AEMuXiX*Jmi875-Vk-Xpc5dRh`)Iy z_(D40Sdr`w%=aoJKcPUz02l6mK)Sj3lIEe>np5u#-l7mcLV=78^NKA%nDr4;b^Vp+ zJs0lmjw0bCeQbEKn9K%dRm@Z^yRN=-%-z3_HNqZb3@|hst=!KJpOdc;{CXj`X@!go zp+Lp}$3*XyYtw>~hy7R>JY(}V!KXm1jjHm2T;pa1{> literal 0 HcmV?d00001 diff --git a/skin/frontend/base/default/css/payu/payu.css b/skin/frontend/base/default/css/payu/payu.css index 1b6a146..4a02699 100644 --- a/skin/frontend/base/default/css/payu/payu.css +++ b/skin/frontend/base/default/css/payu/payu.css @@ -1,4 +1,4 @@ -.formPayuLogo { - height: 20px; +.formPayuLogo, .formPayuCards { + height: 22px; margin-right: 10px; } \ No newline at end of file diff --git a/skin/frontend/base/default/images/payu/payu_cards.png b/skin/frontend/base/default/images/payu/payu_cards.png new file mode 100644 index 0000000000000000000000000000000000000000..a6f8137523550301fbdf47179b112f645cc678a3 GIT binary patch literal 2970 zcmV;L3uW|)P)X1^@s6<7>vw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8}<4Q0Ago{I8J>FN*gelEd=;^GAA+!tIbA9g`RqS2fY>xVN?BC z5Pb(Ssg&XhJ%(;G3U?U`=V={dw;N29R@(ELMKRi;PJGAh$0K$B@p>AbxH%d25`FBT z1KCX2wceN5(4oCXpH<-P&yBqJp@Ft;7gyDc?+;XBc$Cn`GjxzUGZr3x7N*Y~dN8X6 zK0gGEc9Fhf*TPUrVS zG#F=4DwXu~^o*)+R8$nz)zwbhC&MqA9v&W;Ok=C$}~2sr#6RiH?qD z{`~ngHZ~Fz6huZw25Z-@MGyqeo;^!yYAVIW#cbccon52yRyM9|RCKu%7M zXuWdb`Y~+9PfZ}T(L)-$8;SOzF^`jyl0sfy9_i`n2y?8RgsyQNmo}Fr%s)suC9*Fn>Vv(&mK}!Q>m$`VcoiQ6crVbo105|dOG{| z?IR%}VH_BXheo5}-h1z5%9JVW-o2Y`+qR)rt2uY>9BFB3tXQ!El}bfMMh4;G;pF7x z(9qC;PNyS1J)NwqEEEa_%a<>wqN0Mfwl-0EzxV&c0GQ2Y%FD|sDk`F?s*0ML8t%XU zenLV*(ChV>&1RyaqOjR)Bqt|x;lc&7va+bGtfaiWoa*XoHf`EOYild3R;?l=Bm}eB z%;n3Mxq0&@8#ZjfWHJ#SAOEd!ve|5um6cIlUCkF?e1Wn5Vlg>6nYy|sHD2}-4snKK99Zaag-cI^XUl6#oj9{a_@&CQLz zzM)I&$&kZ1gIq4hVi9*EFA=(~3PNk1YsuRHiT`5o3ZJwKJrYc2gBc0_4}mpJ(d1l% Qh5!Hn07*qoM6N<$f+%>5K>z>% literal 0 HcmV?d00001 From b16492402a292444edefce6e1fb1f16ead48a422 Mon Sep 17 00:00:00 2001 From: Tomasz Regdos Date: Mon, 28 Aug 2017 11:45:24 +0200 Subject: [PATCH 2/7] New readme, remove PayU info from card payment --- README.EN.md | 103 ++++++++++++ README.md | 152 ++++++++---------- .../PayU/Account/Block/Form/Abstract.php | 2 - .../PayU/Account/Block/Form/PayuAccount.php | 2 +- .../PayU/Account/Block/Form/PayuCard.php | 4 +- app/locale/pl_PL/PayU_Account.csv | 2 +- readme_images/cache_flushed.png | Bin 6402 -> 0 bytes readme_images/methods.png | Bin 0 -> 9373 bytes readme_images/save_config.png | Bin 5481 -> 0 bytes 9 files changed, 175 insertions(+), 90 deletions(-) create mode 100644 README.EN.md delete mode 100644 readme_images/cache_flushed.png create mode 100644 readme_images/methods.png delete mode 100644 readme_images/save_config.png diff --git a/README.EN.md b/README.EN.md new file mode 100644 index 0000000..72a0513 --- /dev/null +++ b/README.EN.md @@ -0,0 +1,103 @@ +[**Wersja polska**][ext0] + +# PayU account plugin for Magento 1.6.0+ +``This plugin is released under the GPL license.`` + +**If you have any questions or issues, feel free to contact our technical support: tech@payu.pl.** + +## Table of Contents + +1. [Features](#features) +1. [Prerequisites](#prerequisites) +1. [Installation](#installation) + * [Installing Manually](#installing-manually) + * [Installing with Magento Connect](#installing-with-magento-connect) +1. [Configuration](#configuration) + +## Features +The PayU payments Magento plugin adds the PayU payment option and enables you to process the following operations in your e-shop: + * Creating a payment order (with discounts included) + * Receive or canceling a payment order (when auto-receive is disable) + * Conducting a refund operation (for a whole or partial order) + +Moduł dodaje dwie metody płatności: +![methods][img0] + * **Zapłać przez PayU** - przekierowanie na stronę wyboru metod płatności w PayU + * **Zapłać kartą** - bezpośrednie przekierowanie na formularz płatności kartą + +# #Prerequisites + +**Important:** This plugin works only with REST API (checkout) points of sales (POS). + +The following PHP extensions are required: + + * [cURL][ext2] to connect and communicate to many different types of servers with many different types of protocols. + * [hash][ext3] to process directly or incrementally the arbitrary length messages by using a variety of hashing algorithms. + +## Installation + +### Option 1 +**Przeznaczona dla użytkowników z dostępem poprzez FTP do instalacji Magento** + +1. Pobierz moduł z [repozytorium GitHub][ext3] jako plik zip +1. Rozpakuj pobrany plik +1. Połącz się z serwerem ftp i skopiuj katalogi `app`, `lib` oraz `skin` z rozpakowanego pliku do katalogu głównego swojego sklepu Magento +1. W celu aktualizacji listy dostępnych wtyczek należy wyczyścić cache: + * Przejdź do strony administracyjnej swojego sklepu Magento [http://shop-url/admin]. + * Przejdź do **System** > **Cache Management**. + * Naciśnij przycisk **Flush Magento Cache**. +1. Jeżeli używasz opcji kompilacji po przejściu do **System** > **Tools** > **Compilation** należy nacisnąć przycisk **Run Compilation Process**. + +### Option 2 +**Z użyciem Magento Connect** + +1. Przejdź do strony administracyjnej swojego sklepu Magento [http://shop-url/admin]. +1. Przejdź do **System** > **Magento Connect** > **Magento Connect Manager**. +1. W sekcji **Install New Extensions section** do pola `Paste the extension key to install` należy wkleić `http://connect20.magentocommerce.com/community/PayU_Account` i wcisnąć przycisk `Install` +1. Po chwili pojawi się informacji o wtyczce. W celu instalacji należy nacisnąć przycisk `Proceed` + +### Option 3 +**Z użyciem skryptu modman** + +Moduł PayU zawiera konfigurację umożliwiającą instalację poprzez skrypt `modman`. +W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu `modman`. + +## Configuration + +Independently of the installation method, the configuration looks the same: + +1. Go to the Magento administration page [http://shop-url/admin]. +2. Go to **System** > **Configuration** window. +3. From the **Configuration** menu on the left, in the **Sales** section, select **Payment Methods**. +4. In the list of available methods, click PayU to expand the configuration form, and specify the [configuration parameters](#configuration). +5. Click ![save_config][img2] in the top right corner of the page. + +### Configuration Parameters + +#### Main parameters + +| Parameter | Description | +|---------|-----------| +| Enable plugin? | Określa czy metoda płatności będzie dostępna w sklepie na liście płatności. | + +#### POS parameters + +| Parameter | Description | +|---------|-----------| +|POS ID|Unique ID of the POS| +|Second Key|MD5 key for securing communication| +|OAuth - client_id|client_id for OAuth| +|OAuth - client_secret|client_secret for OAuth| + + + + + + +[ext0]: README.EN.md +[ext1]: https://github.com/PayU/plugin_magento_160 +[ext2]: http://php.net/manual/en/book.curl.php +[ext3]: http://php.net/manual/en/book.hash.php + + +[img0]: readme_images/methods.png diff --git a/README.md b/README.md index b57e65b..cc483bc 100644 --- a/README.md +++ b/README.md @@ -1,116 +1,100 @@ -# PayU account plugin for Magento 1.6.0+ -------- -``This plugin is released under the GPL license.`` +[**English version**][ext0] -**If you have any questions or issues, feel free to contact our technical support: tech@payu.pl.** +# Moduł PayU dla Magento 1.6.0+ +``Moduł jest wydawany na licencji GPL.`` -## Table of Contents +**Jeżeli masz jakiekolwiek pytania lub chcesz zgłosić błąd zapraszamy do kontaktu z naszym wsparciem pod adresem: tech@payu.pl.** -1. [Features](#features) -1. [Prerequisites](#prerequisites) -1. [Installation](#installation) - * [Installing Manually](#installing-manually) - * [Installing with Magento Connect](#installing-with-magento-connect) -1. [Configuration](#configuration) +## Spis treści -##Features -The PayU payments Magento plugin adds the PayU payment option and enables you to process the following operations in your e-shop: +1. [Cechy](#cechy) +1. [Wymagania](#wymagania) +1. [Instalacja](#instalacja) +1. [Konfiguracja](#konfiguracja) + * [Parametry](#parametry) -* Creating a payment order (with discounts included) -* Receive or canceling a payment order (when auto-receive is disable) -* Conducting a refund operation (for a whole or partial order) +## Cechy +Moduł płatności PayU dodaje do Magento opcję płatności PayU. -##Prerequisites +Możliwe są następujące operacje: + * Utworzenie płatności (wraz z rabatami) + * Odebranie lub odrzucenie płatności (w przypadku wyłączonego autoodbioru) + * Utworzenie zwrotu online (pełnego lub częściowego) -**Important:** This plugin works only with REST API (checkout) points of sales (POS). +Moduł dodaje dwie metody płatności: +![methods][img0] + * **Zapłać przez PayU** - przekierowanie na stronę wyboru metod płatności w PayU + * **Zapłać kartą** - bezpośrednie przekierowanie na formularz płatności kartą -The following PHP extensions are required: +## Wymagania -* [cURL][ext2] to connect and communicate to many different types of servers with many different types of protocols. -* [hash][ext3] to process directly or incrementally the arbitrary length messages by using a variety of hashing algorithms. +**Ważne:** Moduł ta działa tylko z punktem płatności typu `REST API` (Checkout). -##Installation +Do prawidłowego funkcjonowania modułu wymagane są następujące rozszerzenia PHP: [cURL][ext1] i [hash][ext2]. -There are two ways in which you can install the plugin: +## Instalacja -* [manual installation](#installing-manually) by copying and pasting folders from the repository -* [Magento Connect installation](#installing-with-magento-connect) from the administration page +### Opcja 1 +**Przeznaczona dla użytkowników z dostępem poprzez FTP do instalacji Magento** -See the sections below to find out about steps for each of the procedures. +1. Pobierz moduł z [repozytorium GitHub][ext3] jako plik zip +1. Rozpakuj pobrany plik +1. Połącz się z serwerem ftp i skopiuj katalogi `app`, `lib` oraz `skin` z rozpakowanego pliku do katalogu głównego swojego sklepu Magento +1. W celu aktualizacji listy dostępnych wtyczek należy wyczyścić cache: + * Przejdź do strony administracyjnej swojego sklepu Magento [http://adres-sklepu/admin]. + * Przejdź do **System** > **Cache Management**. + * Naciśnij przycisk **Flush Magento Cache**. +1. Jeżeli używasz opcji kompilacji po przejściu do **System** > **Tools** > **Compilation** należy nacisnąć przycisk **Run Compilation Process**. -###Installing Manually +### Opcja 2 +**Z użyciem Magento Connect** -To install the plugin manually, simply copy folders and refresh the list of plugins: +1. Przejdź do strony administracyjnej swojego sklepu Magento [http://adres-sklepu/admin]. +1. Przejdź do **System** > **Magento Connect** > **Magento Connect Manager**. +1. W sekcji **Install New Extensions section** do pola `Paste the extension key to install` należy wkleić `http://connect20.magentocommerce.com/community/PayU_Account` i wcisnąć przycisk `Install` +1. Po chwili pojawi się informacji o wtyczce. W celu instalacji należy nacisnąć przycisk `Proceed` -1. Copy the folders from [the plugin repository][ext1] to your Magento root folder on the server. -1. In order to update the list of available plugins, clean the cache: - * Go to the Magento administration page [http://your-magento-url/admin]. - * Go to **System** > **Cache Management**. - * Select all cache types and click the **Flush Magento Cache** button.
- **Note:** If the list of plugins doesn't refresh, flush other cache as well. +### Opcja 3 +**Z użyciem skryptu modman** - **Results**
![cache_flush_cusscess][img3]
-3. If you have enabled compilation **System** > **Tools** > **Compilation** you have to click **Run Compilation Process**. +Moduł PayU zawiera konfigurację umożliwiającą instalację poprzez skrypt `modman`. +W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu `modman`. -###Installing with Magento Connect +## Konfiguracja -The Mangento Connect tool allows you to install the plugin from the administration page. +1. Przejdź do strony administracyjnej swojego sklepu Magento [http://adres-sklepu/admin]. +1. Przejdź do **System** > **Configuration**. +3. Na stronie **Configuration** w menu po lewej stronie w sekcji **Sales** wybierz **Payment Methods**. +4. Na liście dostępnych metod płatności należy wybrać **PayU** lub **PayU - karty** w celu konfiguracji parametrów wtyczki. +5. Naciśnij przycisk `Save config` -**Before you start**
-It is recommended to always backup your installation prior to use. +### Parametry -1. Go to Magento administration page [http://your-magento-url/admin]. -2. Go to **System** > **Magento Connect** > **Magento Connect Manager**. -3. In the Install New Extensions section, click Search for modules via Magento Connect.
-*Option:* Paste the extension key to install. -4. Use the search box to find PayU. -5. Click the **PayU** icon and install the plugin by clicking the **Install Now** button.
-**Note:** If you are new to Magento Connect, when you click **Install Now** you are asked to register and log in to get the extension key.
- -##Configuration +#### Główne parametry -Independently of the installation method, the configuration looks the same: +| Parameter | Opis | +|---------|-----------| +| Czy włączyć wtyczkę? | Określa czy metoda płatności będzie dostępna w sklepie na liście płatności. | -1. Go to the Magento administration page [http://your-magento-url/admin]. -2. Go to **System** > **Configuration** window. -3. From the **Configuration** menu on the left, in the **Sales** section, select **Payment Methods**. -4. In the list of available methods, click PayU to expand the configuration form, and specify the [configuration parameters](#configuration). -5. Click ![save_config][img2] in the top right corner of the page. +#### Parametry punktu płatności (POS) -### Configuration Parameters - -The tables below present the descriptions of the configuration form parameters. - -#### Main parameters - -The main parameters for plugin configuration are as follows: - -| Parameter | Values | Description | -|:---------:|:------:|:-----------:| -|Enabled|Yes/No|Specifies whether the module is enabled.| - -#### POS parameters - -To check the values of the parameters below, go to **Administration Panel** > **My shops** > **Your shop** > **POS** and click the name of a given POS. - -| Parameter | Description | -|:---------:|:-----------:| -|POS ID|Unique ID of the POS| -|Second Key|MD5 key for securing communication| -|OAuth - client_id|client_id for OAuth| -|OAuth - client_secret|client_secret for OAuth| +| Parameter | Opis | +|---------|-----------| +| Id punktu płatności| Identyfikator POS-a z systemu PayU | +| Drugi klucz MD5 | Drugi klucz MD5 z systemu PayU | +| OAuth - client_id | client_id dla protokołu OAuth z systemu PayU | +| OAuth - client_secret | client_secret for OAuth z systemu PayU | - -[ext1]: https://github.com/PayU/plugin_magento_160 -[ext2]: http://php.net/manual/en/book.curl.php -[ext3]: http://php.net/manual/en/book.hash.php +[ext0]: README.EN.md +[ext1]: http://php.net/manual/en/book.curl.php +[ext2]: http://php.net/manual/en/book.hash.php +[ext3]: https://github.com/PayU/plugin_magento_160 +[ext4]: https://www.magentocommerce.com/magento-connect/payu-cee-payment-extension.html - -[img2]: https://raw.github.com/PayU/plugin_magento_160/master/readme_images/save_config.png -[img3]: https://raw.github.com/PayU/plugin_magento_160/master/readme_images/cache_flushed.png +[img0]: readme_images/methods.png diff --git a/app/code/community/PayU/Account/Block/Form/Abstract.php b/app/code/community/PayU/Account/Block/Form/Abstract.php index c91edb0..41f896e 100644 --- a/app/code/community/PayU/Account/Block/Form/Abstract.php +++ b/app/code/community/PayU/Account/Block/Form/Abstract.php @@ -5,8 +5,6 @@ abstract class PayU_Account_Block_Form_Abstract extends Mage_Payment_Block_Form protected function _construct() { - $this->setTemplate('payu_account/form.phtml'); - parent::_construct(); } diff --git a/app/code/community/PayU/Account/Block/Form/PayuAccount.php b/app/code/community/PayU/Account/Block/Form/PayuAccount.php index a24dcd7..e978a85 100644 --- a/app/code/community/PayU/Account/Block/Form/PayuAccount.php +++ b/app/code/community/PayU/Account/Block/Form/PayuAccount.php @@ -7,7 +7,7 @@ protected function _construct() { $this->setMethodTitle($this->__('Pay with PayU')); $this->setMethodLabelAfterHtml(''); - + $this->setTemplate('payu_account/form.phtml'); return parent::_construct(); } diff --git a/app/code/community/PayU/Account/Block/Form/PayuCard.php b/app/code/community/PayU/Account/Block/Form/PayuCard.php index 0c93a87..7b7495f 100644 --- a/app/code/community/PayU/Account/Block/Form/PayuCard.php +++ b/app/code/community/PayU/Account/Block/Form/PayuCard.php @@ -5,8 +5,8 @@ class PayU_Account_Block_Form_PayuCard extends PayU_Account_Block_Form_Abstract protected function _construct() { - $this->setMethodTitle($this->__('Pay by card with PayU')); - $this->setMethodLabelAfterHtml(''); + $this->setMethodTitle($this->__('Pay by card')); + $this->setMethodLabelAfterHtml(''); return parent::_construct(); } diff --git a/app/locale/pl_PL/PayU_Account.csv b/app/locale/pl_PL/PayU_Account.csv index 0e6e6ae..0cf5578 100644 --- a/app/locale/pl_PL/PayU_Account.csv +++ b/app/locale/pl_PL/PayU_Account.csv @@ -14,7 +14,7 @@ "No","Nie" "Important: This plugin works only with REST (Checkout) points of sales (POS).","WAŻNE: Plugin działa tylko z POS-ami typu REST (Checkout)." "Pay with PayU","Zapłać przez PayU" -"Pay by card with PayU","Zapłać kartą przez PayU" +"Pay by card","Zapłać kartą" "Order #%s","Zamówienie #%s" "Discount","Rabat" "Shipping","Dostawa" diff --git a/readme_images/cache_flushed.png b/readme_images/cache_flushed.png deleted file mode 100644 index d7b307e8c6501e30911c5ce8892142217b90c45b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6402 zcmZu!Wmr`0x}E_^DM7kJa%hR6V`%9v$)REB6zLA75r*y-kq+sS5RvYXmTm?(eBa(@ z@9(Cb)%z$e|R$_!%;Ogt+{+l6kg#H*&Sq z?6#8Svuy+zMAMTpBddHS(INqgMn5iQkBuo=qe7y~MMBC2ND~Qb4x;1Y0w3p>uaM;% zycZ0%_Dx0~u7Y_YGKWwBm~yEE;7Fh6~fD%5mEfbivYW)qsZ%>k&~fJ;zegC?Ms9w}|LDamvG~ z`3vfJ{XZ_M-i@ru^o?;v?C%Tob6ASPg@aKkJrw8Hua}BtMoA!V4m#A+AJ2$whZS z5tancqS;A^3L?b^={S?Y(bBp+oC(f@&?GR!yPk8QE{9;C2Rq}TJZP5-87I78^_4RZ9Jt+ib8OXwRUMAo!+z{@EwqTHv_^a^h?y(T?2#-sOeQ0D zliRI!Qp%8wUXQ9B$tt5=kfHXcl;f9U^2-bS3ye4!&574v`R1`HBjaW3CP;VqcFf(u zEmTXv9g!VzRFDsO-^`dv9A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z8fs45S7(kvr!~Adg@ak_r|re$<+k$i${_vbBL5VUmD1Q5iG}7j-1)=;+_54 z@ubfWgLVL?>yIEHwL(Y5#oFN0RlJ(iJG7wpFRPc$|_Sg(@EPk~Ig6ygY_j!bN$*g=p@ zi{LYM6g6Cy^Iy!fJkvG)o#Jrnj{BQNhIL*Zj*5yzV@K~|3yweWalR{8Y5OHVQwhcW zMMmdldZr_EQ-B{JtKrzpQE*;v9!wJOh6;2n#n5M^1~KNlb0&&475gB1Y{-CPvxW7u zbiM+q=nY+ukV#NZ;B?Nz+^C=N?8pm&_=xOs5<+6X`7BAmv>bSGLB5bjs0VRV`&EN6 zWzBdrTf(^+5|4~pV6ik$5T%m}n$(oGt{`?Ol)INg_mv`J0B6}K*wx=Nz>T{zgoDvK zEwOgVs!C6PQ6=L0XQ*NHb1}X8n4M8(9@_9YFmTerhJAaPxq5jUTctG6zCC(UW#^+c zNf)@lACad5Gl*}x-?37Zo$ly!d4PSZz?tXXm#_^yEnyYVypK4dv^Cjt8G@J`AYXyCmQ)fy?UW;@;W@^w^+Uous z0XZI2wul9{(8`OlwJxcBap*!J6fN&lp(2meynsQ<6J254u{ z>dErsA(#GC!=XXN>Ux4oe~xvadD8BA6cSh@!9kC}4(~3}mbem>zpi`=GAfX2DbwKp E0l#7iLI3~& diff --git a/readme_images/methods.png b/readme_images/methods.png new file mode 100644 index 0000000000000000000000000000000000000000..46ebbb08280a804c87073b0e62978cdb756d179c GIT binary patch literal 9373 zcmdUVbx>Phw{{4UAc3T~2WXL&;_g~n3KS_?TvOcLLa?H3X@NrV3hq{bLVExWX?Wk+gkfsYdve9{Yq0q1wuqe1ONaaPaZ320{}oE z_Wli+0Q+CTIRpj(;D9Ge^3Q!gZqJ1T>a6C-?&&~@qRm(J`^Y%-Q)dg%I}93^<8xf& z54_Me!CsC;8Wgp=e{G?Mx>fI^Z7oY}RcEO{Fc*p$$tr647d{nMUGka|*(LGsi`5;8 zH*@a1HW0gVn^`%$Vv|LrExeqG%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&62kx@U2a{^W?x8_g8m$ zG)o1fN;@6%T5m|%r~1xuC_m-Vcb+EH8gj3#GmG-mEPc8+nz|=Tv*o7}Ma{F#I|bBwA ztX8CP*FxcMvFh>beT8V4h<3IM*^i~xJ8kr;2&W|YP4lb6O21fe`OyA(wiiq)M$GK9 zga4Vl_0PG`L7T|Ns()EC7*iuVmjcE9W}MTdR^rFwiODkr#dbW}>BcD6*i89GiHDS~ judcjv{TSD2+dWX_&Z1p4$Mj)s0RWWc)#NH Date: Mon, 28 Aug 2017 11:54:52 +0200 Subject: [PATCH 3/7] Cleanup readme --- README.EN.md | 14 +++++++------- README.md | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.EN.md b/README.EN.md index 72a0513..e3207b6 100644 --- a/README.EN.md +++ b/README.EN.md @@ -10,9 +10,8 @@ 1. [Features](#features) 1. [Prerequisites](#prerequisites) 1. [Installation](#installation) - * [Installing Manually](#installing-manually) - * [Installing with Magento Connect](#installing-with-magento-connect) 1. [Configuration](#configuration) + * [Parameters](#parameters) ## Features The PayU payments Magento plugin adds the PayU payment option and enables you to process the following operations in your e-shop: @@ -21,6 +20,7 @@ The PayU payments Magento plugin adds the PayU payment option and enables you to * Conducting a refund operation (for a whole or partial order) Moduł dodaje dwie metody płatności: + ![methods][img0] * **Zapłać przez PayU** - przekierowanie na stronę wyboru metod płatności w PayU * **Zapłać kartą** - bezpośrednie przekierowanie na formularz płatności kartą @@ -67,12 +67,12 @@ W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu ` Independently of the installation method, the configuration looks the same: 1. Go to the Magento administration page [http://shop-url/admin]. -2. Go to **System** > **Configuration** window. +2. Go to **System** > **Configuration**. 3. From the **Configuration** menu on the left, in the **Sales** section, select **Payment Methods**. -4. In the list of available methods, click PayU to expand the configuration form, and specify the [configuration parameters](#configuration). -5. Click ![save_config][img2] in the top right corner of the page. +4. In the list of available methods, click **PayU** or **PayU - cards** to expand the configuration form. +5. Click `Save config`. -### Configuration Parameters +### Parameters #### Main parameters @@ -94,7 +94,7 @@ Independently of the installation method, the configuration looks the same: -[ext0]: README.EN.md +[ext0]: README.md [ext1]: https://github.com/PayU/plugin_magento_160 [ext2]: http://php.net/manual/en/book.curl.php [ext3]: http://php.net/manual/en/book.hash.php diff --git a/README.md b/README.md index cc483bc..2e2be94 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,14 @@ Możliwe są następujące operacje: * Utworzenie zwrotu online (pełnego lub częściowego) Moduł dodaje dwie metody płatności: + ![methods][img0] * **Zapłać przez PayU** - przekierowanie na stronę wyboru metod płatności w PayU * **Zapłać kartą** - bezpośrednie przekierowanie na formularz płatności kartą ## Wymagania -**Ważne:** Moduł ta działa tylko z punktem płatności typu `REST API` (Checkout). +**Ważne:** Moduł ten działa tylko z punktem płatności typu `REST API` (Checkout). Do prawidłowego funkcjonowania modułu wymagane są następujące rozszerzenia PHP: [cURL][ext1] i [hash][ext2]. @@ -66,7 +67,7 @@ W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu ` 1. Przejdź do **System** > **Configuration**. 3. Na stronie **Configuration** w menu po lewej stronie w sekcji **Sales** wybierz **Payment Methods**. 4. Na liście dostępnych metod płatności należy wybrać **PayU** lub **PayU - karty** w celu konfiguracji parametrów wtyczki. -5. Naciśnij przycisk `Save config` +5. Naciśnij przycisk `Save config`. ### Parametry From ca0c2e559335753a5a9cf95acd2ba4d90b42baa5 Mon Sep 17 00:00:00 2001 From: Lukasz Grzesiak Date: Tue, 29 Aug 2017 10:17:50 +0200 Subject: [PATCH 4/7] en translation update --- README.EN.md | 48 +++++++++++++++++------------------ readme_images/methods_en.png | Bin 0 -> 13554 bytes 2 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 readme_images/methods_en.png diff --git a/README.EN.md b/README.EN.md index e3207b6..457a576 100644 --- a/README.EN.md +++ b/README.EN.md @@ -19,13 +19,13 @@ The PayU payments Magento plugin adds the PayU payment option and enables you to * Receive or canceling a payment order (when auto-receive is disable) * Conducting a refund operation (for a whole or partial order) -Moduł dodaje dwie metody płatności: - +The module adds two payment methods: + ![methods][img0] - * **Zapłać przez PayU** - przekierowanie na stronę wyboru metod płatności w PayU - * **Zapłać kartą** - bezpośrednie przekierowanie na formularz płatności kartą + * **Pay with PayU** - redirection to PayU hosted paywall (with all available payment methods) + * **Pay by card** - redirection to PayU hosted card payment form -# #Prerequisites +# Prerequisites **Important:** This plugin works only with REST API (checkout) points of sales (POS). @@ -37,30 +37,30 @@ The following PHP extensions are required: ## Installation ### Option 1 -**Przeznaczona dla użytkowników z dostępem poprzez FTP do instalacji Magento** +**Intended for users with FTP access to Magento Installation** -1. Pobierz moduł z [repozytorium GitHub][ext3] jako plik zip -1. Rozpakuj pobrany plik -1. Połącz się z serwerem ftp i skopiuj katalogi `app`, `lib` oraz `skin` z rozpakowanego pliku do katalogu głównego swojego sklepu Magento -1. W celu aktualizacji listy dostępnych wtyczek należy wyczyścić cache: - * Przejdź do strony administracyjnej swojego sklepu Magento [http://shop-url/admin]. - * Przejdź do **System** > **Cache Management**. - * Naciśnij przycisk **Flush Magento Cache**. -1. Jeżeli używasz opcji kompilacji po przejściu do **System** > **Tools** > **Compilation** należy nacisnąć przycisk **Run Compilation Process**. +1. Download the module from [repozytorium GitHub][ext3] as zip file. +1. Unzip the file. +1. Connect with your FTP server and copy `app`, `lib` and `skin` directories from the unzipped file to the main directory of your Magento installation. +1. Flush the cache to update the available plugins list: + * Go to admin page of your Magento installation [http://shop-url/admin]. + * Choose **System** > **Cache Management**. + * Click **Flush Magento Cache** button. +1. If you are using compilation option, choose **System** > **Tools** > **Compilation** and click **Run Compilation Process** button. ### Option 2 -**Z użyciem Magento Connect** +**Using Magento Connect** -1. Przejdź do strony administracyjnej swojego sklepu Magento [http://shop-url/admin]. -1. Przejdź do **System** > **Magento Connect** > **Magento Connect Manager**. -1. W sekcji **Install New Extensions section** do pola `Paste the extension key to install` należy wkleić `http://connect20.magentocommerce.com/community/PayU_Account` i wcisnąć przycisk `Install` -1. Po chwili pojawi się informacji o wtyczce. W celu instalacji należy nacisnąć przycisk `Proceed` +1. Go to admin page of your Magento installation [http://shop-url/admin]. +1. Choose **System** > **Magento Connect** > **Magento Connect Manager**. +1. In **Install New Extensions section** insert `http://connect20.magentocommerce.com/community/PayU_Account` into the `Paste the extension key to install` field and click `Install` +1. Information about the plugin shall appear shortly. To continue installation click `Proceed`. ### Option 3 -**Z użyciem skryptu modman** +**Using modman script** -Moduł PayU zawiera konfigurację umożliwiającą instalację poprzez skrypt `modman`. -W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu `modman`. +PayU module includes configuration which makes it possible to install via `modman` script. +Please refer to `modman` documentation for further details. ## Configuration @@ -78,7 +78,7 @@ Independently of the installation method, the configuration looks the same: | Parameter | Description | |---------|-----------| -| Enable plugin? | Określa czy metoda płatności będzie dostępna w sklepie na liście płatności. | +| Enable plugin? | Defines the availability of the payment method on the payment method list during checkout. | #### POS parameters @@ -100,4 +100,4 @@ Independently of the installation method, the configuration looks the same: [ext3]: http://php.net/manual/en/book.hash.php -[img0]: readme_images/methods.png +[img0]: readme_images/methods_en.png diff --git a/readme_images/methods_en.png b/readme_images/methods_en.png new file mode 100644 index 0000000000000000000000000000000000000000..fbd2e097758029cd62f7f19fac4aaf08752f7773 GIT binary patch literal 13554 zcmdV>Wl&sC^v4MY2oNBI;1(dbdvFcz3^F)_yAxak1PGqs?lQQ$hu|It*90G2hC#zl ze*b!&+S=XPt=)aKZ>Db7Z8_b2=icx6oYPSNHF<1IGRzk*USKOK$Y{QJf#iv}&U}T2 z_|-{YVtw)A{R>5zkJ>(A`?fK^6;H$9*MP%x?l)rH)r6f_Le3|k?T`r<^2<+l; zs{F88!dXzeKFhMSNY(=T@T!6J(S+UkQiOoy=x_EuFJFb6zY3AWQ;?!e8l6~k$s7Hq z$U{9!M=jkj1;4;e54-_A^iDla2|Ls_7B#M(+^nq`?Yu>mLDG;UXuBkwVFsJr&3z;N zid^`a={+VB>Px6Q#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&#fskf~Hx53AAl(!8ddk%&Y^Zt@xA#Du3HQ8Dv(}wWS}_7%NPVNFro{lT;`Q6LXK` z!-!Y*_&BW~UGk4YO~(W7tZ{&e4AA#_Ue|f5$f!C#iJp;6VZP*loV2e90NdO$Kvw>W##>bO}4#_fk;vjbV zzhQNiZ#zM>+hfcmNYyTJBy3#{ zDJ6ok6aUaSjfXYbOqudze2sNX=(qg?IdsG>+@H={tcV8r9n!NADHGNS@N0UjX;jA< z`JXf!QAm89)7M{`&y-vCZqCIeT=9 zfllzNu}JU!`R{?1`|*Kvee0R80I@g#1y!itNFUAN-|5>rx2fSBbSPqn>&Gm%ix^1V8>HChcE zDL>f0t!Q~h5UCYwy9yIRZV>^s)iyU;H#fJH=klP9pa&JIOD{;j()4A_NeE|L|OD#_10-FK6&yV{OhjV2(h+G_6adA*q(F)^8 z`&Up_5CY*M#gGB>H+WWBRl#{dSgQpRp{im%t#2W)o`VhvCA+f7dh&NJ0Db}}rXS0E zi6$3j1XQ{BbGcW$_6wapEv#`Cv7$ovlwYoY^X^-t-GO8>PvRP=LCy5_!s^vn;IGC{ zc5lFy_493GAkR-2I5@q6HJOnK2?;GWJ@XVAgh0c~^l%Bbv%?xo(iTJC?e;qH8utn%3jnN%YxbTFXxPX+dRZ? z{D7k<8o3$~pzs@SYtu(G()zA}ApVkwP7$Ybu>VU1{C{~m2a&C2gz{gWU=t0Z)9R57 w9>V|K0JcQn%FQm?$p2CX3;T9;x1Ny*{o$NMFQoMlXPI6o%BsoKNSTKIFKrCAvj6}9 literal 0 HcmV?d00001 From add0dfda62d99692c41ab924ceadf66364f99861 Mon Sep 17 00:00:00 2001 From: Tomasz Regdos Date: Tue, 29 Aug 2017 14:54:01 +0200 Subject: [PATCH 5/7] Added Sandbox --- README.EN.md | 12 ++++ README.md | 13 +++- .../community/PayU/Account/Model/Config.php | 25 ++++---- .../PayU/Account/Model/Method/Abstract.php | 2 +- .../community/PayU/Account/etc/config.xml | 2 + .../community/PayU/Account/etc/system.xml | 63 +++++++++++++++++++ app/locale/pl_PL/PayU_Account.csv | 2 + 7 files changed, 104 insertions(+), 15 deletions(-) diff --git a/README.EN.md b/README.EN.md index 457a576..c3c557f 100644 --- a/README.EN.md +++ b/README.EN.md @@ -79,6 +79,7 @@ Independently of the installation method, the configuration looks the same: | Parameter | Description | |---------|-----------| | Enable plugin? | Defines the availability of the payment method on the payment method list during checkout. | +| Sandbox mode | Defines if payments will be created in PayU sandbox instead of production (live) environment. | #### POS parameters @@ -89,6 +90,17 @@ Independently of the installation method, the configuration looks the same: |OAuth - client_id|client_id for OAuth| |OAuth - client_secret|client_secret for OAuth| +#### POS parameters - Sandbox mode +Available when parameter `Sandbox mode` is set to `Yes`. + +| Parameter | Description | +|---------|-----------| +|POS ID|Unique ID of the POS| +|Second Key|MD5 key for securing communication| +|OAuth - client_id|client_id for OAuth| +|OAuth - client_secret|client_secret for OAuth| + + diff --git a/README.md b/README.md index 2e2be94..a6531c6 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu ` | Parameter | Opis | |---------|-----------| | Czy włączyć wtyczkę? | Określa czy metoda płatności będzie dostępna w sklepie na liście płatności. | +| Tryb testowy (Sandbox) | Określa czy płatności będą realizowane na środowisku testowym (sandbox) PayU. | #### Parametry punktu płatności (POS) @@ -86,6 +87,17 @@ W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu ` | OAuth - client_id | client_id dla protokołu OAuth z systemu PayU | | OAuth - client_secret | client_secret for OAuth z systemu PayU | +#### Parametry punktu płatności (POS) - Tryb testowy (Sandbox) +Dostępne gdy parametr `Tryb testowy (Sandbox)` jest ustawiony na `Tak`. + +| Parameter | Opis | +|---------|-----------| +| Id punktu płatności| Identyfikator POS-a z systemu PayU | +| Drugi klucz MD5 | Drugi klucz MD5 z systemu PayU | +| OAuth - client_id | client_id dla protokołu OAuth z systemu PayU | +| OAuth - client_secret | client_secret for OAuth z systemu PayU | + + @@ -95,7 +107,6 @@ W celu instalcji z użyciem `modman` proszę skozystać z dokumentacji skryptu ` [ext1]: http://php.net/manual/en/book.curl.php [ext2]: http://php.net/manual/en/book.hash.php [ext3]: https://github.com/PayU/plugin_magento_160 -[ext4]: https://www.magentocommerce.com/magento-connect/payu-cee-payment-extension.html [img0]: readme_images/methods.png diff --git a/app/code/community/PayU/Account/Model/Config.php b/app/code/community/PayU/Account/Model/Config.php index 76a8676..11ab19a 100644 --- a/app/code/community/PayU/Account/Model/Config.php +++ b/app/code/community/PayU/Account/Model/Config.php @@ -54,39 +54,39 @@ public function setStoreId($storeId) /** @return string get Merchant POS Id */ public function getMerchantPosId() { - return $this->getStoreConfig('payment/' . $this->_method . '/pos_id'); + return $this->getStoreConfig('pos_id'); } /** - * @return string get signature key + * @return string get Signature Key */ public function getSignatureKey() { - return $this->getStoreConfig('payment/' . $this->_method . '/signature_key'); + return $this->getStoreConfig('signature_key'); } /** - * @return string get (OAuth Client Name) + * @return string get OAuth Client Id */ public function getClientId() { - return $this->getStoreConfig('payment/' . $this->_method . '/oauth_client_id'); + return $this->getStoreConfig('oauth_client_id'); } /** - * @return string get (OAuth Client Secret) + * @return string get OAuth Client Secret */ public function getClientSecret() { - return $this->getStoreConfig('payment/' . $this->_method . '/oauth_client_secret'); + return $this->getStoreConfig('oauth_client_secret'); } /** - * @return string one step checkout button url + * @return string get Sandbox */ - public function getButtonSrc() + public function isSandbox() { - return 'https://static.payu.com/pl/standard/partners/buttons/payu_account_button_01.png'; + return (bool)Mage::getStoreConfig('payment/' . $this->_method . '/sandbox', $this->_storeId); } /** @@ -98,7 +98,7 @@ public function getButtonSrc() public function getUrl($action, $params = array()) { $params['_secure'] = true; - return Mage::getUrl("payu/payment/$action", $params); + return Mage::getUrl('payu/payment/' . $action, $params); } /** @@ -124,7 +124,6 @@ public function getMinimumMageVersion() */ protected function getStoreConfig($name) { - return Mage::getStoreConfig($name, $this->_storeId); + return Mage::getStoreConfig('payment/' . $this->_method . '/' . ($this->isSandbox() ? 'sandbox_' : '') . $name, $this->_storeId); } - } diff --git a/app/code/community/PayU/Account/Model/Method/Abstract.php b/app/code/community/PayU/Account/Model/Method/Abstract.php index 1d387c7..624b734 100644 --- a/app/code/community/PayU/Account/Model/Method/Abstract.php +++ b/app/code/community/PayU/Account/Model/Method/Abstract.php @@ -546,7 +546,7 @@ protected function _getLanguageCode() */ protected function _initializeOpenPayUConfiguration() { - OpenPayU_Configuration::setEnvironment('secure'); + OpenPayU_Configuration::setEnvironment($this->_payuConfig->isSandbox() ? 'sandbox' : 'secure'); OpenPayU_Configuration::setMerchantPosId($this->_payuConfig->getMerchantPosId()); OpenPayU_Configuration::setSignatureKey($this->_payuConfig->getSignatureKey()); if ($this->_payuConfig->getClientId() && $this->_payuConfig->getClientSecret()) { diff --git a/app/code/community/PayU/Account/etc/config.xml b/app/code/community/PayU/Account/etc/config.xml index 5d571d2..3aa582f 100644 --- a/app/code/community/PayU/Account/etc/config.xml +++ b/app/code/community/PayU/Account/etc/config.xml @@ -62,12 +62,14 @@ 0 + 0 PayU payu/method_payuAccount payu 0 + 0 PayU - Cards payu/method_payuCard payu diff --git a/app/code/community/PayU/Account/etc/system.xml b/app/code/community/PayU/Account/etc/system.xml index 0f2a1e2..59a5602 100644 --- a/app/code/community/PayU/Account/etc/system.xml +++ b/app/code/community/PayU/Account/etc/system.xml @@ -30,6 +30,15 @@ 1 1 + + + select + adminhtml/system_config_source_yesno + 20 + 1 + 1 + 1 + adminhtml/system_config_form_field_heading @@ -70,6 +79,51 @@ 1 1 + + + 1 + adminhtml/system_config_form_field_heading + 120 + 1 + 1 + 1 + + + + 1 + text + 130 + 1 + 1 + 1 + + + + 1 + text + 140 + 1 + 1 + 1 + + + + 1 + text + 150 + 1 + 1 + 1 + + + + 1 + text + 160 + 1 + 1 + 1 + adminhtml/system_config_form_field_heading @@ -116,6 +170,15 @@ 1 1 + + + select + adminhtml/system_config_source_yesno + 20 + 1 + 1 + 1 + adminhtml/system_config_form_field_heading diff --git a/app/locale/pl_PL/PayU_Account.csv b/app/locale/pl_PL/PayU_Account.csv index 0cf5578..d5ae8be 100644 --- a/app/locale/pl_PL/PayU_Account.csv +++ b/app/locale/pl_PL/PayU_Account.csv @@ -27,3 +27,5 @@ "Refund for order: %s","Zwrot do zamówienia %s" "Payu refund - amount: %s, status: %s","Zwrot Payu - kwota: %s, status: %s" "You will be redirected to PayU after submitting the order.","Zostaniesz przekierowany do PayU po złożeniu zamówienia" +"Sandbox mode","Tryb testowy (Sandbox)" +"POS parameters - Sandbox mode","Parametry punktu płatności (POS) - Tryb testowy (Sandbox)" From d089f450f8ac78d9dbdafbe6548d7816d182a0bd Mon Sep 17 00:00:00 2001 From: Tomasz Regdos Date: Thu, 31 Aug 2017 11:03:30 +0200 Subject: [PATCH 6/7] Fix extract language from locale --- app/code/community/PayU/Account/Model/Method/Abstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/PayU/Account/Model/Method/Abstract.php b/app/code/community/PayU/Account/Model/Method/Abstract.php index 624b734..23dc736 100644 --- a/app/code/community/PayU/Account/Model/Method/Abstract.php +++ b/app/code/community/PayU/Account/Model/Method/Abstract.php @@ -538,7 +538,7 @@ protected function _getLanguageCode() { $locale = Mage::getStoreConfig('general/locale/code', Mage::app()->getStore()->getId()); $langCode = explode('_', $locale, 2); - return strtolower($langCode[1]); + return strtolower($langCode[0]); } /** From acf9176bc5ca0a58d94e1bb2c720aceeaac9618f Mon Sep 17 00:00:00 2001 From: Tomasz Regdos Date: Thu, 31 Aug 2017 11:09:03 +0200 Subject: [PATCH 7/7] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecc90e8..09c625b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.3.0 + * Separated card payment + * Added sandbox + ## 2.2.1 * Fix customerIp and translate * Catch consumeNotification exception