Commit 83fdf775 authored by John Punzalan's avatar John Punzalan

Add Ogone version Omise

parent 0fccd0e0
<?php
/**
* @category OPS
* @package Netresearch_OPS
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Netresearch_OPS_Block_Adminhtml_Customer_Edit_Tab_Alias
*
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Adminhtml_Customer_Edit_Tab_Alias
extends Mage_Adminhtml_Block_Widget_Grid
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
public function _construct()
{
parent::_construct();
$this->setId('customer_edit_tab_ops_alias');
$this->setUseAjax(true);
}
/**
* Return Tab label
*
* @return string
*/
public function getTabLabel()
{
return $this->__('Payment Information');
}
/**
* Return Tab label
*
* @return string
*/
public function getTabTitle()
{
return $this->__('Payment Information');
}
/**
* Can show tab in tabs
*
* @return boolean
*/
public function canShowTab()
{
$customer = Mage::registry('current_customer');
return (bool)$customer->getId();
}
/**
* Tab is hidden
*
* @return boolean
*/
public function isHidden()
{
return false;
}
/**
* Defines after which tab, this tab should be rendered
*
* @return string
*/
public function getAfter()
{
return 'orders';
}
/*
* Retrieves Grid Url
*
* @return string
*/
public function getGridUrl()
{
//return $this->getUrl('*/ops/customer', array('_current'=>true));
}
protected function _prepareCollection()
{
$customer = Mage::registry('current_customer');
$collection = Mage::getModel('ops/alias')
->getCollection()
->addFieldToFilter('customer_id', $customer->getId());
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn('alias', array(
'header' => Mage::helper('ops')->__('Alias'),
'align' => 'right',
'index' => 'alias',
));
/*
$this->addColumn('payment_method', array(
'header' => Mage::helper('ops')->__('Brand'),
'index' => 'payment_method',
));
*/
$this->addColumn('brand', array(
'header' => Mage::helper('ops')->__('Credit Card Type'),
'index' => 'brand',
));
$this->addColumn('pseudo_account_or_cc_no', array(
'header' => Mage::helper('ops')->__('Card Number/Account Number'),
'index' => 'pseudo_account_or_cc_no',
));
$this->addColumn('expiration_date', array(
'header' => Mage::helper('ops')->__('Expiration Date'),
'index' => 'expiration_date',
));
$this->addColumn('card_holder', array(
'header' => Mage::helper('ops')->__('Card Holder'),
'index' => 'card_holder',
));
$this->addColumn('state', array(
'header' => Mage::helper('ops')->__('State'),
'index' => 'state',
'renderer' => 'Netresearch_OPS_Block_Adminhtml_Customer_Renderer_State',
));
$this->addColumn('action',
array(
'header' => Mage::helper('ops')->__('Action'),
'width' => '100',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('ops')->__('Delete'),
'url' => array('base' => 'ops/adminhtml_alias/delete'),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
return parent::_prepareColumns();
}
public function getRowUrl($row)
{
//return $this->getUrl('*/customer/edit', array('id' => $row->getId()));
}
}
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of State
*
* @author sebastian
*/
class Netresearch_OPS_Block_Adminhtml_Customer_Renderer_State extends
Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
public function render(Varien_Object $row)
{
$value = $row->getData($this->getColumn()->getIndex());
return Mage::helper('ops')->__($value);
}
}
?>
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package Netresearch_OPS
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Adminhtml_Kwixo_Shipping_Edit
extends Mage_Adminhtml_Block_Widget_Form_Container
{
private $kwixoShippingModel = null;
/**
* gets the form action url
*
* @return string
*/
public function getFormActionUrl()
{
return $this->getUrl('adminhtml/kwixoshipping/save');
}
/**
* gets the shipping types
*
* @return array
*/
public function getShippingMethods()
{
$methods = Mage::getSingleton('shipping/config')->getAllCarriers();
$options = array();
foreach($methods as $carrierCode => $carrier) {
if(!$title = Mage::getStoreConfig("carriers/$carrierCode/title")) {
$title = $carrierCode;
}
$values = $this->getValues($carrierCode);
$options[] = array('code' => $carrierCode, 'label' => $title, 'values' => $values);
}
return $options;
}
/**
* returns the corresponding shipping method types
*
* @return array - the kwxixo Shipping method types
*/
public function getKwixoShippingTypes()
{
return Mage::getModel('ops/source_kwixo_shipMethodType')->toOptionArray();
}
public function getKwixoShippingSettingModel()
{
if (null === $this->kwxioShippingModel) {
$this->kwixoShippingModel = Mage::getModel('ops/kwixo_shipping_setting');
}
return $this->kwixoShippingModel;
}
private function getValues($carrierCode)
{
$values = array(
'kwixo_shipping_type' => '',
'kwixo_shipping_speed' => '',
'kwixo_shipping_details' => ''
);
if ($this->hasData('postData') && array_key_exists($carrierCode, $this->getData('postData'))) {
$errorData = $this->getData('postData');
$values = $errorData[$carrierCode];
} else {
$values = $this->getKwixoShippingSettingModel()->load($carrierCode, 'shipping_code')->getData();
}
return $values;
}
}
\ No newline at end of file
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Adminhtml_Kwixocategory_CategoryTree
extends Mage_Adminhtml_Block_Catalog_Category_Tree {
public function __construct() {
parent::__construct();
$this->setTemplate('ops/categoriestree.phtml');
$this->setUseAjax(true);
$this->_withProductCount = false;
}
public function getSwitchTreeUrl() {
return $this->getUrl("*/*/tree", array('_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null));
}
public function getNodesUrl() {
return $this->getUrl('adminhtml/catalog_category/jsonTree');
}
public function getEditUrl() {
return $this->getUrl('*/*/edit', array('_current' => true, '_query' => false, 'id' => null, 'parent' => null));
}
protected function _getNodeJson($node, $level = 0) {
$item = array();
$item['text'] = $this->buildNodeName($node);
//$rootForStores = in_array($node->getEntityId(), $this->getRootIds());
$item['id'] = $node->getId();
$item['cls'] = 'folder ' . ($node->getIsActive() ? 'active-category' : 'no-active-category');
$item['store'] = (int) $this->getStore()->getId();
$item['path'] = $node->getData('path');
$item['allowDrop'] = false;
$item['allowDrag'] = false;
if ((int) $node->getChildrenCount() > 0) {
$item['children'] = array();
}
$isParent = $this->_isParentSelectedCategory($node);
if ($node->hasChildren()) {
$item['children'] = array();
if (!($this->getUseAjax() && $node->getLevel() > 1 && !$isParent)) {
foreach ($node->getChildren() as $child) {
$item['children'][] = $this->_getNodeJson($child, $level + 1);
}
}
}
if ($isParent || $node->getLevel() < 2) {
$item['expanded'] = true;
}
return $item;
}
protected function _getProductTypeLabel($productTypeId) {
$res = '';
$types = Mage::getModel('ops/source_kwixo_productCategories')->toOptionArray();
foreach ($types as $data) {
if ($data['value'] == $productTypeId) {
$res = $data['label'];
break;
}
}
return $res;
}
public function buildNodeName($node) {
$result = $this->htmlEscape($node->getName());
return $result;
}
}
\ No newline at end of file
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Adminhtml_Kwixocategory_Edit
extends Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
{
parent::__construct();
$this->_objectId = 'id';
$this->_controller = 'adminhtml_kwixocategory';
$this->_blockGroup = 'ops';
$this->_mode = 'edit';
$this->_updateButton('save', 'label', $this->__('Save'));
$this->_updateButton('save', 'url', $this->getUrl('*/*/save'));
}
public function getHeaderText() {
$categoryId = (int) $this->getRequest()->getParam('id');
if ($categoryId <= 0) {
return Mage::helper('ops/data')->__('Categories configuration');
}
$category = Mage::getModel('catalog/category')->load($categoryId);
return Mage::helper('ops/data')->__("Categorie's %s configuration", $category->getName());
}
public function getFormActionUrl()
{
return $this->getUrl('*/*/save');
}
}
\ No newline at end of file
<?php
class Netresearch_OPS_Block_Adminhtml_Kwixocategory_Edit_Form
extends Mage_Adminhtml_Block_Widget_Form
{
protected function _prepareForm() {
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save'),
'method' => 'post',
'enctype' => 'multipart/form-data'
));
$categoryId = (int) $this->getRequest()->getParam('id');
if ($categoryId <= 0) {
return parent::_prepareForm();
}
$kwixoCategoryMapping = Mage::getModel('ops/kwixo_category_mapping')->loadByCategoryId($categoryId);
$storeId = (int) $this->getRequest()->getParam('store');
$fieldset = $form->addFieldset('ops_form', array('legend' => Mage::helper('ops/data')->__('Categories configuration')));
$fieldset->addField('storeId', 'hidden', array(
'required' => true,
'name' => 'storeId',
'value' => $storeId,
));
$fieldset->addField('id', 'hidden', array(
'required' => false,
'name' => 'id',
'value' => $kwixoCategoryMapping->getId(),
));
$fieldset->addField('category_id', 'hidden', array(
'required' => true,
'name' => 'category_id',
'value' => $categoryId,
));
$fieldset->addField('kwixoCategory_id', 'select', array(
'label' => Mage::Helper('ops/data')->__('Kwixo category'),
'class' => 'required-entry',
'required' => true,
'name' => 'kwixoCategory_id',
'value' => $kwixoCategoryMapping->getKwixoCategoryId(),
'values' => Mage::getModel('ops/source_kwixo_productCategories')->toOptionArray()
));
$fieldset->addField('applysubcat', 'checkbox', array(
'label' => Mage::Helper('ops/data')->__('Apply to sub-categories'),
'name' => 'applysubcat'
));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
}
}
\ No newline at end of file
<?php
/**
* @category OPS
* @package Netresearch_OPS
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Netresearch_OPS_Block_Adminhtml_Sales_Order_Creditmemo_Create_Adjustments_Checkbox
*
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Adminhtml_Sales_Order_Creditmemo_ClosedTransaction_Warning
extends Mage_Core_Block_Template
{
/**
* Internal constructor, that is called from real constructor.
*
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/sales/order/creditmemo/closed-transaction/warning.phtml');
}
}
<?php
/**
* @category OPS
* @package Netresearch_OPS
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Netresearch_OPS_Block_Adminhtml_Sales_Order_Creditmemo_Create_Adjustments_Checkbox
*
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Adminhtml_Sales_Order_Creditmemo_Totals_Checkbox
extends Mage_Core_Block_Template
{
/**
* Internal constructor, that is called from real constructor.
*
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/sales/order/creditmemo/totals/checkbox.phtml');
}
}
<?php
/**
* @category OPS
* @package Netresearch_OPS
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Netresearch_OPS_Block_Alias_List
*
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Alias_List
extends Mage_Core_Block_Template
{
public function getAliases()
{
$aliases = array();
$customer = Mage::helper('customer')->getCustomer();
if (0 < $customer->getId()) {
$aliasesCollection = Mage::helper('ops/alias')->getAliasesForCustomer($customer->getId());
foreach ($aliasesCollection as $alias) {
$aliases[] = $alias;
}
}
return $aliases;
}
/**
* get human readable name of payment method
*
* @param string $methodCode Code of payment method
* @return string Name of payment method
*/
public function getMethodName($methodCode)
{
$instance = Mage::helper('payment')->getMethodInstance($methodCode);
if ($instance) {
return $instance->getTitle();
}
}
/**
* retrieves the url for deletion the alias
*
* @param $aliasId - the id of the alias
*
* @return string - the url for deleting the alias with the given id
*/
public function getAliasDeleteUrl($aliasId)
{
return Mage::getUrl(
'ops/customer/deleteAlias/',
array(
'id' => $aliasId,
'_secure' => Mage::app()->getFrontController()->getRequest()->isSecure()
)
);
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Form extends Mage_Payment_Block_Form_Cc
{
private $aliasDataForCustomer = null;
protected $pmLogo = null;
/**
* Frontend Payment Template
*/
const FRONTEND_TEMPLATE = 'ops/form.phtml';
/**
* Init OPS payment form
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate(self::FRONTEND_TEMPLATE);
}
/**
* get OPS config
*
* @return Netresearch_Ops_Model_Config
*/
public function getConfig()
{
return Mage::getSingleton('ops/config');
}
public function getQuote()
{
return Mage::getSingleton('checkout/session')->getQuote();
}
public function getCcBrands()
{
return explode(',', $this->getConfig()->getAcceptedCcTypes());
}
public function getDirectDebitCountryIds()
{
return explode(',', $this->getConfig()->getDirectDebitCountryIds());
}
public function getBankTransferCountryIds()
{
return explode(',', $this->getConfig()->getBankTransferCountryIds());
}
public function getPSPID($storeId = null)
{
return Mage::getModel('ops/config')->getPSPID($storeId);
}
public function getAliasAcceptUrl($storeId = null, $admin = false)
{
return Mage::getModel('ops/config')->getAliasAcceptUrl($storeId, $admin);
}
public function getAliasExceptionUrl($storeId = null, $admin = false)
{
return Mage::getModel('ops/config')->getAliasExceptionUrl($storeId, $admin);
}
public function getAliasGatewayUrl($storeId = null)
{
return Mage::getModel('ops/config')->getAliasGatewayUrl($storeId);
}
public function getSaveCcBrandUrl()
{
return Mage::getModel('ops/config')->getSaveCcBrandUrl();
}
public function getGenerateHashUrl($storeId = null, $admin = false)
{
return Mage::getModel('ops/config')->getGenerateHashUrl($storeId, $admin);
}
public function getCcSaveAliasUrl($storeId = null, $admin = false)
{
return Mage::getModel('ops/config')->getCcSaveAliasUrl($storeId, $admin);
}
public function getRegisterDirectDebitPaymentUrl()
{
return Mage::getModel('ops/config')->getRegisterDirectDebitPaymentUrl();
}
public function getDirectEbankingBrands()
{
return explode(',', $this->getConfig()->getDirectEbankingBrands());
}
/**
* checks if the 'alias' payment method (!) is available
* no check for customer has aliases here
* just a passthrough of the isAvailable of Netresearch_OPS_Model_Payment_Abstract::isAvailable
*
* @return boolean
*/
public function isAliasPMEnabled()
{
return Mage::getModel('ops/config')->isAliasManagerEnabled();
}
/**
*
* @return array empty or intersolve Vouchers
*/
public function getInterSolveBrands()
{
$brands = array();
if ($this->getMethodCode() == 'ops_interSolve') {
$brands = Mage::getModel('ops/config')->getIntersolveBrands();
}
return $brands;
}
/**
* retrieves the alias data for the logged in customer
*
* @return array | null - array the alias data or null if the customer
* is not logged in
*/
protected function getStoredAliasForCustomer()
{
if (Mage::helper('customer/data')->isLoggedIn()
&& Mage::getModel('ops/config')->isAliasManagerEnabled()) {
$quote = $this->getQuote();
$alias = Mage::helper('ops/alias')->getAliasesForAddresses(
$quote->getCustomer()->getId(), $quote->getBillingAddress(),
$quote->getShippingAddress(), $quote->getStoreId()
)
->addFieldToFilter('state', Netresearch_OPS_Model_Alias_State::ACTIVE)
->setOrder('created_at', Varien_Data_Collection::SORT_ORDER_DESC)
->getFirstItem();
$this->aliasDataForCustomer = $alias->getData();
}
return $this->aliasDataForCustomer;
}
/**
* retrieves single values to given keys from the alias data
*
* @param $key - string the key for the alias data
*
* @return null | string - null if key is not set in the alias data, otherwise
* the value for the given key from the alias data
*
*/
protected function getStoredAliasDataForCustomer($key)
{
$returnValue = null;
$aliasData = null;
if (is_null($this->aliasData)) {
$aliasData = $this->getStoredAliasForCustomer();
}
if (is_array($aliasData) && array_key_exists($key, $aliasData)) {
$returnValue = $aliasData[$key];
}
return $returnValue;
}
/**
* retrieves the given path (month or year) from stored expiration date
*
* @param $key - the requested path
*
* @return null | string the extracted part of the date
*/
public function getExpirationDatePart($key)
{
$returnValue = null;
$expirationDate = $this->getStoredAliasDataForCustomer('expiration_date');
// set expiration date to actual date if no stored Alias is used
if ($expirationDate === null) {
$expirationDate = date('my');
}
if (0 < strlen(trim($expirationDate))
) {
$expirationDateValues = str_split($expirationDate, 2);
if ($key == 'month') {
$returnValue = $expirationDateValues[0];
}
if ($key == 'year') {
$returnValue = $expirationDateValues[1];
}
}
return $returnValue;
}
/**
* retrieves the masked alias card number and formats it in a card specific format
*
* @return null|string - null if no alias data were found,
* otherwise the formatted card number
*/
public function getAliasCardNumber()
{
$aliasCardNumber = $this->getStoredAliasDataForCustomer('pseudo_account_or_cc_no');
if (0 < strlen(trim($aliasCardNumber))) {
$aliasCardNumber = Mage::helper('ops/alias')->formatAliasCardNo(
$this->getStoredAliasDataForCustomer('brand'), $aliasCardNumber
);
}
return $aliasCardNumber;
}
/**
* @return null|string - the card holder either from alias data or
* the name from the the user who is logged in, null otherwise
*/
public function getCardHolderName()
{
$cardHolderName = $this->getStoredAliasDataForCustomer('card_holder');
$customerHelper = Mage::helper('customer/data');
if ((is_null($cardHolderName) || 0 === strlen(trim($cardHolderName)))
&& (!is_null($this->getStoredAlias('alias')))
&& $customerHelper->isLoggedIn()
&& Mage::getModel('ops/config')->isAliasManagerEnabled()
) {
$cardHolderName = $customerHelper->getCustomerName();
}
return $cardHolderName;
}
/**
* the brand of the stored card data
*
* @return null|string - string if stored card data were found, null otherwise
*/
public function getStoredAliasBrand()
{
$storedBrand = $this->getStoredAliasDataForCustomer('brand');
if (in_array($storedBrand, Mage::getModel('ops/config')->getInlinePaymentCcTypes())) {
return $storedBrand;
}
return '';
}
/**
* retrieves an old alias for re-usage or updating it
*
* @return null|string - string the stored alias for re-usage or
* null if no alias data were stored
*/
public function getStoredAlias()
{
return $this->getStoredAliasDataForCustomer('alias');
}
/**
* wrapper for Netresearch_OPS_Helper_Data::checkIfUserRegistering
*
* @return type bool
*/
public function isUserRegistering()
{
return Mage::Helper('ops/data')->checkIfUserIsRegistering();
}
/**
* wrapper for Netresearch_OPS_Helper_Data::checkIfUserRegistering
*
* @return type bool
*/
public function isUserNotRegistering()
{
return Mage::Helper('ops/data')->checkIfUserIsNotRegistering();
}
/**
* determines whether the hint is shown to guests or not
*
* @return bool true if alias feature is enabled and display the hint to
* guests is enabled
*/
public function isAliasInfoBlockEnabled()
{
return ($this->isAliasPMEnabled()
&& Mage::getModel('ops/config')->isAliasInfoBlockEnabled());
}
/**
* @return string
*/
public function getPmLogo()
{
return $this->pmLogo;
}
}
<?php
/**
* @category OPS
* @package Netresearch_OPS
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Netresearch_OPS_Block_Form_Alias
*
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Form_Alias extends Netresearch_OPS_Block_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/form/alias.phtml');
}
/**
* get available aliases for current customer
* will return empty array if there is no current user
*
* @return array|Netresearch_OPS_Model_Mysql4_Alias_Collection
*/
public function getAvailableAliases()
{
$customer = Mage::helper('customer')->getCustomer();
if (0 < $customer->getId()) {
$quote = Mage::helper('ops/payment')->getQuote();
return Mage::helper('ops/payment')->getAliasesForCustomer($customer->getId(), $quote);
}
return array();
}
/**
*
* @param String $alias- the human readable alias
*/
protected function getHumanReadableAlias($alias)
{
$helper = Mage::helper('ops');
$aliasString = $helper->__('Credit Card Type') . ' ' . $helper->__($alias->getBrand());
$aliasString .= ' ' . $helper->__('AccountNo') . ' ' . $helper->__($alias->getPseudoAccountOrCCNo());
$aliasString .= ' ' . $helper->__('Expiration Date') . ' ' . $alias->getExpirationDate();
return $aliasString;
}
}
<?php
/**
* Netresearch_OPS_Block_Form_OpsId
*
* @package OPS
* @copyright 2012 Netresearch App Factory AG <http://www.netresearch.de>
* @author Thomas Birke <thomas.birke@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Block_Form_Cc extends Netresearch_OPS_Block_Form
{
/**
* Backend Payment Template
*/
const BACKEND_TEMPLATE = 'ops/form/cc.phtml';
protected function _construct()
{
parent::_construct();
//Only in case that the form is loaded in the backend, use a special template
if (false === Mage::getModel("ops/config")->isFrontendEnvironment()) {
$this->setTemplate(self::BACKEND_TEMPLATE);
}
}
/**
* gets all Alias CC brands
*
* @return array
*/
public function getAliasBrands()
{
return Mage::getModel('ops/source_cc_aliasInterfaceEnabledTypes')
->getAliasInterfaceCompatibleTypes();
}
}
<?php
/**
* Netresearch_OPS_Block_Form_DirectDebit
*
* @package OPS
* @copyright 2012 Netresearch App Factory AG <http://www.netresearch.de>
* @author Thomas Birke <thomas.birke@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Block_Form_DirectDebit extends Netresearch_OPS_Block_Form
{
protected $previousParams = array();
/**
* Backend Payment Template
*/
const BACKEND_TEMPLATE = 'ops/form/directDebit.phtml';
protected function _construct()
{
parent::_construct();
//Only in case that the form is loaded in the backend, use a special template
if (false === Mage::getModel("ops/config")->isFrontendEnvironment()) {
$this->setTemplate(self::BACKEND_TEMPLATE);
}
}
/**
* get ids of supported countries
*
* @return array
*/
public function getDirectDebitCountryIds()
{
return explode(',', $this->getConfig()->getDirectDebitCountryIds());
}
/**
* get previously entred params for displaying them again in the backend
*
* @return array - the previously entred params
*/
public function getParams()
{
$params = Mage::getModel('adminhtml/session')->getData(
'ops_direct_debit_params'
);
Mage::getModel('adminhtml/session')->unsetData(
'ops_direct_debit_params'
);
if (!is_array($params)) {
$params = array(
'country' => '',
'CN' => '',
'iban' => '',
'bic' => '',
'account' => '',
'bankcode' => ''
);
}
$this->previousParams = $params;
return $this->previousParams;
}
/**
* checks if the iban field is required
*
* @return bool - true if so, false otherwise
*/
public function isIbanFieldRequired()
{
return (count($this->previousParams) == 0
|| (array_key_exists(
'iban', $this->previousParams
)
&& 0 < strlen('iban')
|| array_key_exists('account', $this->previousParams)
&& 0 == strlen($this->previousParams['account'])));
}
/**
* checks if the account field is required
*
* @return bool - true if so, false otherwise
*/
public function isAccountFieldRequired()
{
return (count($this->previousParams) == 0
|| (array_key_exists(
'account', $this->previousParams
)
&& (!array_key_exists('iban', $this->previousParams)
|| 0 == strlen($this->previousParams['iban']))));
}
/**
* checks if the bankcode field is required
*
* @return bool - true if so, false otherwise
*/
public function isBankCodeFieldRequired()
{
return $this->isAccountFieldRequired()
&& array_key_exists(
'country', $this->previousParams
)
&& ('DE' == strtoupper(
$this->getCountry())
|| 'AT' == strtoupper($this->getCountry())
);
}
/**
* checks if the bankcode field is visible
*
* @return bool - true if so, false otherwise
*/
public function isBankCodeFieldVisible()
{
return array_key_exists('country', $this->previousParams)
&& ('DE' == strtoupper($this->getCountry())
|| 'AT' == strtoupper($this->getCountry()));
}
/**
* checks if the bic field is visible
*
* @return bool - true if so, false otherwise
*/
public function isBicFieldVisible()
{
return ('NL' == strtoupper($this->getCountry()));
}
/**
* gets the previously entered country (if any)
*
* @return string - empty string if no country is given, otherwise the country
*/
public function getCountry()
{
$country = '';
if (array_key_exists('country', $this->previousParams)) {
$country = $this->previousParams['country'];
}
return $country;
}
/**
* gets the previously entered iban (if any)
*
* @return string - empty string if no iban is given, otherwise the iban
*/
public function getIban()
{
$iban = '';
if (array_key_exists('iban', $this->previousParams)) {
$iban = $this->previousParams['iban'];
}
return $iban;
}
/**
* gets the previously entered bic (if any)
*
* @return string - empty string if no bic is given, otherwise the bic
*/
public function getBic()
{
$bic = '';
if (array_key_exists('bic', $this->previousParams)) {
$bic = $this->previousParams['bic'];
}
return $bic;
}
/**
* gets the previously entered account (if any)
*
* @return string - empty string if no account is given, otherwise the account
*/
public function getAccount()
{
$account = '';
if (array_key_exists('account', $this->previousParams)) {
$account = $this->previousParams['account'];
}
return $account;
}
/**
* gets the previously entered bankcode (if any)
*
* @return string - empty string if no bankcode is given, otherwise the bankcode
*/
public function getBankcode()
{
$bankcode = '';
if (array_key_exists('bankcode', $this->previousParams)) {
$bankcode = $this->previousParams['bankcode'];
}
return $bankcode;
}
/**
* gets the previously entered card holder (if any)
*
* @return string - empty string if no card holder is given, otherwise the card holder
*/
public function getCardholderName()
{
$cardholder = '';
if (array_key_exists('CN', $this->previousParams)) {
$cardholder = $this->previousParams['CN'];
}
return $cardholder;
}
}
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package Netresearch_OPS
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Form_Kwixo_ApresReception extends Netresearch_OPS_Block_Form
{
const FRONTEND_TEMPLATE = 'ops/form/kwixo/apres_reception.phtml';
protected $pmLogo = 'images/ops/kwixo/apres_reception.jpg';
/**
* Init OPS payment form
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate(self::FRONTEND_TEMPLATE);
}
}
\ No newline at end of file
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package Netresearch_OPS
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Form_Kwixo_Comptant extends Netresearch_OPS_Block_Form
{
const FRONTEND_TEMPLATE = 'ops/form/kwixo/comptant.phtml';
protected $pmLogo = 'images/ops/kwixo/comptant.jpg';
/**
* Init OPS payment form
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate(self::FRONTEND_TEMPLATE);
}
}
\ No newline at end of file
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package Netresearch_OPS
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Form_Kwixo_Credit extends Netresearch_OPS_Block_Form
{
const FRONTEND_TEMPLATE = 'ops/form/kwixo/credit.phtml';
protected $pmLogo = 'images/ops/kwixo/credit.jpg';
/**
* Init OPS payment form
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate(self::FRONTEND_TEMPLATE);
}
}
\ No newline at end of file
<?php
/**
* Netresearch_OPS_Block_Form_OpsId
*
* @package OPS
* @copyright 2012 Netresearch App Factory AG <http://www.netresearch.de>
* @author Thomas Birke <thomas.birke@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Block_Form_OpsId extends Mage_Payment_Block_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/form/opsId.phtml');
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Frauddetection
extends Mage_Core_Block_Template
{
protected $_template = "ops/frauddetection.phtml";
const TRACKING_CODE_APPLICATION_ID = "10376";
/**
* renders the additional fraud detection js
* @return string
*/
protected function _toHtml()
{
$html = null;
$storeId = Mage::helper('core/data')->getStoreId();
if (true === Mage::getModel('ops/config')->isTrackingCodeActivated(
$storeId
)
) {
$html = parent::_toHtml();
}
return $html;
}
/**
* get the tracking code application id from config
*
* @return string
*/
public function getTrackingCodeAid()
{
return self::TRACKING_CODE_APPLICATION_ID;
}
/**
* build md5 hash from customer session ID
*
* @return string
*/
public function getTrackingSid()
{
return md5(Mage::getSingleton("customer/session")->getSessionId());
}
}
\ No newline at end of file
<?php
/**
* @category OPS
* @package Netresearch_OPS
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Netresearch_OPS_Block_Info_Alias
*
* @author Thomas Birke <thomas.birke@netresearch.de>
* @author Michael Lühr <michael.luehr@netresearch.de>
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Info_Alias extends Netresearch_OPS_Block_Info_Redirect
{
/**
* Init ops payment information block
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/info/cc.phtml');
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* OPS payment information block
*/
class Netresearch_OPS_Block_Info_Cc extends Netresearch_OPS_Block_Info_Redirect
{
/**
* Init ops payment information block
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/info/cc.phtml');
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* OPS payment information block
*/
class Netresearch_OPS_Block_Info_OpsId extends Mage_Payment_Block_Info
{
/**
* Init ops payment information block
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/info/opsId.phtml');
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* OPS payment information block
*/
class Netresearch_OPS_Block_Info_Redirect extends Mage_Payment_Block_Info
{
/**
* Init ops payment information block
*
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/info/redirect.phtml');
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Paypage extends Mage_Core_Block_Template
{
/**
* Init pay page block
*
* @return Netresearch_OPS_Block_Paypage
*/
protected function _construct()
{
parent::_construct();
$this->setTemplate('ops/paypage.phtml');
return $this;
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Placeform extends Mage_Core_Block_Template
{
protected $hasMissingParams;
protected $missingFormFields;
protected $formFields;
protected $question;
public function __construct()
{
}
public function getConfig()
{
return Mage::getModel('ops/config');
}
/**
* Get checkout session namespace
*
* @return Mage_Checkout_Model_Session
*/
public function getCheckout()
{
return Mage::getSingleton('checkout/session');
}
/**
* OPS payment APi instance
*
* @return Netresearch_OPS_Model_Payment_Abstract
*/
protected function _getApi()
{
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
if ($order && !is_null($order->getId())) {
return $order->getPayment()->getMethodInstance();
}
}
/**
* Return order instance with loaded information by increment id
*
* @return Mage_Sales_Model_Order
*/
protected function _getOrder()
{
if ($this->getOrder()) {
$order = $this->getOrder();
} else if ($this->getCheckout()->getLastRealOrderId()) {
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
} else {
return null;
}
return $order;
}
/**
* check if payment method is q kwixo one
*
* @return boolean
*/
public function isKwixoPaymentMethod()
{
$isKwixoPayment = false;
$methodInstance = $this->_getOrder()->getPayment()->getMethodInstance();
if ($methodInstance instanceof Netresearch_OPS_Model_Payment_Kwixo_Abstract) {
$isKwixoPayment= true;
}
return $isKwixoPayment;
}
/**
* Get Form data by using ops payment api
*
* @return array
*/
public function getFormData()
{
if (is_null($this->formFields) && $this->_getOrder() && !is_null($this->_getOrder()->getId())) {
$this->formFields = $this->_getApi()->getFormFields($this->_getOrder(), $this->getRequest()->getParams());
}
return $this->formFields;
}
/**
* Getting gateway url
*
* @return string
*/
public function getFormAction()
{
return $this->getRequest()->isPost() || is_null($this->getQuestion()) ? $this->getConfig()->getFrontendGatewayPath() :
Mage::getUrl('*/*/*', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure()));
}
public function hasMissingParams()
{
if (is_null($this->_getOrder())) {
return null;
}
if (is_null($this->hasMissingParams)) {
$this->hasMissingParams = $this->_getApi()->hasFormMissingParams($this->_getOrder(), $this->getRequest()->getParams(), $this->getFormData());
}
return $this->hasMissingParams;
}
public function getQuestion()
{
if (is_null($this->question) && $this->_getOrder() && !is_null($this->_getOrder()->getId())) {
$this->question = $this->_getApi()->getQuestion($this->_getOrder(), $this->getRequest()->getParams());
}
return $this->question;
}
public function getQuestionedFormFields()
{
if (is_null($this->missingFormFields) && $this->_getOrder() && !is_null($this->_getOrder()->getId())) {
$this->missingFormFields = $this->_getApi()->getQuestionedFormFields($this->_getOrder(), $this->getRequest()->getParams());
}
return $this->missingFormFields;
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Block_Placeform3dsecure extends Netresearch_OPS_Block_Placeform
{
/**
* Get Form data of 3D Secure
*
* @return string
*/
public function getFormData()
{
if (!is_null($this->_getOrder())) {
return base64_decode($this->_getOrder()->getPayment()->getAdditionalInformation('HTML_ANSWER'));
}
return null;
}
}
<?php
/**
* Netresearch OPS
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to
* newer versions in the future.
*
* @category Netresearch
* @package Netresearch_OPS
* @copyright Copyright (c) 2012 Netresearch GmbH & Co. KG (http://www.netresearch.de/)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Netresearch
*
* @category Netresearch
* @package Netresearch_OPS
* @author Michael Lühr <michael.luehr@netresearch.de>
*/
class Netresearch_OPS_Block_System_Config_Form_Field_Brand
extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
{
public function __construct()
{
$this->addColumn('brand', array(
'label' => Mage::helper('ops')->__('Brand'),
'style' => 'width:120px',
));
$this->addColumn('value', array(
'label' => Mage::helper('ops')->__('Title'),
'style' => 'width:120px',
));
$this->_addAfter = false;
$this->_addButtonLabel = Mage::helper('ops')->__('Add Brand');
parent::__construct();
}
}
<?php
/**
* Created by JetBrains PhpStorm.
* User: michael
* Date: 23.07.13
* Time: 09:04
* To change this template use File | Settings | File Templates.
*/
class Netresearch_OPS_Block_System_Config_Kwixoconfiguration
extends Mage_Adminhtml_Block_Abstract
implements Varien_Data_Form_Element_Renderer_Interface
{
protected $_template = 'ops/system/config/kwixoconfiglinks.phtml';
/**
* Render fieldset html
*
* @param Varien_Data_Form_Element_Abstract $fieldset
*
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $fieldset)
{
$this->addData(
array(
'fieldset_label' => $fieldset->getLegend(),
)
);
return $this->toHtml();
}
}
\ No newline at end of file
<?php
class Netresearch_OPS_Block_System_Config_Support extends Mage_Adminhtml_Block_Abstract
implements Varien_Data_Form_Element_Renderer_Interface
{
protected $_template = 'ops/system/config/support.phtml';
protected function getConfig()
{
return Mage::getModel('ops/config');
}
/**
* Render fieldset html
*
* @param Varien_Data_Form_Element_Abstract $fieldset
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $fieldset)
{
$originalData = $fieldset->getOriginalData();
$this->addData(array(
'fieldset_label' => $fieldset->getLegend(),
));
return $this->toHtml();
}
/**
* get extension version
*
* @return string
*/
public function getExtensionVersion()
{
return (string) Mage::getConfig()->getNode('modules')->children()->Netresearch_OPS->version;
}
/**
* get Magento version
*
* @return string
*/
public function getMageVersion()
{
$mageVersion = Mage::getVersion();
if (is_callable('Mage::getEdition')) {
$mageVersion = Mage::getEdition() . ' ' . $mageVersion;
}
return $mageVersion;
}
/**
* get support mail address
*
* @return string
*/
public function getSupportMail()
{
$mail = $this->getConfig()->getConfigData('support_mail');
if (0 < strpos($mail, '@')) {
return $mail;
}
}
/**
* if we have a link to documentation
*
* @return string
*/
public function hasDocumentation()
{
return strlen($this->getDocLinkDe() . $this->getDocLinkEn());
}
/**
* get URL of German documentation
*
* @return string
*/
public function getDocLinkDe()
{
$link = $this->getConfig()->getConfigData('doc_link_de');
if (0 < strpos($link, '://')) {
return $link;
}
}
/**
* get URL of English documentation
*
* @return string
*/
public function getDocLinkEn()
{
$link = $this->getConfig()->getConfigData('doc_link_en');
if (0 < strpos($link, '://')) {
return $link;
}
}
/**
* if we use a prefix for parameter ORDERID
*
* @return bool
*/
public function hasDevPrefix()
{
return 0 < strlen($this->getDevPrefix());
}
/**
* get prefix for parameter ORDERID
*
* @return string
*/
public function getDevPrefix()
{
return $this->getConfig()->getConfigData('devprefix');
}
}
<?php
/**
* Netresearch_OPS_Controller_Abstract
*
* @package
* @copyright 2011 Netresearch
* @author Thomas Kappel <thomas.kappel@netresearch.de>
* @author André Herrn <andre.herrn@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Controller_Abstract extends Mage_Core_Controller_Front_Action
{
protected function getQuote()
{
return $this->_getCheckout()->getQuote();
}
/**
* Get checkout session namespace
*
* @return Mage_Checkout_Model_Session
*/
protected function _getCheckout()
{
return Mage::getSingleton('checkout/session');
}
protected function getConfig()
{
return Mage::getModel('ops/config');
}
/**
* Return order instance loaded by increment id'
*
* @return Mage_Sales_Model_Order
*/
/**
* Return order instance loaded by increment id'
*
* @return Mage_Sales_Model_Order
*/
protected function _getOrder($opsOrderId=null)
{
if (empty($this->_order)) {
if (is_null($opsOrderId)) {
$opsOrderId = $this->getRequest()->getParam('orderID');
}
$this->_order = Mage::helper('ops/order')->getOrder($opsOrderId);
}
return $this->_order;
}
/**
* Get singleton with Checkout by OPS Api
*
* @return Netresearch_OPS_Model_Payment_Abstract
*/
protected function _getApi()
{
if (!is_null($this->getRequest()->getParam('orderID'))):
return $this->_getOrder()->getPayment()->getMethodInstance();
else:
return Mage::getSingleton('checkout/session')->getQuote()->getPayment()->getMethodInstance();
endif;
}
/**
* get payment helper
*
* @return Netresearch_OPS_Helper_Payment
*/
protected function getPaymentHelper()
{
return Mage::helper('ops/payment');
}
/**
* get direct link helper
*
* @return Netresearch_OPS_Helper_Directlink
*/
protected function getDirectlinkHelper()
{
return Mage::helper('ops/directlink');
}
/**
* Validation of incoming OPS data
*
* @return bool
*/
protected function _validateOPSData()
{
$params = $this->getRequest()->getParams();
$order = $this->_getOrder();
if (!$order->getId()){
$this->_getCheckout()->addError($this->__('Order is not valid'));
return false;
}
$secureKey = $this->_getApi()->getConfig()->getShaInCode($order->getStoreId());
$secureSet = $this->getPaymentHelper()->getSHAInSet($params, $secureKey);
$helper = Mage::helper('ops');
$helper->log($helper->__("Incoming Ogone Feedback\n\nRequest Path: %s\nParams: %s\n",
$this->getRequest()->getPathInfo(),
serialize($this->getRequest()->getParams())
));
if (Mage::helper('ops/payment')->shaCryptValidation($secureSet, $params['SHASIGN']) !== true) {
$this->_getCheckout()->addError($this->__('Hash is not valid'));
return false;
}
return true;
}
public function isJsonRequested($params)
{
if (array_key_exists('RESPONSEFORMAT', $params) && $params['RESPONSEFORMAT'] == 'JSON') {
return true;
}
return false;
}
}
This diff is collapsed.
<?php
/**
* Netresearch_OPS_Helper_Api
*
* @package
* @copyright 2013 Netresearch
* @author Michael Lühr <michael.luehr@netresearch.de>
* @author Sebastian Ertner <sebastian.ertner@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Helper_Api extends Mage_Core_Helper_Abstract
{
private $configModel = null;
/**
* @param $status - one of the fedd back status
*
* @throws Mage_Core_Exception - in case the status is not known
* @return string - the route for redirect
*/
public function getRedirectRouteFromStatus($status)
{
$route = null;
$configModel = $this->getConfigModel();
if ($this->isAcceptStatus($status)) {
$route = $configModel->getAcceptRedirectRoute();
}
if ($this->isCancelStatus($status)) {
$route = $configModel->getCancelRedirectRoute();
}
if ($this->isDeclineStatus($status)) {
$route = $configModel->getDeclineRedirectRoute();
}
if ($this->isExceptionStatus($status)) {
$route = $configModel->getExceptionRedirectRoute();
}
// in case none of the cases above match then the status is not known
if (is_null($route)) {
Mage::throwException('invalid status provided');
}
return $route;
}
/**
* config getter
*
* @return Netresearch_OPS_Model_Config
*/
private function getConfigModel()
{
if (is_null($this->configModel)) {
$this->configModel = Mage::getModel('ops/config');
}
return $this->configModel;
}
/**
* determine if the status is known as accepted status
*
* @param $status - the status
*
* @return bool - true if the status is known as accept status, false otherwise
*/
private function isAcceptStatus($status)
{
return in_array($status, array(
Netresearch_OPS_Model_Status_Feedback::OPS_ORDER_FEEDBACK_STATUS_ACCEPT
)
);
}
/**
* determine if the status is known as canceled status
*
* @param $status - the status
*
* @return bool - true if the status is known as canceled status, false otherwise
*/
private function isCancelStatus($status)
{
return in_array($status, array(
Netresearch_OPS_Model_Status_Feedback::OPS_ORDER_FEEDBACK_STATUS_CANCEL
)
);
}
/**
* determine if the status is known as declined status
*
* @param $status - the status
*
* @return bool - true if the status is known as declined status, false otherwise
*/
private function isDeclineStatus($status)
{
return in_array($status, array(
Netresearch_OPS_Model_Status_Feedback::OPS_ORDER_FEEDBACK_STATUS_DECLINE
)
);
}
/**
* determine if the status is known as exception status
*
* @param $status - the status
*
* @return bool - true if the status is known as exception status, false otherwise
*/
private function isExceptionStatus($status)
{
return in_array($status, array(
Netresearch_OPS_Model_Status_Feedback::OPS_ORDER_FEEDBACK_STATUS_EXCEPTION
)
);
}
}
\ No newline at end of file
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package ${MODULENAME}
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Helper_Creditcard extends Netresearch_OPS_Helper_Payment_DirectLink_Request
{
protected $aliasHelper = null;
/**
* @param null $aliasHelper
*/
public function setAliasHelper($aliasHelper)
{
$this->aliasHelper = $aliasHelper;
}
/**
* @return null
*/
public function getAliasHelper()
{
if (null === $this->aliasHelper) {
$this->aliasHelper = Mage::helper('ops/alias');
}
return $this->aliasHelper;
}
/**
* @param $quote
* @param $requestParams
*/
public function handleAdminPayment(Mage_Sales_Model_Quote $quote, $requestParams)
{
return $this;
}
protected function getPaymentSpecificParams(Mage_Sales_Model_Quote $quote)
{
$alias = $quote->getPayment()->getAdditionalInformation('alias');
if (is_null($alias) && $this->getDataHelper()->isAdminSession()) {
$alias = $this->getAliasHelper()->getAlias($quote);
}
$params = array (
'ALIAS' => $alias,
);
if (is_numeric($quote->getPayment()->getAdditionalInformation('cvc'))) {
$params['CVC'] = $quote->getPayment()->getAdditionalInformation('cvc');
}
$requestParams3ds = array();
if ($this->getConfig()->get3dSecureIsActive() && false == $this->getDataHelper()->isAdminSession()) {
$requestParams3ds = array(
'FLAG3D' => 'Y',
'WIN3DS' => Netresearch_OPS_Model_Payment_Abstract::OPS_DIRECTLINK_WIN3DS,
'LANGUAGE' => Mage::app()->getLocale()->getLocaleCode(),
'HTTP_ACCEPT' => '*/*',
'HTTP_USER_AGENT' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)',
'ACCEPTURL' => $this->getConfig()->getAcceptUrl(),
'DECLINEURL' => $this->getConfig()->getDeclineUrl(),
'EXCEPTIONURL' => $this->getConfig()->getExceptionUrl(),
);
}
$params = array_merge($params, $requestParams3ds);
return $params;
}
}
\ No newline at end of file
<?php
/**
* Netresearch_OPS_Helper_Data
*
* @package
* @copyright 2011 Netresearch
* @author Thomas Kappel <thomas.kappel@netresearch.de>
* @author André Herrn <andre.herrn@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Helper_Data extends Mage_Core_Helper_Abstract
{
const LOG_FILE_NAME = 'ops.log';
/**
* Returns config model
*
* @return Netresearch_OPS_Model_Config
*/
public function getConfig()
{
return Mage::getSingleton('ops/config');
}
public function getModuleVersionString()
{
$version = Mage::getConfig()->getNode('modules/Netresearch_OPS/version');
$plainversion = str_replace('.', '', $version);
return 'OGmg' . $plainversion;
}
/**
* Checks if logging is enabled and if yes, logs given message to logfile
*
* @param string $message
* @param int $level
*/
public function log($message, $level = null)
{
$separator = "\n"."===================================================================";
$message = $this->clearMsg($message);
if($this->getConfig()->shouldLogRequests()) {
Mage::log($message.$separator, $level, self::LOG_FILE_NAME);
}
}
/**
* deletes certain keys from the message which is going to logged
*
* @param $message - the message
*
* @return array - the cleared message
*/
public function clearMsg($message)
{
if (is_array($message)) {
$keysToBeDeleted = array('cvc', 'CVC');
foreach ($keysToBeDeleted as $keyToDelete) {
if (array_key_exists($keyToDelete, $message)) {
unset($message[$keyToDelete]);
}
}
}
if (is_string($message)) {
$message = preg_replace('/"CVC":".*"(,)/i','',$message);
$message = preg_replace('/"CVC":".*"/i','',$message);
$message = preg_replace('/"CVC".*"[A-Z]*";/','',$message);
$message = preg_replace('/"CVC":".*"(})/i','}',$message);
}
return $message;
}
public function redirect($url)
{
Mage::app()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
exit();
}
/**
* Redirects to the given order and prints some notice output
*
* @param int $orderId
* @param string $message
* @return void
*/
public function redirectNoticed($orderId, $message)
{
Mage::getSingleton('core/session')->addNotice($message);
$this->redirect(
Mage::getUrl('*/sales_order/view', array('order_id' => $orderId))
);
}
public function getStatusText($statusCode)
{
$translationOrigin = "STATUS_".$statusCode;
$translationResult = $this->__($translationOrigin);
if ($translationOrigin != $translationResult):
return $translationResult. " ($statusCode)";
else:
return $statusCode;
endif;
}
public function getAmount($amount)
{
return round($amount * 100);
}
public function getAdminSession()
{
return Mage::getSingleton('admin/session');
}
public function isAdminSession()
{
if ($this->getAdminSession()->getUser()) {
return 0 < $this->getAdminSession()->getUser()->getUserId();
}
return false;
}
/*
* check if user is registering or not
*/
public function checkIfUserIsRegistering()
{
$isRegistering = false;
$checkoutMethod = Mage::getSingleton('checkout/session')->getQuote()->getCheckoutMethod();
if ($checkoutMethod === Mage_Sales_Model_Quote::CHECKOUT_METHOD_REGISTER
|| $checkoutMethod === Mage_Sales_Model_Quote::CHECKOUT_METHOD_LOGIN_IN
)
{
$isRegistering = true;
}
return $isRegistering;
}
/*
* check if user is registering or not
*/
public function checkIfUserIsNotRegistering()
{
$isRegistering = false;
$checkoutMethod = Mage::getSingleton('checkout/session')->getQuote()->getCheckoutMethod();
if ($checkoutMethod === Mage_Sales_Model_Quote::CHECKOUT_METHOD_REGISTER)
{
$isRegistering = true;
}
return $isRegistering;
}
}
This diff is collapsed.
This diff is collapsed.
<?php
/**
* Netresearch_OPS_Helper_Kwixo
*
* @package
* @copyright 2013 Netresearch
* @author Michael Lühr <michael.luehr@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Helper_Kwixo extends Mage_Core_Helper_Abstract
{
private $helper = null;
protected function getHelper()
{
if (null === $this->helper) {
$this->helper = Mage::helper('ops/data');
}
return $this->helper;
}
/**
* validates the kwixoConfiguration data
*
* @param array $postData the data to validate
*
* @throws Mage_Core_Exception on errors
*
*/
public function validateKwixoconfigurationMapping(array $postData)
{
$this->validateKwixoConfigurationData($postData);
$this->validateKwixoMappingExist($postData);
$this->validateCategoryExist($postData);
}
/**
* saves the KwixoConfigurationMapping
*
* @param array $postData
*/
public function saveKwixoconfigurationMapping(array $postData)
{
$this->validateKwixoconfigurationMapping($postData);
$kwixoCatMapModel = Mage::getModel(
'ops/kwixo_category_mapping'
)->load($postData['id']);
$kwixoCatMapModel->setCategoryId($postData['category_id']);
$kwixoCatMapModel->setKwixoCategoryId(
$postData['kwixoCategory_id']
);
$kwixoCatMapModel->save();
if (array_key_exists('applysubcat', $postData)) {
$category = Mage::getModel('catalog/category')->load(
$postData['category_id']
);
$subcategories = $category->getAllChildren(true);
foreach ($subcategories as $subcategory) {
$kwixoCatMapModel = Mage::getModel(
'ops/kwixo_category_mapping'
)->loadByCategoryId($subcategory);
$kwixoCatMapModel->setCategoryId($subcategory);
$kwixoCatMapModel->setKwixoCategoryId(
$postData['kwixoCategory_id']
);
$kwixoCatMapModel->save();
}
}
Mage::getSingleton('adminhtml/session')->addSuccess(
Mage::helper('ops/data')->__(
'Successfully added Kwixo category mapping'
)
);
}
/**
* validates if the structure of a given array does match the expected kwixo
* setting configuration
*
* @param array $postData - the array to inspect
*
* @throws Mage_Core_Exception - if the structure does not match
*/
private function validateKwixoConfigurationData(array $postData)
{
$helper = $this->getHelper();
$isValid = true;
$message = '';
if (0 === count($postData)) {
$message = $helper->__('Invalid form data provided');
$isValid = false;
}
if ($isValid && !array_key_exists('id', $postData)) {
$message = $helper->__('Invalid form data provided');
$isValid = false;
}
if ($isValid && 0 < strlen($postData['id'])
&& (!is_numeric($postData['id'])
|| $postData['id'] < 0)
) {
$message = $helper->__('Invalid id provided');
$isValid = false;
}
if (false === $isValid) {
Mage::throwException($message);
}
}
/**
* validates if the given array contains the neccessary information for
* a proper kwixo category setting
*
* @param array $postData - the array to inspect
*
* @throws Mage_Core_Exception - if the array does not contain the needed
* information
*
*/
private function validateKwixoMappingExist(array $postData)
{
$helper = $this->getHelper();
$kwixoCategories = Mage::getModel('ops/source_kwixo_productCategories')
->getValidKwixoCategoryIds();
if (!array_key_exists('kwixoCategory_id', $postData)
|| !in_array(
$postData['kwixoCategory_id'], $kwixoCategories
)
) {
Mage::throwException(
$helper->__('Invalid kwixo category provided')
);
}
}
/**
* validates if the given array contains a proper category setting
*
* @param array $postData - the array to inspect
*
* @throws Mage_Core_Exception - if an invalid setting is given
*/
private function validateCategoryExist(array $postData)
{
$helper = $this->getHelper();
$isValid = true;
$message = '';
if (!array_key_exists('category_id', $postData)) {
$isValid = false;
$message = $helper->__('Invalid category provided');
}
if ($isValid
&& (!is_numeric($postData['category_id'])
|| is_null(
Mage::getModel('catalog/category')->load(
$postData['category_id']
)->getId()
))
) {
$isValid = false;
$message = $helper->__('Invalid category provided');
}
if (false === $isValid) {
Mage::throwException($message);
}
}
}
\ No newline at end of file
<?php
/**
* Netresearch_OPS_Helper_Order
*
* @package
* @copyright 2013 Netresearch
* @author Michael Lühr <michael.luehr@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Helper_Order extends Mage_Core_Helper_Abstract
{
/** @var $config Netresearch_OPS_Model_Config */
private $config = null;
const DELIMITER = '#';
/**
* return the config model
*
* @return Netresearch_OPS_Model_Config
*/
protected function getConfig()
{
if (is_null($this->config)) {
$this->config = Mage::getModel('ops/config');
}
return $this->config;
}
/**
* generates the OPS order id in dependency to the config
*
* @param Mage_Sales_Order $order
* @param $useOrderIdIfPossible if false forces the usage of quoteid (for Kwixo pm etc.)
* @return string
*/
public function getOpsOrderId($order, $useOrderIdIfPossible = true)
{
$config = $this->getConfig();
$devPrefix = $config->getConfigData('devprefix');
$orderRef = $order->getQuoteId();
if ($config->getOrderReference($order->getStoreId())
== Netresearch_OPS_Model_Payment_Abstract::REFERENCE_ORDER_ID
&& $useOrderIdIfPossible === true) {
$orderRef = self::DELIMITER . $order->getIncrementId();
}
return $devPrefix . $orderRef;
}
/**
* getting the order from opsOrderId which can either the quote id or the order increment id
* in both cases the dev prefix is stripped, if neccessary
*
* @param $opsOrderId
* @return Mage_Sales_Model_Order
*/
public function getOrder($opsOrderId)
{
$order = null;
$fieldToFilter = 'quote_id';
$devPrefix = $this->getConfig()->getConfigData('devprefix');
if ($devPrefix == substr($opsOrderId, 0, strlen($devPrefix))) {
$opsOrderId = substr($opsOrderId, strlen($devPrefix));
}
// opsOrderId was created from order increment id, use increment id for filtering
if (0 === strpos($opsOrderId, self::DELIMITER)) {
$opsOrderId = substr($opsOrderId, strlen(self::DELIMITER));
$fieldToFilter = 'increment_id';
}
$order = Mage::getModel('sales/order')->getCollection()
->addFieldToFilter($fieldToFilter, $opsOrderId)
->getFirstItem();
return $order;
}
/**
* load and return the quote via the quoteId
*
* @param string $quoteId
* @return Mage_Model_Sales_Quote
*/
public function getQuote($quoteId)
{
return Mage::getModel('sales/quote')->load($quoteId);
}
/**
* check if billing is same as shipping address
*
* @param Mage_Model_Sales_Order $order
* @return int
*/
public function checkIfAddressesAreSame(Mage_Sales_Model_Order $order)
{
$addMatch = 0;
$billingAddressHash = null;
$shippingAddressHash = null;
if ($order->getBillingAddress() instanceof Mage_Customer_Model_Address_Abstract) {
$billingAddressHash = Mage::helper('ops/alias')->generateAddressHash(
$order->getBillingAddress()
);
}
if ($order->getShippingAddress() instanceof Mage_Customer_Model_Address_Abstract) {
$shippingAddressHash = Mage::helper('ops/alias')->generateAddressHash(
$order->getShippingAddress()
);
}
if ($billingAddressHash === $shippingAddressHash) {
$addMatch = 1;
}
return $addMatch;
}
}
<?php
/**
* Netresearch_OPS_Helper_Order_Capture
*
* @package
* @copyright 2011 Netresearch
* @author André Herrn <andre.herrn@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Helper_Order_Capture extends Mage_Core_Helper_Abstract
{
/**
* Checks if partial capture
*
* @param Mage_Sales_Order_Payment $payment
* @param float $amount
* @return bool
*/
public function determineIsPartial($payment, $amount)
{
$orderTotalAmount = round(
(Mage::helper('ops/payment')->getBaseGrandTotalFromSalesObject($payment->getOrder())) * 100, 0
);
$captureAmount = round((($payment->getBaseAmountPaidOnline() + $amount) * 100));
if ($orderTotalAmount != $captureAmount) {
return true;
} else {
return false;
}
}
/**
* Prepare capture informations
*
* @param Mage_Sales_Order_Payment $payment
* @param float $amount
* @return array
*/
public function prepareOperation($payment, $amount)
{
$isPartial = $this->determineIsPartial($payment, $amount);
$params = Mage::app()->getRequest()->getParams();
$arrInfo = $params['invoice'];
$arrInfo['amount'] = $amount;
if ($isPartial) {
$arrInfo['operation'] = Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_PARTIAL;
$arrInfo['type'] = "partial";
} else {
$arrInfo['operation'] = Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_FULL;
$arrInfo['type'] = "full";
}
return $arrInfo;
}
/**
* Creates the Invoice for the appropriate capture
*
*
* @param array $params
*/
public function acceptCapture($order, $params)
{
$arrInfo = array();
Mage::register('ops_auto_capture', true);
$forceFullInvoice = false;
$payId = $params['PAYID'];
try {
if ($payId) {
$transaction = Mage::helper("ops/directlink")->getPaymentTransaction(
$order,
$payId,
Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_TRANSACTION_TYPE
);
if ($transaction) {
$arrInfoSerialized = $transaction->getAdditionalInformation();
$arrInfo = unserialize($arrInfoSerialized['arrInfo']);
}
}
}
catch (Mage_Core_Exception $e) {
//If no transaction was found create a full invoice if possible
$forceFullInvoice = true;
$transaction = null;
}
if ($forceFullInvoice === true) {
if (!$order->getInvoiceCollection()->getSize()) {
$invoice = $order->prepareInvoice();
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
$comment = Mage::helper("ops")->__("Capture process complete");
} else {
Mage::throwException(
Mage::helper('ops')->__('The capture has already been invoiced.')
);
}
} else {
$invoice = Mage::getModel('sales/service_order', $order)
->prepareInvoice($arrInfo['items']);
if (!$invoice->getTotalQty()) {
Mage::throwException(
Mage::helper('ops')->__('Cannot create an invoice without products.')
);
}
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
$comment = Mage::helper("ops")->__("Capture process complete");
}
if (is_object($invoice)) {
$invoice->register();
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($invoice)
->addObject($invoice->getOrder());
$shipment = false;
if (isset($transaction)
&& array_key_exists('do_shipment', $arrInfo)
&& $arrInfo['do_shipment']
) {
$shipment = $this->_prepareShipment($invoice, $arrInfo);
if ($shipment) {
$shipment->setEmailSent($invoice->getEmailSent());
$transactionSave->addObject($shipment);
}
}
$transactionSave->save();
//Send E-Mail and Comment
$sendEMail = false;
$sendEMailWithComment = false;
if (isset($arrInfo['send_email'])) $sendEMail = true;
if (isset($arrInfo['comment_customer_notify'])) $sendEMailWithComment = true;
$comment = array_key_exists('comment_text', $arrInfo) ? $arrInfo['comment_text'] : '';
$invoice->addComment($comment,$sendEMailWithComment);
if ($sendEMail) {
$invoice->sendEmail(true, $comment);
$invoice->setEmailSent(true);
}
$invoice->save();
Mage::helper("ops/directlink")->closePaymentTransaction(
$order,
$params,
Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_TRANSACTION_TYPE,
Mage::helper('ops')->__(
'Invoice "%s" was created automatically. Ogone Status: %s.',
$invoice->getIncrementId(),
Mage::helper('ops')->getStatusText($params['STATUS'])
),
$sendEMail
);
Mage::helper('ops')->log(sprintf("Invoice created for order: %s", $order->getIncrementId()));
}
$order->save();
$eventData = array('data_object' => $order, 'order' => $order);
Mage::dispatchEvent('ops_sales_order_save_commit_after', $eventData);
}
/**
* Prepare shipment
*
* @param Mage_Sales_Model_Order_Invoice $invoice New invoice
* @param array $additionalData Array containing additional transaction data
*
* @return Mage_Sales_Model_Order_Shipment
*/
protected function _prepareShipment($invoice, $additionalData)
{
$savedQtys = $additionalData['items'];
$shipment = Mage::getModel('sales/service_order', $invoice->getOrder())
->prepareShipment($savedQtys);
if (!$shipment->getTotalQty()) {
return false;
}
$shipment->register();
if (array_key_exists('tracking', $additionalData)
&& $additionalData['tracking']
) {
foreach ($additionalData['tracking'] as $data) {
$track = Mage::getModel('sales/order_shipment_track')
->addData($data);
$shipment->addTrack($track);
}
}
return $shipment;
}
}
<?php
/**
* Netresearch_OPS_Helper_Order_Refund
*
* @package
* @copyright 2011 Netresearch
* @author André Herrn <andre.herrn@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Helper_Order_Refund extends Mage_Core_Helper_Abstract
{
protected $payment;
protected $amount;
/**
* @param Varien_Object $payment
*/
public function setPayment(Varien_Object $payment)
{
$this->payment = $payment;
return $this;
}
/**
* @param float $amount
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Return the refund operation type (RFS or RFD)
* RFS in case of a full refund, RFD otherwise
*
* @param Varien_Object $payment
* @param float $amount
* @param boolean $closeTransaction
*
* @return
*/
public function getRefundOperation($payment, $amount, $closeTransaction = false)
{
$operation = Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_PARTIAL;
// prevent rounding issues caused by phps floating point arithmetic
$orderAmount = round(
(Mage::helper('ops/payment')->getBaseGrandTotalFromSalesObject($payment->getOrder())) * 100, 0
);
$refundAmount = round((($payment->getBaseAmountRefundedOnline() + $amount) * 100));
if ($closeTransaction === true || $orderAmount == $refundAmount) {
$operation = Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_FULL;
}
return $operation;
}
/**
* Create a new payment transaction for the refund
*
* @param array $response
* @param int $closed
*
* @return void
*/
public function createRefundTransaction($response, $closed = 0)
{
$transactionParams = array(
'creditmemo_request' => Mage::app()->getRequest()->getParams(),
'response' => $response,
'amount' => $this->amount
);
Mage::helper('ops/directlink')->directLinkTransact(
Mage::getModel('sales/order')->load($this->payment->getOrder()->getId()),
$response['PAYID'],
$response['PAYIDSUB'],
$transactionParams,
Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_TRANSACTION_TYPE,
Mage::helper('ops')->__('Start Ogone refund request'),
$closed
);
$order = Mage::getModel('sales/order')->load($this->payment->getOrder()->getId());
$order->addStatusHistoryComment(
Mage::helper('ops')->__(
'Creditmemo will be created automatically as soon as Ogone sends an acknowledgement. Ogone Status: %s.',
Mage::helper('ops')->getStatusText($response['STATUS'])
)
);
$order->save();
}
/**
* Create a new refund
*
* @param Mage_Sales_Model_Order $order
* @param array $params
*
* @return
*/
public function createRefund($order, $params)
{
$refundTransaction = Mage::helper('ops/directlink')->getPaymentTransaction(
$order,
$params['PAYID'],
Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_TRANSACTION_TYPE
);
$transactionParams = $refundTransaction->getAdditionalInformation();
$transactionParams = unserialize($transactionParams['arrInfo']);
try {
//Start to create the creditmemo
Mage::register('ops_auto_creditmemo', true);
$service = Mage::getModel('sales/service_order', $order);
$invoice = Mage::getModel('sales/order_invoice')
->load($transactionParams['creditmemo_request']['invoice_id'])
->setOrder($order);
$data = $this->prepareCreditMemoData($transactionParams);
$creditmemo = $service->prepareInvoiceCreditmemo($invoice, $data);
/**
* Process back to stock flags
*/
$backToStock = $data['backToStock'];
foreach ($creditmemo->getAllItems() as $creditmemoItem) {
$orderItem = $creditmemoItem->getOrderItem();
$parentId = $orderItem->getParentItemId();
if (isset($backToStock[$orderItem->getId()])) {
$creditmemoItem->setBackToStock(true);
} elseif ($orderItem->getParentItem() && isset($backToStock[$parentId]) && $backToStock[$parentId]) {
$creditmemoItem->setBackToStock(true);
} elseif (empty($savedData)) {
$creditmemoItem->setBackToStock(Mage::helper('cataloginventory')->isAutoReturnEnabled());
} else {
$creditmemoItem->setBackToStock(false);
}
}
//Send E-Mail and Comment
$comment = '';
$sendEmail = false;
$sendEMailWithComment = false;
if (isset($data['send_email']) && $data['send_email'] == 1) {
$sendEmail = true;
}
if (isset($data['comment_customer_notify'])) {
$sendEMailWithComment = true;
}
if (!empty($data['comment_text'])):
$creditmemo->addComment($data['comment_text'], $sendEMailWithComment);
if ($sendEMailWithComment):
$comment = $data['comment_text'];
endif;
endif;
$creditmemo->setRefundRequested(true);
$creditmemo->setOfflineRequested(false);
$creditmemo->register();
if ($sendEmail):
$creditmemo->setEmailSent(true);
endif;
$creditmemo->getOrder()->setCustomerNoteNotify($sendEMailWithComment);
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($creditmemo)
->addObject($creditmemo->getOrder());
if ($creditmemo->getInvoice()):
$transactionSave->addObject($creditmemo->getInvoice());
endif;
$creditmemo->sendEmail($sendEmail, $comment);
$transactionSave->save();
//End of create creditmemo
//close refund payment transaction
Mage::helper('ops/directlink')->closePaymentTransaction(
$order,
$params,
Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_TRANSACTION_TYPE,
Mage::helper('ops')->__(
'Creditmemo "%s" was created automatically. Ogone Status: %s.',
$creditmemo->getIncrementId(),
Mage::helper('ops')->getStatusText($params['STATUS'])
),
$sendEmail
);
Mage::helper('ops/payment')->setCanRefundToPayment($order->getPayment());
} catch (Exception $e) {
Mage::throwException('Error in Creditmemo creation process: ' . $e->getMessage());
}
}
/**
* Get requested items qtys
*/
protected function prepareCreditMemoData($transactionParams)
{
$data = $transactionParams['creditmemo_request']['creditmemo'];
$qtys = array();
$backToStock = array();
foreach ($data['items'] as $orderItemId => $itemData):
if (isset($itemData['qty'])):
$qtys[$orderItemId] = $itemData['qty']; else:
if (isset($itemData['back_to_stock'])):
$backToStock[$orderItemId] = true;
endif;
endif;
endforeach;
$data['qtys'] = $qtys;
$data['backToStock'] = $backToStock;
return $data;
}
}
<?php
/**
* Netresearch_OPS_Helper_Order_Void
*
* @package
* @copyright 2011 Netresearch
* @author André Herrn <andre.herrn@netresearch.de>
* @license OSL 3.0
*/
class Netresearch_OPS_Helper_Order_Void extends Mage_Core_Helper_Abstract
{
/**
* Cancels the appropriate order and closes the transaction
*
* @param array $params
*/
public function acceptVoid($order, $params)
{
Mage::register('ops_auto_void', true);
$order->cancel();
$order->save();
Mage::helper("ops/directlink")->closePaymentTransaction(
$order,
$params,
Netresearch_OPS_Model_Payment_Abstract::OPS_VOID_TRANSACTION_TYPE
);
Mage::helper('ops')->log("order voided: ".$params['orderID']);
}
public function getCapturedAmount($order)
{
$sumAmount = 0;
$transactionCollection = Mage::getModel('sales/order_payment_transaction')
->getCollection()
->addAttributeToFilter('txn_type', Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_TRANSACTION_TYPE)
->addAttributeToFilter('order_id', $order->getId())
->addAttributeToFilter('is_closed', 1);
foreach($transactionCollection as $transaction){
$arrInfo = null;
$arrInfoRough = $transaction->getAdditionalInformation();
if(isset($arrInfoRough['arrInfo'])){
$arrInfo = unserialize($arrInfoRough['arrInfo']);
}
if(isset($arrInfo['amount'])){
$sumAmount += $arrInfo['amount'];
}
}
return $sumAmount;
}
}
\ No newline at end of file
This diff is collapsed.
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package Netresearch_OPS
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
abstract class Netresearch_OPS_Helper_Payment_DirectLink_Request
{
protected $dataHelper = null;
protected $quoteHelper = null;
protected $orderHelper = null;
protected $customerHelper = null;
protected $validator = null;
protected $requestHelper = null;
protected $config = null;
/**
* @param null $config
*/
public function setConfig($config)
{
$this->config = $config;
}
/**
* @return null
*/
public function getConfig()
{
if (null === $this->config) {
$this->config = Mage::getModel('ops/config');
}
return $this->config;
}
public function setRequestHelper(Netresearch_OPS_Helper_Payment_Request $requestHelper)
{
$this->requestHelper = $requestHelper;
}
/**
* @return Netresearch_OPS_Helper_Payment_Request
*/
public function getRequestHelper()
{
if (null === $this->requestHelper) {
$this->requestHelper = Mage::helper('ops/payment_request');
}
return $this->requestHelper;
}
/**
* sets the data helper
*
* @param Netresearch_OPS_Helper_Data $dataHelper
*/
public function setDataHelper(Netresearch_OPS_Helper_Data $dataHelper)
{
$this->dataHelper = $dataHelper;
}
/**
* gets the data helper
*
* @return Mage_Core_Helper_Abstract
*/
public function getDataHelper()
{
if (null === $this->dataHelper) {
$this->dataHelper = Mage::helper('ops/data');
}
return $this->dataHelper;
}
/**
* sets the quote helper
*
* @param Netresearch_OPS_Helper_Quote $quoteHelper
*/
public function setQuoteHelper(Netresearch_OPS_Helper_Quote $quoteHelper)
{
$this->quoteHelper = $quoteHelper;
}
/**
* gets the quote helper
*
* @return Mage_Core_Helper_Abstract
*/
public function getQuoteHelper()
{
if (null === $this->quoteHelper) {
$this->quoteHelper = Mage::helper('ops/quote');
}
return $this->quoteHelper;
}
/**
* sets the order helper
*
* @param Netresearch_OPS_Helper_Order $orderHelper
*/
public function setOrderHelper(Netresearch_OPS_Helper_Order $orderHelper)
{
$this->orderHelper = $orderHelper;
}
/**
* gets the order helper
*
* @return Mage_Core_Helper_Abstract
*/
public function getOrderHelper()
{
if (null === $this->orderHelper) {
$this->orderHelper = Mage::helper('ops/order');
}
return $this->orderHelper;
}
/**
* sets the customer helper
*
* @param Mage_Core_Helper_Abstract $customerHelper
*/
public function setCustomerHelper(Mage_Core_Helper_Abstract $customerHelper)
{
$this->customerHelper = $customerHelper;
}
/**
* gets the customer helper
*
* @return Mage_Core_Helper_Abstract
*/
public function getCustomerHelper()
{
if (null === $this->customerHelper) {
$this->customerHelper = Mage::helper('customer/data');
}
return $this->customerHelper;
}
/**
* extracts the aparameter for the direct link request from the quote, order and, optionally from existing request params
*
* @param Mage_Sales_Model_Quote $quote
* @param Mage_Sales_Model_Order $order
* @param array $requestParams
*
* @return array - the parameters for the direct link request
*/
public function getDirectLinkRequestParams(Mage_Sales_Model_Quote $quote, Mage_Sales_Model_Order $order, $requestParams = array())
{
$billingAddress = $order->getBillingAddress();
$shippingAddress = $this->getShippingAddress($order, $billingAddress);
$requestParams = $this->getBaseRequestParams($quote, $order, $billingAddress);
$requestParams = array_merge($requestParams, $this->getPaymentSpecificParams($quote));
$shipToParams = $this->getRequestHelper()->extractShipToParameters($shippingAddress);
$shipToParams = $this->decodeParamsForDirectLinkCall($shipToParams);
$requestParams = array_merge($requestParams, $shipToParams);
$requestParams = $this->addCustomerSpecificParams($requestParams);
$requestParams = $this->addParamsForAdminPayments($requestParams);
return $requestParams;
}
/**
* specail handling like validation and so on for admin payments
*
* @param Mage_Sales_Model_Quote $quote
* @param $requestParams
*
* @return mixed
*/
abstract public function handleAdminPayment(Mage_Sales_Model_Quote $quote, $requestParams);
/**
* extracts payment specific payment parameters
*
* @param Mage_Sales_Model_Quote $quote
*
* @return array
*/
abstract protected function getPaymentSpecificParams(Mage_Sales_Model_Quote $quote);
/**
* gets the shipping address if there is one, otherwise the billing address is used as shipping address
*
* @param $order
* @param $billingAddress
*
* @return mixed
*/
protected function getShippingAddress(Mage_Sales_Model_Order $order, $billingAddress)
{
$shippingAddress = $order->getShippingAddress();
if (null === $shippingAddress || false === $shippingAddress) {
$shippingAddress = $billingAddress;
}
return $shippingAddress;
}
/**
* utf8 decode for direct link calls
*
* @param array $requestParams
*
* @return array - the decoded array
*/
protected function decodeParamsForDirectLinkCall(array $requestParams)
{
foreach ($requestParams as $key => $value) {
$requestParams[$key] = utf8_decode($value);
}
return $requestParams;
}
/**
* @param $requestParams
*
* @return mixed
*/
protected function addCustomerSpecificParams($requestParams)
{
if ($this->getCustomerHelper()->isLoggedIn()) {
$requestParams['CUID'] = $this->getCustomerHelper()->getCustomer()->getId();
}
return $requestParams;
}
/**
* @param $requestParams
*
* @return mixed
*/
protected function addParamsForAdminPayments($requestParams)
{
if ($this->getDataHelper()->isAdminSession()) {
$requestParams['ECI'] = Netresearch_OPS_Model_Eci_Values::MANUALLY_KEYED_FROM_MOTO;
$requestParams['REMOTE_ADDR'] = 'NONE';//$order->getRemoteIp();
}
return $requestParams;
}
/**
* @param $quote
* @param $order
* @param $billingAddress
*
* @return array
*/
protected function getBaseRequestParams($quote, $order, $billingAddress)
{
$requestParams = array(
'AMOUNT' => $this->getDataHelper()->getAmount($quote->getBaseGrandTotal()),
'CURRENCY' => $this->getQuoteHelper()->getQuoteCurrency($quote),
'OPERATION' => $this->getQuoteHelper()->getPaymentAction($quote),
'ORDERID' => $this->getConfig()->getConfigData('devprefix') . $quote->getId(),
'OWNERADDRESS' => utf8_decode($billingAddress->getStreet(-1)),
'OWNERTOWN' => utf8_decode($billingAddress->getCity()),
'OWNERZIP' => $billingAddress->getPostcode(),
'OWNERTELNO' => $billingAddress->getTelephone(),
'OWNERCTY' => $billingAddress->getCountry(),
'ADDMATCH' => $this->getOrderHelper()->checkIfAddressesAreSame($order),
'ECOM_BILLTO_POSTAL_POSTALCODE' => $billingAddress->getPostcode(),
'ORIG' => $this->getDataHelper()->getModuleVersionString(),
'EMAIL' => $order->getCustomerEmail(),
'REMOTE_ADDR' => $quote->getRemoteIp(),
);
return $requestParams;
}
}
\ No newline at end of file
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package Netresearch_OPS
* @copyright Copyright (c) 2014 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Helper_Payment_Request
{
/**
* extracts the ship to information from a given address
*
* @param Mage_Customer_Model_Address_Abstract $address
*
* @return array - the parameters containing the ship to data
*/
public function extractShipToParameters(Mage_Customer_Model_Address_Abstract $address)
{
$paramValues = array();
$paramValues['ECOM_SHIPTO_POSTAL_NAME_FIRST'] = $address->getFirstname();
$paramValues['ECOM_SHIPTO_POSTAL_NAME_LAST'] = $address->getLastname();
$paramValues['ECOM_SHIPTO_POSTAL_STREET_LINE1'] = $address->getStreet(1);
$paramValues['ECOM_SHIPTO_POSTAL_STREET_LINE2'] = $address->getStreet(2);
$paramValues['ECOM_SHIPTO_POSTAL_COUNTRYCODE'] = $address->getCountry();
$paramValues['ECOM_SHIPTO_POSTAL_CITY'] = $address->getCity();
$paramValues['ECOM_SHIPTO_POSTAL_POSTALCODE'] = $address->getPostcode();
return $paramValues;
}
}
\ No newline at end of file
This diff is collapsed.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category OPS
* @package Netresearch_OPS
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Alias model
*/
class Netresearch_OPS_Model_Alias extends Mage_Core_Model_Abstract
{
/**
* Constructor
*
* @see lib/Varien/Varien_Object#_construct()
* @return Netresearch_OPS_Model_Alias
*/
public function _construct()
{
$this->_init('ops/alias');
parent::_construct();
}
/**
* @param $customerId - the id of the customer
* @param $billingAddressHash - optional billing address hash
* @param $shippingAdressHash - optional shipping address hash
* @return Netresearch_OPS_Model_Mysql4_Alias_Collection - collection of aliases for given customer
*/
public function getAliasesForCustomer($customerId, $billingAddressHash = null, $shippingAddressHash = null, $storeId = null)
{
$collection = $this->getCollection()
->addFieldToFilter('customer_id', $customerId);
if (!is_null($billingAddressHash) && !is_null($shippingAddressHash)) {
$collection
->addFieldToFilter('billing_address_hash', $billingAddressHash)
->addFieldToFilter('shipping_address_hash', $shippingAddressHash)
->addFieldToFilter('store_id', array('eq' => $storeId, 'null' => 'null'))
;
}
return $collection->load();
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @author Michael Lühr <michael.luehr@netresearch.de>
* @category Netresearch
* @package ${MODULENAME}
* @copyright Copyright (c) 2013 Netresearch GmbH & Co. KG (http://www.netresearch.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Netresearch_OPS_Model_Kwixo_Shipping_Setting
extends Mage_Core_Model_Abstract
{
/**
* Constructor
*
* @see lib/Varien/Varien_Object#_construct()
* @return Netresearch_OPS_Model_Kwixo_Shipping_Setting
*/
public function _construct()
{
$this->_init('ops/kwixo_shipping_setting');
parent::_construct();
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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