Version Notes
* Rewrote from scratch
* Updated Lib to latest version
* Redesigned credit card payment form
* Several minor bug fixes
Download this release
Release Info
| Developer | PayIntelligent |
| Extension | Paymill_Paymill |
| Version | 3.0.4 |
| Comparing to | |
| See all releases | |
Code changes from version 3.0.0 to 3.0.4
- app/code/community/Paymill/Paymill/Block/Adminhtml/Log.php +12 -0
- app/code/community/Paymill/Paymill/Block/Adminhtml/Log/Grid.php +2 -0
- app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormCreditcard.php +59 -30
- app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormDirectdebit.php +33 -31
- app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormCreditcard.php +52 -50
- app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormDirectdebit.php +52 -50
- app/code/community/Paymill/Paymill/Helper/CustomerHelper.php +65 -62
- app/code/community/Paymill/Paymill/Helper/Data.php +101 -99
- app/code/community/Paymill/Paymill/Helper/FastCheckoutHelper.php +90 -87
- app/code/community/Paymill/Paymill/Helper/LoggingHelper.php +49 -44
- app/code/community/Paymill/Paymill/Helper/OptionHelper.php +135 -141
- app/code/community/Paymill/Paymill/Helper/PaymentHelper.php +84 -71
- app/code/community/Paymill/Paymill/Helper/RefundHelper.php +23 -19
- app/code/community/Paymill/Paymill/Helper/TransactionHelper.php +96 -94
- app/code/community/Paymill/Paymill/Model/Fastcheckout.php +136 -135
- app/code/community/Paymill/Paymill/Model/Log.php +51 -50
- app/code/community/Paymill/Paymill/Model/Method/MethodModelAbstract.php +19 -17
- app/code/community/Paymill/Paymill/Model/Method/MethodModelCreditcard.php +53 -69
- app/code/community/Paymill/Paymill/Model/Method/MethodModelDirectdebit.php +45 -43
- app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout.php +29 -29
- app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout/Collection.php +29 -29
- app/code/community/Paymill/Paymill/Model/Mysql4/Log.php +29 -29
- app/code/community/Paymill/Paymill/Model/Mysql4/Log/Collection.php +29 -29
- app/code/community/Paymill/Paymill/Model/Observer.php +15 -12
- app/code/community/Paymill/Paymill/Model/TransactionData.php +62 -61
- app/code/community/Paymill/Paymill/controllers/Adminhtml/LogController.php +11 -9
- app/code/community/Paymill/Paymill/etc/config.xml +9 -9
- app/code/community/Paymill/Paymill/etc/system.xml +243 -227
- app/code/community/Paymill/Paymill/sql/paymill_setup/mysql4-install-3.0.0.php +4 -4
- app/design/adminhtml/base/default/template/paymill/payment/info/creditcard.phtml +13 -13
- app/design/adminhtml/base/default/template/paymill/payment/info/directdebit.phtml +13 -13
- app/design/frontend/base/default/layout/paymill.xml +6 -5
- app/design/frontend/base/default/template/paymill/payment/form/creditcard.phtml +44 -43
- app/design/frontend/base/default/template/paymill/payment/form/directdebit.phtml +22 -27
- app/design/frontend/base/default/template/paymill/payment/info/creditcard.phtml +5 -5
- app/design/frontend/base/default/template/paymill/payment/info/directdebit.phtml +5 -5
- app/etc/modules/Paymill_Paymill.xml +16 -16
- app/locale/de_DE/Paymill_Paymill.csv +8 -7
- app/locale/en_GB/Paymill_Paymill.csv +13 -12
- app/locale/en_US/Paymill_Paymill.csv +13 -12
- js/paymill/paymentForm.js +106 -62
- lib/Services/Paymill/Apiclient/Curl.php +158 -157
- lib/Services/Paymill/Apiclient/Interface.php +19 -19
- lib/Services/Paymill/Base.php +144 -144
- lib/Services/Paymill/Clients.php +13 -13
- lib/Services/Paymill/Exception.php +16 -16
- lib/Services/Paymill/LoggingInterface.php +14 -14
- lib/Services/Paymill/Offers.php +13 -13
- lib/Services/Paymill/PaymentProcessor.php +548 -462
- lib/Services/Paymill/Payments.php +26 -26
- lib/Services/Paymill/Refunds.php +55 -54
- lib/Services/Paymill/Subscriptions.php +13 -13
- lib/Services/Paymill/Transactions.php +39 -39
- lib/Services/Paymill/Webhooks.php +13 -13
- package.xml +8 -5
- skin/frontend/base/default/css/paymill/logo.css +16 -16
- skin/frontend/base/default/images/paymill/icon_32x20_amex.png +0 -0
- skin/frontend/base/default/images/paymill/icon_32x20_dinersclub.png +0 -0
- skin/frontend/base/default/images/paymill/icon_32x20_discover.png +0 -0
- skin/frontend/base/default/images/paymill/icon_32x20_jcb.png +0 -0
- skin/frontend/base/default/images/paymill/icon_32x20_maestro.png +0 -0
- skin/frontend/base/default/images/paymill/icon_32x20_mastercard.png +0 -0
- skin/frontend/base/default/images/paymill/icon_32x20_visa.png +0 -0
- skin/frontend/base/default/images/paymill/icon_mastercard.png +0 -0
- skin/frontend/base/default/images/paymill/icon_visa.png +0 -0
app/code/community/Paymill/Paymill/Block/Adminhtml/Log.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -19,6 +20,7 @@
|
|
| 19 |
*/
|
| 20 |
class Paymill_Paymill_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
|
| 21 |
{
|
|
|
|
| 22 |
/**
|
| 23 |
* Construct
|
| 24 |
*/
|
|
@@ -29,4 +31,14 @@ class Paymill_Paymill_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Gr
|
|
| 29 |
$this->_headerText = Mage::helper('paymill')->__('paymill_log');
|
| 30 |
parent::__construct();
|
| 31 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
}
|
| 1 |
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 20 |
*/
|
| 21 |
class Paymill_Paymill_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
|
| 22 |
{
|
| 23 |
+
|
| 24 |
/**
|
| 25 |
* Construct
|
| 26 |
*/
|
| 31 |
$this->_headerText = Mage::helper('paymill')->__('paymill_log');
|
| 32 |
parent::__construct();
|
| 33 |
}
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* @see Mage_Adminhtml_Block_Widget_Grid_Container::_prepareLayout()
|
| 37 |
+
*/
|
| 38 |
+
protected function _prepareLayout()
|
| 39 |
+
{
|
| 40 |
+
$this->_removeButton('add');
|
| 41 |
+
return parent::_prepareLayout();
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
}
|
app/code/community/Paymill/Paymill/Block/Adminhtml/Log/Grid.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -19,6 +20,7 @@
|
|
| 19 |
*/
|
| 20 |
class Paymill_Paymill_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
| 21 |
{
|
|
|
|
| 22 |
/**
|
| 23 |
* Is filter allowed
|
| 24 |
*
|
| 1 |
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 20 |
*/
|
| 21 |
class Paymill_Paymill_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
| 22 |
{
|
| 23 |
+
|
| 24 |
/**
|
| 25 |
* Is filter allowed
|
| 26 |
*
|
app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormCreditcard.php
CHANGED
|
@@ -1,30 +1,59 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Block_Payment_Form_PaymentFormCreditcard extends Mage_Payment_Block_Form
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Construct
|
| 26 |
+
*/
|
| 27 |
+
protected function _construct()
|
| 28 |
+
{
|
| 29 |
+
parent::_construct();
|
| 30 |
+
$this->setTemplate('paymill/payment/form/creditcard.phtml');
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Retrieve credit card expire months for Paymill
|
| 35 |
+
*
|
| 36 |
+
* @return array
|
| 37 |
+
*/
|
| 38 |
+
public function getPaymillCcMonths()
|
| 39 |
+
{
|
| 40 |
+
$months[0] = $this->__('Month');
|
| 41 |
+
$months = array_merge($months, Mage::getSingleton('payment/config')->getMonths());
|
| 42 |
+
|
| 43 |
+
return $months;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* Retrieve credit card expire years for Paymill
|
| 48 |
+
*
|
| 49 |
+
* @return array
|
| 50 |
+
*/
|
| 51 |
+
public function getPaymillCcYears()
|
| 52 |
+
{
|
| 53 |
+
$years = Mage::getSingleton('payment/config')->getYears();
|
| 54 |
+
$years = array(0 => $this->__('Year')) + $years;
|
| 55 |
+
|
| 56 |
+
return $years;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
}
|
app/code/community/Paymill/Paymill/Block/Payment/Form/PaymentFormDirectdebit.php
CHANGED
|
@@ -1,31 +1,33 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
}
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Block_Payment_Form_PaymentFormDirectdebit extends Mage_Payment_Block_Form
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Construct
|
| 26 |
+
*/
|
| 27 |
+
protected function _construct()
|
| 28 |
+
{
|
| 29 |
+
parent::_construct();
|
| 30 |
+
$this->setTemplate('paymill/payment/form/directdebit.phtml');
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
}
|
app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormCreditcard.php
CHANGED
|
@@ -1,50 +1,52 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
*
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
$
|
| 44 |
-
|
| 45 |
-
$data
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
}
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Block_Payment_Info_PaymentFormCreditcard extends Mage_Payment_Block_Info
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Construct
|
| 26 |
+
*/
|
| 27 |
+
protected function _construct()
|
| 28 |
+
{
|
| 29 |
+
parent::_construct();
|
| 30 |
+
$this->setTemplate('paymill/payment/info/creditcard.phtml');
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Add custom information to payment method information
|
| 35 |
+
*
|
| 36 |
+
* @param Varien_Object|array $transport
|
| 37 |
+
*/
|
| 38 |
+
protected function _prepareSpecificInformation($transport = null)
|
| 39 |
+
{
|
| 40 |
+
if (null !== $this->_paymentSpecificInformation) {
|
| 41 |
+
return $this->_paymentSpecificInformation;
|
| 42 |
+
}
|
| 43 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
| 44 |
+
|
| 45 |
+
$data = array();
|
| 46 |
+
$data['paymillTransactionId'] = $this->getInfo()->getAdditionalInformation('paymillTransactionId');
|
| 47 |
+
$data['imgUrl'] = Mage::helper('paymill')->getImagePath() . "icon_paymill.png";
|
| 48 |
+
|
| 49 |
+
return $transport->setData(array_merge($data, $transport->getData()));
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
}
|
app/code/community/Paymill/Paymill/Block/Payment/Info/PaymentFormDirectdebit.php
CHANGED
|
@@ -1,50 +1,52 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
*
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
$
|
| 44 |
-
|
| 45 |
-
$data
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
}
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Block_Payment_Info_PaymentFormDirectdebit extends Mage_Payment_Block_Info
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Construct
|
| 26 |
+
*/
|
| 27 |
+
protected function _construct()
|
| 28 |
+
{
|
| 29 |
+
parent::_construct();
|
| 30 |
+
$this->setTemplate('paymill/payment/info/directdebit.phtml');
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Add custom information to payment method information
|
| 35 |
+
*
|
| 36 |
+
* @param Varien_Object|array $transport
|
| 37 |
+
*/
|
| 38 |
+
protected function _prepareSpecificInformation($transport = null)
|
| 39 |
+
{
|
| 40 |
+
if (null !== $this->_paymentSpecificInformation) {
|
| 41 |
+
return $this->_paymentSpecificInformation;
|
| 42 |
+
}
|
| 43 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
| 44 |
+
|
| 45 |
+
$data = array();
|
| 46 |
+
$data['paymillTransactionId'] = $this->getInfo()->getAdditionalInformation('paymillTransactionId');
|
| 47 |
+
$data['imgUrl'] = Mage::helper('paymill')->getImagePath() . "icon_paymill.png";
|
| 48 |
+
|
| 49 |
+
return $transport->setData(array_merge($data, $transport->getData()));
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
}
|
app/code/community/Paymill/Paymill/Helper/CustomerHelper.php
CHANGED
|
@@ -1,63 +1,66 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
| 63 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* The Customer Helper contains methods dealing customer information.
|
| 24 |
+
*/
|
| 25 |
+
class Paymill_Paymill_Helper_CustomerHelper extends Mage_Core_Helper_Abstract
|
| 26 |
+
{
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Returns the current customers full name
|
| 30 |
+
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
|
| 31 |
+
* @return string the customers full name
|
| 32 |
+
*/
|
| 33 |
+
public function getCustomerName($object)
|
| 34 |
+
{
|
| 35 |
+
$custFirstName = $object->getBillingAddress()->getFirstname();
|
| 36 |
+
$custLastName = $object->getBillingAddress()->getLastname();
|
| 37 |
+
$custFullName = $custFirstName . " " . $custLastName;
|
| 38 |
+
return $custFullName;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* Returns the current customers email adress.
|
| 43 |
+
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
|
| 44 |
+
* @return string the customers email adress
|
| 45 |
+
*/
|
| 46 |
+
public function getCustomerEmail($object)
|
| 47 |
+
{
|
| 48 |
+
return $object->getCustomerEmail();
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Returns the Id of the user currently logged in.
|
| 53 |
+
* Returns null if there is no logged in user.
|
| 54 |
+
* @return String userId
|
| 55 |
+
*/
|
| 56 |
+
public function getUserId()
|
| 57 |
+
{
|
| 58 |
+
$result = null;
|
| 59 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
| 60 |
+
$result = Mage::getSingleton('customer/session')->getId();
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
return $result;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
}
|
app/code/community/Paymill/Paymill/Helper/Data.php
CHANGED
|
@@ -1,99 +1,101 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
*
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
}
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* The Data Helper contains methods dealing with shopiformation.
|
| 24 |
+
* Examples for this might be f.Ex backend option states or pathes.
|
| 25 |
+
*/
|
| 26 |
+
class Paymill_Paymill_Helper_Data extends Mage_Core_Helper_Abstract
|
| 27 |
+
{
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* Returns the path to the image directory as a string
|
| 31 |
+
* @return string Path
|
| 32 |
+
*/
|
| 33 |
+
public function getImagePath()
|
| 34 |
+
{
|
| 35 |
+
return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'skin/frontend/base/default/images/paymill/';
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
/**
|
| 39 |
+
* Returns the path to the js directory as a string
|
| 40 |
+
* @return string Path
|
| 41 |
+
*/
|
| 42 |
+
public function getJscriptPath()
|
| 43 |
+
{
|
| 44 |
+
return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/paymill/';
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* Returns the API Url
|
| 49 |
+
* @return string
|
| 50 |
+
*/
|
| 51 |
+
public function getApiUrl()
|
| 52 |
+
{
|
| 53 |
+
return "https://api.paymill.com/v2/";
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* Returns the version of the plugin as a string
|
| 58 |
+
* @return String Version
|
| 59 |
+
*/
|
| 60 |
+
public function getVersion()
|
| 61 |
+
{
|
| 62 |
+
return (string) Mage::getConfig()->getNode()->modules->Paymill_Paymill->version;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/**
|
| 66 |
+
* Returns a boolean deciding if the template is going to be displayed of not
|
| 67 |
+
* @param String $code payment code
|
| 68 |
+
* @return boolean
|
| 69 |
+
*/
|
| 70 |
+
public function showTemplateForm($code)
|
| 71 |
+
{
|
| 72 |
+
$optionHelper = Mage::helper('paymill/optionHelper');
|
| 73 |
+
$fcHelper = Mage::helper('paymill/fastCheckoutHelper');
|
| 74 |
+
|
| 75 |
+
return !($optionHelper->isFastCheckoutEnabled() && $fcHelper->hasData($code));
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* Returns the div tag opening defining the visibility of the payment form
|
| 80 |
+
* @param String $code
|
| 81 |
+
* @return string
|
| 82 |
+
*/
|
| 83 |
+
public function getFormTypeForDisplay($code)
|
| 84 |
+
{
|
| 85 |
+
if ($this->showTemplateForm($code)) {
|
| 86 |
+
return "<div>";
|
| 87 |
+
} else {
|
| 88 |
+
return "<div style='display:none;'>";
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* Returns the Source string passt to every transaction
|
| 94 |
+
* @return String Source
|
| 95 |
+
*/
|
| 96 |
+
public function getSourceString()
|
| 97 |
+
{
|
| 98 |
+
return $this->getVersion() . "_Magento_" . Mage::getVersion();
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
}
|
app/code/community/Paymill/Paymill/Helper/FastCheckoutHelper.php
CHANGED
|
@@ -1,88 +1,91 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
*
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
$
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
| 88 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* The FastCheckout Helper contains methods dealing with the fast checkout process.
|
| 24 |
+
* Examples for this might be f.Ex a customers userId used for matching client data or methods to grant easier access the db information.
|
| 25 |
+
*/
|
| 26 |
+
class Paymill_Paymill_Helper_FastCheckoutHelper extends Mage_Core_Helper_Abstract
|
| 27 |
+
{
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* Calls the Data helper to get the state of the Fast Checkout option
|
| 31 |
+
*/
|
| 32 |
+
public function isFastCheckoutEnabled()
|
| 33 |
+
{
|
| 34 |
+
return Mage::helper("paymill/optionHelper")->isFastCheckoutEnabled();
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
/**
|
| 38 |
+
* Returns the clientId matched with the userId passed as an argument.
|
| 39 |
+
* If no match is found, the return value will be null.
|
| 40 |
+
* @param String $userId Unique identifier of the customer
|
| 41 |
+
* @return String clientId matched with the userId <b>can be null if no match is found</b>
|
| 42 |
+
*/
|
| 43 |
+
public function getClientId()
|
| 44 |
+
{
|
| 45 |
+
$userId = Mage::helper("paymill/customerHelper")->getUserId();
|
| 46 |
+
$collection = Mage::getModel('paymill/fastcheckout')->getCollection();
|
| 47 |
+
$collection->addFilter('user_id', $userId);
|
| 48 |
+
$obj = $collection->getFirstItem();
|
| 49 |
+
return $obj->getClientId();
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
/**
|
| 53 |
+
* Returns the PaymentId associated with the current user
|
| 54 |
+
* @param String $code PaymentMethodCode
|
| 55 |
+
* @return String paymentId
|
| 56 |
+
*/
|
| 57 |
+
public function getPaymentId($code)
|
| 58 |
+
{
|
| 59 |
+
$userId = Mage::helper("paymill/customerHelper")->getUserId();
|
| 60 |
+
return Mage::getModel("paymill/fastcheckout")->getPaymentId($userId, $code);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* Returns a boolean describing whether there is saved fc data for the current user
|
| 65 |
+
* @param String $code PaymentMethodCode
|
| 66 |
+
* @return boolean
|
| 67 |
+
*/
|
| 68 |
+
public function hasData($code)
|
| 69 |
+
{
|
| 70 |
+
$userId = Mage::helper("paymill/customerHelper")->getUserId();
|
| 71 |
+
if (Mage::getModel("paymill/fastcheckout")->hasFcData($userId, $code)) {
|
| 72 |
+
return true;
|
| 73 |
+
}
|
| 74 |
+
return false;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* Saves the dataset into the database
|
| 79 |
+
* @param String $code paymentCode
|
| 80 |
+
* @param String $clientId Description
|
| 81 |
+
* @param String $name Description
|
| 82 |
+
*/
|
| 83 |
+
public function saveData($code, $clientId, $paymentId)
|
| 84 |
+
{
|
| 85 |
+
$userId = Mage::helper("paymill/customerHelper")->getUserId();
|
| 86 |
+
if (isset($userId)) {
|
| 87 |
+
Mage::getModel("paymill/fastcheckout")->saveFcData($code, $userId, $clientId, $paymentId);
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
}
|
app/code/community/Paymill/Paymill/Helper/LoggingHelper.php
CHANGED
|
@@ -1,45 +1,50 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
*
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* The Logging Helper contains methods dealing with Log entries.
|
| 24 |
+
* Examples for this might be f.Ex logging data or reading from the log.
|
| 25 |
+
*/
|
| 26 |
+
class Paymill_Paymill_Helper_LoggingHelper extends Mage_Core_Helper_Abstract implements Services_Paymill_LoggingInterface
|
| 27 |
+
{
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* Inserts the arguments into the db log
|
| 31 |
+
* @param String $merchantInfo
|
| 32 |
+
* @param String $devInfo
|
| 33 |
+
* @param String $devInfoAdditional
|
| 34 |
+
*/
|
| 35 |
+
public function log($merchantInfo, $devInfo = null, $devInfoAdditional = null)
|
| 36 |
+
{
|
| 37 |
+
Mage::getModel('paymill/log')->log($merchantInfo, $devInfo, $devInfoAdditional);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* Returns a collection of all log-entries
|
| 42 |
+
* @return Collection Description
|
| 43 |
+
*/
|
| 44 |
+
public function getEntries()
|
| 45 |
+
{
|
| 46 |
+
$collection = Mage::getModel('paymill/log')->getCollection();
|
| 47 |
+
return $collection;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
}
|
app/code/community/Paymill/Paymill/Helper/OptionHelper.php
CHANGED
|
@@ -1,141 +1,135 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
*
|
| 84 |
-
*
|
| 85 |
-
* @
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
*
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
return $value;
|
| 137 |
-
}
|
| 138 |
-
|
| 139 |
-
return 0;
|
| 140 |
-
}
|
| 141 |
-
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* The Option Helper contains methods dealing with reading out backend options.
|
| 24 |
+
*/
|
| 25 |
+
class Paymill_Paymill_Helper_OptionHelper extends Mage_Core_Helper_Abstract
|
| 26 |
+
{
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Returns the Public Key from the Backend as a string
|
| 30 |
+
* @return String
|
| 31 |
+
*/
|
| 32 |
+
public function getPublicKey()
|
| 33 |
+
{
|
| 34 |
+
return trim($this->_getGeneralOption("public_key"));
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
/**
|
| 38 |
+
* Returns the Private Key from the Backend as a string
|
| 39 |
+
* @return String
|
| 40 |
+
*/
|
| 41 |
+
public function getPrivateKey()
|
| 42 |
+
{
|
| 43 |
+
return trim($this->_getGeneralOption("private_key"));
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* Returns the state of the "Logging" Switch from the Backend as a Boolean
|
| 48 |
+
* @return Boolean
|
| 49 |
+
*/
|
| 50 |
+
public function isLogging()
|
| 51 |
+
{
|
| 52 |
+
return $this->_getGeneralOption("logging_active");
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* Returns the state of the "FastCheckout" Switch from the Backend as a Boolean
|
| 57 |
+
* @return Boolean
|
| 58 |
+
*/
|
| 59 |
+
public function isFastCheckoutEnabled()
|
| 60 |
+
{
|
| 61 |
+
return $this->_getGeneralOption("fc_active");
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* Returns the state of the "Debug" Switch from the Backend as a Boolean
|
| 66 |
+
* @return Boolean
|
| 67 |
+
*/
|
| 68 |
+
public function isInDebugMode()
|
| 69 |
+
{
|
| 70 |
+
return $this->_getGeneralOption("debugging_active");
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* Returns the state of the "Show Labels" Switch from the Backend as a Boolean
|
| 75 |
+
* @return Boolean
|
| 76 |
+
*/
|
| 77 |
+
public function isShowingLabels()
|
| 78 |
+
{
|
| 79 |
+
return $this->_getGeneralOption("show_label");
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* Returns the value of the given backend option.
|
| 84 |
+
* <p align = "center">Needs the $_storeId to be set to work properly</p>
|
| 85 |
+
* @param String $choice Name of the desired category as a string
|
| 86 |
+
* @param String $optionName Name of the desired option as a string
|
| 87 |
+
* @return mixed Value of the Backend Option
|
| 88 |
+
* @throws Exception "No Store Id has been set."
|
| 89 |
+
*/
|
| 90 |
+
private function _getBackendOption($choice, $optionName)
|
| 91 |
+
{
|
| 92 |
+
try {
|
| 93 |
+
$value = Mage::getStoreConfig('payment/' . $choice . '/' . $optionName, Mage::app()->getStore()->getStoreId());
|
| 94 |
+
} catch (Exception $ex) {
|
| 95 |
+
$value = "An Error has occoured getting the config element";
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
return $value;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* Returns the Value of the general Option with the given name.
|
| 103 |
+
* <p align = "center">Needs the $_storeId to be set to work properly</p>
|
| 104 |
+
* @param String $optionName
|
| 105 |
+
* @return mixed Value
|
| 106 |
+
*/
|
| 107 |
+
private function _getGeneralOption($optionName)
|
| 108 |
+
{
|
| 109 |
+
return $this->_getBackendOption("paymill", $optionName);
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* Returns the state of the "preAuth" Switch from the Backend as a Boolean
|
| 114 |
+
* @return boolean
|
| 115 |
+
*/
|
| 116 |
+
public function isPreAuthorizing()
|
| 117 |
+
{
|
| 118 |
+
return $this->_getGeneralOption("preAuth_active");
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/**
|
| 122 |
+
* Returns the Token Tolerance Value for the given payment
|
| 123 |
+
* @param String $paymentType Paymentcode
|
| 124 |
+
* @return int Token Tolerance Value (in multiplied format eg 10.00 to 1000)
|
| 125 |
+
*/
|
| 126 |
+
public function getTokenTolerance($paymentType)
|
| 127 |
+
{
|
| 128 |
+
$optionValue = $this->_getBackendOption($paymentType, 'tokenTolerance');
|
| 129 |
+
$formattedValue = str_replace(',', '.', $optionValue);
|
| 130 |
+
$value = (string) (number_format((float) $formattedValue, 2) * 100);
|
| 131 |
+
|
| 132 |
+
return $value;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Paymill/Paymill/Helper/PaymentHelper.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -17,12 +18,14 @@
|
|
| 17 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
|
|
|
| 20 |
/**
|
| 21 |
* The Payment Helper contains methods dealing with payment relevant information.
|
| 22 |
* Examples for this might be f.Ex customer data, formating of basket amounts or similar.
|
| 23 |
*/
|
| 24 |
class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
| 25 |
{
|
|
|
|
| 26 |
/**
|
| 27 |
* Returns the order amount in the smallest possible unit (f.Ex. cent for the EUR currency)
|
| 28 |
* <p align = "center" color = "red">At the moment, only currencies with a 1:100 conversion are supported. Special cases need to be added if necessary</p>
|
|
@@ -31,7 +34,7 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 31 |
*/
|
| 32 |
public function getAmount($object = null)
|
| 33 |
{
|
| 34 |
-
if($object == null){
|
| 35 |
$object = Mage::getSingleton('checkout/session')->getQuote();
|
| 36 |
}
|
| 37 |
$decimalTotal = $object->getGrandTotal();
|
|
@@ -39,14 +42,25 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 39 |
return $amountTotal;
|
| 40 |
}
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
/**
|
| 43 |
* Returns the currency compliant to ISO 4217 (3 char code)
|
| 44 |
* @return string 3 Character long currency code
|
| 45 |
*/
|
| 46 |
public function getCurrency()
|
| 47 |
{
|
| 48 |
-
|
| 49 |
-
|
| 50 |
}
|
| 51 |
|
| 52 |
/**
|
|
@@ -59,7 +73,7 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 59 |
{
|
| 60 |
$orderId = $this->getOrderId($object);
|
| 61 |
$customerEmail = Mage::helper("paymill/customerHelper")->getCustomerEmail($object);
|
| 62 |
-
$description = $orderId. ", " . $customerEmail;
|
| 63 |
|
| 64 |
return $description;
|
| 65 |
}
|
|
@@ -72,11 +86,11 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 72 |
public function getPaymentType($code)
|
| 73 |
{
|
| 74 |
//Creditcard
|
| 75 |
-
if($code === "paymill_creditcard"){
|
| 76 |
$type = "cc";
|
| 77 |
}
|
| 78 |
//Directdebit
|
| 79 |
-
if($code === "paymill_directdebit"){
|
| 80 |
$type = "elv";
|
| 81 |
}
|
| 82 |
|
|
@@ -92,11 +106,11 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 92 |
{
|
| 93 |
$orderId = null;
|
| 94 |
|
| 95 |
-
if($object instanceof Mage_Sales_Model_Order){
|
| 96 |
$orderId = $object->getIncrementId();
|
| 97 |
}
|
| 98 |
|
| 99 |
-
if($object instanceof Mage_Sales_Model_Quote){
|
| 100 |
$orderId = $object->getReservedOrderId();
|
| 101 |
}
|
| 102 |
|
|
@@ -104,7 +118,6 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 104 |
return $orderId;
|
| 105 |
}
|
| 106 |
|
| 107 |
-
|
| 108 |
/**
|
| 109 |
* Returns an instance of the paymentProcessor class.
|
| 110 |
* @param String $paymentCode name of the payment
|
|
@@ -114,22 +127,23 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 114 |
*/
|
| 115 |
public function createPaymentProcessor($paymentCode, $token)
|
| 116 |
{
|
| 117 |
-
$privateKey
|
| 118 |
-
$apiUrl
|
| 119 |
-
$quote
|
| 120 |
-
$libBase
|
| 121 |
-
|
| 122 |
-
$params
|
| 123 |
-
$params['token']
|
| 124 |
-
$params['amount']
|
| 125 |
-
$params['currency']
|
| 126 |
-
$params['payment']
|
| 127 |
-
$params['name']
|
| 128 |
-
$params['email']
|
| 129 |
-
$params['description']
|
| 130 |
-
$params['source']
|
| 131 |
-
|
| 132 |
-
|
|
|
|
| 133 |
}
|
| 134 |
|
| 135 |
/**
|
|
@@ -141,15 +155,15 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 141 |
*/
|
| 142 |
public function createClient($email, $description)
|
| 143 |
{
|
| 144 |
-
$privateKey
|
| 145 |
-
$apiUrl
|
| 146 |
-
|
| 147 |
-
if(empty($privateKey)){
|
| 148 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 149 |
Mage::throwException("No private Key was set.");
|
| 150 |
}
|
| 151 |
-
|
| 152 |
-
$clientsObject
|
| 153 |
|
| 154 |
$client = $clientsObject->create(
|
| 155 |
array(
|
|
@@ -177,22 +191,22 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 177 |
*/
|
| 178 |
public function createPayment($token, $clientId)
|
| 179 |
{
|
| 180 |
-
$privateKey
|
| 181 |
-
$apiUrl
|
| 182 |
-
|
| 183 |
-
if(empty($privateKey)){
|
| 184 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 185 |
Mage::throwException("No private Key was set.");
|
| 186 |
}
|
| 187 |
-
|
| 188 |
-
$paymentsObject
|
| 189 |
-
|
| 190 |
$payment = $paymentsObject->create(
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
|
| 197 |
if (isset($payment['data']['response_code']) && $payment['data']['response_code'] !== 20000) {
|
| 198 |
$this->_log("An Error occured: " . $payment['data']['response_code'], var_export($payment, true));
|
|
@@ -212,27 +226,25 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 212 |
*/
|
| 213 |
public function createPreAuthorization($paymentId)
|
| 214 |
{
|
| 215 |
-
$privateKey
|
| 216 |
-
$apiUrl
|
| 217 |
-
|
| 218 |
-
if(empty($privateKey)){
|
| 219 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 220 |
Mage::throwException("No private Key was set.");
|
| 221 |
}
|
| 222 |
-
|
| 223 |
-
$preAuthObject = new Services_Paymill_Preauthorizations($privateKey, $apiUrl);
|
| 224 |
|
| 225 |
-
$
|
| 226 |
-
|
|
|
|
|
|
|
| 227 |
|
| 228 |
-
$params
|
| 229 |
-
$preAuth
|
| 230 |
|
| 231 |
Mage::helper('paymill/loggingHelper')->log("PreAuthorization created from Payment", $preAuth['preauthorization']['id'], print_r($params, true));
|
| 232 |
|
| 233 |
return $preAuth['preauthorization'];
|
| 234 |
-
|
| 235 |
-
|
| 236 |
}
|
| 237 |
|
| 238 |
/**
|
|
@@ -244,25 +256,26 @@ class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
|
| 244 |
*/
|
| 245 |
public function createTransactionFromPreAuth($order, $preAuthorizationId, $amount)
|
| 246 |
{
|
| 247 |
-
$privateKey
|
| 248 |
-
$apiUrl
|
| 249 |
-
if(empty($privateKey)){
|
| 250 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 251 |
Mage::throwException("No private Key was set.");
|
| 252 |
}
|
| 253 |
-
|
| 254 |
-
$transactionsObject
|
| 255 |
-
$params
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
$transaction
|
| 264 |
-
Mage::helper('paymill/loggingHelper')->log("Creating Transaction from PreAuthorization", print_r($params, true), var_export($transaction,true));
|
| 265 |
|
| 266 |
return $transaction;
|
| 267 |
}
|
|
|
|
| 268 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 18 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
*/
|
| 21 |
+
|
| 22 |
/**
|
| 23 |
* The Payment Helper contains methods dealing with payment relevant information.
|
| 24 |
* Examples for this might be f.Ex customer data, formating of basket amounts or similar.
|
| 25 |
*/
|
| 26 |
class Paymill_Paymill_Helper_PaymentHelper extends Mage_Core_Helper_Abstract
|
| 27 |
{
|
| 28 |
+
|
| 29 |
/**
|
| 30 |
* Returns the order amount in the smallest possible unit (f.Ex. cent for the EUR currency)
|
| 31 |
* <p align = "center" color = "red">At the moment, only currencies with a 1:100 conversion are supported. Special cases need to be added if necessary</p>
|
| 34 |
*/
|
| 35 |
public function getAmount($object = null)
|
| 36 |
{
|
| 37 |
+
if ($object == null) {
|
| 38 |
$object = Mage::getSingleton('checkout/session')->getQuote();
|
| 39 |
}
|
| 40 |
$decimalTotal = $object->getGrandTotal();
|
| 42 |
return $amountTotal;
|
| 43 |
}
|
| 44 |
|
| 45 |
+
/**
|
| 46 |
+
* Returns the PreAuthAmount and sets a session var for later use
|
| 47 |
+
* @param String $_code
|
| 48 |
+
*/
|
| 49 |
+
public function getPreAuthAmount($_code)
|
| 50 |
+
{
|
| 51 |
+
$amount = $this->getAmount() + Mage::helper('paymill/optionHelper')->getTokenTolerance($_code);
|
| 52 |
+
Mage::getSingleton('core/session')->setPreAuthAmount($amount);
|
| 53 |
+
return $amount;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
/**
|
| 57 |
* Returns the currency compliant to ISO 4217 (3 char code)
|
| 58 |
* @return string 3 Character long currency code
|
| 59 |
*/
|
| 60 |
public function getCurrency()
|
| 61 |
{
|
| 62 |
+
$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 63 |
+
return $currency_code;
|
| 64 |
}
|
| 65 |
|
| 66 |
/**
|
| 73 |
{
|
| 74 |
$orderId = $this->getOrderId($object);
|
| 75 |
$customerEmail = Mage::helper("paymill/customerHelper")->getCustomerEmail($object);
|
| 76 |
+
$description = $orderId . ", " . $customerEmail;
|
| 77 |
|
| 78 |
return $description;
|
| 79 |
}
|
| 86 |
public function getPaymentType($code)
|
| 87 |
{
|
| 88 |
//Creditcard
|
| 89 |
+
if ($code === "paymill_creditcard") {
|
| 90 |
$type = "cc";
|
| 91 |
}
|
| 92 |
//Directdebit
|
| 93 |
+
if ($code === "paymill_directdebit") {
|
| 94 |
$type = "elv";
|
| 95 |
}
|
| 96 |
|
| 106 |
{
|
| 107 |
$orderId = null;
|
| 108 |
|
| 109 |
+
if ($object instanceof Mage_Sales_Model_Order) {
|
| 110 |
$orderId = $object->getIncrementId();
|
| 111 |
}
|
| 112 |
|
| 113 |
+
if ($object instanceof Mage_Sales_Model_Quote) {
|
| 114 |
$orderId = $object->getReservedOrderId();
|
| 115 |
}
|
| 116 |
|
| 118 |
return $orderId;
|
| 119 |
}
|
| 120 |
|
|
|
|
| 121 |
/**
|
| 122 |
* Returns an instance of the paymentProcessor class.
|
| 123 |
* @param String $paymentCode name of the payment
|
| 127 |
*/
|
| 128 |
public function createPaymentProcessor($paymentCode, $token)
|
| 129 |
{
|
| 130 |
+
$privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
|
| 131 |
+
$apiUrl = Mage::helper('paymill')->getApiUrl();
|
| 132 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
| 133 |
+
$libBase = null;
|
| 134 |
+
|
| 135 |
+
$params = array();
|
| 136 |
+
$params['token'] = $token;
|
| 137 |
+
$params['amount'] = (int) $this->getAmount();
|
| 138 |
+
$params['currency'] = $this->getCurrency();
|
| 139 |
+
$params['payment'] = $this->getPaymentType($paymentCode); // The chosen payment (cc | elv)
|
| 140 |
+
$params['name'] = Mage::helper("paymill/customerHelper")->getCustomerName($quote);
|
| 141 |
+
$params['email'] = Mage::helper("paymill/customerHelper")->getCustomerEmail($quote);
|
| 142 |
+
$params['description'] = $this->getDescription($quote);
|
| 143 |
+
$params['source'] = Mage::helper('paymill')->getSourceString();
|
| 144 |
+
|
| 145 |
+
$paymentProcessor = new Services_Paymill_PaymentProcessor($privateKey, $apiUrl, $libBase, $params, Mage::helper('paymill/loggingHelper'));
|
| 146 |
+
return $paymentProcessor;
|
| 147 |
}
|
| 148 |
|
| 149 |
/**
|
| 155 |
*/
|
| 156 |
public function createClient($email, $description)
|
| 157 |
{
|
| 158 |
+
$privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
|
| 159 |
+
$apiUrl = Mage::helper('paymill')->getApiUrl();
|
| 160 |
+
|
| 161 |
+
if (empty($privateKey)) {
|
| 162 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 163 |
Mage::throwException("No private Key was set.");
|
| 164 |
}
|
| 165 |
+
|
| 166 |
+
$clientsObject = new Services_Paymill_Clients($privateKey, $apiUrl);
|
| 167 |
|
| 168 |
$client = $clientsObject->create(
|
| 169 |
array(
|
| 191 |
*/
|
| 192 |
public function createPayment($token, $clientId)
|
| 193 |
{
|
| 194 |
+
$privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
|
| 195 |
+
$apiUrl = Mage::helper('paymill')->getApiUrl();
|
| 196 |
+
|
| 197 |
+
if (empty($privateKey)) {
|
| 198 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 199 |
Mage::throwException("No private Key was set.");
|
| 200 |
}
|
| 201 |
+
|
| 202 |
+
$paymentsObject = new Services_Paymill_Payments($privateKey, $apiUrl);
|
| 203 |
+
|
| 204 |
$payment = $paymentsObject->create(
|
| 205 |
+
array(
|
| 206 |
+
'token' => $token,
|
| 207 |
+
'client' => $clientId
|
| 208 |
+
)
|
| 209 |
+
);
|
| 210 |
|
| 211 |
if (isset($payment['data']['response_code']) && $payment['data']['response_code'] !== 20000) {
|
| 212 |
$this->_log("An Error occured: " . $payment['data']['response_code'], var_export($payment, true));
|
| 226 |
*/
|
| 227 |
public function createPreAuthorization($paymentId)
|
| 228 |
{
|
| 229 |
+
$privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
|
| 230 |
+
$apiUrl = Mage::helper('paymill')->getApiUrl();
|
| 231 |
+
|
| 232 |
+
if (empty($privateKey)) {
|
| 233 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 234 |
Mage::throwException("No private Key was set.");
|
| 235 |
}
|
|
|
|
|
|
|
| 236 |
|
| 237 |
+
$preAuthObject = new Services_Paymill_Preauthorizations($privateKey, $apiUrl);
|
| 238 |
+
|
| 239 |
+
$amount = (int) $this->getAmount();
|
| 240 |
+
$currency = $this->getCurrency();
|
| 241 |
|
| 242 |
+
$params = array('payment' => $paymentId, 'source' => Mage::helper('paymill')->getSourceString(), 'amount' => $amount, 'currency' => $currency);
|
| 243 |
+
$preAuth = $preAuthObject->create($params);
|
| 244 |
|
| 245 |
Mage::helper('paymill/loggingHelper')->log("PreAuthorization created from Payment", $preAuth['preauthorization']['id'], print_r($params, true));
|
| 246 |
|
| 247 |
return $preAuth['preauthorization'];
|
|
|
|
|
|
|
| 248 |
}
|
| 249 |
|
| 250 |
/**
|
| 256 |
*/
|
| 257 |
public function createTransactionFromPreAuth($order, $preAuthorizationId, $amount)
|
| 258 |
{
|
| 259 |
+
$privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
|
| 260 |
+
$apiUrl = Mage::helper('paymill')->getApiUrl();
|
| 261 |
+
if (empty($privateKey)) {
|
| 262 |
Mage::helper('paymill/loggingHelper')->log("No private Key was set.");
|
| 263 |
Mage::throwException("No private Key was set.");
|
| 264 |
}
|
| 265 |
+
|
| 266 |
+
$transactionsObject = new Services_Paymill_Transactions($privateKey, $apiUrl);
|
| 267 |
+
$params = array(
|
| 268 |
+
'amount' => (int) ($amount * 100),
|
| 269 |
+
'currency' => $this->getCurrency(),
|
| 270 |
+
'description' => $this->getDescription($order),
|
| 271 |
+
'source' => Mage::helper('paymill')->getSourceString(),
|
| 272 |
+
'preauthorization' => $preAuthorizationId
|
| 273 |
+
);
|
| 274 |
+
|
| 275 |
+
$transaction = $transactionsObject->create($params);
|
| 276 |
+
Mage::helper('paymill/loggingHelper')->log("Creating Transaction from PreAuthorization", print_r($params, true), var_export($transaction, true));
|
| 277 |
|
| 278 |
return $transaction;
|
| 279 |
}
|
| 280 |
+
|
| 281 |
}
|
app/code/community/Paymill/Paymill/Helper/RefundHelper.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -17,11 +18,13 @@
|
|
| 17 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
|
|
|
| 20 |
/**
|
| 21 |
* The Refund Helper contains methods dealing with refund processes.
|
| 22 |
*/
|
| 23 |
class Paymill_Paymill_Helper_RefundHelper extends Mage_Core_Helper_Abstract
|
| 24 |
{
|
|
|
|
| 25 |
/**
|
| 26 |
* Validates the result of the refund
|
| 27 |
* @param mixed $refund
|
|
@@ -34,7 +37,7 @@ class Paymill_Paymill_Helper_RefundHelper extends Mage_Core_Helper_Abstract
|
|
| 34 |
Mage::helper('paymill/loggingHelper')->log("An Error occured: " . $refund['data']['response_code'], var_export($refund, true));
|
| 35 |
return false;
|
| 36 |
}
|
| 37 |
-
|
| 38 |
//Logs feedback in case of an unset id
|
| 39 |
if (!isset($refund['id']) && !isset($refund['data']['id'])) {
|
| 40 |
Mage::helper('paymill/loggingHelper')->log("No Refund created.", var_export($refund, true));
|
|
@@ -42,41 +45,42 @@ class Paymill_Paymill_Helper_RefundHelper extends Mage_Core_Helper_Abstract
|
|
| 42 |
} else { //Logs success feedback for debugging purposes
|
| 43 |
Mage::helper('paymill/loggingHelper')->log("Refund created.", $refund['id'], var_export($refund, true));
|
| 44 |
}
|
| 45 |
-
|
| 46 |
return true;
|
| 47 |
}
|
| 48 |
-
|
| 49 |
/**
|
| 50 |
* Creates a refund from the ordernumber passed as an argument
|
| 51 |
* @param Mage_Sales_Model_Order $order
|
| 52 |
* @return boolean Indicator of success
|
| 53 |
*/
|
| 54 |
public function createRefund($order, $amount)
|
| 55 |
-
{
|
| 56 |
//Gather Data
|
| 57 |
-
try{
|
| 58 |
-
$privateKey
|
| 59 |
-
$apiUrl
|
| 60 |
-
$refundsObject
|
| 61 |
-
$transactionId
|
| 62 |
-
} catch (Exception $ex){
|
| 63 |
Mage::helper('paymill/loggingHelper')->log("No Refund created due to illegal parameters.", $ex->getMessage());
|
| 64 |
return false;
|
| 65 |
}
|
| 66 |
-
|
| 67 |
//Create Refund
|
| 68 |
$params = array(
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
try{
|
| 74 |
-
|
| 75 |
-
} catch (Exception $ex){
|
| 76 |
Mage::helper('paymill/loggingHelper')->log("No Refund created.", $ex->getMessage(), var_export($params, true));
|
| 77 |
return false;
|
| 78 |
}
|
| 79 |
//Validate Refund and return feedback
|
| 80 |
return $this->validateRefund($refund);
|
| 81 |
}
|
|
|
|
| 82 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 18 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
*/
|
| 21 |
+
|
| 22 |
/**
|
| 23 |
* The Refund Helper contains methods dealing with refund processes.
|
| 24 |
*/
|
| 25 |
class Paymill_Paymill_Helper_RefundHelper extends Mage_Core_Helper_Abstract
|
| 26 |
{
|
| 27 |
+
|
| 28 |
/**
|
| 29 |
* Validates the result of the refund
|
| 30 |
* @param mixed $refund
|
| 37 |
Mage::helper('paymill/loggingHelper')->log("An Error occured: " . $refund['data']['response_code'], var_export($refund, true));
|
| 38 |
return false;
|
| 39 |
}
|
| 40 |
+
|
| 41 |
//Logs feedback in case of an unset id
|
| 42 |
if (!isset($refund['id']) && !isset($refund['data']['id'])) {
|
| 43 |
Mage::helper('paymill/loggingHelper')->log("No Refund created.", var_export($refund, true));
|
| 45 |
} else { //Logs success feedback for debugging purposes
|
| 46 |
Mage::helper('paymill/loggingHelper')->log("Refund created.", $refund['id'], var_export($refund, true));
|
| 47 |
}
|
| 48 |
+
|
| 49 |
return true;
|
| 50 |
}
|
| 51 |
+
|
| 52 |
/**
|
| 53 |
* Creates a refund from the ordernumber passed as an argument
|
| 54 |
* @param Mage_Sales_Model_Order $order
|
| 55 |
* @return boolean Indicator of success
|
| 56 |
*/
|
| 57 |
public function createRefund($order, $amount)
|
| 58 |
+
{
|
| 59 |
//Gather Data
|
| 60 |
+
try {
|
| 61 |
+
$privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
|
| 62 |
+
$apiUrl = Mage::helper('paymill')->getApiUrl();
|
| 63 |
+
$refundsObject = new Services_Paymill_Refunds($privateKey, $apiUrl);
|
| 64 |
+
$transactionId = Mage::helper('paymill/transactionHelper')->getTransactionId($order);
|
| 65 |
+
} catch (Exception $ex) {
|
| 66 |
Mage::helper('paymill/loggingHelper')->log("No Refund created due to illegal parameters.", $ex->getMessage());
|
| 67 |
return false;
|
| 68 |
}
|
| 69 |
+
|
| 70 |
//Create Refund
|
| 71 |
$params = array(
|
| 72 |
+
'transactionId' => $transactionId,
|
| 73 |
+
'source' => Mage::helper('paymill')->getSourceString(),
|
| 74 |
+
'params' => array('amount' => $amount)
|
| 75 |
+
);
|
| 76 |
+
try {
|
| 77 |
+
$refund = $refundsObject->create($params);
|
| 78 |
+
} catch (Exception $ex) {
|
| 79 |
Mage::helper('paymill/loggingHelper')->log("No Refund created.", $ex->getMessage(), var_export($params, true));
|
| 80 |
return false;
|
| 81 |
}
|
| 82 |
//Validate Refund and return feedback
|
| 83 |
return $this->validateRefund($refund);
|
| 84 |
}
|
| 85 |
+
|
| 86 |
}
|
app/code/community/Paymill/Paymill/Helper/TransactionHelper.php
CHANGED
|
@@ -1,95 +1,97 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
*
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
$
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
*
|
| 43 |
-
* @
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
*
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
*
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
*
|
| 85 |
-
* @
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
$transactionModel
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
|
|
|
|
|
|
| 95 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* The Transaction Helper contains methods dealing saving and loading additional transaction data into and from order objects.
|
| 24 |
+
*/
|
| 25 |
+
class Paymill_Paymill_Helper_TransactionHelper extends Mage_Core_Helper_Abstract
|
| 26 |
+
{
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Reads the additional data string from the argumented order object and returns it as an instance of Paymill_Paymill_Model_Transaction
|
| 30 |
+
* @param Mage_Sales_Model_Order_Payment $object
|
| 31 |
+
* @return Paymill_Paymill_Model_TransactionData Transaction Model
|
| 32 |
+
*/
|
| 33 |
+
public function getAdditionalInformation(Mage_Sales_Model_Order_Payment $object)
|
| 34 |
+
{
|
| 35 |
+
$transactionId = $object->getAdditionalInformation('paymillTransactionId');
|
| 36 |
+
$preAuthflag = $object->getAdditionalInformation('paymillPreAuthFlag');
|
| 37 |
+
$model = $this->createTransactionModel($transactionId, $preAuthflag);
|
| 38 |
+
return $model;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* Sets the additional Data string of the argumented object to the valueS of the argumented instance of the Paymill_Paymill_Model_Transaction
|
| 43 |
+
* @param Mage_Sales_Model_Order_Payment $object
|
| 44 |
+
* @param Paymill_Paymill_Model_Transaction $transactionModel Instance of the Transaction Model class
|
| 45 |
+
* @return boolean Indicator of success
|
| 46 |
+
*/
|
| 47 |
+
public function setAdditionalInformation(Mage_Sales_Model_Order_Payment $object, Paymill_Paymill_Model_TransactionData $transactionModel)
|
| 48 |
+
{
|
| 49 |
+
$object->setAdditionalInformation('paymillTransactionId', $transactionModel->getTransactionId());
|
| 50 |
+
$object->setAdditionalInformation('paymillPreAuthFlag', $transactionModel->getPreAuthorizationFlag());
|
| 51 |
+
Mage::helper('paymill/loggingHelper')->log("Saved Transaction Data.", "Order " . $object->getIncrementId() .
|
| 52 |
+
$object->getReservedOrderId(), var_export($object->getAdditionalInformation(), true));
|
| 53 |
+
|
| 54 |
+
return true;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
* Returns the state of the isPreAuthorization Flag as a boolean
|
| 59 |
+
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
|
| 60 |
+
* @return booelean PreAuthorizationFlag
|
| 61 |
+
*/
|
| 62 |
+
public function getPreAuthenticatedFlagState($object)
|
| 63 |
+
{
|
| 64 |
+
$payment = $object->getPayment();
|
| 65 |
+
$transactionObject = $this->getAdditionalInformation($payment);
|
| 66 |
+
Mage::helper('paymill/loggingHelper')->log("Read Model from object to return Flag.", var_export($transactionObject, true));
|
| 67 |
+
return $transactionObject->getPreAuthorizationFlag();
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* Returns the transactionId as a string
|
| 72 |
+
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
|
| 73 |
+
* @return String transactionId
|
| 74 |
+
*/
|
| 75 |
+
public function getTransactionId($object)
|
| 76 |
+
{
|
| 77 |
+
$payment = $object->getPayment();
|
| 78 |
+
$transactionObject = $this->getAdditionalInformation($payment);
|
| 79 |
+
Mage::helper('paymill/loggingHelper')->log("Read Model from object to return Transaction Id.", var_export($transactionObject, true));
|
| 80 |
+
return $transactionObject->getTransactionId();
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Creates a Transaction Model from the given Data
|
| 85 |
+
* @param String $transactionId
|
| 86 |
+
* @param Boolean $isPreAuthenticated
|
| 87 |
+
* @return Paymill_Paymill_Model_TransactionData Model with the desired attributes
|
| 88 |
+
*/
|
| 89 |
+
public function createTransactionModel($transactionId, $isPreAuthenticated = false)
|
| 90 |
+
{
|
| 91 |
+
$transactionModel = new Paymill_Paymill_Model_TransactionData();
|
| 92 |
+
$transactionModel->setTransactionId($transactionId);
|
| 93 |
+
$transactionModel->setPreAuthorizationFlag($isPreAuthenticated);
|
| 94 |
+
return $transactionModel;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
}
|
app/code/community/Paymill/Paymill/Model/Fastcheckout.php
CHANGED
|
@@ -1,136 +1,137 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
/**
|
| 34 |
-
* Returns the paymentId matched with the userId passed as an argument.
|
| 35 |
-
* If no match is found, the return value will be null.
|
| 36 |
-
* @param String $userId Unique identifier of the customer
|
| 37 |
-
* @param String $code PaymentMethodCode
|
| 38 |
-
* @return String paymentId matched with the userId <b>can be null if no match is found</b>
|
| 39 |
-
*/
|
| 40 |
-
public function getPaymentId($userId, $code)
|
| 41 |
-
{
|
| 42 |
-
$collection = Mage::getModel('paymill/fastcheckout')->getCollection();
|
| 43 |
-
$collection->addFilter('user_id', $userId);
|
| 44 |
-
$obj = $collection->getFirstItem();
|
| 45 |
-
if($code === "paymill_creditcard"){
|
| 46 |
-
return $obj->getCcPaymentId();
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
if($code === "paymill_directdebit"){
|
| 50 |
-
return $obj->getElvPaymentId();
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
*
|
| 57 |
-
*
|
| 58 |
-
* @param String $
|
| 59 |
-
* @param String $
|
| 60 |
-
* @
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
$
|
| 66 |
-
$collection
|
| 67 |
-
$collection->
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
*
|
| 113 |
-
* @param String $
|
| 114 |
-
* @
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
$collection = Mage::getModel('paymill/fastcheckout')->getCollection();
|
| 119 |
-
$collection->addFilter('user_id', $userId);
|
| 120 |
-
|
| 121 |
-
if($code === "paymill_creditcard"){
|
| 122 |
-
$obj = $collection->getFirstItem();
|
| 123 |
-
if($obj->getCcPaymentId() != null){
|
| 124 |
-
return true;
|
| 125 |
-
}
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
-
if($code === "paymill_directdebit"){
|
| 129 |
-
$obj = $collection->getFirstItem();
|
| 130 |
-
if($obj->getElvPaymentId() != null){
|
| 131 |
-
return true;
|
| 132 |
-
}
|
| 133 |
-
}
|
| 134 |
-
return false;
|
| 135 |
-
}
|
|
|
|
| 136 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Model_Fastcheckout extends Mage_Core_Model_Abstract
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Construct
|
| 26 |
+
*/
|
| 27 |
+
function _construct()
|
| 28 |
+
{
|
| 29 |
+
parent::_construct();
|
| 30 |
+
$this->_init('paymill/fastcheckout');
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Returns the paymentId matched with the userId passed as an argument.
|
| 35 |
+
* If no match is found, the return value will be null.
|
| 36 |
+
* @param String $userId Unique identifier of the customer
|
| 37 |
+
* @param String $code PaymentMethodCode
|
| 38 |
+
* @return String paymentId matched with the userId <b>can be null if no match is found</b>
|
| 39 |
+
*/
|
| 40 |
+
public function getPaymentId($userId, $code)
|
| 41 |
+
{
|
| 42 |
+
$collection = Mage::getModel('paymill/fastcheckout')->getCollection();
|
| 43 |
+
$collection->addFilter('user_id', $userId);
|
| 44 |
+
$obj = $collection->getFirstItem();
|
| 45 |
+
if ($code === "paymill_creditcard") {
|
| 46 |
+
return $obj->getCcPaymentId();
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
if ($code === "paymill_directdebit") {
|
| 50 |
+
return $obj->getElvPaymentId();
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Saves a set of arguments (paymentMethodCode, clientId and paymentId) as a match to the Id of the current user.
|
| 56 |
+
* The paymentMethodCode is used to bind the Data to the correct payment type.
|
| 57 |
+
* @param String $paymentMethodCode $_code from the payment model
|
| 58 |
+
* @param String $clientId Code returned from the PaymentProcessor used to recreate the current client object
|
| 59 |
+
* @param String $paymentId Code returned from the PaymentProcessor used to recreate the current payment object
|
| 60 |
+
* @return boolean Indicator of Success
|
| 61 |
+
*/
|
| 62 |
+
public function saveFcData($paymentMethodCode, $userId, $clientId, $paymentId)
|
| 63 |
+
{
|
| 64 |
+
$logger = Mage::helper("paymill/loggingHelper");
|
| 65 |
+
$collection = Mage::getModel('paymill/fastcheckout')->getCollection();
|
| 66 |
+
$collection->addFilter('user_id', $userId);
|
| 67 |
+
$customerExists = $collection->count();
|
| 68 |
+
|
| 69 |
+
if ($customerExists == 1) {
|
| 70 |
+
$obj = $collection->getFirstItem();
|
| 71 |
+
|
| 72 |
+
if ($paymentMethodCode === 'paymill_creditcard') {
|
| 73 |
+
$logger->log("Saving Fast Checkout Data", "Customer data already exists. Saving CC only Data.");
|
| 74 |
+
$obj->setCcPaymentId($paymentId)
|
| 75 |
+
->save();
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
if ($paymentMethodCode === 'paymill_directdebit') {
|
| 79 |
+
$logger->log("Saving Fast Checkout Data", "Customer data already exists. Saving ELV only Data.");
|
| 80 |
+
$obj->setElvPaymentId($paymentId)
|
| 81 |
+
->save();
|
| 82 |
+
}
|
| 83 |
+
return true;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
//Insert into db
|
| 87 |
+
if ($paymentMethodCode === 'paymill_creditcard') {
|
| 88 |
+
$logger->log("Saving Fast Checkout Data", "Customer data saved with CC data");
|
| 89 |
+
$this->setId(null)
|
| 90 |
+
->setUserId($userId)
|
| 91 |
+
->setClientId($clientId)
|
| 92 |
+
->setCcPaymentId($paymentId)
|
| 93 |
+
->save();
|
| 94 |
+
return true;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
if ($paymentMethodCode === 'paymill_directdebit') {
|
| 98 |
+
$logger->log("Saving Fast Checkout Data", "Customer data saved with ELV data");
|
| 99 |
+
$this->setId(null)
|
| 100 |
+
->setUserId($userId)
|
| 101 |
+
->setClientId($clientId)
|
| 102 |
+
->setElvPaymentId($paymentId)
|
| 103 |
+
->save();
|
| 104 |
+
return true;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
return false;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/**
|
| 111 |
+
* Returns a boolean describing if there is FC Data registered for the given userId
|
| 112 |
+
* @param String $userId
|
| 113 |
+
* @param String $code PaymentMethodCode
|
| 114 |
+
* @return boolean
|
| 115 |
+
*/
|
| 116 |
+
public function hasFcData($userId, $code)
|
| 117 |
+
{
|
| 118 |
+
$collection = Mage::getModel('paymill/fastcheckout')->getCollection();
|
| 119 |
+
$collection->addFilter('user_id', $userId);
|
| 120 |
+
|
| 121 |
+
if ($code === "paymill_creditcard") {
|
| 122 |
+
$obj = $collection->getFirstItem();
|
| 123 |
+
if ($obj->getCcPaymentId() != null) {
|
| 124 |
+
return true;
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
if ($code === "paymill_directdebit") {
|
| 129 |
+
$obj = $collection->getFirstItem();
|
| 130 |
+
if ($obj->getElvPaymentId() != null) {
|
| 131 |
+
return true;
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
return false;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
}
|
app/code/community/Paymill/Paymill/Model/Log.php
CHANGED
|
@@ -1,51 +1,52 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
*
|
| 35 |
-
* @param String $
|
| 36 |
-
* @param String $
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
->
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
| 51 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Model_Log extends Mage_Core_Model_Abstract
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Construct
|
| 26 |
+
*/
|
| 27 |
+
function _construct()
|
| 28 |
+
{
|
| 29 |
+
parent::_construct();
|
| 30 |
+
$this->_init('paymill/log');
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Inserts the arguments into the db log
|
| 35 |
+
* @param String $merchantInfo
|
| 36 |
+
* @param String $devInfo
|
| 37 |
+
* @param String $devInfoAdditional
|
| 38 |
+
*/
|
| 39 |
+
public function log($merchantInfo, $devInfo, $devInfoAdditional = null)
|
| 40 |
+
{
|
| 41 |
+
if (Mage::helper("paymill/optionHelper")->isLogging()) {
|
| 42 |
+
$this->setId(null)
|
| 43 |
+
->setEntryDate(null)
|
| 44 |
+
->setVersion(Mage::helper("paymill")->getVersion())
|
| 45 |
+
->setMerchantInfo($merchantInfo)
|
| 46 |
+
->setDevInfo($devInfo)
|
| 47 |
+
->setDevInfoAdditional($devInfoAdditional)
|
| 48 |
+
->save();
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
}
|
app/code/community/Paymill/Paymill/Model/Method/MethodModelAbstract.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -46,7 +47,7 @@ abstract class Paymill_Paymill_Model_Method_MethodModelAbstract extends Mage_Pay
|
|
| 46 |
*
|
| 47 |
* @var boolean
|
| 48 |
*/
|
| 49 |
-
protected $_canRefundInvoicePartial
|
| 50 |
|
| 51 |
/**
|
| 52 |
* Can use the Capture method
|
|
@@ -107,7 +108,7 @@ abstract class Paymill_Paymill_Model_Method_MethodModelAbstract extends Mage_Pay
|
|
| 107 |
}
|
| 108 |
return true;
|
| 109 |
}
|
| 110 |
-
|
| 111 |
/**
|
| 112 |
* Return Quote or Order Object depending on the type of the payment info
|
| 113 |
*
|
|
@@ -165,15 +166,15 @@ abstract class Paymill_Paymill_Model_Method_MethodModelAbstract extends Mage_Pay
|
|
| 165 |
public function authorize(Varien_Object $payment, $amount)
|
| 166 |
{
|
| 167 |
$success = false;
|
| 168 |
-
if(Mage::helper('paymill/optionHelper')->isPreAuthorizing() && $this->_code === "paymill_creditcard"){
|
| 169 |
Mage::helper('paymill/loggingHelper')->log("Starting payment process as preAuth");
|
| 170 |
$success = $this->preAuth($payment, $amount);
|
| 171 |
-
} else{
|
| 172 |
Mage::helper('paymill/loggingHelper')->log("Starting payment process as debit");
|
| 173 |
$success = $this->debit($payment, $amount);
|
| 174 |
}
|
| 175 |
|
| 176 |
-
if(!$success){
|
| 177 |
Mage::helper('paymill/loggingHelper')->log("There was an error processing the payment.");
|
| 178 |
Mage::getSingleton('checkout/session')->setGotoSection('payment');
|
| 179 |
Mage::throwException("There was an error processing your payment.");
|
|
@@ -196,14 +197,15 @@ abstract class Paymill_Paymill_Model_Method_MethodModelAbstract extends Mage_Pay
|
|
| 196 |
$paymentHelper = Mage::helper("paymill/paymentHelper");
|
| 197 |
$fcHelper = Mage::helper("paymill/fastCheckoutHelper");
|
| 198 |
$paymentProcessor = $paymentHelper->createPaymentProcessor($this->getCode(), $token);
|
|
|
|
| 199 |
|
| 200 |
//Loading Fast Checkout Data (if enabled and given)
|
| 201 |
-
if($fcHelper->isFastCheckoutEnabled()){
|
| 202 |
$clientId = $fcHelper->getClientId();
|
| 203 |
-
if(isset($clientId)){
|
| 204 |
$paymentProcessor->setClientId($clientId);
|
| 205 |
$paymentId = $fcHelper->getPaymentId($this->_code);
|
| 206 |
-
if(isset($paymentId)){
|
| 207 |
$paymentProcessor->setPaymentId($paymentId);
|
| 208 |
}
|
| 209 |
}
|
|
@@ -211,27 +213,27 @@ abstract class Paymill_Paymill_Model_Method_MethodModelAbstract extends Mage_Pay
|
|
| 211 |
|
| 212 |
//Process Payment
|
| 213 |
$success = $paymentProcessor->processPayment();
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
If($success){
|
| 217 |
//Save Transaction Data
|
| 218 |
$transactionHelper = Mage::helper("paymill/transactionHelper");
|
| 219 |
$transactionModel = $transactionHelper->createTransactionModel($paymentProcessor->getTransactionId(), false);
|
| 220 |
$transactionHelper->setAdditionalInformation($payment, $transactionModel);
|
| 221 |
|
| 222 |
//Save Data for Fast Checkout (if enabled)
|
| 223 |
-
if($fcHelper->isFastCheckoutEnabled()){ //Fast checkout enabled
|
| 224 |
-
if(!$fcHelper->hasData($this->_code)){
|
| 225 |
$clientId = $paymentProcessor->getClientId();
|
| 226 |
$paymentId = $paymentProcessor->getPaymentId();
|
| 227 |
$fcHelper->saveData($this->_code, $clientId, $paymentId);
|
| 228 |
}
|
| 229 |
}
|
| 230 |
-
|
| 231 |
return true;
|
| 232 |
}
|
| 233 |
-
|
| 234 |
return false;
|
| 235 |
-
|
| 236 |
}
|
|
|
|
| 237 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 47 |
*
|
| 48 |
* @var boolean
|
| 49 |
*/
|
| 50 |
+
protected $_canRefundInvoicePartial = true;
|
| 51 |
|
| 52 |
/**
|
| 53 |
* Can use the Capture method
|
| 108 |
}
|
| 109 |
return true;
|
| 110 |
}
|
| 111 |
+
|
| 112 |
/**
|
| 113 |
* Return Quote or Order Object depending on the type of the payment info
|
| 114 |
*
|
| 166 |
public function authorize(Varien_Object $payment, $amount)
|
| 167 |
{
|
| 168 |
$success = false;
|
| 169 |
+
if (Mage::helper('paymill/optionHelper')->isPreAuthorizing() && $this->_code === "paymill_creditcard") {
|
| 170 |
Mage::helper('paymill/loggingHelper')->log("Starting payment process as preAuth");
|
| 171 |
$success = $this->preAuth($payment, $amount);
|
| 172 |
+
} else {
|
| 173 |
Mage::helper('paymill/loggingHelper')->log("Starting payment process as debit");
|
| 174 |
$success = $this->debit($payment, $amount);
|
| 175 |
}
|
| 176 |
|
| 177 |
+
if (!$success) {
|
| 178 |
Mage::helper('paymill/loggingHelper')->log("There was an error processing the payment.");
|
| 179 |
Mage::getSingleton('checkout/session')->setGotoSection('payment');
|
| 180 |
Mage::throwException("There was an error processing your payment.");
|
| 197 |
$paymentHelper = Mage::helper("paymill/paymentHelper");
|
| 198 |
$fcHelper = Mage::helper("paymill/fastCheckoutHelper");
|
| 199 |
$paymentProcessor = $paymentHelper->createPaymentProcessor($this->getCode(), $token);
|
| 200 |
+
$paymentProcessor->setPreAuthAmount(Mage::getSingleton('core/session')->getPreAuthAmount());
|
| 201 |
|
| 202 |
//Loading Fast Checkout Data (if enabled and given)
|
| 203 |
+
if ($fcHelper->isFastCheckoutEnabled()) {
|
| 204 |
$clientId = $fcHelper->getClientId();
|
| 205 |
+
if (isset($clientId)) {
|
| 206 |
$paymentProcessor->setClientId($clientId);
|
| 207 |
$paymentId = $fcHelper->getPaymentId($this->_code);
|
| 208 |
+
if (isset($paymentId)) {
|
| 209 |
$paymentProcessor->setPaymentId($paymentId);
|
| 210 |
}
|
| 211 |
}
|
| 213 |
|
| 214 |
//Process Payment
|
| 215 |
$success = $paymentProcessor->processPayment();
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
If ($success) {
|
| 219 |
//Save Transaction Data
|
| 220 |
$transactionHelper = Mage::helper("paymill/transactionHelper");
|
| 221 |
$transactionModel = $transactionHelper->createTransactionModel($paymentProcessor->getTransactionId(), false);
|
| 222 |
$transactionHelper->setAdditionalInformation($payment, $transactionModel);
|
| 223 |
|
| 224 |
//Save Data for Fast Checkout (if enabled)
|
| 225 |
+
if ($fcHelper->isFastCheckoutEnabled()) { //Fast checkout enabled
|
| 226 |
+
if (!$fcHelper->hasData($this->_code)) {
|
| 227 |
$clientId = $paymentProcessor->getClientId();
|
| 228 |
$paymentId = $paymentProcessor->getPaymentId();
|
| 229 |
$fcHelper->saveData($this->_code, $clientId, $paymentId);
|
| 230 |
}
|
| 231 |
}
|
| 232 |
+
|
| 233 |
return true;
|
| 234 |
}
|
| 235 |
+
|
| 236 |
return false;
|
|
|
|
| 237 |
}
|
| 238 |
+
|
| 239 |
}
|
app/code/community/Paymill/Paymill/Model/Method/MethodModelCreditcard.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -19,12 +20,13 @@
|
|
| 19 |
*/
|
| 20 |
class Paymill_Paymill_Model_Method_MethodModelCreditcard extends Paymill_Paymill_Model_Method_MethodModelAbstract
|
| 21 |
{
|
|
|
|
| 22 |
/**
|
| 23 |
* Magento method code
|
| 24 |
*
|
| 25 |
* @var string
|
| 26 |
*/
|
| 27 |
-
protected $_code
|
| 28 |
|
| 29 |
/**
|
| 30 |
* Form block identifier
|
|
@@ -45,75 +47,49 @@ class Paymill_Paymill_Model_Method_MethodModelCreditcard extends Paymill_Paymill
|
|
| 45 |
*/
|
| 46 |
public function preAuth(Varien_Object $payment, $amount)
|
| 47 |
{
|
| 48 |
-
//
|
| 49 |
-
$
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
$paymentHelper
|
| 53 |
-
$
|
| 54 |
-
$
|
| 55 |
-
|
| 56 |
-
//Gathering data
|
| 57 |
-
$token = Mage::getSingleton('core/session')->getToken();
|
| 58 |
-
$email = $customerHelper->getCustomerEmail($quote);
|
| 59 |
-
$description = $paymentHelper->getDescription($quote);
|
| 60 |
|
| 61 |
//Loading Fast Checkout Data (if enabled and given)
|
| 62 |
-
if($fcHelper->isFastCheckoutEnabled()){
|
| 63 |
$clientId = $fcHelper->getClientId();
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
$paymill_flag_client_set = true;
|
| 67 |
$paymentId = $fcHelper->getPaymentId($this->_code);
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
$paymill_flag_payment_set = true;
|
| 71 |
}
|
| 72 |
}
|
| 73 |
}
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
$clientId = $paymentHelper->createClient($email, $description);
|
| 78 |
-
} catch (Exception $ex){
|
| 79 |
-
Mage::helper('paymill/loggingHelper')->log("There was an error creating the client.", $ex->getMessage());
|
| 80 |
-
return false;
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
}
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
return false;
|
| 91 |
-
}
|
| 92 |
-
}
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
|
|
|
| 100 |
}
|
| 101 |
|
| 102 |
-
|
| 103 |
-
$transactionHelper = Mage::helper("paymill/transactionHelper");
|
| 104 |
-
$transactionModel = $transactionHelper->createTransactionModel($transaction['id'], true);
|
| 105 |
-
$transactionHelper->setAdditionalInformation($payment, $transactionModel);
|
| 106 |
-
|
| 107 |
-
//Save Data for Fast Checkout (if enabled)
|
| 108 |
-
if($fcHelper->isFastCheckoutEnabled()){ //Fast checkout enabled
|
| 109 |
-
if(!$fcHelper->hasData($this->_code)){
|
| 110 |
-
$clientId = $clientId;
|
| 111 |
-
$paymentId = $paymentId;
|
| 112 |
-
$fcHelper->saveData($this->_code, $clientId, $paymentId);
|
| 113 |
-
}
|
| 114 |
}
|
| 115 |
-
|
| 116 |
-
return
|
| 117 |
}
|
| 118 |
|
| 119 |
/**
|
|
@@ -122,25 +98,33 @@ class Paymill_Paymill_Model_Method_MethodModelCreditcard extends Paymill_Paymill
|
|
| 122 |
public function capture(Varien_Object $payment, $amount)
|
| 123 |
{
|
| 124 |
//Initalizing variables and helpers
|
| 125 |
-
$
|
| 126 |
-
$
|
| 127 |
-
$order = $payment->getOrder();
|
| 128 |
|
| 129 |
-
if($transactionHelper->getPreAuthenticatedFlagState($order)){
|
| 130 |
//Capture preAuth
|
| 131 |
$preAuthorization = $transactionHelper->getTransactionId($order);
|
| 132 |
-
$
|
|
|
|
|
|
|
| 133 |
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
Mage::helper('paymill
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
//Save Transaction Data
|
| 141 |
-
$transactionId = $
|
| 142 |
$transactionModel = $transactionHelper->createTransactionModel($transactionId, true);
|
| 143 |
$transactionHelper->setAdditionalInformation($payment, $transactionModel);
|
| 144 |
}
|
| 145 |
}
|
|
|
|
| 146 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 20 |
*/
|
| 21 |
class Paymill_Paymill_Model_Method_MethodModelCreditcard extends Paymill_Paymill_Model_Method_MethodModelAbstract
|
| 22 |
{
|
| 23 |
+
|
| 24 |
/**
|
| 25 |
* Magento method code
|
| 26 |
*
|
| 27 |
* @var string
|
| 28 |
*/
|
| 29 |
+
protected $_code = "paymill_creditcard";
|
| 30 |
|
| 31 |
/**
|
| 32 |
* Form block identifier
|
| 47 |
*/
|
| 48 |
public function preAuth(Varien_Object $payment, $amount)
|
| 49 |
{
|
| 50 |
+
//Gathering data from session
|
| 51 |
+
$token = Mage::getSingleton('core/session')->getToken();
|
| 52 |
+
|
| 53 |
+
//Create Payment Processor
|
| 54 |
+
$paymentHelper = Mage::helper("paymill/paymentHelper");
|
| 55 |
+
$fcHelper = Mage::helper("paymill/fastCheckoutHelper");
|
| 56 |
+
$paymentProcessor = $paymentHelper->createPaymentProcessor($this->getCode(), $token);
|
| 57 |
+
$paymentProcessor->setPreAuthAmount(Mage::getSingleton('core/session')->getPreAuthAmount());
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
//Loading Fast Checkout Data (if enabled and given)
|
| 60 |
+
if ($fcHelper->isFastCheckoutEnabled()) {
|
| 61 |
$clientId = $fcHelper->getClientId();
|
| 62 |
+
if (isset($clientId)) {
|
| 63 |
+
$paymentProcessor->setClientId($clientId);
|
|
|
|
| 64 |
$paymentId = $fcHelper->getPaymentId($this->_code);
|
| 65 |
+
if (isset($paymentId)) {
|
| 66 |
+
$paymentProcessor->setPaymentId($paymentId);
|
|
|
|
| 67 |
}
|
| 68 |
}
|
| 69 |
}
|
| 70 |
|
| 71 |
+
//Process Payment
|
| 72 |
+
$success = $paymentProcessor->processPayment(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
+
If ($success) {
|
| 75 |
+
//Save Transaction Data
|
| 76 |
+
$transactionHelper = Mage::helper("paymill/transactionHelper");
|
| 77 |
+
$transactionModel = $transactionHelper->createTransactionModel($paymentProcessor->getPreauthId(), true);
|
| 78 |
+
$transactionHelper->setAdditionalInformation($payment, $transactionModel);
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
+
//Save Data for Fast Checkout (if enabled)
|
| 81 |
+
if ($fcHelper->isFastCheckoutEnabled()) { //Fast checkout enabled
|
| 82 |
+
if (!$fcHelper->hasData($this->_code)) {
|
| 83 |
+
$clientId = $paymentProcessor->getClientId();
|
| 84 |
+
$paymentId = $paymentProcessor->getPaymentId();
|
| 85 |
+
$fcHelper->saveData($this->_code, $clientId, $paymentId);
|
| 86 |
+
}
|
| 87 |
}
|
| 88 |
|
| 89 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
}
|
| 91 |
+
|
| 92 |
+
return false;
|
| 93 |
}
|
| 94 |
|
| 95 |
/**
|
| 98 |
public function capture(Varien_Object $payment, $amount)
|
| 99 |
{
|
| 100 |
//Initalizing variables and helpers
|
| 101 |
+
$transactionHelper = Mage::helper("paymill/transactionHelper");
|
| 102 |
+
$order = $payment->getOrder();
|
|
|
|
| 103 |
|
| 104 |
+
if ($transactionHelper->getPreAuthenticatedFlagState($order)) {
|
| 105 |
//Capture preAuth
|
| 106 |
$preAuthorization = $transactionHelper->getTransactionId($order);
|
| 107 |
+
$privateKey = Mage::helper('paymill/optionHelper')->getPrivateKey();
|
| 108 |
+
$apiUrl = Mage::helper('paymill')->getApiUrl();
|
| 109 |
+
$libBase = null;
|
| 110 |
|
| 111 |
+
$params = array();
|
| 112 |
+
$params['amount'] = (int) (string) ($amount * 100);
|
| 113 |
+
$params['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
| 114 |
+
$params['description'] = Mage::helper('paymill/paymentHelper')->getDescription($order);
|
| 115 |
+
$params['source'] = Mage::helper('paymill')->getSourceString();
|
| 116 |
+
|
| 117 |
+
$paymentProcessor = new Services_Paymill_PaymentProcessor($privateKey, $apiUrl, $libBase, $params, Mage::helper('paymill/loggingHelper'));
|
| 118 |
+
$paymentProcessor->setPreauthId($preAuthorization);
|
| 119 |
+
$paymentProcessor->capture();
|
| 120 |
+
|
| 121 |
+
Mage::helper('paymill/loggingHelper')->log("Capture created", var_export($paymentProcessor->getLastResponse(), true));
|
| 122 |
|
| 123 |
//Save Transaction Data
|
| 124 |
+
$transactionId = $paymentProcessor->getTransactionId();
|
| 125 |
$transactionModel = $transactionHelper->createTransactionModel($transactionId, true);
|
| 126 |
$transactionHelper->setAdditionalInformation($payment, $transactionModel);
|
| 127 |
}
|
| 128 |
}
|
| 129 |
+
|
| 130 |
}
|
app/code/community/Paymill/Paymill/Model/Method/MethodModelDirectdebit.php
CHANGED
|
@@ -1,43 +1,45 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
*
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
*
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
*
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Model_Method_MethodModelDirectdebit extends Paymill_Paymill_Model_Method_MethodModelAbstract
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Magento method code
|
| 26 |
+
*
|
| 27 |
+
* @var string
|
| 28 |
+
*/
|
| 29 |
+
protected $_code = "paymill_directdebit";
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
* Form block identifier
|
| 33 |
+
*
|
| 34 |
+
* @var string
|
| 35 |
+
*/
|
| 36 |
+
protected $_formBlockType = 'paymill/payment_form_paymentFormDirectdebit';
|
| 37 |
+
|
| 38 |
+
/**
|
| 39 |
+
* Info block identifier
|
| 40 |
+
*
|
| 41 |
+
* @var string
|
| 42 |
+
*/
|
| 43 |
+
protected $_infoBlockType = 'paymill/payment_info_paymentFormDirectdebit';
|
| 44 |
+
|
| 45 |
+
}
|
app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout.php
CHANGED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* @category Paymill
|
| 16 |
-
* @package Paymill_Paymill
|
| 17 |
-
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
-
*/
|
| 20 |
-
class Paymill_Paymill_Model_Mysql4_Fastcheckout extends Mage_Core_Model_Mysql4_Abstract
|
| 21 |
-
{
|
| 22 |
-
|
| 23 |
-
/**
|
| 24 |
-
* Construct
|
| 25 |
-
*/
|
| 26 |
-
function _construct()
|
| 27 |
-
{
|
| 28 |
-
$this->_init('paymill/fastcheckout', 'id');
|
| 29 |
-
}
|
| 30 |
}
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* @category Paymill
|
| 16 |
+
* @package Paymill_Paymill
|
| 17 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
class Paymill_Paymill_Model_Mysql4_Fastcheckout extends Mage_Core_Model_Mysql4_Abstract
|
| 21 |
+
{
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Construct
|
| 25 |
+
*/
|
| 26 |
+
function _construct()
|
| 27 |
+
{
|
| 28 |
+
$this->_init('paymill/fastcheckout', 'id');
|
| 29 |
+
}
|
| 30 |
}
|
app/code/community/Paymill/Paymill/Model/Mysql4/Fastcheckout/Collection.php
CHANGED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* @category Paymill
|
| 16 |
-
* @package Paymill_Paymill
|
| 17 |
-
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
-
*/
|
| 20 |
-
class Paymill_Paymill_Model_Mysql4_FastCheckout_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
| 21 |
-
{
|
| 22 |
-
/**
|
| 23 |
-
* Construct
|
| 24 |
-
*/
|
| 25 |
-
public function _construct()
|
| 26 |
-
{
|
| 27 |
-
parent::_construct();
|
| 28 |
-
$this->_init('paymill/fastcheckout');
|
| 29 |
-
}
|
| 30 |
}
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* @category Paymill
|
| 16 |
+
* @package Paymill_Paymill
|
| 17 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
class Paymill_Paymill_Model_Mysql4_FastCheckout_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
| 21 |
+
{
|
| 22 |
+
/**
|
| 23 |
+
* Construct
|
| 24 |
+
*/
|
| 25 |
+
public function _construct()
|
| 26 |
+
{
|
| 27 |
+
parent::_construct();
|
| 28 |
+
$this->_init('paymill/fastcheckout');
|
| 29 |
+
}
|
| 30 |
}
|
app/code/community/Paymill/Paymill/Model/Mysql4/Log.php
CHANGED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* @category Paymill
|
| 16 |
-
* @package Paymill_Paymill
|
| 17 |
-
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
-
*/
|
| 20 |
-
class Paymill_Paymill_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
|
| 21 |
-
{
|
| 22 |
-
|
| 23 |
-
/**
|
| 24 |
-
* Construct
|
| 25 |
-
*/
|
| 26 |
-
function _construct()
|
| 27 |
-
{
|
| 28 |
-
$this->_init('paymill/log', 'id');
|
| 29 |
-
}
|
| 30 |
}
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* @category Paymill
|
| 16 |
+
* @package Paymill_Paymill
|
| 17 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
class Paymill_Paymill_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
|
| 21 |
+
{
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Construct
|
| 25 |
+
*/
|
| 26 |
+
function _construct()
|
| 27 |
+
{
|
| 28 |
+
$this->_init('paymill/log', 'id');
|
| 29 |
+
}
|
| 30 |
}
|
app/code/community/Paymill/Paymill/Model/Mysql4/Log/Collection.php
CHANGED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Magento
|
| 4 |
-
*
|
| 5 |
-
* NOTICE OF LICENSE
|
| 6 |
-
*
|
| 7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
-
* It is also available through the world-wide-web at this URL:
|
| 10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
-
* If you did not receive a copy of the license and are unable to
|
| 12 |
-
* obtain it through the world-wide-web, please send an email
|
| 13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
-
*
|
| 15 |
-
* @category Paymill
|
| 16 |
-
* @package Paymill_Paymill
|
| 17 |
-
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
-
*/
|
| 20 |
-
class Paymill_Paymill_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
| 21 |
-
{
|
| 22 |
-
/**
|
| 23 |
-
* Construct
|
| 24 |
-
*/
|
| 25 |
-
public function _construct()
|
| 26 |
-
{
|
| 27 |
-
parent::_construct();
|
| 28 |
-
$this->_init('paymill/log');
|
| 29 |
-
}
|
| 30 |
}
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Magento
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* @category Paymill
|
| 16 |
+
* @package Paymill_Paymill
|
| 17 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
class Paymill_Paymill_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
| 21 |
+
{
|
| 22 |
+
/**
|
| 23 |
+
* Construct
|
| 24 |
+
*/
|
| 25 |
+
public function _construct()
|
| 26 |
+
{
|
| 27 |
+
parent::_construct();
|
| 28 |
+
$this->_init('paymill/log');
|
| 29 |
+
}
|
| 30 |
}
|
app/code/community/Paymill/Paymill/Model/Observer.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -17,8 +18,9 @@
|
|
| 17 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
-
class Paymill_Paymill_Model_Observer
|
| 21 |
-
|
|
|
|
| 22 |
/**
|
| 23 |
* Registered for the checkout_onepage_controller_success_action event
|
| 24 |
* Generates the invoice for the current order
|
|
@@ -35,22 +37,22 @@ class Paymill_Paymill_Model_Observer{
|
|
| 35 |
}
|
| 36 |
}
|
| 37 |
$order = Mage::getModel('sales/order')->load($orderId);
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
if(
|
| 42 |
Mage::helper('paymill/loggingHelper')->log("Debug", "No Invoice generated, since the transaction is flagged as preauth");
|
| 43 |
} else {
|
| 44 |
-
if($order->canInvoice()) {
|
| 45 |
//Create the Invoice
|
| 46 |
-
Mage::helper('paymill/loggingHelper')->log(Mage::helper('paymill')->__($paymentCode), Mage::helper('paymill')->__('paymill_checkout_generating_invoice'), "Order Id: "
|
| 47 |
$invoiceId = Mage::getModel('sales/order_invoice_api')->create($order->getIncrementId(), array());
|
| 48 |
Mage::getModel('sales/order_invoice_api')->capture($invoiceId);
|
| 49 |
}
|
| 50 |
}
|
| 51 |
}
|
| 52 |
}
|
| 53 |
-
|
| 54 |
/**
|
| 55 |
* Registered for the sales_order_creditmemo_refund event
|
| 56 |
* Creates a refund based on the created creditmemo
|
|
@@ -60,11 +62,12 @@ class Paymill_Paymill_Model_Observer{
|
|
| 60 |
{
|
| 61 |
$creditmemo = $observer->getEvent()->getCreditmemo();
|
| 62 |
$order = $creditmemo->getOrder();
|
| 63 |
-
if($order->getPayment()->getMethod() === 'paymill_creditcard' || $order->getPayment()->getMethod() === 'paymill_directdebit'){
|
| 64 |
-
$amount = (int)((string)($creditmemo->getGrandTotal()*100));
|
| 65 |
Mage::helper('paymill/loggingHelper')->log("Trying to Refund.", var_export($order->getIncrementId(), true), $amount);
|
| 66 |
Mage::helper('paymill/refundHelper')->createRefund($order, $amount);
|
| 67 |
}
|
| 68 |
}
|
|
|
|
| 69 |
}
|
| 70 |
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 18 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
*/
|
| 21 |
+
class Paymill_Paymill_Model_Observer
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
/**
|
| 25 |
* Registered for the checkout_onepage_controller_success_action event
|
| 26 |
* Generates the invoice for the current order
|
| 37 |
}
|
| 38 |
}
|
| 39 |
$order = Mage::getModel('sales/order')->load($orderId);
|
| 40 |
+
|
| 41 |
+
if ($order->getPayment()->getMethod() === 'paymill_creditcard' || $order->getPayment()->getMethod() === 'paymill_directdebit') {
|
| 42 |
+
|
| 43 |
+
if (Mage::helper('paymill/transactionHelper')->getPreAuthenticatedFlagState($order)) { // If the transaction is not flagged as a debit (not a preAuth) transaction
|
| 44 |
Mage::helper('paymill/loggingHelper')->log("Debug", "No Invoice generated, since the transaction is flagged as preauth");
|
| 45 |
} else {
|
| 46 |
+
if ($order->canInvoice()) {
|
| 47 |
//Create the Invoice
|
| 48 |
+
Mage::helper('paymill/loggingHelper')->log(Mage::helper('paymill')->__($paymentCode), Mage::helper('paymill')->__('paymill_checkout_generating_invoice'), "Order Id: " . $order->getIncrementId());
|
| 49 |
$invoiceId = Mage::getModel('sales/order_invoice_api')->create($order->getIncrementId(), array());
|
| 50 |
Mage::getModel('sales/order_invoice_api')->capture($invoiceId);
|
| 51 |
}
|
| 52 |
}
|
| 53 |
}
|
| 54 |
}
|
| 55 |
+
|
| 56 |
/**
|
| 57 |
* Registered for the sales_order_creditmemo_refund event
|
| 58 |
* Creates a refund based on the created creditmemo
|
| 62 |
{
|
| 63 |
$creditmemo = $observer->getEvent()->getCreditmemo();
|
| 64 |
$order = $creditmemo->getOrder();
|
| 65 |
+
if ($order->getPayment()->getMethod() === 'paymill_creditcard' || $order->getPayment()->getMethod() === 'paymill_directdebit') {
|
| 66 |
+
$amount = (int) ((string) ($creditmemo->getGrandTotal() * 100));
|
| 67 |
Mage::helper('paymill/loggingHelper')->log("Trying to Refund.", var_export($order->getIncrementId(), true), $amount);
|
| 68 |
Mage::helper('paymill/refundHelper')->createRefund($order, $amount);
|
| 69 |
}
|
| 70 |
}
|
| 71 |
+
|
| 72 |
}
|
| 73 |
|
app/code/community/Paymill/Paymill/Model/TransactionData.php
CHANGED
|
@@ -1,62 +1,63 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
*
|
| 8 |
-
*
|
| 9 |
-
*
|
| 10 |
-
*
|
| 11 |
-
*
|
| 12 |
-
*
|
| 13 |
-
*
|
| 14 |
-
*
|
| 15 |
-
*
|
| 16 |
-
* @
|
| 17 |
-
* @
|
| 18 |
-
* @
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
private $
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
*
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
*
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
*
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
*
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
| 62 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Magento
|
| 5 |
+
*
|
| 6 |
+
* NOTICE OF LICENSE
|
| 7 |
+
*
|
| 8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 10 |
+
* It is also available through the world-wide-web at this URL:
|
| 11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 12 |
+
* If you did not receive a copy of the license and are unable to
|
| 13 |
+
* obtain it through the world-wide-web, please send an email
|
| 14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
+
*
|
| 16 |
+
* @category Paymill
|
| 17 |
+
* @package Paymill_Paymill
|
| 18 |
+
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
+
*/
|
| 21 |
+
class Paymill_Paymill_Model_TransactionData
|
| 22 |
+
{
|
| 23 |
+
|
| 24 |
+
private $_preAuthorizationFlag = null;
|
| 25 |
+
private $_transactionId = null;
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Returns the state of the PreAuthorizationFlag
|
| 29 |
+
* @return Boolean
|
| 30 |
+
*/
|
| 31 |
+
public function getPreAuthorizationFlag()
|
| 32 |
+
{
|
| 33 |
+
return $this->_preAuthorizationFlag;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Returns the TransactionId as a string
|
| 38 |
+
* @return String
|
| 39 |
+
*/
|
| 40 |
+
public function getTransactionId()
|
| 41 |
+
{
|
| 42 |
+
return $this->_transactionId;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* Sets the PreAuthorizationFlag
|
| 47 |
+
* @param Boolean $flag
|
| 48 |
+
*/
|
| 49 |
+
public function setPreAuthorizationFlag($flag)
|
| 50 |
+
{
|
| 51 |
+
$this->_preAuthorizationFlag = $flag;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Sets the transaction id
|
| 56 |
+
* @param String $id
|
| 57 |
+
*/
|
| 58 |
+
public function setTransactionId($id)
|
| 59 |
+
{
|
| 60 |
+
$this->_transactionId = $id;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
}
|
app/code/community/Paymill/Paymill/controllers/Adminhtml/LogController.php
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
|
|
|
| 3 |
* Magento
|
| 4 |
*
|
| 5 |
* NOTICE OF LICENSE
|
|
@@ -18,7 +19,7 @@
|
|
| 18 |
*/
|
| 19 |
class Paymill_Paymill_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action
|
| 20 |
{
|
| 21 |
-
|
| 22 |
/**
|
| 23 |
* Initialize logs view
|
| 24 |
*
|
|
@@ -29,17 +30,17 @@ class Paymill_Paymill_Adminhtml_LogController extends Mage_Adminhtml_Controller_
|
|
| 29 |
$this->loadLayout()->_setActiveMenu('log/paymill_log');
|
| 30 |
return $this;
|
| 31 |
}
|
| 32 |
-
|
| 33 |
/**
|
| 34 |
* Action initially called
|
| 35 |
*/
|
| 36 |
public function indexAction()
|
| 37 |
-
{
|
| 38 |
// Let's call our initAction method which will set some basic params for each action
|
| 39 |
$this->_initAction()
|
| 40 |
-
|
| 41 |
-
}
|
| 42 |
-
|
| 43 |
/**
|
| 44 |
* Normal Magento delete mass action for selected entries
|
| 45 |
*/
|
|
@@ -54,7 +55,7 @@ class Paymill_Paymill_Adminhtml_LogController extends Mage_Adminhtml_Controller_
|
|
| 54 |
foreach ($logIds as $logId) {
|
| 55 |
Mage::getModel('paymill/log')->load($logId)->delete();
|
| 56 |
}
|
| 57 |
-
|
| 58 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('paymill')->__("paymill_log_action_success"));
|
| 59 |
} catch (Exception $e) {
|
| 60 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
|
@@ -62,4 +63,5 @@ class Paymill_Paymill_Adminhtml_LogController extends Mage_Adminhtml_Controller_
|
|
| 62 |
}
|
| 63 |
$this->_redirect('*/*/index');
|
| 64 |
}
|
|
|
|
| 65 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 6 |
* NOTICE OF LICENSE
|
| 19 |
*/
|
| 20 |
class Paymill_Paymill_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action
|
| 21 |
{
|
| 22 |
+
|
| 23 |
/**
|
| 24 |
* Initialize logs view
|
| 25 |
*
|
| 30 |
$this->loadLayout()->_setActiveMenu('log/paymill_log');
|
| 31 |
return $this;
|
| 32 |
}
|
| 33 |
+
|
| 34 |
/**
|
| 35 |
* Action initially called
|
| 36 |
*/
|
| 37 |
public function indexAction()
|
| 38 |
+
{
|
| 39 |
// Let's call our initAction method which will set some basic params for each action
|
| 40 |
$this->_initAction()
|
| 41 |
+
->renderLayout();
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
/**
|
| 45 |
* Normal Magento delete mass action for selected entries
|
| 46 |
*/
|
| 55 |
foreach ($logIds as $logId) {
|
| 56 |
Mage::getModel('paymill/log')->load($logId)->delete();
|
| 57 |
}
|
| 58 |
+
|
| 59 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('paymill')->__("paymill_log_action_success"));
|
| 60 |
} catch (Exception $e) {
|
| 61 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 63 |
}
|
| 64 |
$this->_redirect('*/*/index');
|
| 65 |
}
|
| 66 |
+
|
| 67 |
}
|
app/code/community/Paymill/Paymill/etc/config.xml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
</modules>
|
| 8 |
|
| 9 |
|
|
@@ -55,17 +55,17 @@
|
|
| 55 |
</paymill_write>
|
| 56 |
|
| 57 |
<paymill_read>
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
</paymill_read>
|
| 62 |
</resources>
|
| 63 |
</global>
|
| 64 |
|
| 65 |
|
| 66 |
-
<!-- declare default configuration values for this module -->
|
| 67 |
<default>
|
| 68 |
-
<!-- 'payment' configuration section (tab) -->
|
| 69 |
<payment>
|
| 70 |
<paymill_creditcard>
|
| 71 |
<active>0</active>
|
|
@@ -84,7 +84,7 @@
|
|
| 84 |
<title>paymill_direct_debit</title>
|
| 85 |
<payment_action>authorize</payment_action>
|
| 86 |
</paymill_directdebit>
|
| 87 |
-
|
| 88 |
</default>
|
| 89 |
|
| 90 |
<frontend>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
+
<Paymill_Paymill>
|
| 5 |
+
<version>3.0.5</version>
|
| 6 |
+
</Paymill_Paymill>
|
| 7 |
</modules>
|
| 8 |
|
| 9 |
|
| 55 |
</paymill_write>
|
| 56 |
|
| 57 |
<paymill_read>
|
| 58 |
+
<connection>
|
| 59 |
+
<use>core_read</use>
|
| 60 |
+
</connection>
|
| 61 |
</paymill_read>
|
| 62 |
</resources>
|
| 63 |
</global>
|
| 64 |
|
| 65 |
|
| 66 |
+
<!-- declare default configuration values for this module -->
|
| 67 |
<default>
|
| 68 |
+
<!-- 'payment' configuration section (tab) -->
|
| 69 |
<payment>
|
| 70 |
<paymill_creditcard>
|
| 71 |
<active>0</active>
|
| 84 |
<title>paymill_direct_debit</title>
|
| 85 |
<payment_action>authorize</payment_action>
|
| 86 |
</paymill_directdebit>
|
| 87 |
+
</payment>
|
| 88 |
</default>
|
| 89 |
|
| 90 |
<frontend>
|
app/code/community/Paymill/Paymill/etc/system.xml
CHANGED
|
@@ -1,228 +1,244 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<config>
|
| 3 |
-
<sections>
|
| 4 |
-
<payment>
|
| 5 |
-
<groups>
|
| 6 |
-
<paymill translate="label">
|
| 7 |
-
<label>paymill_Basic_Setting</label>
|
| 8 |
-
<show_in_default>1</show_in_default>
|
| 9 |
-
<show_in_website>1</show_in_website>
|
| 10 |
-
<show_in_store>1</show_in_store>
|
| 11 |
-
<sort_order>700</sort_order>
|
| 12 |
-
<fields>
|
| 13 |
-
<version>
|
| 14 |
-
<label>v3.0.0</label>
|
| 15 |
-
<sort_order>1</sort_order>
|
| 16 |
-
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
| 17 |
-
<frontend_type>label</frontend_type>
|
| 18 |
-
<show_in_default>1</show_in_default>
|
| 19 |
-
<show_in_website>1</show_in_website>
|
| 20 |
-
<show_in_store>1</show_in_store>
|
| 21 |
-
</version>
|
| 22 |
-
<public_key translate="label, tooltip, comment">
|
| 23 |
-
<label>paymill_Public_Key</label>
|
| 24 |
-
<sort_order>2</sort_order>
|
| 25 |
-
<tooltip>paymill_public_key_tooltip</tooltip>
|
| 26 |
-
<comment>paymill_public_key_comment</comment>
|
| 27 |
-
<frontend_type>text</frontend_type>
|
| 28 |
-
<show_in_default>1</show_in_default>
|
| 29 |
-
<show_in_website>1</show_in_website>
|
| 30 |
-
<show_in_store>1</show_in_store>
|
| 31 |
-
</public_key>
|
| 32 |
-
<private_key translate="label, tooltip, comment">
|
| 33 |
-
<label>paymill_Private_Key</label>
|
| 34 |
-
<sort_order>3</sort_order>
|
| 35 |
-
<tooltip>paymill_private_key_tooltip</tooltip>
|
| 36 |
-
<comment>paymill_private_key_comment</comment>
|
| 37 |
-
<frontend_type>text</frontend_type>
|
| 38 |
-
<show_in_default>1</show_in_default>
|
| 39 |
-
<show_in_website>1</show_in_website>
|
| 40 |
-
<show_in_store>1</show_in_store>
|
| 41 |
-
</private_key>
|
| 42 |
-
<debugging_active translate="label">
|
| 43 |
-
<label>paymill_Activate_Debugging</label>
|
| 44 |
-
<sort_order>6</sort_order>
|
| 45 |
-
<frontend_type>select</frontend_type>
|
| 46 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 47 |
-
<show_in_default>1</show_in_default>
|
| 48 |
-
<show_in_website>1</show_in_website>
|
| 49 |
-
<show_in_store>1</show_in_store>
|
| 50 |
-
</debugging_active>
|
| 51 |
-
<fc_active translate="label">
|
| 52 |
-
<label>paymill_fc_active</label>
|
| 53 |
-
<sort_order>7</sort_order>
|
| 54 |
-
<frontend_type>select</frontend_type>
|
| 55 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 56 |
-
<show_in_default>1</show_in_default>
|
| 57 |
-
<show_in_website>1</show_in_website>
|
| 58 |
-
<show_in_store>1</show_in_store>
|
| 59 |
-
</fc_active>
|
| 60 |
-
<logging_active translate="label">
|
| 61 |
-
<label>paymill_Activate_Logging</label>
|
| 62 |
-
<sort_order>8</sort_order>
|
| 63 |
-
<frontend_type>select</frontend_type>
|
| 64 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 65 |
-
<show_in_default>1</show_in_default>
|
| 66 |
-
<show_in_website>1</show_in_website>
|
| 67 |
-
<show_in_store>1</show_in_store>
|
| 68 |
-
</logging_active>
|
| 69 |
-
<show_label translate="label">
|
| 70 |
-
<label>paymill_Show_Label</label>
|
| 71 |
-
<sort_order>9</sort_order>
|
| 72 |
-
<frontend_type>select</frontend_type>
|
| 73 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 74 |
-
<show_in_default>1</show_in_default>
|
| 75 |
-
<show_in_website>1</show_in_website>
|
| 76 |
-
<show_in_store>1</show_in_store>
|
| 77 |
-
</show_label>
|
| 78 |
-
<preAuth_active translate="label">
|
| 79 |
-
<label>paymill_preAuth_active</label>
|
| 80 |
-
<sort_order>10</sort_order>
|
| 81 |
-
<frontend_type>select</frontend_type>
|
| 82 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 83 |
-
<show_in_default>1</show_in_default>
|
| 84 |
-
<show_in_website>1</show_in_website>
|
| 85 |
-
<show_in_store>1</show_in_store>
|
| 86 |
-
</preAuth_active>
|
| 87 |
-
</fields>
|
| 88 |
-
</paymill>
|
| 89 |
-
|
| 90 |
-
<paymill_creditcard module="paymill" translate="label">
|
| 91 |
-
<label>paymill_credit_card_label</label>
|
| 92 |
-
<show_in_default>1</show_in_default>
|
| 93 |
-
<show_in_website>1</show_in_website>
|
| 94 |
-
<show_in_store>1</show_in_store>
|
| 95 |
-
<sort_order>800</sort_order>
|
| 96 |
-
<fields>
|
| 97 |
-
<version>
|
| 98 |
-
<label>v3.0.0</label>
|
| 99 |
-
<sort_order>100</sort_order>
|
| 100 |
-
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
| 101 |
-
<frontend_type>label</frontend_type>
|
| 102 |
-
<show_in_default>1</show_in_default>
|
| 103 |
-
<show_in_website>1</show_in_website>
|
| 104 |
-
<show_in_store>1</show_in_store>
|
| 105 |
-
</version>
|
| 106 |
-
|
| 107 |
-
<active translate="label">
|
| 108 |
-
<label>paymill_opt_Enabled</label>
|
| 109 |
-
<sort_order>200</sort_order>
|
| 110 |
-
<frontend_type>select</frontend_type>
|
| 111 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 112 |
-
<show_in_default>1</show_in_default>
|
| 113 |
-
<show_in_website>1</show_in_website>
|
| 114 |
-
<show_in_store>1</show_in_store>
|
| 115 |
-
</active>
|
| 116 |
-
|
| 117 |
-
<tokenTolerance translate="label, tooltip, comment">
|
| 118 |
-
<label>paymill_token_tolerace</label>
|
| 119 |
-
<sort_order>210</sort_order>
|
| 120 |
-
<tooltip>paymill_token_tolerace_tooltip</tooltip>
|
| 121 |
-
<comment>paymill_token_tolerace_comment</comment>
|
| 122 |
-
<frontend_type>text</frontend_type>
|
| 123 |
-
<show_in_default>1</show_in_default>
|
| 124 |
-
<show_in_website>1</show_in_website>
|
| 125 |
-
<show_in_store>1</show_in_store>
|
| 126 |
-
</tokenTolerance>
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
<
|
| 130 |
-
<
|
| 131 |
-
<
|
| 132 |
-
<
|
| 133 |
-
<
|
| 134 |
-
<
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
<
|
| 140 |
-
<
|
| 141 |
-
<
|
| 142 |
-
<
|
| 143 |
-
<
|
| 144 |
-
<
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
<
|
| 149 |
-
<
|
| 150 |
-
<sort_order>
|
| 151 |
-
<show_in_default>1</show_in_default>
|
| 152 |
-
<show_in_website>1</show_in_website>
|
| 153 |
-
<show_in_store>
|
| 154 |
-
</
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
<
|
| 177 |
-
<
|
| 178 |
-
<
|
| 179 |
-
<
|
| 180 |
-
<
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
<
|
| 187 |
-
<
|
| 188 |
-
<
|
| 189 |
-
<
|
| 190 |
-
<
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
<
|
| 198 |
-
<
|
| 199 |
-
<
|
| 200 |
-
<
|
| 201 |
-
<
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
<
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
<
|
| 208 |
-
<
|
| 209 |
-
<
|
| 210 |
-
<
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
<
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
<
|
| 217 |
-
<
|
| 218 |
-
<
|
| 219 |
-
<
|
| 220 |
-
<
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
</config>
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<payment>
|
| 5 |
+
<groups>
|
| 6 |
+
<paymill translate="label">
|
| 7 |
+
<label>paymill_Basic_Setting</label>
|
| 8 |
+
<show_in_default>1</show_in_default>
|
| 9 |
+
<show_in_website>1</show_in_website>
|
| 10 |
+
<show_in_store>1</show_in_store>
|
| 11 |
+
<sort_order>700</sort_order>
|
| 12 |
+
<fields>
|
| 13 |
+
<version>
|
| 14 |
+
<label>v3.0.0</label>
|
| 15 |
+
<sort_order>1</sort_order>
|
| 16 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
| 17 |
+
<frontend_type>label</frontend_type>
|
| 18 |
+
<show_in_default>1</show_in_default>
|
| 19 |
+
<show_in_website>1</show_in_website>
|
| 20 |
+
<show_in_store>1</show_in_store>
|
| 21 |
+
</version>
|
| 22 |
+
<public_key translate="label, tooltip, comment">
|
| 23 |
+
<label>paymill_Public_Key</label>
|
| 24 |
+
<sort_order>2</sort_order>
|
| 25 |
+
<tooltip>paymill_public_key_tooltip</tooltip>
|
| 26 |
+
<comment>paymill_public_key_comment</comment>
|
| 27 |
+
<frontend_type>text</frontend_type>
|
| 28 |
+
<show_in_default>1</show_in_default>
|
| 29 |
+
<show_in_website>1</show_in_website>
|
| 30 |
+
<show_in_store>1</show_in_store>
|
| 31 |
+
</public_key>
|
| 32 |
+
<private_key translate="label, tooltip, comment">
|
| 33 |
+
<label>paymill_Private_Key</label>
|
| 34 |
+
<sort_order>3</sort_order>
|
| 35 |
+
<tooltip>paymill_private_key_tooltip</tooltip>
|
| 36 |
+
<comment>paymill_private_key_comment</comment>
|
| 37 |
+
<frontend_type>text</frontend_type>
|
| 38 |
+
<show_in_default>1</show_in_default>
|
| 39 |
+
<show_in_website>1</show_in_website>
|
| 40 |
+
<show_in_store>1</show_in_store>
|
| 41 |
+
</private_key>
|
| 42 |
+
<debugging_active translate="label">
|
| 43 |
+
<label>paymill_Activate_Debugging</label>
|
| 44 |
+
<sort_order>6</sort_order>
|
| 45 |
+
<frontend_type>select</frontend_type>
|
| 46 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 47 |
+
<show_in_default>1</show_in_default>
|
| 48 |
+
<show_in_website>1</show_in_website>
|
| 49 |
+
<show_in_store>1</show_in_store>
|
| 50 |
+
</debugging_active>
|
| 51 |
+
<fc_active translate="label">
|
| 52 |
+
<label>paymill_fc_active</label>
|
| 53 |
+
<sort_order>7</sort_order>
|
| 54 |
+
<frontend_type>select</frontend_type>
|
| 55 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 56 |
+
<show_in_default>1</show_in_default>
|
| 57 |
+
<show_in_website>1</show_in_website>
|
| 58 |
+
<show_in_store>1</show_in_store>
|
| 59 |
+
</fc_active>
|
| 60 |
+
<logging_active translate="label">
|
| 61 |
+
<label>paymill_Activate_Logging</label>
|
| 62 |
+
<sort_order>8</sort_order>
|
| 63 |
+
<frontend_type>select</frontend_type>
|
| 64 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 65 |
+
<show_in_default>1</show_in_default>
|
| 66 |
+
<show_in_website>1</show_in_website>
|
| 67 |
+
<show_in_store>1</show_in_store>
|
| 68 |
+
</logging_active>
|
| 69 |
+
<show_label translate="label">
|
| 70 |
+
<label>paymill_Show_Label</label>
|
| 71 |
+
<sort_order>9</sort_order>
|
| 72 |
+
<frontend_type>select</frontend_type>
|
| 73 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 74 |
+
<show_in_default>1</show_in_default>
|
| 75 |
+
<show_in_website>1</show_in_website>
|
| 76 |
+
<show_in_store>1</show_in_store>
|
| 77 |
+
</show_label>
|
| 78 |
+
<preAuth_active translate="label">
|
| 79 |
+
<label>paymill_preAuth_active</label>
|
| 80 |
+
<sort_order>10</sort_order>
|
| 81 |
+
<frontend_type>select</frontend_type>
|
| 82 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 83 |
+
<show_in_default>1</show_in_default>
|
| 84 |
+
<show_in_website>1</show_in_website>
|
| 85 |
+
<show_in_store>1</show_in_store>
|
| 86 |
+
</preAuth_active>
|
| 87 |
+
</fields>
|
| 88 |
+
</paymill>
|
| 89 |
+
|
| 90 |
+
<paymill_creditcard module="paymill" translate="label">
|
| 91 |
+
<label>paymill_credit_card_label</label>
|
| 92 |
+
<show_in_default>1</show_in_default>
|
| 93 |
+
<show_in_website>1</show_in_website>
|
| 94 |
+
<show_in_store>1</show_in_store>
|
| 95 |
+
<sort_order>800</sort_order>
|
| 96 |
+
<fields>
|
| 97 |
+
<version>
|
| 98 |
+
<label>v3.0.0</label>
|
| 99 |
+
<sort_order>100</sort_order>
|
| 100 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
| 101 |
+
<frontend_type>label</frontend_type>
|
| 102 |
+
<show_in_default>1</show_in_default>
|
| 103 |
+
<show_in_website>1</show_in_website>
|
| 104 |
+
<show_in_store>1</show_in_store>
|
| 105 |
+
</version>
|
| 106 |
+
|
| 107 |
+
<active translate="label">
|
| 108 |
+
<label>paymill_opt_Enabled</label>
|
| 109 |
+
<sort_order>200</sort_order>
|
| 110 |
+
<frontend_type>select</frontend_type>
|
| 111 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 112 |
+
<show_in_default>1</show_in_default>
|
| 113 |
+
<show_in_website>1</show_in_website>
|
| 114 |
+
<show_in_store>1</show_in_store>
|
| 115 |
+
</active>
|
| 116 |
+
|
| 117 |
+
<tokenTolerance translate="label, tooltip, comment">
|
| 118 |
+
<label>paymill_token_tolerace</label>
|
| 119 |
+
<sort_order>210</sort_order>
|
| 120 |
+
<tooltip>paymill_token_tolerace_tooltip</tooltip>
|
| 121 |
+
<comment>paymill_token_tolerace_comment</comment>
|
| 122 |
+
<frontend_type>text</frontend_type>
|
| 123 |
+
<show_in_default>1</show_in_default>
|
| 124 |
+
<show_in_website>1</show_in_website>
|
| 125 |
+
<show_in_store>1</show_in_store>
|
| 126 |
+
</tokenTolerance>
|
| 127 |
+
<allowspecific translate="label">
|
| 128 |
+
<label>Payment from Applicable Countries</label>
|
| 129 |
+
<sort_order>220</sort_order>
|
| 130 |
+
<frontend_type>allowspecific</frontend_type>
|
| 131 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
| 132 |
+
<show_in_default>1</show_in_default>
|
| 133 |
+
<show_in_website>1</show_in_website>
|
| 134 |
+
<show_in_store>1</show_in_store>
|
| 135 |
+
</allowspecific>
|
| 136 |
+
<specificcountry translate="label">
|
| 137 |
+
<label>Payment from Specific Countries</label>
|
| 138 |
+
<sort_order>300</sort_order>
|
| 139 |
+
<frontend_type>multiselect</frontend_type>
|
| 140 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
| 141 |
+
<can_be_empty>1</can_be_empty>
|
| 142 |
+
<show_in_default>1</show_in_default>
|
| 143 |
+
<show_in_website>1</show_in_website>
|
| 144 |
+
<show_in_store>1</show_in_store>
|
| 145 |
+
</specificcountry>
|
| 146 |
+
<currency translate="label">
|
| 147 |
+
<label>paymill_accepted_currency</label>
|
| 148 |
+
<frontend_type>multiselect</frontend_type>
|
| 149 |
+
<source_model>adminhtml/system_config_source_currency</source_model>
|
| 150 |
+
<sort_order>350</sort_order>
|
| 151 |
+
<show_in_default>1</show_in_default>
|
| 152 |
+
<show_in_website>1</show_in_website>
|
| 153 |
+
<show_in_store>0</show_in_store>
|
| 154 |
+
</currency>
|
| 155 |
+
<sort_order translate="label">
|
| 156 |
+
<label>paymill_opt_Sort</label>
|
| 157 |
+
<frontend_type>text</frontend_type>
|
| 158 |
+
<sort_order>400</sort_order>
|
| 159 |
+
<show_in_default>1</show_in_default>
|
| 160 |
+
<show_in_website>1</show_in_website>
|
| 161 |
+
<show_in_store>1</show_in_store>
|
| 162 |
+
</sort_order>
|
| 163 |
+
</fields>
|
| 164 |
+
</paymill_creditcard>
|
| 165 |
+
|
| 166 |
+
<paymill_directdebit module="paymill" translate="label">
|
| 167 |
+
<label>paymill_direct_debit_label</label>
|
| 168 |
+
<show_in_default>1</show_in_default>
|
| 169 |
+
<show_in_website>1</show_in_website>
|
| 170 |
+
<show_in_store>1</show_in_store>
|
| 171 |
+
<sort_order>800</sort_order>
|
| 172 |
+
<fields>
|
| 173 |
+
<version>
|
| 174 |
+
<label>v3.0.0</label>
|
| 175 |
+
<sort_order>100</sort_order>
|
| 176 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
| 177 |
+
<frontend_type>label</frontend_type>
|
| 178 |
+
<show_in_default>1</show_in_default>
|
| 179 |
+
<show_in_website>1</show_in_website>
|
| 180 |
+
<show_in_store>1</show_in_store>
|
| 181 |
+
</version>
|
| 182 |
+
|
| 183 |
+
<active translate="label">
|
| 184 |
+
<label>paymill_opt_Enabled</label>
|
| 185 |
+
<sort_order>200</sort_order>
|
| 186 |
+
<frontend_type>select</frontend_type>
|
| 187 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 188 |
+
<show_in_default>1</show_in_default>
|
| 189 |
+
<show_in_website>1</show_in_website>
|
| 190 |
+
<show_in_store>1</show_in_store>
|
| 191 |
+
</active>
|
| 192 |
+
|
| 193 |
+
<tokenTolerance translate="label, tooltip, comment">
|
| 194 |
+
<label>paymill_token_tolerace</label>
|
| 195 |
+
<sort_order>210</sort_order>
|
| 196 |
+
<tooltip>paymill_token_tolerace_tooltip</tooltip>
|
| 197 |
+
<comment>paymill_token_tolerace_comment</comment>
|
| 198 |
+
<frontend_type>text</frontend_type>
|
| 199 |
+
<show_in_default>1</show_in_default>
|
| 200 |
+
<show_in_website>1</show_in_website>
|
| 201 |
+
<show_in_store>1</show_in_store>
|
| 202 |
+
</tokenTolerance>
|
| 203 |
+
<allowspecific translate="label">
|
| 204 |
+
<label>Payment from Applicable Countries</label>
|
| 205 |
+
<sort_order>220</sort_order>
|
| 206 |
+
<frontend_type>allowspecific</frontend_type>
|
| 207 |
+
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
|
| 208 |
+
<show_in_default>1</show_in_default>
|
| 209 |
+
<show_in_website>1</show_in_website>
|
| 210 |
+
<show_in_store>1</show_in_store>
|
| 211 |
+
</allowspecific>
|
| 212 |
+
<specificcountry translate="label">
|
| 213 |
+
<label>Payment from Specific Countries</label>
|
| 214 |
+
<sort_order>300</sort_order>
|
| 215 |
+
<frontend_type>multiselect</frontend_type>
|
| 216 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
| 217 |
+
<can_be_empty>1</can_be_empty>
|
| 218 |
+
<show_in_default>1</show_in_default>
|
| 219 |
+
<show_in_website>1</show_in_website>
|
| 220 |
+
<show_in_store>1</show_in_store>
|
| 221 |
+
</specificcountry>
|
| 222 |
+
<currency translate="label">
|
| 223 |
+
<label>paymill_accepted_currency</label>
|
| 224 |
+
<frontend_type>multiselect</frontend_type>
|
| 225 |
+
<source_model>adminhtml/system_config_source_currency</source_model>
|
| 226 |
+
<sort_order>350</sort_order>
|
| 227 |
+
<show_in_default>1</show_in_default>
|
| 228 |
+
<show_in_website>1</show_in_website>
|
| 229 |
+
<show_in_store>0</show_in_store>
|
| 230 |
+
</currency>
|
| 231 |
+
<sort_order translate="label">
|
| 232 |
+
<label>paymill_opt_Sort</label>
|
| 233 |
+
<frontend_type>text</frontend_type>
|
| 234 |
+
<sort_order>400</sort_order>
|
| 235 |
+
<show_in_default>1</show_in_default>
|
| 236 |
+
<show_in_website>1</show_in_website>
|
| 237 |
+
<show_in_store>1</show_in_store>
|
| 238 |
+
</sort_order>
|
| 239 |
+
</fields>
|
| 240 |
+
</paymill_directdebit>
|
| 241 |
+
</groups>
|
| 242 |
+
</payment>
|
| 243 |
+
</sections>
|
| 244 |
</config>
|
app/code/community/Paymill/Paymill/sql/paymill_setup/mysql4-install-3.0.0.php
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
<?php
|
|
|
|
| 2 |
/**
|
| 3 |
* Magento
|
| 4 |
*
|
|
@@ -17,10 +18,9 @@
|
|
| 17 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
-
|
| 21 |
$installer = $this;
|
| 22 |
$installer->startSetup();
|
| 23 |
-
|
| 24 |
$installer->run("
|
| 25 |
CREATE TABLE IF NOT EXISTS `{$this->getTable('paymill_log')}` (
|
| 26 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
@@ -42,5 +42,5 @@ $installer->run("
|
|
| 42 |
UNIQUE KEY `userId` (`user_id`)
|
| 43 |
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
|
| 44 |
");
|
| 45 |
-
|
| 46 |
$installer->endSetup();
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
/**
|
| 4 |
* Magento
|
| 5 |
*
|
| 18 |
* @copyright Copyright (c) 2013 PAYMILL GmbH (https://paymill.com/en-gb/)
|
| 19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
*/
|
|
|
|
| 21 |
$installer = $this;
|
| 22 |
$installer->startSetup();
|
| 23 |
+
|
| 24 |
$installer->run("
|
| 25 |
CREATE TABLE IF NOT EXISTS `{$this->getTable('paymill_log')}` (
|
| 26 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
| 42 |
UNIQUE KEY `userId` (`user_id`)
|
| 43 |
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
|
| 44 |
");
|
| 45 |
+
|
| 46 |
$installer->endSetup();
|
app/design/adminhtml/base/default/template/paymill/payment/info/creditcard.phtml
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php if ($_specificInfo = $this->getSpecificInformation()): ?>
|
| 2 |
-
|
| 3 |
-
<tr>
|
| 4 |
-
<td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
|
| 5 |
-
</tr>
|
| 6 |
-
<tr>
|
| 7 |
-
<td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
|
| 8 |
-
</tr>
|
| 9 |
-
<tr>
|
| 10 |
-
<td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
|
| 11 |
-
</tr>
|
| 12 |
-
|
| 13 |
-
<?php endif; ?>
|
| 14 |
<?php echo $this->getChildHtml() ?>
|
| 1 |
+
<?php if ($_specificInfo = $this->getSpecificInformation()): ?>
|
| 2 |
+
<table
|
| 3 |
+
<tr>
|
| 4 |
+
<td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
|
| 5 |
+
</tr>
|
| 6 |
+
<tr>
|
| 7 |
+
<td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
|
| 8 |
+
</tr>
|
| 9 |
+
<tr>
|
| 10 |
+
<td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
|
| 11 |
+
</tr>
|
| 12 |
+
</table>
|
| 13 |
+
<?php endif; ?>
|
| 14 |
<?php echo $this->getChildHtml() ?>
|
app/design/adminhtml/base/default/template/paymill/payment/info/directdebit.phtml
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php if ($_specificInfo = $this->getSpecificInformation()): ?>
|
| 2 |
-
|
| 3 |
-
<tr>
|
| 4 |
-
<td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
|
| 5 |
-
</tr>
|
| 6 |
-
<tr>
|
| 7 |
-
<td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
|
| 8 |
-
</tr>
|
| 9 |
-
<tr>
|
| 10 |
-
<td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
|
| 11 |
-
</tr>
|
| 12 |
-
|
| 13 |
-
<?php endif; ?>
|
| 14 |
<?php echo $this->getChildHtml() ?>
|
| 1 |
+
<?php if ($_specificInfo = $this->getSpecificInformation()): ?>
|
| 2 |
+
<table
|
| 3 |
+
<tr>
|
| 4 |
+
<td><img src="<?php echo $_specificInfo['imgUrl'] ?>" /></td>
|
| 5 |
+
</tr>
|
| 6 |
+
<tr>
|
| 7 |
+
<td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
|
| 8 |
+
</tr>
|
| 9 |
+
<tr>
|
| 10 |
+
<td><?php echo $this->escapeHtml("Transaction Id: " . $_specificInfo['paymillTransactionId']); ?></td>
|
| 11 |
+
</tr>
|
| 12 |
+
</table>
|
| 13 |
+
<?php endif; ?>
|
| 14 |
<?php echo $this->getChildHtml() ?>
|
app/design/frontend/base/default/layout/paymill.xml
CHANGED
|
@@ -6,12 +6,13 @@ and open the template in the editor.
|
|
| 6 |
<layout version="0.1.0">
|
| 7 |
<checkout_onepage_index>
|
| 8 |
<reference name="head">
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
<block type="core/text" name="google.cdn.jquery">
|
| 13 |
-
|
| 14 |
-
<text><![CDATA[<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script type="text/javascript" src="https://bridge.paymill.com/"></script></script><script type="text/javascript">pmQuery = jQuery.noConflict();</script>]]
|
|
|
|
| 15 |
</action>
|
| 16 |
</block>
|
| 17 |
</reference>
|
| 6 |
<layout version="0.1.0">
|
| 7 |
<checkout_onepage_index>
|
| 8 |
<reference name="head">
|
| 9 |
+
<action method="addCss">
|
| 10 |
+
<stylesheet>css/paymill/logo.css</stylesheet>
|
| 11 |
+
</action>
|
| 12 |
<block type="core/text" name="google.cdn.jquery">
|
| 13 |
+
<action method="setText">
|
| 14 |
+
<text><![CDATA[<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script type="text/javascript" src="https://bridge.paymill.com/"></script></script><script type="text/javascript">pmQuery = jQuery.noConflict();</script>]]>
|
| 15 |
+
</text>
|
| 16 |
</action>
|
| 17 |
</block>
|
| 18 |
</reference>
|
app/design/frontend/base/default/template/paymill/payment/form/creditcard.phtml
CHANGED
|
@@ -1,63 +1,64 @@
|
|
| 1 |
-
<?php $_code
|
| 2 |
-
<script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath()."paymentForm.js"?>"></script>
|
| 3 |
-
<?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code)?>
|
| 4 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 5 |
<li>
|
| 6 |
-
<
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
<?php echo $this->__("paymill_Number") ?>
|
| 11 |
-
</label>
|
| 12 |
-
</li>
|
| 13 |
-
<li>
|
| 14 |
-
<div class="card-icon"></div>
|
| 15 |
-
</li>
|
| 16 |
-
<li>
|
| 17 |
-
<input id ="card-number" class="card-number" type="text" size="20"/>
|
| 18 |
-
</li>
|
| 19 |
-
<li>
|
| 20 |
-
<label class="card-cvc-label">
|
| 21 |
-
<?php echo $this->__("paymill_Cvc") ?>
|
| 22 |
-
</label>
|
| 23 |
-
</li>
|
| 24 |
-
<li>
|
| 25 |
-
<input class="card-cvc" type="text" size="4"/>
|
| 26 |
</li>
|
| 27 |
<li>
|
| 28 |
-
<label class="
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
</li>
|
| 32 |
<li>
|
| 33 |
-
<
|
|
|
|
|
|
|
|
|
|
| 34 |
</li>
|
| 35 |
<li>
|
| 36 |
-
<label class="
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
</div>
|
| 46 |
</li>
|
| 47 |
-
<?php if(Mage::helper('paymill/optionHelper')->isShowingLabels())
|
|
|
|
|
|
|
| 48 |
<li>
|
| 49 |
<input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
|
| 50 |
-
<input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->
|
| 51 |
<input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
|
| 52 |
<input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
|
| 53 |
-
<input class="paymill-option-tokenTolerance-cc" name="payment[paymill-option-tokenTolerance-cc]" id="payment[paymill-option-tokenTolerance-cc]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getTokenTolerance($_code) ?>"/>
|
| 54 |
<input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
|
| 55 |
<input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
|
| 56 |
<input class="paymill-info-fastCheckout-cc" name="payment[paymill-info-fastCheckout-cc]" id="payment[paymill-info-fastCheckout-cc]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
|
| 57 |
-
<input class="paymill-payment-error-number" name="payment[paymill-payment-error-number]" id="payment[paymill-payment-error-number]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_cc") ."<br/>\n" ?>" />
|
| 58 |
-
<input class="paymill-payment-error-holder" name="payment[paymill-payment-error-holder]" id="payment[paymill-payment-error-holder]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_cc") ."<br/>\n" ?>" />
|
| 59 |
-
<input class="paymill-payment-error-expdate" name="payment[paymill-payment-error-expdate]" id="payment[paymill-payment-error-expdate]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_expdate")
|
| 60 |
-
<input class="paymill-payment-error-cvc" name="payment[paymill-payment-error-cvc]" id="payment[paymill-payment-error--cvc]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_cvc")
|
| 61 |
</li>
|
| 62 |
</ul>
|
| 63 |
</div>
|
| 1 |
+
<?php $_code = $this->getMethodCode() ?>
|
| 2 |
+
<script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath() . "paymentForm.js" ?>"></script>
|
| 3 |
+
<?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code) ?>
|
| 4 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 5 |
<li>
|
| 6 |
+
<label for="<?php echo $_code ?>_holdername" class="required"><em>*</em><?php echo $this->__("paymill_Holder") ?></label>
|
| 7 |
+
<div class="input-box">
|
| 8 |
+
<input value="" type="text" id="<?php echo $_code ?>_holdername" class="input-text paymill-validate-cc-holder required-entry"/>
|
| 9 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
</li>
|
| 11 |
<li>
|
| 12 |
+
<label for="<?php echo $_code ?>_number" class="required"><em>*</em><?php echo $this->__("paymill_Number") ?></label>
|
| 13 |
+
<div class="input-box">
|
| 14 |
+
<table>
|
| 15 |
+
<tr>
|
| 16 |
+
<td><input value="" type="text" id="<?php echo $_code ?>_number" class="input-text paymill-validate-cc-number required-entry"/></td>
|
| 17 |
+
<td><div id="<?php echo $_code ?>_card_icon"></div></td>
|
| 18 |
+
</tr>
|
| 19 |
+
</table>
|
| 20 |
+
</div>
|
| 21 |
</li>
|
| 22 |
<li>
|
| 23 |
+
<label for="<?php echo $_code ?>_cvc" class="required"><em>*</em><?php echo $this->__("paymill_Cvc") ?></label>
|
| 24 |
+
<div class="input-box">
|
| 25 |
+
<input value="" type="text" id="<?php echo $_code ?>_cvc" class="input-text paymill-validate-cc-cvc required-entry"/>
|
| 26 |
+
</div>
|
| 27 |
</li>
|
| 28 |
<li>
|
| 29 |
+
<label for="<?php echo $_code ?>_expiry_month" class="required"><em>*</em><?php echo $this->__("paymill_Date") ?></label>
|
| 30 |
+
<div class="input-box">
|
| 31 |
+
<div class="v-fix">
|
| 32 |
+
<select id="<?php echo $_code ?>_expiry_month" class="month paymill-validate-cc-expdate">
|
| 33 |
+
<?php foreach ($this->getPaymillCcMonths() as $k => $v): ?>
|
| 34 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
| 35 |
+
<?php endforeach ?>
|
| 36 |
+
</select>
|
| 37 |
+
</div>
|
| 38 |
+
<div class="v-fix">
|
| 39 |
+
<select id="<?php echo $_code ?>_expiry_year" class="year">
|
| 40 |
+
<?php foreach ($this->getPaymillCcYears() as $k => $v): ?>
|
| 41 |
+
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $this->getInfoData($_code . '_expiry_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
| 42 |
+
<?php endforeach ?>
|
| 43 |
+
</select>
|
| 44 |
+
</div>
|
| 45 |
</div>
|
| 46 |
</li>
|
| 47 |
+
<?php if (Mage::helper('paymill/optionHelper')->isShowingLabels()) : ?>
|
| 48 |
+
<li><div class='paymill_powered'><div class='paymill_credits'><?php echo $this->__("paymill_slogan"); ?><a href='http://www.paymill.de' target='_blank'>PAYMILL</a></div></div></li>
|
| 49 |
+
<?php endif; ?>
|
| 50 |
<li>
|
| 51 |
<input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
|
| 52 |
+
<input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getPreAuthAmount($_code) ?>"/>
|
| 53 |
<input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
|
| 54 |
<input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
|
|
|
|
| 55 |
<input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
|
| 56 |
<input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
|
| 57 |
<input class="paymill-info-fastCheckout-cc" name="payment[paymill-info-fastCheckout-cc]" id="payment[paymill-info-fastCheckout-cc]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
|
| 58 |
+
<input class="paymill-payment-error-number" name="payment[paymill-payment-error-number]" id="payment[paymill-payment-error-number]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_cc") . "<br/>\n" ?>" />
|
| 59 |
+
<input class="paymill-payment-error-holder" name="payment[paymill-payment-error-holder]" id="payment[paymill-payment-error-holder]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_cc") . "<br/>\n" ?>" />
|
| 60 |
+
<input class="paymill-payment-error-expdate" name="payment[paymill-payment-error-expdate]" id="payment[paymill-payment-error-expdate]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_expdate") . "<br/>\n" ?>" />
|
| 61 |
+
<input class="paymill-payment-error-cvc" name="payment[paymill-payment-error-cvc]" id="payment[paymill-payment-error--cvc]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_cvc") . "<br/>\n" ?>" />
|
| 62 |
</li>
|
| 63 |
</ul>
|
| 64 |
</div>
|
app/design/frontend/base/default/template/paymill/payment/form/directdebit.phtml
CHANGED
|
@@ -1,47 +1,42 @@
|
|
| 1 |
-
<?php $_code
|
| 2 |
-
<script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath()."paymentForm.js"?>"></script>
|
| 3 |
-
<?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code)?>
|
| 4 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 5 |
<li>
|
| 6 |
<p class="paymill-payment-errors alert-error" style="display:none;"></p>
|
| 7 |
</li>
|
| 8 |
<li>
|
| 9 |
-
<label class="
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
<li>
|
| 14 |
-
<input class="elv-account" type="text" size="20"/>
|
| 15 |
-
</li>
|
| 16 |
-
<li>
|
| 17 |
-
<label class="elv-bankcode-label">
|
| 18 |
-
<?php echo $this->__("paymill_bankcode") ?>
|
| 19 |
-
</label>
|
| 20 |
-
</li>
|
| 21 |
-
<li>
|
| 22 |
-
<input class="elv-bankcode" type="text" size="20"/>
|
| 23 |
</li>
|
| 24 |
<li>
|
| 25 |
-
<label class="
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
</li>
|
| 29 |
<li>
|
| 30 |
-
<
|
|
|
|
|
|
|
|
|
|
| 31 |
</li>
|
| 32 |
-
<?php if(Mage::helper('paymill/optionHelper')->isShowingLabels())
|
|
|
|
|
|
|
| 33 |
<li>
|
| 34 |
<input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
|
| 35 |
-
<input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->
|
| 36 |
<input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
|
| 37 |
<input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
|
| 38 |
-
<input class="paymill-option-tokenTolerance-elv" name="payment[paymill-option-tokenTolerance-elv]" id="payment[paymill-option-tokenTolerance-elv]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getTokenTolerance($_code) ?>" />
|
| 39 |
<input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
|
| 40 |
<input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
|
| 41 |
<input class="paymill-info-fastCheckout-elv" name="payment[paymill-info-fastCheckout-elv]" id="payment[paymill-info-fastCheckout-elv]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
|
| 42 |
-
<input class="paymill-payment-error-number-elv" name="payment[paymill-payment-error-number-elv]" id="payment[paymill-payment-error-number-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_elv") ."<br/>\n" ?>" />
|
| 43 |
-
<input class="paymill-payment-error-holder-elv" name="payment[paymill-payment-error-holder-elv]" id="payment[paymill-payment-error-holder-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_elv") ."<br/>\n" ?>" />
|
| 44 |
-
<input class="paymill-payment-error-bankcode" name="payment[paymill-payment-error-bankcode]" id="payment[paymill-payment-error-bankcode]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_bankcode")
|
| 45 |
</li>
|
| 46 |
</ul>
|
| 47 |
</div>
|
| 1 |
+
<?php $_code = $this->getMethodCode() ?>
|
| 2 |
+
<script type="text/javascript" src="<?php echo Mage::helper('paymill')->getJscriptPath() . "paymentForm.js" ?>"></script>
|
| 3 |
+
<?php echo Mage::helper('paymill')->getFormTypeForDisplay($_code) ?>
|
| 4 |
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 5 |
<li>
|
| 6 |
<p class="paymill-payment-errors alert-error" style="display:none;"></p>
|
| 7 |
</li>
|
| 8 |
<li>
|
| 9 |
+
<label for="<?php echo $_code ?>_holdername" class="required"><em>*</em><?php echo $this->__("paymill_Holder") ?></label>
|
| 10 |
+
<div class="input-box">
|
| 11 |
+
<input value="" type="text" id="<?php echo $_code ?>_holdername" class="input-text paymill-validate-dd-holdername required-entry"/>
|
| 12 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
</li>
|
| 14 |
<li>
|
| 15 |
+
<label for="<?php echo $_code ?>_account" class="required"><em>*</em><?php echo $this->__("paymill_account") ?></label>
|
| 16 |
+
<div class="input-box">
|
| 17 |
+
<input value="" type="text" id="<?php echo $_code ?>_account" class="input-text paymill-validate-dd-account required-entry"/>
|
| 18 |
+
</div>
|
| 19 |
</li>
|
| 20 |
<li>
|
| 21 |
+
<label for="<?php echo $_code ?>_bankcode" class="required"><em>*</em><?php echo $this->__("paymill_bankcode") ?></label>
|
| 22 |
+
<div class="input-box">
|
| 23 |
+
<input value="" type="text" id="<?php echo $_code ?>_bankcode" class="input-text paymill-validate-dd-bankcode required-entry"/>
|
| 24 |
+
</div>
|
| 25 |
</li>
|
| 26 |
+
<?php if (Mage::helper('paymill/optionHelper')->isShowingLabels()) : ?>
|
| 27 |
+
<li><div class='paymill_powered'><div class='paymill_credits'> <?php echo $this->__("paymill_slogan_elv"); ?> <a href='http://www.paymill.de' target='_blank'>PAYMILL</a></div></div></li>
|
| 28 |
+
<?php endif; ?>
|
| 29 |
<li>
|
| 30 |
<input class="paymill-payment-token" name="payment[paymill-payment-token]" id="payment[paymill-payment-token]" type="hidden" value="" />
|
| 31 |
+
<input class="paymill-payment-amount" name="payment[paymill-payment-amount]" id="payment[paymill-payment-amount]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getPreAuthAmount($_code) ?>" />
|
| 32 |
<input class="paymill-payment-currency" name="payment[paymill-payment-currency]" id="payment[paymill-payment-currency]" type="hidden" value="<?php echo Mage::helper('paymill/paymentHelper')->getCurrency() ?>" />
|
| 33 |
<input class="paymill-option-debug" name="payment[paymill-option-debug]" id="payment[paymill-option-debug]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->isInDebugMode() ?>" />
|
|
|
|
| 34 |
<input class="paymill-info-image-path" name="payment[paymill-info-image-path]" id="payment[paymill-info-image-path]" type="hidden" value="<?php echo Mage::helper('paymill')->getImagePath() ?>" />
|
| 35 |
<input class="paymill-info-public_key" name="payment[paymill-info-public_key]" id="payment[paymill-info-public_key]" type="hidden" value="<?php echo Mage::helper('paymill/optionHelper')->getPublicKey() ?>" />
|
| 36 |
<input class="paymill-info-fastCheckout-elv" name="payment[paymill-info-fastCheckout-elv]" id="payment[paymill-info-fastCheckout-elv]" type="hidden" value="<?php echo Mage::helper('paymill')->showTemplateForm($_code) ?>" />
|
| 37 |
+
<input class="paymill-payment-error-number-elv" name="payment[paymill-payment-error-number-elv]" id="payment[paymill-payment-error-number-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_number_elv") . "<br/>\n" ?>" />
|
| 38 |
+
<input class="paymill-payment-error-holder-elv" name="payment[paymill-payment-error-holder-elv]" id="payment[paymill-payment-error-holder-elv]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_holder_elv") . "<br/>\n" ?>" />
|
| 39 |
+
<input class="paymill-payment-error-bankcode" name="payment[paymill-payment-error-bankcode]" id="payment[paymill-payment-error-bankcode]" type="hidden" value="<?php echo $this->__("paymill_error_text_invalid_bankcode") . "<br/>\n" ?>" />
|
| 40 |
</li>
|
| 41 |
</ul>
|
| 42 |
</div>
|
app/design/frontend/base/default/template/paymill/payment/info/creditcard.phtml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
<table>
|
| 2 |
-
<tr>
|
| 3 |
-
|
| 4 |
-
</tr>
|
| 5 |
-
</table>
|
| 6 |
<?php echo $this->getChildHtml() ?>
|
| 1 |
+
<table>
|
| 2 |
+
<tr>
|
| 3 |
+
<td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
|
| 4 |
+
</tr>
|
| 5 |
+
</table>
|
| 6 |
<?php echo $this->getChildHtml() ?>
|
app/design/frontend/base/default/template/paymill/payment/info/directdebit.phtml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
<table>
|
| 2 |
-
<tr>
|
| 3 |
-
|
| 4 |
-
</tr>
|
| 5 |
-
</table>
|
| 6 |
<?php echo $this->getChildHtml() ?>
|
| 1 |
+
<table>
|
| 2 |
+
<tr>
|
| 3 |
+
<td><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></td>
|
| 4 |
+
</tr>
|
| 5 |
+
</table>
|
| 6 |
<?php echo $this->getChildHtml() ?>
|
app/etc/modules/Paymill_Paymill.xml
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
-
<config>
|
| 3 |
-
<modules>
|
| 4 |
-
<!-- declare CompanyName_NewModule module -->
|
| 5 |
-
<Paymill_Paymill>
|
| 6 |
-
<!-- this is an active module -->
|
| 7 |
-
<active>true</active>
|
| 8 |
-
<!-- this module will be located in app/code/local code pool -->
|
| 9 |
-
<codePool>community</codePool>
|
| 10 |
-
<!-- specify dependencies for correct module loading order -->
|
| 11 |
-
<depends>
|
| 12 |
-
<Mage_Payment />
|
| 13 |
-
</depends>
|
| 14 |
-
</Paymill_Paymill>
|
| 15 |
-
</modules>
|
| 16 |
-
</config>
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<!-- declare CompanyName_NewModule module -->
|
| 5 |
+
<Paymill_Paymill>
|
| 6 |
+
<!-- this is an active module -->
|
| 7 |
+
<active>true</active>
|
| 8 |
+
<!-- this module will be located in app/code/local code pool -->
|
| 9 |
+
<codePool>community</codePool>
|
| 10 |
+
<!-- specify dependencies for correct module loading order -->
|
| 11 |
+
<depends>
|
| 12 |
+
<Mage_Payment />
|
| 13 |
+
</depends>
|
| 14 |
+
</Paymill_Paymill>
|
| 15 |
+
</modules>
|
| 16 |
+
</config>
|
app/locale/de_DE/Paymill_Paymill.csv
CHANGED
|
@@ -6,14 +6,14 @@
|
|
| 6 |
"paymill_Public_Key","Public Key"
|
| 7 |
"paymill_Private_Key","Private Key"
|
| 8 |
"paymill_Activate_Debugging","Debugging aktivieren"
|
| 9 |
-
"paymill_fc_active","
|
| 10 |
"paymill_Activate_Logging","Logging aktivieren"
|
| 11 |
"paymill_Show_Label","Paymill Label im Checkout anzeigen"
|
| 12 |
-
"paymill_credit_card_label","Kreditkarte"
|
| 13 |
-
"paymill_direct_debit_label","Lastschrift"
|
| 14 |
-
"paymill_opt_Enabled","
|
| 15 |
"paymill_opt_Countries","Länder"
|
| 16 |
-
"paymill_opt_Sort","
|
| 17 |
"paymill_Number","Nummer"
|
| 18 |
"paymill_Cvc","CVC"
|
| 19 |
"paymill_Holder","Inhabername"
|
|
@@ -44,11 +44,12 @@
|
|
| 44 |
"paymill_backend_log_dev_info","Entwickler Informationen"
|
| 45 |
"paymill_backend_log_dev_info_additional","Weitere Entwickler Informationen"
|
| 46 |
"paymill_checkout_generating_invoice","Rechnung wird generiert"
|
| 47 |
-
"paymill_preAuth_active","Kreditkarten
|
| 48 |
"paymill_token_tolerace","Token Toleranz Wert"
|
| 49 |
"paymill_token_tolerace_tooltip","Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
|
| 50 |
"paymill_token_tolerace_comment", "Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
|
| 51 |
"paymill_log_action_success", "Aktion erfolgreich"
|
| 52 |
-
"paymill_accepted_currency", "
|
| 53 |
"paymill_slogan","Sichere Kreditkartenzahlung powered by "
|
|
|
|
| 54 |
"paymill_error_text_invalid_cvc", "Ungültige CVC"
|
| 6 |
"paymill_Public_Key","Public Key"
|
| 7 |
"paymill_Private_Key","Private Key"
|
| 8 |
"paymill_Activate_Debugging","Debugging aktivieren"
|
| 9 |
+
"paymill_fc_active","Fast Checkout erlauben"
|
| 10 |
"paymill_Activate_Logging","Logging aktivieren"
|
| 11 |
"paymill_Show_Label","Paymill Label im Checkout anzeigen"
|
| 12 |
+
"paymill_credit_card_label","Paymill Kreditkarte"
|
| 13 |
+
"paymill_direct_debit_label","Paymill Lastschrift"
|
| 14 |
+
"paymill_opt_Enabled","Aktivieren"
|
| 15 |
"paymill_opt_Countries","Länder"
|
| 16 |
+
"paymill_opt_Sort","Reihenfolge"
|
| 17 |
"paymill_Number","Nummer"
|
| 18 |
"paymill_Cvc","CVC"
|
| 19 |
"paymill_Holder","Inhabername"
|
| 44 |
"paymill_backend_log_dev_info","Entwickler Informationen"
|
| 45 |
"paymill_backend_log_dev_info_additional","Weitere Entwickler Informationen"
|
| 46 |
"paymill_checkout_generating_invoice","Rechnung wird generiert"
|
| 47 |
+
"paymill_preAuth_active","Kreditkarten Transaktionen im Checkout authorisieren, Buchung bei Rechnungsgenerierung durchführen."
|
| 48 |
"paymill_token_tolerace","Token Toleranz Wert"
|
| 49 |
"paymill_token_tolerace_tooltip","Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
|
| 50 |
"paymill_token_tolerace_comment", "Wert der bei Generierung des Paymill Tokens aufgeschlagen wird, um 3DSecure Abweichungen zu vermeiden"
|
| 51 |
"paymill_log_action_success", "Aktion erfolgreich"
|
| 52 |
+
"paymill_accepted_currency", "Akzeptierte Währungen"
|
| 53 |
"paymill_slogan","Sichere Kreditkartenzahlung powered by "
|
| 54 |
+
"paymill_slogan_elv","Elektronisches Lastschriftverfahren powered by "
|
| 55 |
"paymill_error_text_invalid_cvc", "Ungültige CVC"
|
app/locale/en_GB/Paymill_Paymill.csv
CHANGED
|
@@ -5,25 +5,25 @@
|
|
| 5 |
"paymill_Basic_Setting","Paymill Basic Settings"
|
| 6 |
"paymill_Public_Key","Public Key"
|
| 7 |
"paymill_Private_Key","Private Key"
|
| 8 |
-
"paymill_Activate_Debugging","
|
| 9 |
-
"paymill_fc_active","
|
| 10 |
-
"paymill_Activate_Logging","
|
| 11 |
"paymill_Show_Label","show Paymill label during checkout"
|
| 12 |
-
"paymill_credit_card_label","Credit Card"
|
| 13 |
-
"paymill_direct_debit_label","Direct Debit"
|
| 14 |
-
"paymill_opt_Enabled","
|
| 15 |
"paymill_opt_Countries","Countries"
|
| 16 |
-
"paymill_opt_Sort","
|
| 17 |
"paymill_Number","Number"
|
| 18 |
"paymill_Cvc","CVC"
|
| 19 |
-
"paymill_Holder","
|
| 20 |
"paymill_Date","Valid until (MM/YYYY)"
|
| 21 |
"paymill_Amount","Amount"
|
| 22 |
"paymill_Currency","Currency"
|
| 23 |
"paymill_public_key_tooltip","Please enter your Public Key."
|
| 24 |
-
"paymill_public_key_comment","You can find your
|
| 25 |
"paymill_private_key_tooltip","Please enter your Private Key."
|
| 26 |
-
"paymill_private_key_comment","You can find your
|
| 27 |
"paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
|
| 28 |
"paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
|
| 29 |
"paymill_error_text_invalid_expdate","Invalid Expiry Date"
|
|
@@ -48,7 +48,8 @@
|
|
| 48 |
"paymill_token_tolerace","Token Tolerance Value"
|
| 49 |
"paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
|
| 50 |
"paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
|
| 51 |
-
"paymill_log_action_success", "Action
|
| 52 |
"paymill_accepted_currency", "Accepted Currencies"
|
| 53 |
-
"paymill_slogan","Secure
|
|
|
|
| 54 |
"paymill_error_text_invalid_cvc", "Invalid cvc"
|
| 5 |
"paymill_Basic_Setting","Paymill Basic Settings"
|
| 6 |
"paymill_Public_Key","Public Key"
|
| 7 |
"paymill_Private_Key","Private Key"
|
| 8 |
+
"paymill_Activate_Debugging","Activate Debugging"
|
| 9 |
+
"paymill_fc_active","Enable Fast Checkout"
|
| 10 |
+
"paymill_Activate_Logging","Enable Logging"
|
| 11 |
"paymill_Show_Label","show Paymill label during checkout"
|
| 12 |
+
"paymill_credit_card_label","Paymill Credit Card"
|
| 13 |
+
"paymill_direct_debit_label","Paymill Direct Debit"
|
| 14 |
+
"paymill_opt_Enabled","Enable"
|
| 15 |
"paymill_opt_Countries","Countries"
|
| 16 |
+
"paymill_opt_Sort","Sort Order"
|
| 17 |
"paymill_Number","Number"
|
| 18 |
"paymill_Cvc","CVC"
|
| 19 |
+
"paymill_Holder","Accountowner"
|
| 20 |
"paymill_Date","Valid until (MM/YYYY)"
|
| 21 |
"paymill_Amount","Amount"
|
| 22 |
"paymill_Currency","Currency"
|
| 23 |
"paymill_public_key_tooltip","Please enter your Public Key."
|
| 24 |
+
"paymill_public_key_comment","You can find your Public Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
|
| 25 |
"paymill_private_key_tooltip","Please enter your Private Key."
|
| 26 |
+
"paymill_private_key_comment","You can find your Private Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
|
| 27 |
"paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
|
| 28 |
"paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
|
| 29 |
"paymill_error_text_invalid_expdate","Invalid Expiry Date"
|
| 48 |
"paymill_token_tolerace","Token Tolerance Value"
|
| 49 |
"paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
|
| 50 |
"paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
|
| 51 |
+
"paymill_log_action_success", "Action Successful"
|
| 52 |
"paymill_accepted_currency", "Accepted Currencies"
|
| 53 |
+
"paymill_slogan","Secure credit card payments powered by "
|
| 54 |
+
"paymill_slogan_elv","Direct debit payments powered by "
|
| 55 |
"paymill_error_text_invalid_cvc", "Invalid cvc"
|
app/locale/en_US/Paymill_Paymill.csv
CHANGED
|
@@ -5,25 +5,25 @@
|
|
| 5 |
"paymill_Basic_Setting","Paymill Basic Settings"
|
| 6 |
"paymill_Public_Key","Public Key"
|
| 7 |
"paymill_Private_Key","Private Key"
|
| 8 |
-
"paymill_Activate_Debugging","
|
| 9 |
-
"paymill_fc_active","
|
| 10 |
-
"paymill_Activate_Logging","
|
| 11 |
"paymill_Show_Label","show Paymill label during checkout"
|
| 12 |
-
"paymill_credit_card_label","Credit Card"
|
| 13 |
-
"paymill_direct_debit_label","Direct Debit"
|
| 14 |
-
"paymill_opt_Enabled","
|
| 15 |
"paymill_opt_Countries","Countries"
|
| 16 |
-
"paymill_opt_Sort","
|
| 17 |
"paymill_Number","Number"
|
| 18 |
"paymill_Cvc","CVC"
|
| 19 |
-
"paymill_Holder","
|
| 20 |
"paymill_Date","Valid until (MM/YYYY)"
|
| 21 |
"paymill_Amount","Amount"
|
| 22 |
"paymill_Currency","Currency"
|
| 23 |
"paymill_public_key_tooltip","Please enter your Public Key."
|
| 24 |
-
"paymill_public_key_comment","You can find your
|
| 25 |
"paymill_private_key_tooltip","Please enter your Private Key."
|
| 26 |
-
"paymill_private_key_comment","You can find your
|
| 27 |
"paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
|
| 28 |
"paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
|
| 29 |
"paymill_error_text_invalid_expdate","Invalid Expiry Date"
|
|
@@ -48,7 +48,8 @@
|
|
| 48 |
"paymill_token_tolerace","Token Tolerance Value"
|
| 49 |
"paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
|
| 50 |
"paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
|
| 51 |
-
"paymill_log_action_success", "Action
|
| 52 |
"paymill_accepted_currency", "Accepted Currencies"
|
| 53 |
-
"paymill_slogan","Secure
|
|
|
|
| 54 |
"paymill_error_text_invalid_cvc", "Invalid cvc"
|
| 5 |
"paymill_Basic_Setting","Paymill Basic Settings"
|
| 6 |
"paymill_Public_Key","Public Key"
|
| 7 |
"paymill_Private_Key","Private Key"
|
| 8 |
+
"paymill_Activate_Debugging","Activate Debugging"
|
| 9 |
+
"paymill_fc_active","Enable Fast Checkout"
|
| 10 |
+
"paymill_Activate_Logging","Enable Logging"
|
| 11 |
"paymill_Show_Label","show Paymill label during checkout"
|
| 12 |
+
"paymill_credit_card_label","Paymill Credit Card"
|
| 13 |
+
"paymill_direct_debit_label","Paymill Direct Debit"
|
| 14 |
+
"paymill_opt_Enabled","Enable"
|
| 15 |
"paymill_opt_Countries","Countries"
|
| 16 |
+
"paymill_opt_Sort","Sort Order"
|
| 17 |
"paymill_Number","Number"
|
| 18 |
"paymill_Cvc","CVC"
|
| 19 |
+
"paymill_Holder","Accountowner"
|
| 20 |
"paymill_Date","Valid until (MM/YYYY)"
|
| 21 |
"paymill_Amount","Amount"
|
| 22 |
"paymill_Currency","Currency"
|
| 23 |
"paymill_public_key_tooltip","Please enter your Public Key."
|
| 24 |
+
"paymill_public_key_comment","You can find your Public Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
|
| 25 |
"paymill_private_key_tooltip","Please enter your Private Key."
|
| 26 |
+
"paymill_private_key_comment","You can find your Private Key in the Paymill cockpit by clicking: MY ACCOUNT->Settings->API keys"
|
| 27 |
"paymill_error_text_invalid_number_cc","Please enter a valid Credit Card number."
|
| 28 |
"paymill_error_text_invalid_number_elv","Please enter a valid Accountnumber"
|
| 29 |
"paymill_error_text_invalid_expdate","Invalid Expiry Date"
|
| 48 |
"paymill_token_tolerace","Token Tolerance Value"
|
| 49 |
"paymill_token_tolerace_tooltip","Sum of all additional charges used to avoid 3D secure variations"
|
| 50 |
"paymill_token_tolerace_comment", "Sum of all additional charges used to avoid 3D secure variations"
|
| 51 |
+
"paymill_log_action_success", "Action Successful"
|
| 52 |
"paymill_accepted_currency", "Accepted Currencies"
|
| 53 |
+
"paymill_slogan","Secure credit card payments powered by "
|
| 54 |
+
"paymill_slogan_elv","Direct debit payments powered by "
|
| 55 |
"paymill_error_text_invalid_cvc", "Invalid cvc"
|
js/paymill/paymentForm.js
CHANGED
|
@@ -4,7 +4,7 @@ var PAYMILL_PUBLIC_KEY = null;
|
|
| 4 |
//State Descriptors
|
| 5 |
var PAYMILL_PAYMENT_NAME = "Preparing Payment";
|
| 6 |
var PAYMILL_IMAGE_PATH = null;
|
| 7 |
-
var PAYMILL_NO_FAST_CHECKOUT
|
| 8 |
|
| 9 |
//Errortexts
|
| 10 |
var PAYMILL_ERROR_STRING = "";
|
|
@@ -42,18 +42,38 @@ function debug(message)
|
|
| 42 |
*/
|
| 43 |
function paymillShowCardIcon()
|
| 44 |
{
|
| 45 |
-
switch(paymill.cardType(pmQuery('
|
| 46 |
case 'Visa':
|
| 47 |
-
pmQuery('
|
| 48 |
-
pmQuery('
|
| 49 |
break;
|
| 50 |
-
case '
|
| 51 |
-
pmQuery('
|
| 52 |
-
pmQuery('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
break;
|
| 54 |
default:
|
| 55 |
-
pmQuery('
|
| 56 |
-
debug("Creditcard number not according to any known pattern: "+paymill.cardType(pmQuery('
|
| 57 |
break;
|
| 58 |
}
|
| 59 |
}
|
|
@@ -85,8 +105,6 @@ function paymillResponseHandler(error, result)
|
|
| 85 |
function paymillSubmitForm()
|
| 86 |
{
|
| 87 |
PAYMILL_PAYMENT_NAME = pmQuery("input[name='payment[method]']:checked").val();
|
| 88 |
-
PAYMILL_ERROR_STRING = "";
|
| 89 |
-
pmQuery('.paymill-payment-errors').hide();
|
| 90 |
|
| 91 |
if(PAYMILL_PAYMENT_NAME === "paymill_creditcard"){
|
| 92 |
PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC = pmQuery('.paymill-payment-error-number').val();
|
|
@@ -104,61 +122,95 @@ function paymillSubmitForm()
|
|
| 104 |
switch(PAYMILL_PAYMENT_NAME){
|
| 105 |
case "paymill_creditcard":
|
| 106 |
PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-cc').val();
|
| 107 |
-
PAYMILL_TOKEN_TOLERANCE = pmQuery('.paymill-option-tokenTolerance-cc').val();
|
| 108 |
if(PAYMILL_NO_FAST_CHECKOUT){
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
-
if
|
| 119 |
-
|
| 120 |
-
debug(PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC);
|
| 121 |
}
|
| 122 |
|
| 123 |
-
if (false == paymill.validateCvc(pmQuery('.card-cvc').val())) {
|
| 124 |
-
PAYMILL_ERROR_STRING += PAYMILL_ERROR_TEXT_IVALID_CVC;
|
| 125 |
-
debug(PAYMILL_ERROR_TEXT_IVALID_CVC);
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
var params = {
|
| 129 |
-
amount_int:
|
| 130 |
currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
|
| 131 |
-
number: pmQuery('
|
| 132 |
-
exp_month: pmQuery('
|
| 133 |
-
exp_year: pmQuery('
|
| 134 |
-
cvc: pmQuery('
|
| 135 |
-
cardholdername: pmQuery('
|
| 136 |
};
|
| 137 |
}
|
| 138 |
break;
|
| 139 |
|
| 140 |
case "paymill_directdebit":
|
| 141 |
PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-elv').val();
|
| 142 |
-
PAYMILL_TOKEN_TOLERANCE = pmQuery('.paymill-option-tokenTolerance-elv').val();
|
| 143 |
if(PAYMILL_NO_FAST_CHECKOUT){
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
}
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
}
|
| 156 |
-
var params = {
|
| 157 |
-
amount_int: pmQuery('.paymill-payment-amount').val() + PAYMILL_TOKEN_TOLERANCE, // E.g. "15" for 0.15 Eur
|
| 158 |
-
currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
|
| 159 |
-
number: pmQuery('.elv-account').val(),
|
| 160 |
-
bank: pmQuery('.elv-bankcode').val(),
|
| 161 |
-
accountholder: pmQuery('.elv-holdername').val()
|
| 162 |
};
|
| 163 |
}
|
| 164 |
break;
|
|
@@ -167,14 +219,8 @@ function paymillSubmitForm()
|
|
| 167 |
payment.save();
|
| 168 |
return false;
|
| 169 |
break;
|
| 170 |
-
}
|
| 171 |
-
if(PAYMILL_ERROR_STRING !== ""){
|
| 172 |
-
debug(PAYMILL_ERROR_STRING);
|
| 173 |
-
// Append Errormessage to form
|
| 174 |
-
pmQuery('.paymill-payment-errors').html(PAYMILL_ERROR_STRING);
|
| 175 |
-
pmQuery('.paymill-payment-errors').show();
|
| 176 |
-
return false;
|
| 177 |
}
|
|
|
|
| 178 |
if(PAYMILL_NO_FAST_CHECKOUT){
|
| 179 |
debug("Generating Token");
|
| 180 |
paymill.createToken(params, paymillResponseHandler);
|
|
@@ -191,10 +237,8 @@ pmQuery(document).ready(function()
|
|
| 191 |
{
|
| 192 |
//Gather Data
|
| 193 |
PAYMILL_PUBLIC_KEY = pmQuery('.paymill-info-public_key').val();
|
| 194 |
-
PAYMILL_ERROR_STRING = "";
|
| 195 |
-
pmQuery('.paymill-payment-errors').hide();
|
| 196 |
|
| 197 |
-
pmQuery('#
|
| 198 |
pmQuery('#payment-buttons-container button:first').prop("onclick", null);
|
| 199 |
pmQuery('#payment-buttons-container button:first').unbind('click');
|
| 200 |
pmQuery('#payment-buttons-container button:first').click(paymillSubmitForm);
|
| 4 |
//State Descriptors
|
| 5 |
var PAYMILL_PAYMENT_NAME = "Preparing Payment";
|
| 6 |
var PAYMILL_IMAGE_PATH = null;
|
| 7 |
+
var PAYMILL_NO_FAST_CHECKOUT = false;
|
| 8 |
|
| 9 |
//Errortexts
|
| 10 |
var PAYMILL_ERROR_STRING = "";
|
| 42 |
*/
|
| 43 |
function paymillShowCardIcon()
|
| 44 |
{
|
| 45 |
+
switch(paymill.cardType(pmQuery('#paymill_creditcard_number').val())){
|
| 46 |
case 'Visa':
|
| 47 |
+
pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_visa.png" >');
|
| 48 |
+
pmQuery('#paymill_creditcard_card_icon').show();
|
| 49 |
break;
|
| 50 |
+
case 'Mastercard':
|
| 51 |
+
pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_mastercard.png" >');
|
| 52 |
+
pmQuery('#paymill_creditcard_card_icon').show();
|
| 53 |
+
break;
|
| 54 |
+
case 'American Express':
|
| 55 |
+
pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_amex.png" >');
|
| 56 |
+
pmQuery('#paymill_creditcard_card_icon').show();
|
| 57 |
+
break;
|
| 58 |
+
case 'JCB':
|
| 59 |
+
pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_jcb.png" >');
|
| 60 |
+
pmQuery('#paymill_creditcard_card_icon').show();
|
| 61 |
+
break;
|
| 62 |
+
case 'Maestro':
|
| 63 |
+
pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_maestro.png" >');
|
| 64 |
+
pmQuery('#paymill_creditcard_card_icon').show();
|
| 65 |
+
break;
|
| 66 |
+
case 'Diners Club':
|
| 67 |
+
pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_dinersclub.png" >');
|
| 68 |
+
pmQuery('#paymill_creditcard_card_icon').show();
|
| 69 |
+
break;
|
| 70 |
+
case 'Discover':
|
| 71 |
+
pmQuery('#paymill_creditcard_card_icon').html('<img src="'+ pmQuery('.paymill-info-image-path').val() +'icon_32x20_discover.png" >');
|
| 72 |
+
pmQuery('#paymill_creditcard_card_icon').show();
|
| 73 |
break;
|
| 74 |
default:
|
| 75 |
+
pmQuery('#paymill_creditcard_card_icon').hide();
|
| 76 |
+
debug("Creditcard number not according to any known pattern: "+paymill.cardType(pmQuery('#paymill_creditcard_number').val()));
|
| 77 |
break;
|
| 78 |
}
|
| 79 |
}
|
| 105 |
function paymillSubmitForm()
|
| 106 |
{
|
| 107 |
PAYMILL_PAYMENT_NAME = pmQuery("input[name='payment[method]']:checked").val();
|
|
|
|
|
|
|
| 108 |
|
| 109 |
if(PAYMILL_PAYMENT_NAME === "paymill_creditcard"){
|
| 110 |
PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC = pmQuery('.paymill-payment-error-number').val();
|
| 122 |
switch(PAYMILL_PAYMENT_NAME){
|
| 123 |
case "paymill_creditcard":
|
| 124 |
PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-cc').val();
|
|
|
|
| 125 |
if(PAYMILL_NO_FAST_CHECKOUT){
|
| 126 |
+
var paymillValidator = new Validation('co-payment-form');
|
| 127 |
+
var nv = {};
|
| 128 |
+
nv['paymill-validate-cc-number'] = new Validator('paymill-validate-cc-number', PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC, function(v) {
|
| 129 |
+
if (false == paymill.validateCardNumber(pmQuery('#paymill_creditcard_number').val())) {
|
| 130 |
+
debug(PAYMILL_ERROR_TEXT_IVALID_NUMBER_CC);
|
| 131 |
+
return false;
|
| 132 |
+
}
|
| 133 |
+
return true;
|
| 134 |
+
}, '');
|
| 135 |
+
nv['paymill-validate-cc-expdate'] = new Validator('paymill-validate-cc-expdate', PAYMILL_ERROR_TEXT_IVALID_EXPDATE, function(v) {
|
| 136 |
+
if (false == paymill.validateExpiry(pmQuery('#paymill_creditcard_expiry_month').val(), pmQuery('#paymill_creditcard_expiry_year').val())) {
|
| 137 |
+
debug(PAYMILL_ERROR_TEXT_IVALID_EXPDATE);
|
| 138 |
+
return false;
|
| 139 |
+
}
|
| 140 |
+
return true;
|
| 141 |
+
}, '');
|
| 142 |
+
nv['paymill-validate-cc-holder'] = new Validator('paymill-validate-cc-holder', PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC, function(v) {
|
| 143 |
+
if (pmQuery('#paymill_creditcard_holdername').val() == '') {
|
| 144 |
+
debug(PAYMILL_ERROR_TEXT_IVALID_HOLDER_CC);
|
| 145 |
+
return false;
|
| 146 |
+
}
|
| 147 |
+
return true;
|
| 148 |
+
}, '');
|
| 149 |
+
nv['paymill-validate-cc-cvc'] = new Validator('paymill-validate-cc-cvc', PAYMILL_ERROR_TEXT_IVALID_CVC, function(v) {
|
| 150 |
+
if (false == paymill.validateCvc(pmQuery('#paymill_creditcard_cvc').val())) {
|
| 151 |
+
debug(PAYMILL_ERROR_TEXT_IVALID_CVC);
|
| 152 |
+
return false;
|
| 153 |
+
}
|
| 154 |
+
return true;
|
| 155 |
+
}, '');
|
| 156 |
+
|
| 157 |
+
Object.extend(Validation.methods, nv);
|
| 158 |
|
| 159 |
+
if(!paymillValidator.validate()) {
|
| 160 |
+
return false;
|
|
|
|
| 161 |
}
|
| 162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
var params = {
|
| 164 |
+
amount_int: parseInt(pmQuery('.paymill-payment-amount').val()), // E.g. "15" for 0.15 Eur
|
| 165 |
currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
|
| 166 |
+
number: pmQuery('#paymill_creditcard_number').val(),
|
| 167 |
+
exp_month: pmQuery('#paymill_creditcard_expiry_month').val(),
|
| 168 |
+
exp_year: pmQuery('#paymill_creditcard_expiry_year').val(),
|
| 169 |
+
cvc: pmQuery('#paymill_creditcard_cvc').val(),
|
| 170 |
+
cardholdername: pmQuery('#paymill_creditcard_holdername').val()
|
| 171 |
};
|
| 172 |
}
|
| 173 |
break;
|
| 174 |
|
| 175 |
case "paymill_directdebit":
|
| 176 |
PAYMILL_NO_FAST_CHECKOUT = pmQuery('.paymill-info-fastCheckout-elv').val();
|
|
|
|
| 177 |
if(PAYMILL_NO_FAST_CHECKOUT){
|
| 178 |
+
var paymillValidator = new Validation('co-payment-form');
|
| 179 |
+
var nv = {};
|
| 180 |
+
nv['paymill-validate-dd-holdername'] = new Validator('paymill-validate-dd-holdername', PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV, function(v) {
|
| 181 |
+
if (false == pmQuery('#paymill_directdebit_holdername').val()) {
|
| 182 |
+
debug(PAYMILL_ERROR_TEXT_IVALID_HOLDER_ELV);
|
| 183 |
+
return false;
|
| 184 |
+
}
|
| 185 |
+
return true;
|
| 186 |
+
}, '');
|
| 187 |
+
nv['paymill-validate-dd-account'] = new Validator('paymill-validate-dd-account', PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV, function(v) {
|
| 188 |
+
if (false == paymill.validateAccountNumber(pmQuery('#paymill_directdebit_account').val())) {
|
| 189 |
+
debug(PAYMILL_ERROR_TEXT_IVALID_NUMBER_ELV);
|
| 190 |
+
return false;
|
| 191 |
+
}
|
| 192 |
+
return true;
|
| 193 |
+
}, '');
|
| 194 |
+
nv['paymill-validate-dd-bankcode'] = new Validator('paymill-validate-dd-bankcode', PAYMILL_ERROR_TEXT_IVALID_BANKCODE, function(v) {
|
| 195 |
+
if (false == paymill.validateBankCode(pmQuery('#paymill_directdebit_bankcode').val())) {
|
| 196 |
+
debug(PAYMILL_ERROR_TEXT_IVALID_BANKCODE);
|
| 197 |
+
return false;
|
| 198 |
+
}
|
| 199 |
+
return true;
|
| 200 |
+
}, '');
|
| 201 |
+
|
| 202 |
+
Object.extend(Validation.methods, nv);
|
| 203 |
+
|
| 204 |
+
if(!paymillValidator.validate()) {
|
| 205 |
+
return false;
|
| 206 |
}
|
| 207 |
+
|
| 208 |
+
var params = {
|
| 209 |
+
amount_int: pmQuery('.paymill-payment-amount').val(), // E.g. "15" for 0.15 Eur
|
| 210 |
+
currency: pmQuery('.paymill-payment-currency').val(), // ISO 4217 e.g. "EUR"
|
| 211 |
+
number: pmQuery('#paymill_directdebit_account').val(),
|
| 212 |
+
bank: pmQuery('#paymill_directdebit_bankcode').val(),
|
| 213 |
+
accountholder: pmQuery('#paymill_directdebit_holdername').val()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
};
|
| 215 |
}
|
| 216 |
break;
|
| 219 |
payment.save();
|
| 220 |
return false;
|
| 221 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
}
|
| 223 |
+
|
| 224 |
if(PAYMILL_NO_FAST_CHECKOUT){
|
| 225 |
debug("Generating Token");
|
| 226 |
paymill.createToken(params, paymillResponseHandler);
|
| 237 |
{
|
| 238 |
//Gather Data
|
| 239 |
PAYMILL_PUBLIC_KEY = pmQuery('.paymill-info-public_key').val();
|
|
|
|
|
|
|
| 240 |
|
| 241 |
+
pmQuery('#paymill_creditcard_number').live('input', paymillShowCardIcon);
|
| 242 |
pmQuery('#payment-buttons-container button:first').prop("onclick", null);
|
| 243 |
pmQuery('#payment-buttons-container button:first').unbind('click');
|
| 244 |
pmQuery('#payment-buttons-container button:first').click(paymillSubmitForm);
|
lib/Services/Paymill/Apiclient/Curl.php
CHANGED
|
@@ -1,158 +1,159 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once 'Interface.php';
|
| 4 |
-
|
| 5 |
-
require_once realpath(dirname(__FILE__)) . '/../Exception.php';
|
| 6 |
-
|
| 7 |
-
if (!function_exists('json_decode')) {
|
| 8 |
-
throw new Exception("Please install the PHP JSON extension");
|
| 9 |
-
}
|
| 10 |
-
|
| 11 |
-
if (!function_exists('curl_init')) {
|
| 12 |
-
throw new Exception("Please install the PHP cURL extension");
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
/**
|
| 16 |
-
* Services_Paymill cURL HTTP client
|
| 17 |
-
*/
|
| 18 |
-
class Services_Paymill_Apiclient_Curl implements Services_Paymill_Apiclient_Interface
|
| 19 |
-
{
|
| 20 |
-
|
| 21 |
-
/**
|
| 22 |
-
* Paymill API merchant key
|
| 23 |
-
*
|
| 24 |
-
* @var string
|
| 25 |
-
*/
|
| 26 |
-
private $_apiKey = null;
|
| 27 |
-
|
| 28 |
-
private $_responseArray = null;
|
| 29 |
-
|
| 30 |
-
/**
|
| 31 |
-
* Paymill API base url
|
| 32 |
-
*
|
| 33 |
-
* @var string
|
| 34 |
-
*/
|
| 35 |
-
private $_apiUrl = '/';
|
| 36 |
-
|
| 37 |
-
const USER_AGENT = 'Paymill-php/0.0.2';
|
| 38 |
-
|
| 39 |
-
public static $lastRawResponse;
|
| 40 |
-
public static $lastRawCurlOptions;
|
| 41 |
-
|
| 42 |
-
/**
|
| 43 |
-
* cURL HTTP client constructor
|
| 44 |
-
*
|
| 45 |
-
* @param string $apiKey
|
| 46 |
-
* @param string $apiEndpoint
|
| 47 |
-
*/
|
| 48 |
-
public function __construct($apiKey, $apiEndpoint)
|
| 49 |
-
{
|
| 50 |
-
$this->_apiKey = $apiKey;
|
| 51 |
-
$this->_apiUrl = $apiEndpoint;
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
/**
|
| 55 |
-
* Perform API and handle exceptions
|
| 56 |
-
*
|
| 57 |
-
* @param $action
|
| 58 |
-
* @param array $params
|
| 59 |
-
* @param string $method
|
| 60 |
-
* @return mixed
|
| 61 |
-
* @throws Services_Paymill_Exception
|
| 62 |
-
* @throws Exception
|
| 63 |
-
*/
|
| 64 |
-
public function request($action, $params = array(), $method = 'POST')
|
| 65 |
-
{
|
| 66 |
-
if (!is_array($params))
|
| 67 |
-
$params = array();
|
| 68 |
-
|
| 69 |
-
try {
|
| 70 |
-
$this->_responseArray = $this->_requestApi($action, $params, $method);
|
| 71 |
-
$httpStatusCode = $this->_responseArray['header']['status'];
|
| 72 |
-
if ($httpStatusCode != 200) {
|
| 73 |
-
$errorMessage = 'Client returned HTTP status code ' . $httpStatusCode;
|
| 74 |
-
if (isset($this->_responseArray['body']['error'])) {
|
| 75 |
-
$errorMessage = $this->_responseArray['body']['error'];
|
| 76 |
-
}
|
| 77 |
-
$responseCode = '';
|
| 78 |
-
if (isset($this->_responseArray['body']['response_code'])) {
|
| 79 |
-
$responseCode = $this->_responseArray['body']['response_code'];
|
| 80 |
-
}
|
| 81 |
-
|
| 82 |
-
return array("data" => array(
|
| 83 |
-
"error" => $errorMessage,
|
| 84 |
-
"response_code" => $responseCode
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
*
|
| 97 |
-
*
|
| 98 |
-
* @param
|
| 99 |
-
* @param
|
| 100 |
-
* @
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
$curlOpts[CURLOPT_URL] .=
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
$
|
| 129 |
-
|
| 130 |
-
self::$
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
'
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
*
|
| 153 |
-
* @
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
|
|
|
| 158 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once 'Interface.php';
|
| 4 |
+
|
| 5 |
+
require_once realpath(dirname(__FILE__)) . '/../Exception.php';
|
| 6 |
+
|
| 7 |
+
if (!function_exists('json_decode')) {
|
| 8 |
+
throw new Exception("Please install the PHP JSON extension");
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
if (!function_exists('curl_init')) {
|
| 12 |
+
throw new Exception("Please install the PHP cURL extension");
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* Services_Paymill cURL HTTP client
|
| 17 |
+
*/
|
| 18 |
+
class Services_Paymill_Apiclient_Curl implements Services_Paymill_Apiclient_Interface
|
| 19 |
+
{
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* Paymill API merchant key
|
| 23 |
+
*
|
| 24 |
+
* @var string
|
| 25 |
+
*/
|
| 26 |
+
private $_apiKey = null;
|
| 27 |
+
|
| 28 |
+
private $_responseArray = null;
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* Paymill API base url
|
| 32 |
+
*
|
| 33 |
+
* @var string
|
| 34 |
+
*/
|
| 35 |
+
private $_apiUrl = '/';
|
| 36 |
+
|
| 37 |
+
const USER_AGENT = 'Paymill-php/0.0.2';
|
| 38 |
+
|
| 39 |
+
public static $lastRawResponse;
|
| 40 |
+
public static $lastRawCurlOptions;
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* cURL HTTP client constructor
|
| 44 |
+
*
|
| 45 |
+
* @param string $apiKey
|
| 46 |
+
* @param string $apiEndpoint
|
| 47 |
+
*/
|
| 48 |
+
public function __construct($apiKey, $apiEndpoint)
|
| 49 |
+
{
|
| 50 |
+
$this->_apiKey = $apiKey;
|
| 51 |
+
$this->_apiUrl = $apiEndpoint;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Perform API and handle exceptions
|
| 56 |
+
*
|
| 57 |
+
* @param $action
|
| 58 |
+
* @param array $params
|
| 59 |
+
* @param string $method
|
| 60 |
+
* @return mixed
|
| 61 |
+
* @throws Services_Paymill_Exception
|
| 62 |
+
* @throws Exception
|
| 63 |
+
*/
|
| 64 |
+
public function request($action, $params = array(), $method = 'POST')
|
| 65 |
+
{
|
| 66 |
+
if (!is_array($params))
|
| 67 |
+
$params = array();
|
| 68 |
+
|
| 69 |
+
try {
|
| 70 |
+
$this->_responseArray = $this->_requestApi($action, $params, $method);
|
| 71 |
+
$httpStatusCode = $this->_responseArray['header']['status'];
|
| 72 |
+
if ($httpStatusCode != 200) {
|
| 73 |
+
$errorMessage = 'Client returned HTTP status code ' . $httpStatusCode;
|
| 74 |
+
if (isset($this->_responseArray['body']['error'])) {
|
| 75 |
+
$errorMessage = $this->_responseArray['body']['error'];
|
| 76 |
+
}
|
| 77 |
+
$responseCode = '';
|
| 78 |
+
if (isset($this->_responseArray['body']['response_code'])) {
|
| 79 |
+
$responseCode = $this->_responseArray['body']['response_code'];
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
return array("data" => array(
|
| 83 |
+
"error" => $errorMessage,
|
| 84 |
+
"response_code" => $responseCode,
|
| 85 |
+
"http_status_code" => $httpStatusCode
|
| 86 |
+
));
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
return $this->_responseArray['body'];
|
| 90 |
+
} catch (Exception $e) {
|
| 91 |
+
return array("data" => array("error" => $e->getMessage()));
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* Perform HTTP request to REST endpoint
|
| 97 |
+
*
|
| 98 |
+
* @param string $action
|
| 99 |
+
* @param array $params
|
| 100 |
+
* @param string $method
|
| 101 |
+
* @return array
|
| 102 |
+
*/
|
| 103 |
+
protected function _requestApi($action = '', $params = array(), $method = 'POST')
|
| 104 |
+
{
|
| 105 |
+
$curlOpts = array(
|
| 106 |
+
CURLOPT_URL => $this->_apiUrl . $action,
|
| 107 |
+
CURLOPT_RETURNTRANSFER => true,
|
| 108 |
+
CURLOPT_CUSTOMREQUEST => $method,
|
| 109 |
+
CURLOPT_USERAGENT => self::USER_AGENT,
|
| 110 |
+
CURLOPT_SSL_VERIFYPEER => true,
|
| 111 |
+
CURLOPT_CAINFO => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'paymill.crt',
|
| 112 |
+
);
|
| 113 |
+
|
| 114 |
+
if (Services_Paymill_Apiclient_Interface::HTTP_GET === $method) {
|
| 115 |
+
if (0 !== count($params)) {
|
| 116 |
+
$curlOpts[CURLOPT_URL] .= false === strpos($curlOpts[CURLOPT_URL], '?') ? '?' : '&';
|
| 117 |
+
$curlOpts[CURLOPT_URL] .= http_build_query($params, null, '&');
|
| 118 |
+
}
|
| 119 |
+
} else {
|
| 120 |
+
$curlOpts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
if ($this->_apiKey) {
|
| 124 |
+
$curlOpts[CURLOPT_USERPWD] = $this->_apiKey . ':';
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
$curl = curl_init();
|
| 128 |
+
curl_setopt_array($curl, $curlOpts);
|
| 129 |
+
$responseBody = curl_exec($curl);
|
| 130 |
+
self::$lastRawCurlOptions = $curlOpts;
|
| 131 |
+
self::$lastRawResponse = $responseBody;
|
| 132 |
+
$responseInfo = curl_getinfo($curl);
|
| 133 |
+
if ($responseBody === false) {
|
| 134 |
+
$responseBody = array('error' => curl_error($curl));
|
| 135 |
+
}
|
| 136 |
+
curl_close($curl);
|
| 137 |
+
|
| 138 |
+
if ('application/json' === $responseInfo['content_type']) {
|
| 139 |
+
$responseBody = json_decode($responseBody, true);
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
return array(
|
| 143 |
+
'header' => array(
|
| 144 |
+
'status' => $responseInfo['http_code'],
|
| 145 |
+
'reason' => null,
|
| 146 |
+
),
|
| 147 |
+
'body' => $responseBody
|
| 148 |
+
);
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
/**
|
| 152 |
+
* Returns the response of the request as an array.
|
| 153 |
+
* @return mixed Response
|
| 154 |
+
* @todo Create Unit Test
|
| 155 |
+
*/
|
| 156 |
+
public function getResponse(){
|
| 157 |
+
return $this->_responseArray;
|
| 158 |
+
}
|
| 159 |
}
|
lib/Services/Paymill/Apiclient/Interface.php
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
interface Services_Paymill_Apiclient_Interface
|
| 4 |
-
{
|
| 5 |
-
const HTTP_POST = 'POST';
|
| 6 |
-
const HTTP_GET = 'GET';
|
| 7 |
-
const HTTP_PUT = 'PUT';
|
| 8 |
-
const HTTP_DELETE = 'DELETE';
|
| 9 |
-
|
| 10 |
-
/**
|
| 11 |
-
* Perform API and handle exceptions
|
| 12 |
-
*
|
| 13 |
-
* @param $action
|
| 14 |
-
* @param array $params
|
| 15 |
-
* @param string $method
|
| 16 |
-
* @return mixed
|
| 17 |
-
*/
|
| 18 |
-
public function request($action, $params = array(), $method = 'POST');
|
| 19 |
-
|
| 20 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
interface Services_Paymill_Apiclient_Interface
|
| 4 |
+
{
|
| 5 |
+
const HTTP_POST = 'POST';
|
| 6 |
+
const HTTP_GET = 'GET';
|
| 7 |
+
const HTTP_PUT = 'PUT';
|
| 8 |
+
const HTTP_DELETE = 'DELETE';
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Perform API and handle exceptions
|
| 12 |
+
*
|
| 13 |
+
* @param $action
|
| 14 |
+
* @param array $params
|
| 15 |
+
* @param string $method
|
| 16 |
+
* @return mixed
|
| 17 |
+
*/
|
| 18 |
+
public function request($action, $params = array(), $method = 'POST');
|
| 19 |
+
|
| 20 |
}
|
lib/Services/Paymill/Base.php
CHANGED
|
@@ -1,145 +1,145 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once 'Apiclient/Curl.php';
|
| 4 |
-
/**
|
| 5 |
-
* Paymill API wrapper super class
|
| 6 |
-
*/
|
| 7 |
-
abstract class Services_Paymill_Base
|
| 8 |
-
{
|
| 9 |
-
/**
|
| 10 |
-
* Resource relative url path name ending with '/', set or override in subclass
|
| 11 |
-
*
|
| 12 |
-
* @var string
|
| 13 |
-
*/
|
| 14 |
-
protected $_serviceResource = null;
|
| 15 |
-
|
| 16 |
-
/**
|
| 17 |
-
* Paymill HTTP client class
|
| 18 |
-
*
|
| 19 |
-
* @var Services_Paymill_Apiclient_Interface
|
| 20 |
-
*/
|
| 21 |
-
protected $_httpClient;
|
| 22 |
-
|
| 23 |
-
/**
|
| 24 |
-
* Base constructor
|
| 25 |
-
* sets _httpClient property
|
| 26 |
-
*
|
| 27 |
-
* @param string $apiKey merchant api key
|
| 28 |
-
* @param string $apiEndpoint endpoint URL for the api
|
| 29 |
-
*/
|
| 30 |
-
public function __construct($apiKey, $apiEndpoint)
|
| 31 |
-
{
|
| 32 |
-
$this->_httpClient = new Services_Paymill_Apiclient_Curl($apiKey, $apiEndpoint);
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
/**
|
| 36 |
-
* General REST GET verb
|
| 37 |
-
*
|
| 38 |
-
* @param array $filters e.g. count,offest
|
| 39 |
-
* @param string $identifier resource id
|
| 40 |
-
*
|
| 41 |
-
* @return array of resource items
|
| 42 |
-
*/
|
| 43 |
-
public function get($filters = array(), $identifier = '')
|
| 44 |
-
{
|
| 45 |
-
$response = $this->_httpClient->request(
|
| 46 |
-
$this->_serviceResource . $identifier,
|
| 47 |
-
$filters,
|
| 48 |
-
Services_Paymill_Apiclient_Interface::HTTP_GET
|
| 49 |
-
);
|
| 50 |
-
|
| 51 |
-
return $response['data'];
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
/**
|
| 55 |
-
* General REST GET verb
|
| 56 |
-
* returns one item or null
|
| 57 |
-
*
|
| 58 |
-
* @param string $identifier resource id
|
| 59 |
-
*
|
| 60 |
-
* @return array resource item | null
|
| 61 |
-
*/
|
| 62 |
-
public function getOne($identifier = null)
|
| 63 |
-
{
|
| 64 |
-
if (!$identifier) {
|
| 65 |
-
return null;
|
| 66 |
-
}
|
| 67 |
-
|
| 68 |
-
$filters = array("count" => 1, 'offset' => 0);
|
| 69 |
-
|
| 70 |
-
return $this->get($filters, $identifier);
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
/**
|
| 74 |
-
* General REST DELETE verb
|
| 75 |
-
* Delete or inactivate/cancel resource item
|
| 76 |
-
*
|
| 77 |
-
* @param string $clientId
|
| 78 |
-
*
|
| 79 |
-
* @return array item deleted
|
| 80 |
-
*/
|
| 81 |
-
public function delete($clientId = null)
|
| 82 |
-
{
|
| 83 |
-
$response = $this->_httpClient->request(
|
| 84 |
-
$this->_serviceResource . $clientId,
|
| 85 |
-
array(),
|
| 86 |
-
Services_Paymill_Apiclient_Interface::HTTP_DELETE
|
| 87 |
-
);
|
| 88 |
-
|
| 89 |
-
return $response['data'];
|
| 90 |
-
}
|
| 91 |
-
|
| 92 |
-
/**
|
| 93 |
-
* General REST POST verb
|
| 94 |
-
* create resource item
|
| 95 |
-
*
|
| 96 |
-
* @param array $itemData
|
| 97 |
-
*
|
| 98 |
-
* @return array created item
|
| 99 |
-
*/
|
| 100 |
-
public function create($itemData = array())
|
| 101 |
-
{
|
| 102 |
-
$response = $this->_httpClient->request(
|
| 103 |
-
$this->_serviceResource,
|
| 104 |
-
$itemData,
|
| 105 |
-
Services_Paymill_Apiclient_Interface::HTTP_POST
|
| 106 |
-
);
|
| 107 |
-
|
| 108 |
-
return $response['data'];
|
| 109 |
-
}
|
| 110 |
-
|
| 111 |
-
/**
|
| 112 |
-
* General REST PUT verb
|
| 113 |
-
* Update resource item
|
| 114 |
-
*
|
| 115 |
-
* @param array $itemData
|
| 116 |
-
*
|
| 117 |
-
* @return array item updated or null
|
| 118 |
-
*/
|
| 119 |
-
public function update(array $itemData = array())
|
| 120 |
-
{
|
| 121 |
-
if (!isset($itemData['id']) ) {
|
| 122 |
-
return null;
|
| 123 |
-
}
|
| 124 |
-
|
| 125 |
-
$itemId = $itemData['id'];
|
| 126 |
-
unset ($itemData['id']);
|
| 127 |
-
|
| 128 |
-
$response = $this->_httpClient->request(
|
| 129 |
-
$this->_serviceResource . $itemId,
|
| 130 |
-
$itemData,
|
| 131 |
-
Services_Paymill_Apiclient_Interface::HTTP_PUT
|
| 132 |
-
);
|
| 133 |
-
|
| 134 |
-
return $response['data'];
|
| 135 |
-
}
|
| 136 |
-
|
| 137 |
-
/**
|
| 138 |
-
* Returns the response of the last request as an array
|
| 139 |
-
* @return mixed Response
|
| 140 |
-
* @todo Add Unit test
|
| 141 |
-
*/
|
| 142 |
-
public function getResponse(){
|
| 143 |
-
return $this->_httpClient->getResponse();
|
| 144 |
-
}
|
| 145 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once 'Apiclient/Curl.php';
|
| 4 |
+
/**
|
| 5 |
+
* Paymill API wrapper super class
|
| 6 |
+
*/
|
| 7 |
+
abstract class Services_Paymill_Base
|
| 8 |
+
{
|
| 9 |
+
/**
|
| 10 |
+
* Resource relative url path name ending with '/', set or override in subclass
|
| 11 |
+
*
|
| 12 |
+
* @var string
|
| 13 |
+
*/
|
| 14 |
+
protected $_serviceResource = null;
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Paymill HTTP client class
|
| 18 |
+
*
|
| 19 |
+
* @var Services_Paymill_Apiclient_Interface
|
| 20 |
+
*/
|
| 21 |
+
protected $_httpClient;
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Base constructor
|
| 25 |
+
* sets _httpClient property
|
| 26 |
+
*
|
| 27 |
+
* @param string $apiKey merchant api key
|
| 28 |
+
* @param string $apiEndpoint endpoint URL for the api
|
| 29 |
+
*/
|
| 30 |
+
public function __construct($apiKey, $apiEndpoint)
|
| 31 |
+
{
|
| 32 |
+
$this->_httpClient = new Services_Paymill_Apiclient_Curl($apiKey, $apiEndpoint);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* General REST GET verb
|
| 37 |
+
*
|
| 38 |
+
* @param array $filters e.g. count,offest
|
| 39 |
+
* @param string $identifier resource id
|
| 40 |
+
*
|
| 41 |
+
* @return array of resource items
|
| 42 |
+
*/
|
| 43 |
+
public function get($filters = array(), $identifier = '')
|
| 44 |
+
{
|
| 45 |
+
$response = $this->_httpClient->request(
|
| 46 |
+
$this->_serviceResource . $identifier,
|
| 47 |
+
$filters,
|
| 48 |
+
Services_Paymill_Apiclient_Interface::HTTP_GET
|
| 49 |
+
);
|
| 50 |
+
|
| 51 |
+
return $response['data'];
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* General REST GET verb
|
| 56 |
+
* returns one item or null
|
| 57 |
+
*
|
| 58 |
+
* @param string $identifier resource id
|
| 59 |
+
*
|
| 60 |
+
* @return array resource item | null
|
| 61 |
+
*/
|
| 62 |
+
public function getOne($identifier = null)
|
| 63 |
+
{
|
| 64 |
+
if (!$identifier) {
|
| 65 |
+
return null;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
$filters = array("count" => 1, 'offset' => 0);
|
| 69 |
+
|
| 70 |
+
return $this->get($filters, $identifier);
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* General REST DELETE verb
|
| 75 |
+
* Delete or inactivate/cancel resource item
|
| 76 |
+
*
|
| 77 |
+
* @param string $clientId
|
| 78 |
+
*
|
| 79 |
+
* @return array item deleted
|
| 80 |
+
*/
|
| 81 |
+
public function delete($clientId = null)
|
| 82 |
+
{
|
| 83 |
+
$response = $this->_httpClient->request(
|
| 84 |
+
$this->_serviceResource . $clientId,
|
| 85 |
+
array(),
|
| 86 |
+
Services_Paymill_Apiclient_Interface::HTTP_DELETE
|
| 87 |
+
);
|
| 88 |
+
|
| 89 |
+
return $response['data'];
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* General REST POST verb
|
| 94 |
+
* create resource item
|
| 95 |
+
*
|
| 96 |
+
* @param array $itemData
|
| 97 |
+
*
|
| 98 |
+
* @return array created item
|
| 99 |
+
*/
|
| 100 |
+
public function create($itemData = array())
|
| 101 |
+
{
|
| 102 |
+
$response = $this->_httpClient->request(
|
| 103 |
+
$this->_serviceResource,
|
| 104 |
+
$itemData,
|
| 105 |
+
Services_Paymill_Apiclient_Interface::HTTP_POST
|
| 106 |
+
);
|
| 107 |
+
|
| 108 |
+
return $response['data'];
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
/**
|
| 112 |
+
* General REST PUT verb
|
| 113 |
+
* Update resource item
|
| 114 |
+
*
|
| 115 |
+
* @param array $itemData
|
| 116 |
+
*
|
| 117 |
+
* @return array item updated or null
|
| 118 |
+
*/
|
| 119 |
+
public function update(array $itemData = array())
|
| 120 |
+
{
|
| 121 |
+
if (!isset($itemData['id']) ) {
|
| 122 |
+
return null;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
$itemId = $itemData['id'];
|
| 126 |
+
unset ($itemData['id']);
|
| 127 |
+
|
| 128 |
+
$response = $this->_httpClient->request(
|
| 129 |
+
$this->_serviceResource . $itemId,
|
| 130 |
+
$itemData,
|
| 131 |
+
Services_Paymill_Apiclient_Interface::HTTP_PUT
|
| 132 |
+
);
|
| 133 |
+
|
| 134 |
+
return $response['data'];
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
/**
|
| 138 |
+
* Returns the response of the last request as an array
|
| 139 |
+
* @return mixed Response
|
| 140 |
+
* @todo Add Unit test
|
| 141 |
+
*/
|
| 142 |
+
public function getResponse(){
|
| 143 |
+
return $this->_httpClient->getResponse();
|
| 144 |
+
}
|
| 145 |
}
|
lib/Services/Paymill/Clients.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once ('Base.php');
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Paymill API wrapper for clients resource
|
| 7 |
-
*/
|
| 8 |
-
class Services_Paymill_Clients extends Services_Paymill_Base
|
| 9 |
-
{
|
| 10 |
-
/**
|
| 11 |
-
* {@inheritDoc}
|
| 12 |
-
*/
|
| 13 |
-
protected $_serviceResource = 'clients/';
|
| 14 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once ('Base.php');
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Paymill API wrapper for clients resource
|
| 7 |
+
*/
|
| 8 |
+
class Services_Paymill_Clients extends Services_Paymill_Base
|
| 9 |
+
{
|
| 10 |
+
/**
|
| 11 |
+
* {@inheritDoc}
|
| 12 |
+
*/
|
| 13 |
+
protected $_serviceResource = 'clients/';
|
| 14 |
}
|
lib/Services/Paymill/Exception.php
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Services_Paymill_Exception class
|
| 5 |
-
*/
|
| 6 |
-
class Services_Paymill_Exception extends Exception
|
| 7 |
-
{
|
| 8 |
-
/**
|
| 9 |
-
* Constructor for exception object
|
| 10 |
-
*
|
| 11 |
-
* @return void
|
| 12 |
-
*/
|
| 13 |
-
public function __construct($message, $code)
|
| 14 |
-
{
|
| 15 |
-
parent::__construct($message, $code);
|
| 16 |
-
}
|
| 17 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Services_Paymill_Exception class
|
| 5 |
+
*/
|
| 6 |
+
class Services_Paymill_Exception extends Exception
|
| 7 |
+
{
|
| 8 |
+
/**
|
| 9 |
+
* Constructor for exception object
|
| 10 |
+
*
|
| 11 |
+
* @return void
|
| 12 |
+
*/
|
| 13 |
+
public function __construct($message, $code)
|
| 14 |
+
{
|
| 15 |
+
parent::__construct($message, $code);
|
| 16 |
+
}
|
| 17 |
}
|
lib/Services/Paymill/LoggingInterface.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
interface Services_Paymill_LoggingInterface
|
| 4 |
-
{
|
| 5 |
-
|
| 6 |
-
/**
|
| 7 |
-
* Logging for PaymentProcessor
|
| 8 |
-
*
|
| 9 |
-
* @param type $message
|
| 10 |
-
* @param type $debugInfo
|
| 11 |
-
*/
|
| 12 |
-
public function log($message, $debugInfo);
|
| 13 |
-
|
| 14 |
-
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
interface Services_Paymill_LoggingInterface
|
| 4 |
+
{
|
| 5 |
+
|
| 6 |
+
/**
|
| 7 |
+
* Logging for PaymentProcessor
|
| 8 |
+
*
|
| 9 |
+
* @param type $message
|
| 10 |
+
* @param type $debugInfo
|
| 11 |
+
*/
|
| 12 |
+
public function log($message, $debugInfo = null, $additionalInformation = null);
|
| 13 |
+
|
| 14 |
+
}
|
lib/Services/Paymill/Offers.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once ('Base.php');
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Paymill API wrapper for offers resource
|
| 7 |
-
*/
|
| 8 |
-
class Services_Paymill_Offers extends Services_Paymill_Base
|
| 9 |
-
{
|
| 10 |
-
/**
|
| 11 |
-
* {@inheritDoc}
|
| 12 |
-
*/
|
| 13 |
-
protected $_serviceResource = 'offers/';
|
| 14 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once ('Base.php');
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Paymill API wrapper for offers resource
|
| 7 |
+
*/
|
| 8 |
+
class Services_Paymill_Offers extends Services_Paymill_Base
|
| 9 |
+
{
|
| 10 |
+
/**
|
| 11 |
+
* {@inheritDoc}
|
| 12 |
+
*/
|
| 13 |
+
protected $_serviceResource = 'offers/';
|
| 14 |
}
|
lib/Services/Paymill/PaymentProcessor.php
CHANGED
|
@@ -1,463 +1,549 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* This class acts as an easy to use gateway for the paymill phph wrapper.
|
| 5 |
-
* @version 1.0.0
|
| 6 |
-
* @category PayIntelligent
|
| 7 |
-
* @copyright Copyright (c) 2013 PayIntelligent GmbH (http://payintelligent.de)
|
| 8 |
-
*/
|
| 9 |
-
class Services_Paymill_PaymentProcessor
|
| 10 |
-
{
|
| 11 |
-
|
| 12 |
-
//Options: Variables needed to create Paymill Lib Components
|
| 13 |
-
private $_libBase;
|
| 14 |
-
private $_privateKey;
|
| 15 |
-
private $_apiUrl;
|
| 16 |
-
//Objects: Objects used by the methods
|
| 17 |
-
private $
|
| 18 |
-
private $
|
| 19 |
-
private $
|
| 20 |
-
private $
|
| 21 |
-
//
|
| 22 |
-
|
| 23 |
-
private $
|
| 24 |
-
private $
|
| 25 |
-
private $
|
| 26 |
-
private $
|
| 27 |
-
private $
|
| 28 |
-
private $
|
| 29 |
-
private $
|
| 30 |
-
|
| 31 |
-
private $
|
| 32 |
-
private $
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
*
|
| 41 |
-
*
|
| 42 |
-
*
|
| 43 |
-
*
|
| 44 |
-
*
|
| 45 |
-
* <b>
|
| 46 |
-
*
|
| 47 |
-
*
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
$this->
|
| 57 |
-
$this->
|
| 58 |
-
$this->
|
| 59 |
-
$this->
|
| 60 |
-
$this->
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
$this->
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
*
|
| 165 |
-
*/
|
| 166 |
-
private function
|
| 167 |
-
{
|
| 168 |
-
$
|
| 169 |
-
$
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
return $this->
|
| 328 |
-
}
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
*
|
| 332 |
-
*
|
| 333 |
-
* @return
|
| 334 |
-
*/
|
| 335 |
-
public function
|
| 336 |
-
{
|
| 337 |
-
return
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
*
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
*
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
*
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* This class acts as an easy to use gateway for the paymill phph wrapper.
|
| 5 |
+
* @version 1.0.0
|
| 6 |
+
* @category PayIntelligent
|
| 7 |
+
* @copyright Copyright (c) 2013 PayIntelligent GmbH (http://payintelligent.de)
|
| 8 |
+
*/
|
| 9 |
+
class Services_Paymill_PaymentProcessor
|
| 10 |
+
{
|
| 11 |
+
|
| 12 |
+
//Options: Variables needed to create Paymill Lib Components
|
| 13 |
+
private $_libBase;
|
| 14 |
+
private $_privateKey;
|
| 15 |
+
private $_apiUrl;
|
| 16 |
+
//Objects: Objects used by the methods
|
| 17 |
+
private $_transactionsObject;
|
| 18 |
+
private $_preauthObject;
|
| 19 |
+
private $_clientsObject;
|
| 20 |
+
private $_paymentsObject;
|
| 21 |
+
private $_logger; //Only this object can be set using a set function.
|
| 22 |
+
//Process Payment relevant
|
| 23 |
+
private $_token; //Token generated for the Transaction
|
| 24 |
+
private $_amount; //Current Amount
|
| 25 |
+
private $_preAuthAmount;
|
| 26 |
+
private $_currency; //Currency (of both amounts)
|
| 27 |
+
private $_name; //Customername
|
| 28 |
+
private $_email; //Customer Email Adress
|
| 29 |
+
private $_description;
|
| 30 |
+
private $_lastResponse;
|
| 31 |
+
private $_transactionId; //Transaction Id generated by the createTransaction function.
|
| 32 |
+
private $_preauthId;
|
| 33 |
+
//Fast Checkout Variables
|
| 34 |
+
private $_clientId = null;
|
| 35 |
+
private $_paymentId = null;
|
| 36 |
+
//Source
|
| 37 |
+
private $_source;
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* Creates an object of the PaymentProcessor class.
|
| 41 |
+
* @param String <b>$privateKey</b> Paymill-PrivateKey
|
| 42 |
+
* @param String <b>$apiUrl</b> Paymill-Api Url
|
| 43 |
+
* @param String <b>$libBase</b> Path to the lib Base (Can be null, Default Path will be used)
|
| 44 |
+
* @param array <b>$params</b>( <br />
|
| 45 |
+
* <b>token</b>, generated Token <br />
|
| 46 |
+
* <b>amount</b>, Basketamount <br />
|
| 47 |
+
* <b>currency</b>, Transaction currency <br />
|
| 48 |
+
* <b>name</b>, Customer name <br />
|
| 49 |
+
* <b>email</b>, Customer emailaddress <br />
|
| 50 |
+
* <b>description</b>, Description for transactions <br />
|
| 51 |
+
* ) <p color='red'><b>(If not set here, the use of setters is required for the class to work)</b></p>
|
| 52 |
+
* @param object $loggingClassInstance Instance of Object implementing the Services_Paymill_PaymentProcessorInterface. If not set, there will be no logging.
|
| 53 |
+
*/
|
| 54 |
+
public function __construct($privateKey = null, $apiUrl = null, $libBase = null, $params = null, Services_Paymill_LoggingInterface $loggingClassInstance = null)
|
| 55 |
+
{
|
| 56 |
+
$this->setPrivateKey($privateKey);
|
| 57 |
+
$this->setApiUrl($apiUrl);
|
| 58 |
+
$this->setLibBase($libBase);
|
| 59 |
+
$this->_preAuthAmount = $params['preauthamount'];
|
| 60 |
+
$this->_token = $params['token'];
|
| 61 |
+
$this->_amount = $params['amount'];
|
| 62 |
+
$this->_currency = $params['currency'];
|
| 63 |
+
$this->_name = $params['name'];
|
| 64 |
+
$this->_email = $params['email'];
|
| 65 |
+
$this->_description = $params['description'];
|
| 66 |
+
$this->setLogger($loggingClassInstance);
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* Creates a Paymill-Client with the given Data
|
| 71 |
+
*
|
| 72 |
+
* @param array $params
|
| 73 |
+
* @return boolean
|
| 74 |
+
*/
|
| 75 |
+
private function _createClient()
|
| 76 |
+
{
|
| 77 |
+
if (isset($this->_clientId)) {
|
| 78 |
+
$this->_log("Client using: " . $this->_clientId);
|
| 79 |
+
} else {
|
| 80 |
+
$client = $this->_clientsObject->create(
|
| 81 |
+
array(
|
| 82 |
+
'email' => $this->_email,
|
| 83 |
+
'description' => $this->_description
|
| 84 |
+
)
|
| 85 |
+
);
|
| 86 |
+
|
| 87 |
+
$this->_validateResult($client, 'Client');
|
| 88 |
+
|
| 89 |
+
$this->_clientId = $client['id'];
|
| 90 |
+
}
|
| 91 |
+
return $this->_clientId;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* Creates a Paymill-Payment with the given Data
|
| 96 |
+
*
|
| 97 |
+
* @param array $params
|
| 98 |
+
* @return boolean
|
| 99 |
+
*/
|
| 100 |
+
private function _createPayment()
|
| 101 |
+
{
|
| 102 |
+
if (isset($this->_paymentId)) {
|
| 103 |
+
$this->_log("Payment using: " . $this->_paymentId);
|
| 104 |
+
} else {
|
| 105 |
+
$payment = $this->_paymentsObject->create(
|
| 106 |
+
array(
|
| 107 |
+
'token' => $this->_token,
|
| 108 |
+
'client' => $this->_clientId
|
| 109 |
+
)
|
| 110 |
+
);
|
| 111 |
+
$this->_validateResult($payment, 'Payment');
|
| 112 |
+
|
| 113 |
+
$this->_paymentId = $payment['id'];
|
| 114 |
+
}
|
| 115 |
+
return true;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* Creates a Paymill-Transaction with the given Data
|
| 120 |
+
*
|
| 121 |
+
* @param array $params
|
| 122 |
+
* @return boolean
|
| 123 |
+
*/
|
| 124 |
+
private function _createTransaction()
|
| 125 |
+
{
|
| 126 |
+
$transaction = $this->_transactionsObject->create(
|
| 127 |
+
array(
|
| 128 |
+
'amount' => $this->_amount,
|
| 129 |
+
'currency' => $this->_currency,
|
| 130 |
+
'description' => $this->_description,
|
| 131 |
+
'preauthorization' => $this->_preauthId,
|
| 132 |
+
'source' => $this->_source
|
| 133 |
+
)
|
| 134 |
+
);
|
| 135 |
+
$this->_validateResult($transaction, 'Transaction');
|
| 136 |
+
|
| 137 |
+
$this->_transactionId = $transaction['id'];
|
| 138 |
+
return true;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
/**
|
| 142 |
+
* Creates a Paymill-Transaction with the given Data
|
| 143 |
+
*
|
| 144 |
+
* @param array $params
|
| 145 |
+
* @return boolean
|
| 146 |
+
*/
|
| 147 |
+
private function _createPreauthorization()
|
| 148 |
+
{
|
| 149 |
+
$preAuth = $this->_preauthObject->create(
|
| 150 |
+
array(
|
| 151 |
+
'amount' => $this->_preAuthAmount,
|
| 152 |
+
'currency' => $this->_currency,
|
| 153 |
+
'description' => $this->_description,
|
| 154 |
+
'payment' => $this->_paymentId,
|
| 155 |
+
'client' => $this->_clientId,
|
| 156 |
+
)
|
| 157 |
+
);
|
| 158 |
+
$this->_validateResult($preAuth, 'Preauthorization');
|
| 159 |
+
$this->_preauthId = $preAuth['preauthorization']['id'];
|
| 160 |
+
return true;
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
/**
|
| 164 |
+
* Load the PhpWrapper-Classes and creates an instance for each class.
|
| 165 |
+
*/
|
| 166 |
+
private function _initiatePhpWrapperClasses()
|
| 167 |
+
{
|
| 168 |
+
require_once $this->_libBase . 'Transactions.php';
|
| 169 |
+
require_once $this->_libBase . 'Preauthorizations.php';
|
| 170 |
+
require_once $this->_libBase . 'Clients.php';
|
| 171 |
+
require_once $this->_libBase . 'Payments.php';
|
| 172 |
+
|
| 173 |
+
$this->_transactionsObject = new Services_Paymill_Transactions($this->_privateKey, $this->_apiUrl);
|
| 174 |
+
$this->_preauthObject = new Services_Paymill_Preauthorizations($this->_privateKey, $this->_apiUrl);
|
| 175 |
+
$this->_clientsObject = new Services_Paymill_Clients($this->_privateKey, $this->_apiUrl);
|
| 176 |
+
$this->_paymentsObject = new Services_Paymill_Payments($this->_privateKey, $this->_apiUrl);
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/**
|
| 180 |
+
* Calls the log() function of the logger object if the object has been set.
|
| 181 |
+
*
|
| 182 |
+
* @param string $message
|
| 183 |
+
* @param string $debugInfo
|
| 184 |
+
*/
|
| 185 |
+
private function _log($message, $debugInfo = null)
|
| 186 |
+
{
|
| 187 |
+
if (isset($this->_logger)) {
|
| 188 |
+
$this->_logger->log($message, $debugInfo);
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
/**
|
| 193 |
+
* Validates the array passed as an argument to be processPayment() compliant
|
| 194 |
+
* @param mixed $parameter
|
| 195 |
+
* @return boolean
|
| 196 |
+
*/
|
| 197 |
+
private function _validateParameter()
|
| 198 |
+
{
|
| 199 |
+
if($this->_preAuthAmount == null){
|
| 200 |
+
$this->_preAuthAmount = $this->_amount;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
$validation = true;
|
| 204 |
+
$parameter = array(
|
| 205 |
+
"token" => $this->_token,
|
| 206 |
+
"amount" => $this->_amount,
|
| 207 |
+
"currency" => $this->_currency,
|
| 208 |
+
"name" => $this->_name,
|
| 209 |
+
"email" => $this->_email,
|
| 210 |
+
"description" => $this->_description);
|
| 211 |
+
|
| 212 |
+
$arrayMask = array(
|
| 213 |
+
"token" => 'string',
|
| 214 |
+
"amount" => 'integer',
|
| 215 |
+
"currency" => 'string',
|
| 216 |
+
"name" => 'string',
|
| 217 |
+
"email" => 'string',
|
| 218 |
+
"description" => 'string');
|
| 219 |
+
|
| 220 |
+
foreach ($arrayMask as $mask => $type) {
|
| 221 |
+
if (is_null($parameter[$mask])) {
|
| 222 |
+
$validation = false;
|
| 223 |
+
$this->_log("The Parameter $mask is missing.", var_export($parameter, true));
|
| 224 |
+
} else {
|
| 225 |
+
switch ($type) {
|
| 226 |
+
case 'string':
|
| 227 |
+
if (!is_string($parameter[$mask])) {
|
| 228 |
+
$this->_log("The Parameter $mask is not a string.", var_export($parameter, true));
|
| 229 |
+
$validation = false;
|
| 230 |
+
}
|
| 231 |
+
break;
|
| 232 |
+
case 'integer':
|
| 233 |
+
if (!is_integer($parameter[$mask])) {
|
| 234 |
+
$this->_log("The Parameter $mask is not an integer.", var_export($parameter, true));
|
| 235 |
+
$validation = false;
|
| 236 |
+
}
|
| 237 |
+
break;
|
| 238 |
+
}
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
if (!$validation) {
|
| 242 |
+
break;
|
| 243 |
+
}
|
| 244 |
+
}
|
| 245 |
+
return $validation;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
/**
|
| 249 |
+
* Validates the created Paymill-Objects
|
| 250 |
+
*
|
| 251 |
+
* @param array $transaction
|
| 252 |
+
* @param string $type
|
| 253 |
+
* @return boolean
|
| 254 |
+
*/
|
| 255 |
+
private function _validateResult($transaction, $type)
|
| 256 |
+
{
|
| 257 |
+
$this->_lastResponse = $transaction;
|
| 258 |
+
if (isset($transaction['data']['response_code']) && $transaction['data']['response_code'] !== 20000) {
|
| 259 |
+
$this->_log("An Error occured: " . $transaction['data']['response_code'], var_export($transaction, true));
|
| 260 |
+
throw new Exception("Invalid Result Exception: Invalid ResponseCode");
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
if (!isset($transaction['id']) && !isset($transaction['data']['id'])) {
|
| 264 |
+
$this->_log("No $type created.", var_export($transaction, true));
|
| 265 |
+
throw new Exception("Invalid Result Exception: Invalid Id");
|
| 266 |
+
} else {
|
| 267 |
+
$this->_log("$type created.", isset($transaction['id']) ? $transaction['id'] : $transaction['data']['id']);
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
// check result
|
| 271 |
+
if ($type == 'Transaction') {
|
| 272 |
+
if (is_array($transaction) && array_key_exists('status', $transaction)) {
|
| 273 |
+
if ($transaction['status'] == "closed") {
|
| 274 |
+
// transaction was successfully issued
|
| 275 |
+
return true;
|
| 276 |
+
} elseif ($transaction['status'] == "open") {
|
| 277 |
+
// transaction was issued but status is open for any reason
|
| 278 |
+
$this->_log("Status is open.", var_export($transaction, true));
|
| 279 |
+
throw new Exception("Invalid Result Exception: Invalid Orderstate");
|
| 280 |
+
} else {
|
| 281 |
+
// another error occured
|
| 282 |
+
$this->_log("Unknown error." . var_export($transaction, true));
|
| 283 |
+
throw new Exception("Invalid Result Exception: Unknown Error");
|
| 284 |
+
}
|
| 285 |
+
} else {
|
| 286 |
+
// another error occured
|
| 287 |
+
$this->_log("$type could not be issued.", var_export($transaction, true));
|
| 288 |
+
throw new Exception("Invalid Result Exception: $type could not be issued.");
|
| 289 |
+
}
|
| 290 |
+
} else {
|
| 291 |
+
return true;
|
| 292 |
+
}
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
/**
|
| 296 |
+
* Executes the Payment Process
|
| 297 |
+
*
|
| 298 |
+
* @return boolean
|
| 299 |
+
*/
|
| 300 |
+
final public function processPayment($captureNow = true)
|
| 301 |
+
{
|
| 302 |
+
$this->_initiatePhpWrapperClasses();
|
| 303 |
+
if (!$this->_validateParameter()) {
|
| 304 |
+
return false;
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
try {
|
| 308 |
+
$this->_createClient();
|
| 309 |
+
$this->_createPayment();
|
| 310 |
+
$this->_createPreauthorization();
|
| 311 |
+
if($captureNow){
|
| 312 |
+
$this->_createTransaction();
|
| 313 |
+
}
|
| 314 |
+
return true;
|
| 315 |
+
} catch (Exception $ex) {
|
| 316 |
+
// paymill wrapper threw an exception
|
| 317 |
+
$this->_log("Exception thrown from paymill wrapper.", $ex->getMessage());
|
| 318 |
+
return false;
|
| 319 |
+
}
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
final public function capture(){
|
| 323 |
+
$this->_initiatePhpWrapperClasses();
|
| 324 |
+
if(!isset($this->_amount) || !isset($this->_currency) || !isset($this->_preauthId)){
|
| 325 |
+
return false;
|
| 326 |
+
}
|
| 327 |
+
return $this->_createTransaction();
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
/**
|
| 331 |
+
* Returns the objects data
|
| 332 |
+
*
|
| 333 |
+
* @return array
|
| 334 |
+
*/
|
| 335 |
+
public function toArray()
|
| 336 |
+
{
|
| 337 |
+
return array(
|
| 338 |
+
'apiurl' => $this->_apiUrl,
|
| 339 |
+
'libbase' => $this->_libBase,
|
| 340 |
+
'privatekey' => $this->_privateKey,
|
| 341 |
+
'logger' => $this->_logger,
|
| 342 |
+
'token' => $this->_token,
|
| 343 |
+
'amount' => $this->_amount,
|
| 344 |
+
'preauthamount' => $this->_preAuthAmount,
|
| 345 |
+
'currency' => $this->_currency,
|
| 346 |
+
'description' => $this->_description,
|
| 347 |
+
'email' => $this->_email,
|
| 348 |
+
'name' => $this->_name,
|
| 349 |
+
'source' => $this->_source
|
| 350 |
+
);
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
/* * **************************************************************************************************************
|
| 354 |
+
* *********************************************** Getter **************************************************
|
| 355 |
+
* *************************************************************************************************************** */
|
| 356 |
+
|
| 357 |
+
/**
|
| 358 |
+
* <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
|
| 359 |
+
* Returns the ClientId
|
| 360 |
+
* @return String ClientId
|
| 361 |
+
*/
|
| 362 |
+
public function getClientId()
|
| 363 |
+
{
|
| 364 |
+
return $this->_clientId;
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
/**
|
| 368 |
+
* <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
|
| 369 |
+
* Returns the PaymentId
|
| 370 |
+
* @return String PaymentId
|
| 371 |
+
*/
|
| 372 |
+
public function getPaymentId()
|
| 373 |
+
{
|
| 374 |
+
return $this->_paymentId;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
/**
|
| 378 |
+
* <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
|
| 379 |
+
* Returns the TransactionId
|
| 380 |
+
* @return String TransactionId
|
| 381 |
+
*/
|
| 382 |
+
public function getTransactionId()
|
| 383 |
+
{
|
| 384 |
+
return $this->_transactionId;
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
/**
|
| 388 |
+
* <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
|
| 389 |
+
* Returns the preauthId
|
| 390 |
+
* @return String preauthId
|
| 391 |
+
*/
|
| 392 |
+
public function getPreauthId()
|
| 393 |
+
{
|
| 394 |
+
return $this->_preauthId;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
/**
|
| 398 |
+
* <p align = 'center'><b>Can only be called after the call of processPayment(). Otherwise null will be returned</b></p>
|
| 399 |
+
* Returns the last response send by Paymill
|
| 400 |
+
* @return array LastResponse
|
| 401 |
+
*/
|
| 402 |
+
public function getLastResponse()
|
| 403 |
+
{
|
| 404 |
+
return $this->_lastResponse;
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
/* * **************************************************************************************************************
|
| 408 |
+
* *********************************************** Setter **************************************************
|
| 409 |
+
* *************************************************************************************************************** */
|
| 410 |
+
|
| 411 |
+
/**
|
| 412 |
+
* Sets the clientId
|
| 413 |
+
* @param String $clientId
|
| 414 |
+
*/
|
| 415 |
+
public function setClientId($clientId = null)
|
| 416 |
+
{
|
| 417 |
+
$this->_clientId = $clientId;
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
/**
|
| 421 |
+
* Sets the paymentId
|
| 422 |
+
* @param String $paymentId
|
| 423 |
+
*/
|
| 424 |
+
public function setPaymentId($paymentId = null)
|
| 425 |
+
{
|
| 426 |
+
$this->_paymentId = $paymentId;
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
/**
|
| 430 |
+
* This method sets the token
|
| 431 |
+
* @param String $token
|
| 432 |
+
*/
|
| 433 |
+
public function setToken($token = null)
|
| 434 |
+
{
|
| 435 |
+
$this->_token = $token;
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
/**
|
| 439 |
+
* This method sets the preAuthAmount
|
| 440 |
+
* @param String $preAuthAmount
|
| 441 |
+
*/
|
| 442 |
+
public function setPreAuthAmount($preAuthAmount = null)
|
| 443 |
+
{
|
| 444 |
+
$this->_preAuthAmount = $preAuthAmount;
|
| 445 |
+
}
|
| 446 |
+
|
| 447 |
+
/**
|
| 448 |
+
* This method sets the amount
|
| 449 |
+
* @param String $amount
|
| 450 |
+
*/
|
| 451 |
+
public function setAmount($amount = null)
|
| 452 |
+
{
|
| 453 |
+
$this->_amount = $amount;
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
/**
|
| 457 |
+
* Sets the currency
|
| 458 |
+
* @param String $currency
|
| 459 |
+
*/
|
| 460 |
+
public function setCurrency($currency = null)
|
| 461 |
+
{
|
| 462 |
+
$this->_currency = $currency;
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
/**
|
| 466 |
+
* Sets the Customer name
|
| 467 |
+
* @param String $name
|
| 468 |
+
*/
|
| 469 |
+
public function setName($name = null)
|
| 470 |
+
{
|
| 471 |
+
$this->_name = $name;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
/**
|
| 475 |
+
* Sets the Customer Email Adress
|
| 476 |
+
* @param String $email
|
| 477 |
+
*/
|
| 478 |
+
public function setEmail($email = null)
|
| 479 |
+
{
|
| 480 |
+
$this->_email = $email;
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
/**
|
| 484 |
+
* Sets the Description
|
| 485 |
+
* @param String $description
|
| 486 |
+
*/
|
| 487 |
+
public function setDescription($description = null)
|
| 488 |
+
{
|
| 489 |
+
$this->_description = $description;
|
| 490 |
+
}
|
| 491 |
+
|
| 492 |
+
/**
|
| 493 |
+
* Sets the Api URL
|
| 494 |
+
* @param String $apiUrl
|
| 495 |
+
*/
|
| 496 |
+
public function setApiUrl($apiUrl = null)
|
| 497 |
+
{
|
| 498 |
+
$this->_apiUrl = $apiUrl;
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
/**
|
| 502 |
+
* Sets the Path to the libBase
|
| 503 |
+
* @param String $libBase Path to the Lib base. If not set, the default path is set.
|
| 504 |
+
*/
|
| 505 |
+
public function setLibBase($libBase = null)
|
| 506 |
+
{
|
| 507 |
+
$this->_libBase = $libBase == null ? dirname(__FILE__) . DIRECTORY_SEPARATOR : $libBase;
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
/**
|
| 511 |
+
* Sets up the Logger Object.
|
| 512 |
+
* <b>The Logger object can be any class implementing the Services_Paymill_PaymentProcessorInterface.</b>
|
| 513 |
+
* @param any $logger
|
| 514 |
+
*/
|
| 515 |
+
public function setLogger(Services_Paymill_LoggingInterface $logger = null)
|
| 516 |
+
{
|
| 517 |
+
$this->_logger = $logger;
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
/**
|
| 521 |
+
* Sets the Paymill-PrivateKey
|
| 522 |
+
* @param string $privateKey
|
| 523 |
+
*/
|
| 524 |
+
public function setPrivateKey($privateKey = null)
|
| 525 |
+
{
|
| 526 |
+
$this->_privateKey = $privateKey;
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
/**
|
| 530 |
+
* Set the request source
|
| 531 |
+
* (Modulversion_Shopname_Shopversion)
|
| 532 |
+
* @param string $source
|
| 533 |
+
*/
|
| 534 |
+
public function setSource($source)
|
| 535 |
+
{
|
| 536 |
+
$this->_source = $source;
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
/**
|
| 540 |
+
* Set PreauthorizationID to be captured
|
| 541 |
+
*
|
| 542 |
+
* @param string $preauthId
|
| 543 |
+
*/
|
| 544 |
+
public function setPreauthId($preauthId)
|
| 545 |
+
{
|
| 546 |
+
$this->_preauthId = $preauthId;
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
}
|
lib/Services/Paymill/Payments.php
CHANGED
|
@@ -1,27 +1,27 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once ('Base.php');
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Paymill API wrapper for payments resource
|
| 7 |
-
*/
|
| 8 |
-
class Services_Paymill_Payments extends Services_Paymill_Base
|
| 9 |
-
{
|
| 10 |
-
/**
|
| 11 |
-
* {@inheritDoc}
|
| 12 |
-
*/
|
| 13 |
-
protected $_serviceResource = 'payments/';
|
| 14 |
-
|
| 15 |
-
/**
|
| 16 |
-
* General REST PUT verb
|
| 17 |
-
* Update resource item
|
| 18 |
-
*
|
| 19 |
-
* @param array $itemData
|
| 20 |
-
*
|
| 21 |
-
* @return array item updated or null
|
| 22 |
-
*/
|
| 23 |
-
public function update(array $itemData = array())
|
| 24 |
-
{
|
| 25 |
-
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
|
| 26 |
-
}
|
| 27 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once ('Base.php');
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Paymill API wrapper for payments resource
|
| 7 |
+
*/
|
| 8 |
+
class Services_Paymill_Payments extends Services_Paymill_Base
|
| 9 |
+
{
|
| 10 |
+
/**
|
| 11 |
+
* {@inheritDoc}
|
| 12 |
+
*/
|
| 13 |
+
protected $_serviceResource = 'payments/';
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* General REST PUT verb
|
| 17 |
+
* Update resource item
|
| 18 |
+
*
|
| 19 |
+
* @param array $itemData
|
| 20 |
+
*
|
| 21 |
+
* @return array item updated or null
|
| 22 |
+
*/
|
| 23 |
+
public function update(array $itemData = array())
|
| 24 |
+
{
|
| 25 |
+
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
|
| 26 |
+
}
|
| 27 |
}
|
lib/Services/Paymill/Refunds.php
CHANGED
|
@@ -1,55 +1,56 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once ('Base.php');
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Paymill API wrapper for refunds resource
|
| 7 |
-
*/
|
| 8 |
-
class Services_Paymill_Refunds extends Services_Paymill_Base
|
| 9 |
-
{
|
| 10 |
-
/**
|
| 11 |
-
* {@inheritDoc}
|
| 12 |
-
*/
|
| 13 |
-
protected $_serviceResource = 'refunds/';
|
| 14 |
-
|
| 15 |
-
/**
|
| 16 |
-
* General REST POST verb
|
| 17 |
-
* create resource item
|
| 18 |
-
*
|
| 19 |
-
* @param array $itemData
|
| 20 |
-
*
|
| 21 |
-
* @return array created item
|
| 22 |
-
*/
|
| 23 |
-
public function create($itemData = array())
|
| 24 |
-
{
|
| 25 |
-
$transactionId = $itemData['transactionId'];
|
| 26 |
-
$params = $itemData['params'];
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
$this->_serviceResource . "$transactionId",
|
| 30 |
-
$params,
|
| 31 |
-
Services_Paymill_Apiclient_Interface::HTTP_POST
|
| 32 |
-
);
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
*
|
| 38 |
-
*
|
| 39 |
-
*
|
| 40 |
-
*
|
| 41 |
-
*
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
| 55 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once ('Base.php');
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Paymill API wrapper for refunds resource
|
| 7 |
+
*/
|
| 8 |
+
class Services_Paymill_Refunds extends Services_Paymill_Base
|
| 9 |
+
{
|
| 10 |
+
/**
|
| 11 |
+
* {@inheritDoc}
|
| 12 |
+
*/
|
| 13 |
+
protected $_serviceResource = 'refunds/';
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* General REST POST verb
|
| 17 |
+
* create resource item
|
| 18 |
+
*
|
| 19 |
+
* @param array $itemData
|
| 20 |
+
*
|
| 21 |
+
* @return array created item
|
| 22 |
+
*/
|
| 23 |
+
public function create($itemData = array())
|
| 24 |
+
{
|
| 25 |
+
$transactionId = $itemData['transactionId'];
|
| 26 |
+
$params = $itemData['params'];
|
| 27 |
+
|
| 28 |
+
$result = $this->_httpClient->request(
|
| 29 |
+
$this->_serviceResource . "$transactionId",
|
| 30 |
+
$params,
|
| 31 |
+
Services_Paymill_Apiclient_Interface::HTTP_POST
|
| 32 |
+
);
|
| 33 |
+
return $result['data'];
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* General REST DELETE verb
|
| 38 |
+
* Delete or inactivate/cancel resource item
|
| 39 |
+
*
|
| 40 |
+
* @param string $clientId
|
| 41 |
+
*
|
| 42 |
+
* @return array item deleted
|
| 43 |
+
*/
|
| 44 |
+
public function delete($identifier = null)
|
| 45 |
+
{
|
| 46 |
+
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* {@inheritDoc}
|
| 51 |
+
*/
|
| 52 |
+
public function update(array $itemData = array())
|
| 53 |
+
{
|
| 54 |
+
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404" );
|
| 55 |
+
}
|
| 56 |
}
|
lib/Services/Paymill/Subscriptions.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once ('Base.php');
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Paymill API wrapper for subscriptions resource
|
| 7 |
-
*/
|
| 8 |
-
class Services_Paymill_Subscriptions extends Services_Paymill_Base
|
| 9 |
-
{
|
| 10 |
-
/**
|
| 11 |
-
* {@inheritDoc}
|
| 12 |
-
*/
|
| 13 |
-
protected $_serviceResource = 'subscriptions/';
|
| 14 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once ('Base.php');
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Paymill API wrapper for subscriptions resource
|
| 7 |
+
*/
|
| 8 |
+
class Services_Paymill_Subscriptions extends Services_Paymill_Base
|
| 9 |
+
{
|
| 10 |
+
/**
|
| 11 |
+
* {@inheritDoc}
|
| 12 |
+
*/
|
| 13 |
+
protected $_serviceResource = 'subscriptions/';
|
| 14 |
}
|
lib/Services/Paymill/Transactions.php
CHANGED
|
@@ -1,40 +1,40 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once ('Base.php');
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Paymill API wrapper for transactions resource
|
| 7 |
-
*/
|
| 8 |
-
class Services_Paymill_Transactions extends Services_Paymill_Base
|
| 9 |
-
{
|
| 10 |
-
/**
|
| 11 |
-
* {@inheritDoc}
|
| 12 |
-
*/
|
| 13 |
-
protected $_serviceResource = 'transactions/';
|
| 14 |
-
|
| 15 |
-
/**
|
| 16 |
-
* General REST PUT verb
|
| 17 |
-
* Update resource item
|
| 18 |
-
*
|
| 19 |
-
* @param array $itemData
|
| 20 |
-
*
|
| 21 |
-
* @return array item updated or null
|
| 22 |
-
*/
|
| 23 |
-
public function update(array $itemData = array())
|
| 24 |
-
{
|
| 25 |
-
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
/**
|
| 29 |
-
* General REST DELETE verb
|
| 30 |
-
* Delete or inactivate/cancel resource item
|
| 31 |
-
*
|
| 32 |
-
* @param string $clientId
|
| 33 |
-
*
|
| 34 |
-
* @return array item deleted
|
| 35 |
-
*/
|
| 36 |
-
public function delete($clientId = null)
|
| 37 |
-
{
|
| 38 |
-
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
|
| 39 |
-
}
|
| 40 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once ('Base.php');
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Paymill API wrapper for transactions resource
|
| 7 |
+
*/
|
| 8 |
+
class Services_Paymill_Transactions extends Services_Paymill_Base
|
| 9 |
+
{
|
| 10 |
+
/**
|
| 11 |
+
* {@inheritDoc}
|
| 12 |
+
*/
|
| 13 |
+
protected $_serviceResource = 'transactions/';
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* General REST PUT verb
|
| 17 |
+
* Update resource item
|
| 18 |
+
*
|
| 19 |
+
* @param array $itemData
|
| 20 |
+
*
|
| 21 |
+
* @return array item updated or null
|
| 22 |
+
*/
|
| 23 |
+
public function update(array $itemData = array())
|
| 24 |
+
{
|
| 25 |
+
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* General REST DELETE verb
|
| 30 |
+
* Delete or inactivate/cancel resource item
|
| 31 |
+
*
|
| 32 |
+
* @param string $clientId
|
| 33 |
+
*
|
| 34 |
+
* @return array item deleted
|
| 35 |
+
*/
|
| 36 |
+
public function delete($clientId = null)
|
| 37 |
+
{
|
| 38 |
+
throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404");
|
| 39 |
+
}
|
| 40 |
}
|
lib/Services/Paymill/Webhooks.php
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
require_once ('Base.php');
|
| 4 |
-
|
| 5 |
-
/**
|
| 6 |
-
* Paymill API wrapper for webhooks resource
|
| 7 |
-
*/
|
| 8 |
-
class Services_Paymill_Webhooks extends Services_Paymill_Base
|
| 9 |
-
{
|
| 10 |
-
/**
|
| 11 |
-
* {@inheritDoc}
|
| 12 |
-
*/
|
| 13 |
-
protected $_serviceResource = 'webhooks/';
|
| 14 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once ('Base.php');
|
| 4 |
+
|
| 5 |
+
/**
|
| 6 |
+
* Paymill API wrapper for webhooks resource
|
| 7 |
+
*/
|
| 8 |
+
class Services_Paymill_Webhooks extends Services_Paymill_Base
|
| 9 |
+
{
|
| 10 |
+
/**
|
| 11 |
+
* {@inheritDoc}
|
| 12 |
+
*/
|
| 13 |
+
protected $_serviceResource = 'webhooks/';
|
| 14 |
}
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Paymill_Paymill</name>
|
| 4 |
-
<version>3.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>Open Software License</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -13,11 +13,14 @@ The Paymill Magento extension provides a credit card form and a direct debit for
|
|
| 13 |
<br /><br />
|
| 14 |
IMPORTANT: Only use the latest version.
|
| 15 |
</description>
|
| 16 |
-
<notes>* Rewrote from scratch
|
|
|
|
|
|
|
|
|
|
| 17 |
<authors><author><name>PayIntelligent</name><user>Paymill</user><email>community@paymill.de</email></author></authors>
|
| 18 |
-
<date>2013-07-
|
| 19 |
-
<time>
|
| 20 |
-
<contents><target name="magecommunity"><dir><dir name="Paymill"><dir name="Paymill"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="
|
| 21 |
<compatible/>
|
| 22 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0.</max></php></required></dependencies>
|
| 23 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Paymill_Paymill</name>
|
| 4 |
+
<version>3.0.4</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>Open Software License</license>
|
| 7 |
<channel>community</channel>
|
| 13 |
<br /><br />
|
| 14 |
IMPORTANT: Only use the latest version.
|
| 15 |
</description>
|
| 16 |
+
<notes>* Rewrote from scratch
|
| 17 |
+
* Updated Lib to latest version
|
| 18 |
+
* Redesigned credit card payment form
|
| 19 |
+
* Several minor bug fixes</notes>
|
| 20 |
<authors><author><name>PayIntelligent</name><user>Paymill</user><email>community@paymill.de</email></author></authors>
|
| 21 |
+
<date>2013-07-23</date>
|
| 22 |
+
<time>12:50:05</time>
|
| 23 |
+
<contents><target name="magecommunity"><dir><dir name="Paymill"><dir name="Paymill"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="a072de29acb8c020366d94b127368fd2"/></dir><file name="Log.php" hash="1876dc72d3ea2af71cf11b78a1433090"/></dir><dir name="Payment"><dir name="Form"><file name="PaymentFormCreditcard.php" hash="47b33902693d6ad04099235507692d86"/><file name="PaymentFormDirectdebit.php" hash="1b15c365ac781a823977e4e78bdd1ad4"/></dir><dir name="Info"><file name="PaymentFormCreditcard.php" hash="ecd6af705b2f7fe793366231aa60109f"/><file name="PaymentFormDirectdebit.php" hash="24dbeb75e07650a952783c98fb54ffc7"/></dir></dir></dir><dir name="Helper"><file name="CustomerHelper.php" hash="baa44a3c09c3fe8000e0d3a854edcf3c"/><file name="Data.php" hash="79a1668c897de219e4a07188265bf381"/><file name="FastCheckoutHelper.php" hash="2a53baf4ae5fe79ba17e55ad0fd58197"/><file name="LoggingHelper.php" hash="69b6bbc137bdf4c00cd68dcbb6c1e745"/><file name="OptionHelper.php" hash="21d2931511b0eb6afe4f094785e6259a"/><file name="PaymentHelper.php" hash="641f1e0dfad92c3756d07673fc8ac9d2"/><file name="RefundHelper.php" hash="4ef32cb3359876ad0b0a1a3b5b90929e"/><file name="TransactionHelper.php" hash="03767c497742c07bea7c7474d71711d0"/></dir><dir name="Model"><file name="Fastcheckout.php" hash="73f98e9f714ca3852345d083fe61886b"/><file name="Log.php" hash="3fad24d6a59944e532d84b3da4e0deec"/><dir name="Method"><file name="MethodModelAbstract.php" hash="183a6b6a262121ade0e5c2535755a100"/><file name="MethodModelCreditcard.php" hash="9d3a411d46dedd668262e839f5381bfa"/><file name="MethodModelDirectdebit.php" hash="b2b48a08b55e1b197f644be542f6e4dc"/></dir><dir name="Mysql4"><dir name="Fastcheckout"><file name="Collection.php" hash="12d097172603664ba709c172b58a93e7"/></dir><file name="Fastcheckout.php" hash="14c502c4d34233dc28608ade742ab714"/><dir name="Log"><file name="Collection.php" hash="c5b02070b09412822a839b3cbb0eba4e"/></dir><file name="Log.php" hash="aa7ffaa88fec8df550926e974c15baa0"/></dir><file name="Observer.php" hash="ec8a2a41facd5ac63eced1b7779ffd56"/><file name="TransactionData.php" hash="6ee635f10a61be28fd9e4a2fff84ff07"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LogController.php" hash="6c29c403416a13150e76e400a2437157"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="383052bdb4651dacf1373a27349259fd"/><file name="config.xml" hash="2d21da70bdc37e813009f21be2e41a88"/><file name="system.xml" hash="9a13c76c9447a53a117c708feba46328"/></dir><dir name="sql"><dir name="paymill_setup"><file name="mysql4-install-3.0.0.php" hash="cb5c381203c39066849fa301e6dfc70f"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="paymill.xml" hash="77d6d4e07a61ba76c8842249d267f62d"/></dir><dir name="template"><dir name="paymill"><dir name="payment"><dir name="info"><file name="creditcard.phtml" hash="6cd22661b0299e918c17a1f53ad7d6e3"/><file name="directdebit.phtml" hash="6cd22661b0299e918c17a1f53ad7d6e3"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="paymill.xml" hash="a93d3b26d40c793f10b51ba8f5bea27d"/></dir><dir name="template"><dir name="paymill"><dir name="payment"><dir name="form"><file name="creditcard.phtml" hash="a8e42f2b62e752d8ae3cf010228abe78"/><file name="directdebit.phtml" hash="2234a3ca4cbd76f6cff0396ddfae96f0"/></dir><dir name="info"><file name="creditcard.phtml" hash="f8172621f496767cba1aa5ee9a17f241"/><file name="directdebit.phtml" hash="f8172621f496767cba1aa5ee9a17f241"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Paymill_Paymill.xml" hash="87f99b47f25b708a6aa8f94507bc91db"/></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Paymill_Paymill.csv" hash="2bd3abdd228ca04bf94e25cd4644f6cc"/></dir><dir name="en_GB"><file name="Paymill_Paymill.csv" hash="56724674005626dbbc17f25917476f6f"/></dir><dir name="en_US"><file name="Paymill_Paymill.csv" hash="56724674005626dbbc17f25917476f6f"/></dir></dir></target><target name="mageweb"><dir><dir name="js"><dir name="paymill"><file name="paymentForm.js" hash="a893716ff9ef8d83f54e343fd896059b"/></dir></dir></dir></target><target name="magelib"><dir><dir name="Services"><dir name="Paymill"><dir name="Apiclient"><file name="Curl.php" hash="be417f59f4500ac3821459f1d4adb073"/><file name="Interface.php" hash="db5fb584ce410ff55b71419624f6d7db"/><file name="paymill.crt" hash="f85d1ff17b0079709f131f3ce3f288d2"/></dir><file name="Base.php" hash="371fbb92b604876ef9f4cdde503d8360"/><file name="Clients.php" hash="55eecee28daf6f00e803dfec1e31156c"/><file name="Exception.php" hash="21dc05247ea04d8ced72c2ee39a4d602"/><file name="LoggingInterface.php" hash="7f425749d7fab561c9826c3984fed9dc"/><file name="Offers.php" hash="07f219489dc347c432530cdc927d720a"/><file name="PaymentProcessor.php" hash="9f92501a7f493c4dd1227756cded1239"/><file name="Payments.php" hash="01d376af043989b363155d2dd94a808d"/><file name="Preauthorizations.php" hash="62dda9a5ee853e9c53d0c40fae7e95bd"/><file name="Refunds.php" hash="2b1599f36acb269fce94693b8ab172f8"/><file name="Subscriptions.php" hash="ddc58cc1e045a2ca7831f84886db4fbf"/><file name="Transactions.php" hash="f61bb42d8bf51b397574bb2c7d66e5e2"/><file name="Webhooks.php" hash="0d47a80f04565970179d5543685ca1aa"/></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="paymill"><file name="logo.css" hash="9bd7e954725c6de30bbc2e9f99262c52"/></dir></dir><dir name="images"><dir name="paymill"><file name="icon_32x20_amex.png" hash="42c5fb43b4b603804b50da9761927d40"/><file name="icon_32x20_dinersclub.png" hash="0a7a8fc8f679ccf05d91298c9968629c"/><file name="icon_32x20_discover.png" hash="4fe8ef419087bed97cddbdeb251b847c"/><file name="icon_32x20_jcb.png" hash="774a040f938c5566fa3fddfa840d4743"/><file name="icon_32x20_maestro.png" hash="a6ffd22c9bbedb603449e2aa6136dbd1"/><file name="icon_32x20_mastercard.png" hash="09aef6dcbc50038605b7c0e5a38eb76e"/><file name="icon_32x20_visa.png" hash="e6d54e5c0120202eb5757bcfe499d73b"/><file name="icon_paymill.png" hash="303983a288b45cc7ddc5b88ad2eedd51"/></dir></dir></dir></dir></dir></dir></target></contents>
|
| 24 |
<compatible/>
|
| 25 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0.</max></php></required></dependencies>
|
| 26 |
</package>
|
skin/frontend/base/default/css/paymill/logo.css
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
-
.paymill_powered {
|
| 2 |
-
border: 1px solid #ccc;
|
| 3 |
-
width: 350px;
|
| 4 |
-
padding: 4px;
|
| 5 |
-
background: white url('../../images/paymill/icon_paymill.png') no-repeat center right;
|
| 6 |
-
-moz-border-radius: 3px;
|
| 7 |
-
border-radius: 3px;
|
| 8 |
-
margin-top: 10px;
|
| 9 |
-
}
|
| 10 |
-
.paymill_powered > .paymill_credits {
|
| 11 |
-
width: 160px;
|
| 12 |
-
color: #666;
|
| 13 |
-
}
|
| 14 |
-
.paymill_powered > a {
|
| 15 |
-
color: #666;
|
| 16 |
-
text-decoration: underline;
|
| 17 |
}
|
| 1 |
+
.paymill_powered {
|
| 2 |
+
border: 1px solid #ccc;
|
| 3 |
+
width: 350px;
|
| 4 |
+
padding: 4px;
|
| 5 |
+
background: white url('../../images/paymill/icon_paymill.png') no-repeat center right;
|
| 6 |
+
-moz-border-radius: 3px;
|
| 7 |
+
border-radius: 3px;
|
| 8 |
+
margin-top: 10px;
|
| 9 |
+
}
|
| 10 |
+
.paymill_powered > .paymill_credits {
|
| 11 |
+
width: 160px;
|
| 12 |
+
color: #666;
|
| 13 |
+
}
|
| 14 |
+
.paymill_powered > a {
|
| 15 |
+
color: #666;
|
| 16 |
+
text-decoration: underline;
|
| 17 |
}
|
skin/frontend/base/default/images/paymill/icon_32x20_amex.png
ADDED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_32x20_dinersclub.png
ADDED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_32x20_discover.png
ADDED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_32x20_jcb.png
ADDED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_32x20_maestro.png
ADDED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_32x20_mastercard.png
ADDED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_32x20_visa.png
ADDED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_mastercard.png
DELETED
|
Binary file
|
skin/frontend/base/default/images/paymill/icon_visa.png
DELETED
|
Binary file
|
