Version Notes
ING PSP-Magento Extension
====================
# Changelog #
## Changes in version 1.0.0
+ Initial version based upon Ginger Payments version
## Changes in version 1.0.1
+ Updated the README.md
## Changes in version 1.0.2
+ Handle banktransfer correctly
## Changes in version 1.0.3
+ Added version to the webhook
+ Added cash on delivery
## Changes in version 1.1.0
+ Added Bancontact
+ Added product selection
## Changes in version 1.1.1
+ Renamed bcmc to bancontact
Download this release
Release Info
Developer | ING |
Extension | ing_psp |
Version | 1.1.2 |
Comparing to | |
See all releases |
Version 1.1.2
- app/code/community/ING/PSP/Block/Payment/Banktransfer/Form.php +31 -0
- app/code/community/ING/PSP/Block/Payment/Banktransfer/Info.php +57 -0
- app/code/community/ING/PSP/Block/Payment/Cashondelivery/Form.php +31 -0
- app/code/community/ING/PSP/Block/Payment/Cashondelivery/Info.php +57 -0
- app/code/community/ING/PSP/Block/Payment/Ideal/Form.php +31 -0
- app/code/community/ING/PSP/Block/Payment/Ideal/Info.php +24 -0
- app/code/community/ING/PSP/Helper/Bancontact.php +165 -0
- app/code/community/ING/PSP/Helper/Banktransfer.php +170 -0
- app/code/community/ING/PSP/Helper/Cashondelivery.php +167 -0
- app/code/community/ING/PSP/Helper/Creditcard.php +160 -0
- app/code/community/ING/PSP/Helper/Data.php +87 -0
- app/code/community/ING/PSP/Helper/Ideal.php +184 -0
- app/code/community/ING/PSP/Model/Bancontact.php +118 -0
- app/code/community/ING/PSP/Model/Banktransfer.php +139 -0
- app/code/community/ING/PSP/Model/Cashondelivery.php +135 -0
- app/code/community/ING/PSP/Model/Creditcard.php +118 -0
- app/code/community/ING/PSP/Model/Ideal.php +143 -0
- app/code/community/ING/PSP/Model/Observer.php +121 -0
- app/code/community/ING/PSP/Model/System/Config/Source/Dropdown/Values.php +22 -0
- app/code/community/ING/PSP/controllers/BancontactController.php +271 -0
- app/code/community/ING/PSP/controllers/BanktransferController.php +230 -0
- app/code/community/ING/PSP/controllers/CashondeliveryController.php +228 -0
- app/code/community/ING/PSP/controllers/CreditcardController.php +271 -0
- app/code/community/ING/PSP/controllers/IdealController.php +383 -0
- app/code/community/ING/PSP/etc/adminhtml.xml +42 -0
- app/code/community/ING/PSP/etc/config.xml +247 -0
- app/code/community/ING/PSP/etc/system.xml +515 -0
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-install-0.0.1.php +37 -0
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-uninstall-0.0.1.php +37 -0
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-upgrade-0.0.1-0.0.2.php +76 -0
- app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-upgrade-0.0.2-0.0.3.php +75 -0
- app/design/adminhtml/default/default/template/ing_psp/info/banktransfer.phtml +29 -0
- app/design/adminhtml/default/default/template/ing_psp/info/cashondelivery.phtml +29 -0
- app/design/frontend/base/default/layout/ing_psp.xml +28 -0
- app/design/frontend/base/default/template/ing_psp/form/banktransfer.phtml +23 -0
- app/design/frontend/base/default/template/ing_psp/form/cashondelivery.phtml +23 -0
- app/design/frontend/base/default/template/ing_psp/form/ideal.phtml +38 -0
- app/design/frontend/base/default/template/ing_psp/info/banktransfer.phtml +29 -0
- app/design/frontend/base/default/template/ing_psp/info/cashondelivery.phtml +29 -0
- app/design/frontend/base/default/template/ing_psp/success.phtml +77 -0
- app/etc/modules/ING_PSP.xml +42 -0
- app/locale/en_US/ING_PSP.csv +30 -0
- app/locale/nl_NL/ING_PSP.csv +30 -0
- package.xml +42 -0
app/code/community/ING/PSP/Block/Payment/Banktransfer/Form.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Block_Payment_Banktransfer_Form extends Mage_Payment_Block_Form
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Sets Banktransfer template into the checkout page
|
25 |
+
*/
|
26 |
+
public function _construct()
|
27 |
+
{
|
28 |
+
parent::_construct();
|
29 |
+
$this->setTemplate('ing_psp/form/banktransfer.phtml');
|
30 |
+
}
|
31 |
+
}
|
app/code/community/ING/PSP/Block/Payment/Banktransfer/Info.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Block_Payment_Banktransfer_Info extends Mage_Payment_Block_Info
|
22 |
+
{
|
23 |
+
protected $_mailingAddress;
|
24 |
+
|
25 |
+
protected function _construct()
|
26 |
+
{
|
27 |
+
parent::_construct();
|
28 |
+
$this->setTemplate('ing_psp/info/banktransfer.phtml');
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
*
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
public function getMailingAddress()
|
36 |
+
{
|
37 |
+
if (is_null($this->_mailingAddress)) {
|
38 |
+
$this->_convertAdditionalData();
|
39 |
+
}
|
40 |
+
return $this->_mailingAddress;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @return ING_PSP_Block_Payment_Banktransfer_Info
|
45 |
+
*/
|
46 |
+
protected function _convertAdditionalData()
|
47 |
+
{
|
48 |
+
$details = @unserialize($this->getInfo()->getAdditionalData());
|
49 |
+
if (is_array($details)) {
|
50 |
+
$this->_mailingAddress = isset($details['mailing_address']) ? (string) $details['mailing_address'] : '';
|
51 |
+
} else {
|
52 |
+
$this->_mailingAddress = '';
|
53 |
+
}
|
54 |
+
|
55 |
+
return $this;
|
56 |
+
}
|
57 |
+
}
|
app/code/community/ING/PSP/Block/Payment/Cashondelivery/Form.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Block_Payment_Cashondelivery_Form extends Mage_Payment_Block_Form
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Sets Cashondelivery template into the checkout page
|
25 |
+
*/
|
26 |
+
public function _construct()
|
27 |
+
{
|
28 |
+
parent::_construct();
|
29 |
+
$this->setTemplate('ing_psp/form/cashondelivery.phtml');
|
30 |
+
}
|
31 |
+
}
|
app/code/community/ING/PSP/Block/Payment/Cashondelivery/Info.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Block_Payment_Cashondelivery_Info extends Mage_Payment_Block_Info
|
22 |
+
{
|
23 |
+
protected $_mailingAddress;
|
24 |
+
|
25 |
+
protected function _construct()
|
26 |
+
{
|
27 |
+
parent::_construct();
|
28 |
+
$this->setTemplate('ing_psp/info/cashondelivery.phtml');
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
*
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
public function getMailingAddress()
|
36 |
+
{
|
37 |
+
if (is_null($this->_mailingAddress)) {
|
38 |
+
$this->_convertAdditionalData();
|
39 |
+
}
|
40 |
+
return $this->_mailingAddress;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @return ING_PSP_Block_Payment_Cashondelivery_Info
|
45 |
+
*/
|
46 |
+
protected function _convertAdditionalData()
|
47 |
+
{
|
48 |
+
$details = @unserialize($this->getInfo()->getAdditionalData());
|
49 |
+
if (is_array($details)) {
|
50 |
+
$this->_mailingAddress = isset($details['mailing_address']) ? (string) $details['mailing_address'] : '';
|
51 |
+
} else {
|
52 |
+
$this->_mailingAddress = '';
|
53 |
+
}
|
54 |
+
|
55 |
+
return $this;
|
56 |
+
}
|
57 |
+
}
|
app/code/community/ING/PSP/Block/Payment/Ideal/Form.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Block_Payment_Ideal_Form extends Mage_Payment_Block_Form
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Sets iDEAL template into the checkout page
|
25 |
+
*/
|
26 |
+
public function _construct()
|
27 |
+
{
|
28 |
+
parent::_construct();
|
29 |
+
$this->setTemplate('ing_psp/form/ideal.phtml');
|
30 |
+
}
|
31 |
+
}
|
app/code/community/ING/PSP/Block/Payment/Ideal/Info.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Block_Payment_Ideal_Info extends Mage_Payment_Block_Info
|
22 |
+
{
|
23 |
+
|
24 |
+
}
|
app/code/community/ING/PSP/Helper/Bancontact.php
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Helper_Bancontact extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $amount = 0;
|
25 |
+
protected $description = null;
|
26 |
+
protected $returnUrl = null;
|
27 |
+
protected $paymentUrl = null;
|
28 |
+
protected $orderStatus = null;
|
29 |
+
protected $consumerInfo = array();
|
30 |
+
protected $errorMessage = '';
|
31 |
+
protected $errorCode = 0;
|
32 |
+
protected $ingLib = null;
|
33 |
+
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
37 |
+
|
38 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
39 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
40 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
42 |
+
);
|
43 |
+
|
44 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
45 |
+
$this->ingLib->useBundledCA();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
public function extensionEnabled()
|
51 |
+
{
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Prepare an order and get a redirect URL
|
57 |
+
*
|
58 |
+
* @param int $orderId
|
59 |
+
* @param float $amount
|
60 |
+
* @param string $currency
|
61 |
+
* @param string $description
|
62 |
+
* @param string $returnUrl
|
63 |
+
* @param array $customer
|
64 |
+
* @return bool
|
65 |
+
*/
|
66 |
+
public function createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer = array())
|
67 |
+
{
|
68 |
+
if (!$this->setOrderId($orderId) ||
|
69 |
+
!$this->setAmount($amount) ||
|
70 |
+
!$this->setDescription($description) ||
|
71 |
+
!$this->setReturnUrl($returnUrl)
|
72 |
+
) {
|
73 |
+
$this->errorMessage = "Error in the given payment data";
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/bancontact/webhook') : null;
|
78 |
+
|
79 |
+
$ingOrder = $this->ingLib->createBancontactOrder(
|
80 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
81 |
+
$currency,
|
82 |
+
$description,
|
83 |
+
$orderId,
|
84 |
+
$returnUrl,
|
85 |
+
null,
|
86 |
+
$customer,
|
87 |
+
null,
|
88 |
+
$webhookUrl
|
89 |
+
)->toArray();
|
90 |
+
|
91 |
+
Mage::log($ingOrder);
|
92 |
+
|
93 |
+
if ( !is_array( $ingOrder ) or array_key_exists( 'error', $ingOrder) or $ingOrder['status'] == 'error' ) {
|
94 |
+
Mage::throwException(
|
95 |
+
"Could not start transaction. Contact the owner."
|
96 |
+
);
|
97 |
+
}
|
98 |
+
|
99 |
+
$this->orderId = (string) $ingOrder['id'];
|
100 |
+
$this->paymentUrl = (string) $ingOrder['transactions'][0]['payment_url'];
|
101 |
+
|
102 |
+
return true;
|
103 |
+
}
|
104 |
+
|
105 |
+
public function getOrderDetails($ingOrderId)
|
106 |
+
{
|
107 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
108 |
+
}
|
109 |
+
|
110 |
+
public function setAmount($amount)
|
111 |
+
{
|
112 |
+
return ($this->amount = $amount);
|
113 |
+
}
|
114 |
+
|
115 |
+
public function getAmount()
|
116 |
+
{
|
117 |
+
return $this->amount;
|
118 |
+
}
|
119 |
+
|
120 |
+
public function setOrderId($orderId)
|
121 |
+
{
|
122 |
+
return ($this->orderId = $orderId);
|
123 |
+
}
|
124 |
+
|
125 |
+
public function getOrderId()
|
126 |
+
{
|
127 |
+
return $this->orderId;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function setDescription($description)
|
131 |
+
{
|
132 |
+
$description = substr($description, 0, 29);
|
133 |
+
|
134 |
+
return ($this->description = $description);
|
135 |
+
}
|
136 |
+
|
137 |
+
public function getDescription()
|
138 |
+
{
|
139 |
+
return $this->description;
|
140 |
+
}
|
141 |
+
|
142 |
+
public function setReturnURL($returnUrl)
|
143 |
+
{
|
144 |
+
if (!preg_match('|(\w+)://([^/:]+)(:\d+)?(.*)|', $returnUrl)) {
|
145 |
+
return false;
|
146 |
+
}
|
147 |
+
|
148 |
+
return ($this->returnUrl = $returnUrl);
|
149 |
+
}
|
150 |
+
|
151 |
+
public function getReturnURL()
|
152 |
+
{
|
153 |
+
return $this->returnUrl;
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getPaymentURL()
|
157 |
+
{
|
158 |
+
return (string) $this->paymentUrl;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function getErrorMessage()
|
162 |
+
{
|
163 |
+
return $this->errorMessage;
|
164 |
+
}
|
165 |
+
}
|
app/code/community/ING/PSP/Helper/Banktransfer.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Banktransfer extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
const XML_PATH_EMAIL_TEMPLATE = "payment/ingpsp_banktransfer/order_email_template";
|
24 |
+
const XML_PATH_EMAIL_GUEST_TEMPLATE = "payment/ingpsp_banktransfer/order_email_template_guest";
|
25 |
+
|
26 |
+
protected $orderId = null;
|
27 |
+
protected $amount = 0;
|
28 |
+
protected $description = null;
|
29 |
+
protected $orderStatus = null;
|
30 |
+
protected $consumerInfo = array();
|
31 |
+
protected $errorMessage = '';
|
32 |
+
protected $errorCode = 0;
|
33 |
+
protected $ingLib = null;
|
34 |
+
|
35 |
+
public function __construct()
|
36 |
+
{
|
37 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
38 |
+
|
39 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
40 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
42 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
43 |
+
);
|
44 |
+
|
45 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
46 |
+
$this->ingLib->useBundledCA();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Prepare an order and get a redirect URL
|
53 |
+
*
|
54 |
+
* @param int $orderId
|
55 |
+
* @param float $amount
|
56 |
+
* @param string $currency
|
57 |
+
* @param string $description
|
58 |
+
* @param array $customer
|
59 |
+
* @return bool
|
60 |
+
*/
|
61 |
+
public function createOrder($orderId, $amount, $currency, $description, $customer = array())
|
62 |
+
{
|
63 |
+
if (!$this->setOrderId($orderId) ||
|
64 |
+
!$this->setAmount($amount) ||
|
65 |
+
!$this->setDescription($description)
|
66 |
+
) {
|
67 |
+
$this->errorMessage = "Error in the given payment data";
|
68 |
+
return false;
|
69 |
+
}
|
70 |
+
|
71 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/banktransfer/webhook') : null;
|
72 |
+
|
73 |
+
$ingOrder = $this->ingLib->createSepaOrder(
|
74 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
75 |
+
$currency,
|
76 |
+
[],
|
77 |
+
$description,
|
78 |
+
$orderId,
|
79 |
+
null,
|
80 |
+
null,
|
81 |
+
$customer,
|
82 |
+
null,
|
83 |
+
$webhookUrl
|
84 |
+
)->toArray();
|
85 |
+
|
86 |
+
Mage::log($ingOrder);
|
87 |
+
|
88 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
89 |
+
Mage::throwException(
|
90 |
+
"Could not start transaction. Contact the owner."
|
91 |
+
);
|
92 |
+
}
|
93 |
+
|
94 |
+
if (!is_array($ingOrder) || array_key_exists('error', $ingOrder)) {
|
95 |
+
// TODO: handle the error
|
96 |
+
return false;
|
97 |
+
} else {
|
98 |
+
$this->orderId = (string) $ingOrder['id'];
|
99 |
+
|
100 |
+
return $ingOrder['transactions'][0]['payment_method_details']['reference'];
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* @param Mage_Sales_Model_Order $order
|
106 |
+
* @param string $reference
|
107 |
+
* @return string
|
108 |
+
*/
|
109 |
+
public function getSuccessHtml(Mage_Sales_Model_Order $order, $reference)
|
110 |
+
{
|
111 |
+
if ($order->getPayment()->getMethodInstance() instanceof ING_PSP_Model_Banktransfer) {
|
112 |
+
$paymentBlock = $order->getPayment()->getMethodInstance()->getMailingAddress($order->getStoreId());
|
113 |
+
|
114 |
+
$grandTotal = $order->getGrandTotal();
|
115 |
+
$currency = Mage::app()->getLocale()->currency($order->getOrderCurrencyCode())->getSymbol();
|
116 |
+
|
117 |
+
$amountStr = $currency.' '.number_format(round($grandTotal, 2), 2, '.', '');;
|
118 |
+
|
119 |
+
$paymentBlock = str_replace('%AMOUNT%', $amountStr, $paymentBlock);
|
120 |
+
$paymentBlock = str_replace('%REFERENCE%', $reference, $paymentBlock);
|
121 |
+
$paymentBlock = str_replace('\n', PHP_EOL, $paymentBlock);
|
122 |
+
|
123 |
+
return $paymentBlock;
|
124 |
+
}
|
125 |
+
|
126 |
+
return '';
|
127 |
+
}
|
128 |
+
|
129 |
+
public function getOrderDetails($ingOrderId)
|
130 |
+
{
|
131 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
132 |
+
}
|
133 |
+
|
134 |
+
public function setAmount($amount)
|
135 |
+
{
|
136 |
+
return ($this->amount = $amount);
|
137 |
+
}
|
138 |
+
|
139 |
+
public function getAmount()
|
140 |
+
{
|
141 |
+
return $this->amount;
|
142 |
+
}
|
143 |
+
|
144 |
+
public function setOrderId($orderId)
|
145 |
+
{
|
146 |
+
return ($this->orderId = $orderId);
|
147 |
+
}
|
148 |
+
|
149 |
+
public function getOrderId()
|
150 |
+
{
|
151 |
+
return $this->orderId;
|
152 |
+
}
|
153 |
+
|
154 |
+
public function setDescription($description)
|
155 |
+
{
|
156 |
+
$description = substr($description, 0, 29);
|
157 |
+
|
158 |
+
return ($this->description = $description);
|
159 |
+
}
|
160 |
+
|
161 |
+
public function getDescription()
|
162 |
+
{
|
163 |
+
return $this->description;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getErrorMessage()
|
167 |
+
{
|
168 |
+
return $this->errorMessage;
|
169 |
+
}
|
170 |
+
}
|
app/code/community/ING/PSP/Helper/Cashondelivery.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Cashondelivery extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
const XML_PATH_EMAIL_TEMPLATE = "payment/ingpsp_cashondelivery/order_email_template";
|
24 |
+
const XML_PATH_EMAIL_GUEST_TEMPLATE = "payment/ingpsp_cashondelivery/order_email_template_guest";
|
25 |
+
|
26 |
+
protected $orderId = null;
|
27 |
+
protected $amount = 0;
|
28 |
+
protected $description = null;
|
29 |
+
protected $orderStatus = null;
|
30 |
+
protected $consumerInfo = array();
|
31 |
+
protected $errorMessage = '';
|
32 |
+
protected $errorCode = 0;
|
33 |
+
protected $ingLib = null;
|
34 |
+
|
35 |
+
public function __construct()
|
36 |
+
{
|
37 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
38 |
+
|
39 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
40 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
42 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
43 |
+
);
|
44 |
+
|
45 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
46 |
+
$this->ingLib->useBundledCA();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Prepare an order and get a redirect URL
|
53 |
+
*
|
54 |
+
* @param int $orderId
|
55 |
+
* @param float $amount
|
56 |
+
* @param string $currency
|
57 |
+
* @param string $description
|
58 |
+
* @param array $customer
|
59 |
+
* @return bool
|
60 |
+
*/
|
61 |
+
public function createOrder($orderId, $amount, $currency, $description, $customer = array())
|
62 |
+
{
|
63 |
+
if (!$this->setOrderId($orderId) ||
|
64 |
+
!$this->setAmount($amount) ||
|
65 |
+
!$this->setDescription($description)
|
66 |
+
) {
|
67 |
+
$this->errorMessage = "Error in the given payment data";
|
68 |
+
return false;
|
69 |
+
}
|
70 |
+
|
71 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/cashondelivery/webhook') : null;
|
72 |
+
|
73 |
+
$ingOrder = $this->ingLib->createCashOnDeliveryOrder(
|
74 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
75 |
+
$currency,
|
76 |
+
[],
|
77 |
+
$description,
|
78 |
+
$orderId,
|
79 |
+
null,
|
80 |
+
null,
|
81 |
+
$customer,
|
82 |
+
null,
|
83 |
+
$webhookUrl
|
84 |
+
)->toArray();
|
85 |
+
|
86 |
+
Mage::log($ingOrder);
|
87 |
+
|
88 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
89 |
+
Mage::throwException(
|
90 |
+
"Could not start transaction. Contact the owner."
|
91 |
+
);
|
92 |
+
}
|
93 |
+
|
94 |
+
if (!is_array($ingOrder) || array_key_exists('error', $ingOrder)) {
|
95 |
+
// TODO: handle the error
|
96 |
+
return false;
|
97 |
+
} else {
|
98 |
+
$this->orderId = (string) $ingOrder['id'];
|
99 |
+
return true;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* @param Mage_Sales_Model_Order $order
|
105 |
+
* @return string
|
106 |
+
*/
|
107 |
+
public function getSuccessHtml(Mage_Sales_Model_Order $order)
|
108 |
+
{
|
109 |
+
if ($order->getPayment()->getMethodInstance() instanceof ING_PSP_Model_Cashondelivery) {
|
110 |
+
$paymentBlock = $order->getPayment()->getMethodInstance()->getMailingAddress($order->getStoreId());
|
111 |
+
|
112 |
+
$grandTotal = $order->getGrandTotal();
|
113 |
+
$currency = Mage::app()->getLocale()->currency($order->getOrderCurrencyCode())->getSymbol();
|
114 |
+
|
115 |
+
$amountStr = $currency.' '.number_format(round($grandTotal, 2), 2, '.', '');;
|
116 |
+
|
117 |
+
$paymentBlock = str_replace('%AMOUNT%', $amountStr, $paymentBlock);
|
118 |
+
$paymentBlock = str_replace('\n', PHP_EOL, $paymentBlock);
|
119 |
+
|
120 |
+
return $paymentBlock;
|
121 |
+
}
|
122 |
+
|
123 |
+
return '';
|
124 |
+
}
|
125 |
+
|
126 |
+
public function getOrderDetails($ingOrderId)
|
127 |
+
{
|
128 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
129 |
+
}
|
130 |
+
|
131 |
+
public function setAmount($amount)
|
132 |
+
{
|
133 |
+
return ($this->amount = $amount);
|
134 |
+
}
|
135 |
+
|
136 |
+
public function getAmount()
|
137 |
+
{
|
138 |
+
return $this->amount;
|
139 |
+
}
|
140 |
+
|
141 |
+
public function setOrderId($orderId)
|
142 |
+
{
|
143 |
+
return ($this->orderId = $orderId);
|
144 |
+
}
|
145 |
+
|
146 |
+
public function getOrderId()
|
147 |
+
{
|
148 |
+
return $this->orderId;
|
149 |
+
}
|
150 |
+
|
151 |
+
public function setDescription($description)
|
152 |
+
{
|
153 |
+
$description = substr($description, 0, 29);
|
154 |
+
|
155 |
+
return ($this->description = $description);
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getDescription()
|
159 |
+
{
|
160 |
+
return $this->description;
|
161 |
+
}
|
162 |
+
|
163 |
+
public function getErrorMessage()
|
164 |
+
{
|
165 |
+
return $this->errorMessage;
|
166 |
+
}
|
167 |
+
}
|
app/code/community/ING/PSP/Helper/Creditcard.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Creditcard extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $amount = 0;
|
25 |
+
protected $description = null;
|
26 |
+
protected $returnUrl = null;
|
27 |
+
protected $paymentUrl = null;
|
28 |
+
protected $orderStatus = null;
|
29 |
+
protected $consumerInfo = array();
|
30 |
+
protected $errorMessage = '';
|
31 |
+
protected $errorCode = 0;
|
32 |
+
protected $ingLib = null;
|
33 |
+
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
37 |
+
|
38 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
39 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
40 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
42 |
+
);
|
43 |
+
|
44 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
45 |
+
$this->ingLib->useBundledCA();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Prepare an order and get a redirect URL
|
52 |
+
*
|
53 |
+
* @param int $orderId
|
54 |
+
* @param float $amount
|
55 |
+
* @param string $currency
|
56 |
+
* @param string $description
|
57 |
+
* @param string $returnUrl
|
58 |
+
* @param array $customer
|
59 |
+
* @return bool
|
60 |
+
*/
|
61 |
+
public function createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer = array())
|
62 |
+
{
|
63 |
+
if (!$this->setOrderId($orderId) ||
|
64 |
+
!$this->setAmount($amount) ||
|
65 |
+
!$this->setDescription($description) ||
|
66 |
+
!$this->setReturnUrl($returnUrl)
|
67 |
+
) {
|
68 |
+
$this->errorMessage = "Error in the given payment data";
|
69 |
+
return false;
|
70 |
+
}
|
71 |
+
|
72 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/creditcard/webhook') : null;
|
73 |
+
|
74 |
+
$ingOrder = $this->ingLib->createCreditCardOrder(
|
75 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
76 |
+
$currency,
|
77 |
+
$description,
|
78 |
+
$orderId,
|
79 |
+
$returnUrl,
|
80 |
+
null,
|
81 |
+
$customer,
|
82 |
+
null,
|
83 |
+
$webhookUrl
|
84 |
+
)->toArray();
|
85 |
+
|
86 |
+
Mage::log($ingOrder);
|
87 |
+
|
88 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
89 |
+
Mage::throwException(
|
90 |
+
"Could not start transaction. Contact the owner."
|
91 |
+
);
|
92 |
+
}
|
93 |
+
|
94 |
+
$this->orderId = (string) $ingOrder['id'];
|
95 |
+
$this->paymentUrl = (string) $ingOrder['transactions'][0]['payment_url'];
|
96 |
+
|
97 |
+
return true;
|
98 |
+
}
|
99 |
+
|
100 |
+
public function getOrderDetails($ingOrderId)
|
101 |
+
{
|
102 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
103 |
+
}
|
104 |
+
|
105 |
+
public function setAmount($amount)
|
106 |
+
{
|
107 |
+
return ($this->amount = $amount);
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getAmount()
|
111 |
+
{
|
112 |
+
return $this->amount;
|
113 |
+
}
|
114 |
+
|
115 |
+
public function setOrderId($orderId)
|
116 |
+
{
|
117 |
+
return ($this->orderId = $orderId);
|
118 |
+
}
|
119 |
+
|
120 |
+
public function getOrderId()
|
121 |
+
{
|
122 |
+
return $this->orderId;
|
123 |
+
}
|
124 |
+
|
125 |
+
public function setDescription($description)
|
126 |
+
{
|
127 |
+
$description = substr($description, 0, 29);
|
128 |
+
|
129 |
+
return ($this->description = $description);
|
130 |
+
}
|
131 |
+
|
132 |
+
public function getDescription()
|
133 |
+
{
|
134 |
+
return $this->description;
|
135 |
+
}
|
136 |
+
|
137 |
+
public function setReturnURL($returnUrl)
|
138 |
+
{
|
139 |
+
if (!preg_match('|(\w+)://([^/:]+)(:\d+)?(.*)|', $returnUrl)) {
|
140 |
+
return false;
|
141 |
+
}
|
142 |
+
|
143 |
+
return ($this->returnUrl = $returnUrl);
|
144 |
+
}
|
145 |
+
|
146 |
+
public function getReturnURL()
|
147 |
+
{
|
148 |
+
return $this->returnUrl;
|
149 |
+
}
|
150 |
+
|
151 |
+
public function getPaymentURL()
|
152 |
+
{
|
153 |
+
return (string) $this->paymentUrl;
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getErrorMessage()
|
157 |
+
{
|
158 |
+
return $this->errorMessage;
|
159 |
+
}
|
160 |
+
}
|
app/code/community/ING/PSP/Helper/Data.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Data extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Parse address for split street and house number
|
25 |
+
*
|
26 |
+
* @param string $streetAddress
|
27 |
+
* @return array
|
28 |
+
*/
|
29 |
+
public function parseAddress($streetAddress)
|
30 |
+
{
|
31 |
+
$address = $streetAddress;
|
32 |
+
$houseNumber = '';
|
33 |
+
|
34 |
+
$offset = strlen($streetAddress);
|
35 |
+
|
36 |
+
while (($offset = $this->_rstrpos($streetAddress, ' ', $offset)) !== false) {
|
37 |
+
if ($offset < strlen($streetAddress) - 1 && is_numeric($streetAddress[$offset + 1])) {
|
38 |
+
$address = trim(substr($streetAddress, 0, $offset));
|
39 |
+
$houseNumber = trim(substr($streetAddress, $offset + 1));
|
40 |
+
break;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
if (empty($houseNumber) && strlen($streetAddress) > 0 && is_numeric($streetAddress[0])) {
|
45 |
+
$pos = strpos($streetAddress, ' ');
|
46 |
+
|
47 |
+
if ($pos !== false) {
|
48 |
+
$houseNumber = trim(substr($streetAddress, 0, $pos), ", \t\n\r\0\x0B");
|
49 |
+
$address = trim(substr($streetAddress, $pos + 1));
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
return array($address, $houseNumber);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @param string $haystack
|
58 |
+
* @param string $needle
|
59 |
+
* @param null|int $offset
|
60 |
+
* @return int
|
61 |
+
*/
|
62 |
+
protected function _rstrpos($haystack, $needle, $offset = null)
|
63 |
+
{
|
64 |
+
$size = strlen($haystack);
|
65 |
+
|
66 |
+
if (is_null($offset)) {
|
67 |
+
$offset = $size;
|
68 |
+
}
|
69 |
+
|
70 |
+
$pos = strpos(strrev($haystack), strrev($needle), $size - $offset);
|
71 |
+
|
72 |
+
if ($pos === false) {
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
|
76 |
+
return $size - $pos - strlen($needle);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @param string|float $amount
|
81 |
+
* @return int
|
82 |
+
*/
|
83 |
+
public static function getAmountInCents($amount)
|
84 |
+
{
|
85 |
+
return (int) (100 * round($amount, 2, PHP_ROUND_HALF_UP));
|
86 |
+
}
|
87 |
+
}
|
app/code/community/ING/PSP/Helper/Ideal.php
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Helper_Ideal extends Mage_Core_Helper_Abstract
|
22 |
+
{
|
23 |
+
protected $orderId = null;
|
24 |
+
protected $issuerId = null;
|
25 |
+
protected $amount = 0;
|
26 |
+
protected $description = null;
|
27 |
+
protected $returnUrl = null;
|
28 |
+
protected $paymentUrl = null;
|
29 |
+
protected $orderStatus = null;
|
30 |
+
protected $consumerInfo = array();
|
31 |
+
protected $errorMessage = '';
|
32 |
+
protected $errorCode = 0;
|
33 |
+
protected $ingLib = null;
|
34 |
+
|
35 |
+
public function __construct()
|
36 |
+
{
|
37 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
38 |
+
|
39 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
40 |
+
$this->ingLib = \GingerPayments\Payment\Ginger::createClient(
|
41 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
42 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
43 |
+
);
|
44 |
+
|
45 |
+
if (Mage::getStoreConfig("payment/ingpsp/bundle_cacert")) {
|
46 |
+
$this->ingLib->useBundledCA();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Fetch the list of issuers
|
53 |
+
*
|
54 |
+
* @return null|array
|
55 |
+
*/
|
56 |
+
public function getIssuers()
|
57 |
+
{
|
58 |
+
return $this->ingLib->getIdealIssuers()->toArray();
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Prepare an order and get a redirect URL
|
63 |
+
*
|
64 |
+
* @param int $orderId
|
65 |
+
* @param $issuerId
|
66 |
+
* @param float $amount
|
67 |
+
* @param string $currency
|
68 |
+
* @param string $description
|
69 |
+
* @param string $returnUrl
|
70 |
+
* @param array $customer
|
71 |
+
* @return bool
|
72 |
+
*/
|
73 |
+
public function createOrder($orderId, $issuerId, $amount, $currency, $description, $returnUrl, $customer = array())
|
74 |
+
{
|
75 |
+
if (!$this->setOrderId($orderId) ||
|
76 |
+
!$this->setIssuerId($issuerId) ||
|
77 |
+
!$this->setAmount($amount) ||
|
78 |
+
!$this->setDescription($description) ||
|
79 |
+
!$this->setReturnUrl($returnUrl)
|
80 |
+
) {
|
81 |
+
$this->errorMessage = "Error in the given payment data";
|
82 |
+
return false;
|
83 |
+
}
|
84 |
+
|
85 |
+
$webhookUrl = Mage::getStoreConfig("payment/ingpsp/webhook") ? Mage::getUrl('ingpsp/ideal/webhook') : null;
|
86 |
+
|
87 |
+
$ingOrder = $this->ingLib->createIdealOrder(
|
88 |
+
ING_PSP_Helper_Data::getAmountInCents($amount),
|
89 |
+
$currency,
|
90 |
+
$issuerId,
|
91 |
+
$description,
|
92 |
+
$orderId,
|
93 |
+
$returnUrl,
|
94 |
+
null,
|
95 |
+
$customer,
|
96 |
+
null,
|
97 |
+
$webhookUrl
|
98 |
+
)->toArray();
|
99 |
+
|
100 |
+
Mage::log($ingOrder);
|
101 |
+
|
102 |
+
if (!is_array($ingOrder) or array_key_exists('error', $ingOrder) or $ingOrder['status'] == 'error') {
|
103 |
+
Mage::throwException(
|
104 |
+
"Could not start transaction. Contact the owner."
|
105 |
+
);
|
106 |
+
}
|
107 |
+
|
108 |
+
$this->orderId = (string) $ingOrder['id'];
|
109 |
+
$this->paymentUrl = (string) $ingOrder['transactions'][0]['payment_url'];
|
110 |
+
|
111 |
+
return true;
|
112 |
+
}
|
113 |
+
|
114 |
+
public function getOrderDetails($ingOrderId)
|
115 |
+
{
|
116 |
+
return $this->ingLib->getOrder($ingOrderId)->toArray();
|
117 |
+
}
|
118 |
+
|
119 |
+
public function setIssuerId($issuerId)
|
120 |
+
{
|
121 |
+
return ($this->issuerId = $issuerId);
|
122 |
+
}
|
123 |
+
|
124 |
+
public function getIssuerId()
|
125 |
+
{
|
126 |
+
return $this->issuerId;
|
127 |
+
}
|
128 |
+
|
129 |
+
public function setAmount($amount)
|
130 |
+
{
|
131 |
+
return ($this->amount = $amount);
|
132 |
+
}
|
133 |
+
|
134 |
+
public function getAmount()
|
135 |
+
{
|
136 |
+
return $this->amount;
|
137 |
+
}
|
138 |
+
|
139 |
+
public function setOrderId($orderId)
|
140 |
+
{
|
141 |
+
return ($this->orderId = $orderId);
|
142 |
+
}
|
143 |
+
|
144 |
+
public function getOrderId()
|
145 |
+
{
|
146 |
+
return $this->orderId;
|
147 |
+
}
|
148 |
+
|
149 |
+
public function setDescription($description)
|
150 |
+
{
|
151 |
+
$description = substr($description, 0, 29);
|
152 |
+
|
153 |
+
return ($this->description = $description);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getDescription()
|
157 |
+
{
|
158 |
+
return $this->description;
|
159 |
+
}
|
160 |
+
|
161 |
+
public function setReturnURL($returnUrl)
|
162 |
+
{
|
163 |
+
if (!preg_match('|(\w+)://([^/:]+)(:\d+)?(.*)|', $returnUrl)) {
|
164 |
+
return false;
|
165 |
+
}
|
166 |
+
|
167 |
+
return ($this->returnUrl = $returnUrl);
|
168 |
+
}
|
169 |
+
|
170 |
+
public function getReturnURL()
|
171 |
+
{
|
172 |
+
return $this->returnUrl;
|
173 |
+
}
|
174 |
+
|
175 |
+
public function getPaymentURL()
|
176 |
+
{
|
177 |
+
return (string) $this->paymentUrl;
|
178 |
+
}
|
179 |
+
|
180 |
+
public function getErrorMessage()
|
181 |
+
{
|
182 |
+
return $this->errorMessage;
|
183 |
+
}
|
184 |
+
}
|
app/code/community/ING/PSP/Model/Bancontact.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Bancontact extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Bancontact
|
25 |
+
*/
|
26 |
+
protected $_creditCard;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_bancontact';
|
29 |
+
protected $_paymentMethod = 'Bancontact';
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canUseCheckout = true;
|
33 |
+
protected $_canUseInternal = true;
|
34 |
+
protected $_canUseForMultishipping = false;
|
35 |
+
protected $_canRefund = true;
|
36 |
+
protected $_canRefundInvoicePartial = false;
|
37 |
+
protected $_canCapture = false;
|
38 |
+
|
39 |
+
// Payment flags
|
40 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
41 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
42 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
43 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
44 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build constructor
|
48 |
+
*/
|
49 |
+
public function __construct()
|
50 |
+
{
|
51 |
+
parent::_construct();
|
52 |
+
$this->_creditCard = Mage::helper('ingpsp/bancontact');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isAvailable($quote = null)
|
60 |
+
{
|
61 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
62 |
+
return parent::isAvailable($quote);
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get checkout session namespace
|
70 |
+
*
|
71 |
+
* @return Mage_Checkout_Model_Session
|
72 |
+
*/
|
73 |
+
protected function _getCheckout()
|
74 |
+
{
|
75 |
+
return Mage::getSingleton('checkout/session');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get current quote
|
80 |
+
*
|
81 |
+
* @return Mage_Sales_Model_Quote
|
82 |
+
*/
|
83 |
+
public function getQuote()
|
84 |
+
{
|
85 |
+
return $this->_getCheckout()->getQuote();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Bancontact is only active if 'EURO' is currency
|
90 |
+
*
|
91 |
+
* @param string $currencyCode
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function canUseForCurrency($currencyCode)
|
95 |
+
{
|
96 |
+
if ($currencyCode !== "EUR") {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return parent::canUseForCurrency($currencyCode);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Redirects the client on click 'Place Order' to selected Bancontact bank
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getOrderPlaceRedirectUrl()
|
109 |
+
{
|
110 |
+
return Mage::getUrl(
|
111 |
+
'ingpsp/bancontact/payment',
|
112 |
+
array(
|
113 |
+
'_secure' => true,
|
114 |
+
'_query' => array(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
app/code/community/ING/PSP/Model/Banktransfer.php
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
class ING_PSP_Model_Banktransfer extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Banktransfer
|
25 |
+
*/
|
26 |
+
protected $_banktransfer;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_banktransfer';
|
29 |
+
protected $_formBlockType = 'ingpsp/payment_banktransfer_form';
|
30 |
+
protected $_infoBlockType = 'ingpsp/payment_banktransfer_info';
|
31 |
+
protected $_paymentMethod = 'Banktransfer';
|
32 |
+
protected $_isGateway = true;
|
33 |
+
protected $_canAuthorize = true;
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
protected $_canUseForMultishipping = false;
|
37 |
+
protected $_canRefund = true;
|
38 |
+
protected $_canRefundInvoicePartial = false;
|
39 |
+
protected $_canCapture = false;
|
40 |
+
|
41 |
+
// Payment flags
|
42 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
43 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
44 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
45 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
46 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Build constructor
|
50 |
+
*/
|
51 |
+
public function __construct()
|
52 |
+
{
|
53 |
+
parent::_construct();
|
54 |
+
$this->_banktransfer = Mage::helper('ingpsp/banktransfer');
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
59 |
+
* @return bool
|
60 |
+
*/
|
61 |
+
public function isAvailable($quote = null)
|
62 |
+
{
|
63 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
64 |
+
return parent::isAvailable($quote);
|
65 |
+
}
|
66 |
+
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get checkout session namespace
|
72 |
+
*
|
73 |
+
* @return Mage_Checkout_Model_Session
|
74 |
+
*/
|
75 |
+
protected function _getCheckout()
|
76 |
+
{
|
77 |
+
return Mage::getSingleton('checkout/session');
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Get current quote
|
82 |
+
*
|
83 |
+
* @return Mage_Sales_Model_Quote
|
84 |
+
*/
|
85 |
+
public function getQuote()
|
86 |
+
{
|
87 |
+
return $this->_getCheckout()->getQuote();
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Banktransfer is only active if 'EURO' is currency
|
92 |
+
*
|
93 |
+
* @param string $currencyCode
|
94 |
+
* @return bool
|
95 |
+
*/
|
96 |
+
public function canUseForCurrency($currencyCode)
|
97 |
+
{
|
98 |
+
if ($currencyCode !== "EUR") {
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
|
102 |
+
return parent::canUseForCurrency($currencyCode);
|
103 |
+
}
|
104 |
+
|
105 |
+
public function getMailingAddress($store = null)
|
106 |
+
{
|
107 |
+
/** @var $helper ING_PSP_Helper_Data */
|
108 |
+
$helper = Mage::helper('ingpsp');
|
109 |
+
|
110 |
+
$accountDetails = Mage::getStoreConfig("payment/ingpsp_banktransfer/account_details", $store);
|
111 |
+
|
112 |
+
$paymentBlock = '';
|
113 |
+
|
114 |
+
$paymentBlock .= $helper->__('Amount:') . ' ' . '%AMOUNT%' . "\n";
|
115 |
+
$paymentBlock .= $helper->__('Reference:') . ' ' . '%REFERENCE%' . "\n";
|
116 |
+
$paymentBlock .= $helper->__('IBAN:') . ' ' . $accountDetails['iban'] . "\n";
|
117 |
+
$paymentBlock .= $helper->__('BIC:') . ' ' . $accountDetails['bic'] . "\n";
|
118 |
+
$paymentBlock .= $helper->__('Account holder:') . ' ' . $accountDetails['holder'] . "\n";
|
119 |
+
$paymentBlock .= $helper->__('City:') . ' ' . $accountDetails['city'];
|
120 |
+
|
121 |
+
return $paymentBlock;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Redirects the client on click 'Place Order' to selected Banktransfer bank
|
126 |
+
*
|
127 |
+
* @return string
|
128 |
+
*/
|
129 |
+
public function getOrderPlaceRedirectUrl()
|
130 |
+
{
|
131 |
+
return Mage::getUrl(
|
132 |
+
'ingpsp/banktransfer/payment',
|
133 |
+
array(
|
134 |
+
'_secure' => true,
|
135 |
+
'_query' => array(),
|
136 |
+
)
|
137 |
+
);
|
138 |
+
}
|
139 |
+
}
|
app/code/community/ING/PSP/Model/Cashondelivery.php
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Cashondelivery extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Cashondelivery
|
25 |
+
*/
|
26 |
+
protected $_cashondelivery;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_cashondelivery';
|
29 |
+
protected $_formBlockType = 'ingpsp/payment_cashondelivery_form';
|
30 |
+
protected $_infoBlockType = 'ingpsp/payment_cashondelivery_info';
|
31 |
+
protected $_paymentMethod = 'Cashondelivery';
|
32 |
+
protected $_isGateway = true;
|
33 |
+
protected $_canAuthorize = true;
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
protected $_canUseForMultishipping = false;
|
37 |
+
protected $_canRefund = true;
|
38 |
+
protected $_canRefundInvoicePartial = false;
|
39 |
+
protected $_canCapture = false;
|
40 |
+
|
41 |
+
// Payment flags
|
42 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
43 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
44 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
45 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
46 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Build constructor
|
50 |
+
*/
|
51 |
+
public function __construct()
|
52 |
+
{
|
53 |
+
parent::_construct();
|
54 |
+
$this->_cashondelivery = Mage::helper('ingpsp/cashondelivery');
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
59 |
+
* @return bool
|
60 |
+
*/
|
61 |
+
public function isAvailable($quote = null)
|
62 |
+
{
|
63 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
64 |
+
return parent::isAvailable($quote);
|
65 |
+
}
|
66 |
+
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get checkout session namespace
|
72 |
+
*
|
73 |
+
* @return Mage_Checkout_Model_Session
|
74 |
+
*/
|
75 |
+
protected function _getCheckout()
|
76 |
+
{
|
77 |
+
return Mage::getSingleton('checkout/session');
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Get current quote
|
82 |
+
*
|
83 |
+
* @return Mage_Sales_Model_Quote
|
84 |
+
*/
|
85 |
+
public function getQuote()
|
86 |
+
{
|
87 |
+
return $this->_getCheckout()->getQuote();
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Cashondelivery is only active if 'EURO' is currency
|
92 |
+
*
|
93 |
+
* @param string $currencyCode
|
94 |
+
* @return bool
|
95 |
+
*/
|
96 |
+
public function canUseForCurrency($currencyCode)
|
97 |
+
{
|
98 |
+
if ($currencyCode !== "EUR") {
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
|
102 |
+
return parent::canUseForCurrency($currencyCode);
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* @param null|int|Mage_Core_Model_Store $store
|
107 |
+
* @return string
|
108 |
+
*/
|
109 |
+
public function getMailingAddress($store = null)
|
110 |
+
{
|
111 |
+
/** @var $helper ING_PSP_Helper_Data */
|
112 |
+
$helper = Mage::helper('ingpsp');
|
113 |
+
|
114 |
+
$paymentBlock = '';
|
115 |
+
$paymentBlock .= $helper->__('Amount:') . ' ' . '%AMOUNT%' . PHP_EOL;
|
116 |
+
|
117 |
+
return $paymentBlock;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Redirects the client on click 'Place Order' to selected Cashondelivery bank
|
122 |
+
*
|
123 |
+
* @return string
|
124 |
+
*/
|
125 |
+
public function getOrderPlaceRedirectUrl()
|
126 |
+
{
|
127 |
+
return Mage::getUrl(
|
128 |
+
'ingpsp/cashondelivery/payment',
|
129 |
+
array(
|
130 |
+
'_secure' => true,
|
131 |
+
'_query' => array(),
|
132 |
+
)
|
133 |
+
);
|
134 |
+
}
|
135 |
+
}
|
app/code/community/ING/PSP/Model/Creditcard.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Creditcard extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Creditcard
|
25 |
+
*/
|
26 |
+
protected $_creditCard;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_creditcard';
|
29 |
+
protected $_paymentMethod = 'CreditCard';
|
30 |
+
protected $_isGateway = true;
|
31 |
+
protected $_canAuthorize = true;
|
32 |
+
protected $_canUseCheckout = true;
|
33 |
+
protected $_canUseInternal = true;
|
34 |
+
protected $_canUseForMultishipping = false;
|
35 |
+
protected $_canRefund = true;
|
36 |
+
protected $_canRefundInvoicePartial = false;
|
37 |
+
protected $_canCapture = false;
|
38 |
+
|
39 |
+
// Payment flags
|
40 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
41 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
42 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
43 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
44 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Build constructor
|
48 |
+
*/
|
49 |
+
public function __construct()
|
50 |
+
{
|
51 |
+
parent::_construct();
|
52 |
+
$this->_creditCard = Mage::helper('ingpsp/creditcard');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
57 |
+
* @return bool
|
58 |
+
*/
|
59 |
+
public function isAvailable($quote = null)
|
60 |
+
{
|
61 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
62 |
+
return parent::isAvailable($quote);
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get checkout session namespace
|
70 |
+
*
|
71 |
+
* @return Mage_Checkout_Model_Session
|
72 |
+
*/
|
73 |
+
protected function _getCheckout()
|
74 |
+
{
|
75 |
+
return Mage::getSingleton('checkout/session');
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get current quote
|
80 |
+
*
|
81 |
+
* @return Mage_Sales_Model_Quote
|
82 |
+
*/
|
83 |
+
public function getQuote()
|
84 |
+
{
|
85 |
+
return $this->_getCheckout()->getQuote();
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* CreditCard is only active if 'EURO' is currency
|
90 |
+
*
|
91 |
+
* @param string $currencyCode
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function canUseForCurrency($currencyCode)
|
95 |
+
{
|
96 |
+
if ($currencyCode !== "EUR") {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return parent::canUseForCurrency($currencyCode);
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Redirects the client on click 'Place Order' to selected CreditCard bank
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getOrderPlaceRedirectUrl()
|
109 |
+
{
|
110 |
+
return Mage::getUrl(
|
111 |
+
'ingpsp/creditcard/payment',
|
112 |
+
array(
|
113 |
+
'_secure' => true,
|
114 |
+
'_query' => array(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
}
|
118 |
+
}
|
app/code/community/ING/PSP/Model/Ideal.php
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Ideal extends Mage_Payment_Model_Method_Abstract
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Ideal
|
25 |
+
*/
|
26 |
+
protected $_ideal;
|
27 |
+
|
28 |
+
protected $_code = 'ingpsp_ideal';
|
29 |
+
protected $_formBlockType = 'ingpsp/payment_ideal_form';
|
30 |
+
protected $_infoBlockType = 'ingpsp/payment_ideal_info';
|
31 |
+
protected $_paymentMethod = 'iDEAL';
|
32 |
+
protected $_isGateway = true;
|
33 |
+
protected $_canAuthorize = true;
|
34 |
+
protected $_canUseCheckout = true;
|
35 |
+
protected $_canUseInternal = true;
|
36 |
+
protected $_canUseForMultishipping = false;
|
37 |
+
protected $_canRefund = true;
|
38 |
+
protected $_canRefundInvoicePartial = false;
|
39 |
+
protected $_canCapture = false;
|
40 |
+
|
41 |
+
// Payment flags
|
42 |
+
const PAYMENT_FLAG_PENDING = "Payment is pending";
|
43 |
+
const PAYMENT_FLAG_COMPLETED = "Payment is completed";
|
44 |
+
const PAYMENT_FLAG_CANCELLED = "Payment is cancelled";
|
45 |
+
const PAYMENT_FLAG_ERROR = "Payment failed with an error";
|
46 |
+
const PAYMENT_FLAG_FRAUD = "Amounts don't match. Possible fraud";
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Build constructor
|
50 |
+
*/
|
51 |
+
public function __construct()
|
52 |
+
{
|
53 |
+
parent::_construct();
|
54 |
+
$this->_ideal = Mage::helper('ingpsp/ideal');
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param Mage_Sales_Model_Quote|null $quote
|
59 |
+
* @return bool
|
60 |
+
*/
|
61 |
+
public function isAvailable($quote = null)
|
62 |
+
{
|
63 |
+
if (Mage::getStoreConfig('payment/ingpsp/apikey', $quote ? $quote->getStoreId() : null)) {
|
64 |
+
return parent::isAvailable($quote);
|
65 |
+
}
|
66 |
+
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get checkout session namespace
|
72 |
+
*
|
73 |
+
* @return Mage_Checkout_Model_Session
|
74 |
+
*/
|
75 |
+
protected function _getCheckout()
|
76 |
+
{
|
77 |
+
return Mage::getSingleton('checkout/session');
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Get current quote
|
82 |
+
*
|
83 |
+
* @return Mage_Sales_Model_Quote
|
84 |
+
*/
|
85 |
+
public function getQuote()
|
86 |
+
{
|
87 |
+
return $this->_getCheckout()->getQuote();
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* iDEAL is only active if 'EURO' is currency
|
92 |
+
*
|
93 |
+
* @param type $currencyCode
|
94 |
+
* @return true/false
|
95 |
+
*/
|
96 |
+
public function canUseForCurrency($currencyCode)
|
97 |
+
{
|
98 |
+
if ($currencyCode !== "EUR") {
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
|
102 |
+
return parent::canUseForCurrency($currencyCode);
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* On click payment button, this function is called to assign data
|
107 |
+
*
|
108 |
+
* @param $data
|
109 |
+
* @return $this
|
110 |
+
*/
|
111 |
+
public function assignData($data)
|
112 |
+
{
|
113 |
+
if (!($data instanceof Varien_Object)) {
|
114 |
+
$data = new Varien_Object($data);
|
115 |
+
}
|
116 |
+
|
117 |
+
if (Mage::registry('issuer_id')) {
|
118 |
+
Mage::unregister('issuer_id');
|
119 |
+
}
|
120 |
+
|
121 |
+
Mage::register('issuer_id', Mage::app()->getRequest()->getParam('issuer_id'));
|
122 |
+
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Redirects the client on click 'Place Order' to selected iDEAL bank
|
128 |
+
*
|
129 |
+
* @return string
|
130 |
+
*/
|
131 |
+
public function getOrderPlaceRedirectUrl()
|
132 |
+
{
|
133 |
+
return Mage::getUrl(
|
134 |
+
'ingpsp/ideal/payment',
|
135 |
+
array(
|
136 |
+
'_secure' => true,
|
137 |
+
'_query' => array(
|
138 |
+
'issuer_id' => Mage::registry('issuer_id')
|
139 |
+
)
|
140 |
+
)
|
141 |
+
);
|
142 |
+
}
|
143 |
+
}
|
app/code/community/ING/PSP/Model/Observer.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_Model_Observer
|
22 |
+
{
|
23 |
+
private $ing_modules = [
|
24 |
+
'ingpsp_ideal',
|
25 |
+
'ingpsp_banktransfer',
|
26 |
+
'ingpsp_creditcard',
|
27 |
+
'ingpsp_bancontact',
|
28 |
+
'ingpsp_cashondelivery'
|
29 |
+
];
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @param Varien_Event_Observer $observer
|
33 |
+
* @return $this
|
34 |
+
*/
|
35 |
+
public function convertPayment(Varien_Event_Observer $observer)
|
36 |
+
{
|
37 |
+
$orderPayment = $observer->getEvent()->getOrderPayment();
|
38 |
+
$quotePayment = $observer->getEvent()->getQuotePayment();
|
39 |
+
|
40 |
+
$orderPayment->setIngOrderId($quotePayment->getIngOrderId());
|
41 |
+
$orderPayment->setIngBanktransferReference($quotePayment->getIngBanktransferReference());
|
42 |
+
$orderPayment->setIngIdealIssuerId($quotePayment->getIngIdealIssuerId());
|
43 |
+
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Hide payment methods that are not allowed by ING.
|
49 |
+
*
|
50 |
+
* @param Varien_Event_Observer $observer
|
51 |
+
* @return $this
|
52 |
+
*/
|
53 |
+
public function checkPaymentMethodStatus(Varien_Event_Observer $observer)
|
54 |
+
{
|
55 |
+
$allowedProducts = $this->getActiveINGProducts();
|
56 |
+
$config = $observer->getConfig();
|
57 |
+
|
58 |
+
foreach ($this->ing_modules AS $product) {
|
59 |
+
$ingModule = $config->getNode('sections/payment/groups/'.$product);
|
60 |
+
if (in_array(str_replace('ingpsp_', '', $product), $allowedProducts)) {
|
61 |
+
$ingModule->show_in_default = 1;
|
62 |
+
$ingModule->show_in_website = 1;
|
63 |
+
$ingModule->show_in_store = 1;
|
64 |
+
$ingModule->active = 1;
|
65 |
+
} else {
|
66 |
+
$ingModule->show_in_default = 0;
|
67 |
+
$ingModule->show_in_website = 0;
|
68 |
+
$ingModule->show_in_store = 0;
|
69 |
+
$ingModule->active = 0;
|
70 |
+
}
|
71 |
+
$ingModule->saveXML();
|
72 |
+
}
|
73 |
+
|
74 |
+
return $this;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Hide payment methods that are not allowed by ING.
|
79 |
+
*
|
80 |
+
* @param Varien_Event_Observer $observer
|
81 |
+
* @return $this
|
82 |
+
*/
|
83 |
+
public function paymentMethodIsActive(Varien_Event_Observer $observer)
|
84 |
+
{
|
85 |
+
$allowedProducts = $this->getActiveINGProducts();
|
86 |
+
$event = $observer->getEvent();
|
87 |
+
$method = $event->getMethodInstance();
|
88 |
+
$result = $event->getResult();
|
89 |
+
|
90 |
+
if (in_array($method->getCode(), $this->ing_modules)) {
|
91 |
+
if (in_array(str_replace('ingpsp_', '', $method->getCode()), $allowedProducts)) {
|
92 |
+
$result->isAvailable = true;
|
93 |
+
} else {
|
94 |
+
$result->isAvailable = false;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Request ING for available payment methods.
|
103 |
+
*
|
104 |
+
* @return array
|
105 |
+
*/
|
106 |
+
protected function getActiveINGProducts()
|
107 |
+
{
|
108 |
+
require_once(Mage::getBaseDir('lib').DS.'Ing'.DS.'Services'.DS.'ing-php'.DS.'vendor'.DS.'autoload.php');
|
109 |
+
|
110 |
+
if (Mage::getStoreConfig("payment/ingpsp/apikey")) {
|
111 |
+
$ingAPI = \GingerPayments\Payment\Ginger::createClient(
|
112 |
+
Mage::getStoreConfig("payment/ingpsp/apikey"),
|
113 |
+
Mage::getStoreConfig("payment/ingpsp/product")
|
114 |
+
);
|
115 |
+
|
116 |
+
return $ingAPI->getAllowedProducts();
|
117 |
+
}
|
118 |
+
|
119 |
+
return [];
|
120 |
+
}
|
121 |
+
}
|
app/code/community/ING/PSP/Model/System/Config/Source/Dropdown/Values.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ING_PSP_Model_System_Config_Source_Dropdown_Values
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array(
|
9 |
+
'value' => 'kassacompleet',
|
10 |
+
'label' => 'Kassa Compleet',
|
11 |
+
),
|
12 |
+
array(
|
13 |
+
'value' => 'ingcheckout',
|
14 |
+
'label' => 'ING Checkout',
|
15 |
+
),
|
16 |
+
array(
|
17 |
+
'value' => 'epay',
|
18 |
+
'label' => 'ING ePay',
|
19 |
+
),
|
20 |
+
);
|
21 |
+
}
|
22 |
+
}
|
app/code/community/ING/PSP/controllers/BancontactController.php
ADDED
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_BancontactController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Bancontact
|
25 |
+
*/
|
26 |
+
protected $_bancontact;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
30 |
+
*/
|
31 |
+
protected $_read;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
35 |
+
*/
|
36 |
+
protected $_write;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get CreditCard core
|
40 |
+
* Give $_write mage writing resource
|
41 |
+
* Give $_read mage reading resource
|
42 |
+
*/
|
43 |
+
public function _construct()
|
44 |
+
{
|
45 |
+
$this->_bancontact = Mage::helper('ingpsp/bancontact');
|
46 |
+
$this->_helper = Mage::helper('ingpsp');
|
47 |
+
$this->_coreHttp = Mage::helper('core/http');
|
48 |
+
|
49 |
+
|
50 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
51 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
52 |
+
|
53 |
+
parent::_construct();
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Gets the current checkout session with order information
|
58 |
+
*
|
59 |
+
* @return Mage_Checkout_Model_Session
|
60 |
+
*/
|
61 |
+
protected function _getCheckout()
|
62 |
+
{
|
63 |
+
return Mage::getSingleton('checkout/session');
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Creates the order and sets the redirect url
|
68 |
+
*/
|
69 |
+
public function paymentAction()
|
70 |
+
{
|
71 |
+
// Load last order
|
72 |
+
/** @var $order Mage_Sales_Model_Order */
|
73 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
74 |
+
|
75 |
+
try {
|
76 |
+
// Assign required value's
|
77 |
+
$amount = $order->getGrandTotal();
|
78 |
+
$orderId = $order->getIncrementId();
|
79 |
+
$description = str_replace('%', $orderId,
|
80 |
+
Mage::getStoreConfig("payment/ingpsp_bancontact/description", $order->getStoreId())
|
81 |
+
);
|
82 |
+
$currency = $order->getOrderCurrencyCode();
|
83 |
+
$customer = $this->_getCustomerData($order);
|
84 |
+
$returnUrl = Mage::getUrl('ingpsp/bancontact/return');
|
85 |
+
|
86 |
+
if ($this->_bancontact->createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer)) {
|
87 |
+
if (!$order->getId()) {
|
88 |
+
Mage::log('Geen order voor verwerking gevonden');
|
89 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
90 |
+
}
|
91 |
+
|
92 |
+
// Creates transaction
|
93 |
+
/** @var $payment Mage_Sales_Model_Order_Payment */
|
94 |
+
$payment = $order->getPayment();
|
95 |
+
|
96 |
+
if (!$payment->getId()) {
|
97 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
98 |
+
}
|
99 |
+
|
100 |
+
//->setMethod('CreditCard')
|
101 |
+
$payment->setIsTransactionClosed(false)
|
102 |
+
->setIngOrderId($this->_bancontact->getOrderId())
|
103 |
+
->setIngIdealIssuerId(null);
|
104 |
+
|
105 |
+
// Sets the above transaction
|
106 |
+
$order->setPayment($payment);
|
107 |
+
|
108 |
+
$order->setIngOrderId($this->_bancontact->getOrderId())
|
109 |
+
->setIngIdealIssuerId(null);
|
110 |
+
$order->save();
|
111 |
+
|
112 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
113 |
+
|
114 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
115 |
+
if ($order->getData('ing_order_id')) {
|
116 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
117 |
+
}
|
118 |
+
|
119 |
+
$order->setState(
|
120 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
121 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
122 |
+
$pendingMessage,
|
123 |
+
false
|
124 |
+
);
|
125 |
+
$order->save();
|
126 |
+
|
127 |
+
Mage::log("Issuer url: ".$this->_bancontact->getPaymentUrl());
|
128 |
+
$this->_redirectUrl($this->_bancontact->getPaymentUrl());
|
129 |
+
}
|
130 |
+
} catch (Exception $e) {
|
131 |
+
Mage::log($e);
|
132 |
+
Mage::throwException(
|
133 |
+
"Could not start transaction. Contact the owner.<br />
|
134 |
+
Error message: ".$this->_bancontact->getErrorMessage()
|
135 |
+
);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Customer returning with an order_id
|
141 |
+
* Depending on the order state redirected to the corresponding page
|
142 |
+
*/
|
143 |
+
public function returnAction()
|
144 |
+
{
|
145 |
+
$orderId = Mage::app()->getRequest()->getParam('order_id');
|
146 |
+
|
147 |
+
try {
|
148 |
+
if (!empty($orderId)) {
|
149 |
+
$ingOrderDetails = $this->_bancontact->getOrderDetails($orderId);
|
150 |
+
|
151 |
+
$paymentStatus = isset($ingOrderDetails['status']) ? $ingOrderDetails['status'] : null;
|
152 |
+
|
153 |
+
if ($paymentStatus == "completed") {
|
154 |
+
// Redirect to success page
|
155 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
156 |
+
} else {
|
157 |
+
$this->_restoreCart();
|
158 |
+
|
159 |
+
// Redirect to failure page
|
160 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
161 |
+
}
|
162 |
+
}
|
163 |
+
} catch (Exception $e) {
|
164 |
+
$this->_restoreCart();
|
165 |
+
|
166 |
+
Mage::log($e);
|
167 |
+
$this->_redirectUrl(Mage::getBaseUrl());
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
protected function _restoreCart()
|
172 |
+
{
|
173 |
+
$session = Mage::getSingleton('checkout/session');
|
174 |
+
$orderId = $session->getLastRealOrderId();
|
175 |
+
if (!empty($orderId)) {
|
176 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
177 |
+
}
|
178 |
+
$quoteId = $order->getQuoteId();
|
179 |
+
|
180 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
181 |
+
|
182 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* @param Mage_Sales_Model_Order $order
|
187 |
+
* @param float $orderAmount
|
188 |
+
*/
|
189 |
+
protected function _setAmountPaid(Mage_Sales_Model_Order $order, $orderAmount)
|
190 |
+
{
|
191 |
+
// set the amounts paid
|
192 |
+
$currentBase = Mage::app()->getStore()->getBaseCurrencyCode();
|
193 |
+
$currentStore = Mage::app()->getStore()->getCurrentCurrencyCode();
|
194 |
+
|
195 |
+
$amountBase = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentBase);
|
196 |
+
$amountStore = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentStore);
|
197 |
+
|
198 |
+
$order->setBaseTotalPaid($amountBase);
|
199 |
+
$order->setTotalPaid($amountStore);
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* @param Mage_Sales_Model_Order $order
|
204 |
+
* @param null|string $transactionId
|
205 |
+
* @return bool
|
206 |
+
*/
|
207 |
+
protected function _savePaidInvoice(Mage_Sales_Model_Order $order, $transactionId = null)
|
208 |
+
{
|
209 |
+
$invoice = $order->prepareInvoice()
|
210 |
+
->register()
|
211 |
+
->setTransactionId($transactionId)
|
212 |
+
->pay();
|
213 |
+
|
214 |
+
Mage::getModel('core/resource_transaction')
|
215 |
+
->addObject($invoice)
|
216 |
+
->addObject($invoice->getOrder())
|
217 |
+
->save();
|
218 |
+
|
219 |
+
if (Mage::getStoreConfig("payment/ingpsp_bancontact/send_invoice_mail", $order->getStoreId())) {
|
220 |
+
$invoice->sendEmail();
|
221 |
+
}
|
222 |
+
|
223 |
+
return true;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Format price with currency sign
|
228 |
+
*
|
229 |
+
* @param Mage_Sales_Model_Order $order
|
230 |
+
* @param float $amount
|
231 |
+
* @return string
|
232 |
+
*/
|
233 |
+
protected function _formatPrice($order, $amount)
|
234 |
+
{
|
235 |
+
return $order->getBaseCurrency()->formatTxt($amount);
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* @param Mage_Sales_Model_Order $order
|
240 |
+
* @return array
|
241 |
+
*/
|
242 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
243 |
+
{
|
244 |
+
$billingAddress = $order->getBillingAddress();
|
245 |
+
|
246 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
247 |
+
|
248 |
+
return array(
|
249 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
250 |
+
'email_address' => $order->getCustomerEmail(),
|
251 |
+
'first_name' => $order->getCustomerFirstname(),
|
252 |
+
'last_name' => $order->getCustomerLastname(),
|
253 |
+
'address_type' => 'billing',
|
254 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
255 |
+
'postal_code' => $billingAddress->getPostcode(),
|
256 |
+
'housenumber' => $houseNumber,
|
257 |
+
'country' => $billingAddress->getCountryId(),
|
258 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
259 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
260 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
261 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
262 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
263 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
264 |
+
// "male", "female", "other", null
|
265 |
+
'birth_date' => $order->getCustomerDob(),
|
266 |
+
// Date (ISO 8601 / RFC 3339)
|
267 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
268 |
+
// "^[a-zA-Z]{2}(_[a-zA-Z]{2})?$"
|
269 |
+
);
|
270 |
+
}
|
271 |
+
}
|
app/code/community/ING/PSP/controllers/BanktransferController.php
ADDED
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_BanktransferController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Banktransfer
|
25 |
+
*/
|
26 |
+
protected $_banktransfer;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var ING_PSP_Helper_Data
|
30 |
+
*/
|
31 |
+
protected $_helper;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Mage_Core_Helper_Http
|
35 |
+
*/
|
36 |
+
protected $_coreHttp;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
40 |
+
*/
|
41 |
+
protected $_read;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
45 |
+
*/
|
46 |
+
protected $_write;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get iDEAL core
|
50 |
+
* Give $_write mage writing resource
|
51 |
+
* Give $_read mage reading resource
|
52 |
+
*/
|
53 |
+
public function _construct()
|
54 |
+
{
|
55 |
+
$this->_banktransfer = Mage::helper('ingpsp/banktransfer');
|
56 |
+
$this->_helper = Mage::helper('ingpsp');
|
57 |
+
$this->_coreHttp = Mage::helper('core/http');
|
58 |
+
|
59 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
60 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
61 |
+
|
62 |
+
parent::_construct();
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Create the order and sets the redirect url
|
67 |
+
*
|
68 |
+
* @return void
|
69 |
+
*/
|
70 |
+
public function paymentAction()
|
71 |
+
{
|
72 |
+
// Load last order
|
73 |
+
/** @var $order Mage_Sales_Model_Order */
|
74 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
75 |
+
|
76 |
+
try {
|
77 |
+
$amount = $order->getGrandTotal();
|
78 |
+
$orderId = $order->getIncrementId();
|
79 |
+
$description = str_replace('%', $orderId,
|
80 |
+
Mage::getStoreConfig("payment/ingpsp_banktransfer/description", $order->getStoreId())
|
81 |
+
);
|
82 |
+
$currency = $order->getOrderCurrencyCode();
|
83 |
+
$customer = $this->_getCustomerData($order);
|
84 |
+
$reference = $this->_banktransfer->createOrder($orderId, $amount, $currency, $description, $customer);
|
85 |
+
|
86 |
+
if ($reference) {
|
87 |
+
if ($order->getPayment()->getMethodInstance() instanceof ING_PSP_Model_Banktransfer &&
|
88 |
+
$paymentBlock = $order->getPayment()->getMethodInstance()->getMailingAddress($order->getStoreId())
|
89 |
+
) {
|
90 |
+
$details = array();
|
91 |
+
$grandTotal = $order->getGrandTotal();
|
92 |
+
$currency = Mage::app()->getLocale()->currency($order->getOrderCurrencyCode())->getSymbol();
|
93 |
+
$amountStr = $currency.' '.number_format(round($grandTotal, 2), 2, '.', '');
|
94 |
+
|
95 |
+
$paymentBlock = str_replace('%AMOUNT%', $amountStr, $paymentBlock);
|
96 |
+
$paymentBlock = str_replace('%REFERENCE%', $reference, $paymentBlock);
|
97 |
+
$paymentBlock = str_replace('\n', PHP_EOL, $paymentBlock);
|
98 |
+
|
99 |
+
$details['mailing_address'] = $paymentBlock;
|
100 |
+
if (!empty($details)) {
|
101 |
+
$order->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalData(serialize($details));
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
if (!$order->getId()) {
|
106 |
+
Mage::log('Geen order voor verwerking gevonden');
|
107 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
108 |
+
}
|
109 |
+
|
110 |
+
// Creates transaction
|
111 |
+
/** @var $payment Mage_Sales_Model_Order_Payment */
|
112 |
+
$payment = $order->getPayment();
|
113 |
+
|
114 |
+
if (!$payment->getId()) {
|
115 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
116 |
+
}
|
117 |
+
|
118 |
+
$payment->setIsTransactionClosed(false)
|
119 |
+
->setIngOrderId($this->_banktransfer->getOrderId())
|
120 |
+
->setIngBanktransferReference($reference);
|
121 |
+
|
122 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
123 |
+
|
124 |
+
// Sets the above transaction
|
125 |
+
$order->setPayment($payment);
|
126 |
+
|
127 |
+
$order->setIngOrderId($this->_banktransfer->getOrderId())
|
128 |
+
->setIngBanktransferReference($reference);
|
129 |
+
$order->save();
|
130 |
+
|
131 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
132 |
+
if ($order->getData('ing_order_id')) {
|
133 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
134 |
+
}
|
135 |
+
|
136 |
+
$order->setState(
|
137 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
138 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
139 |
+
$pendingMessage,
|
140 |
+
false
|
141 |
+
);
|
142 |
+
$order->save();
|
143 |
+
|
144 |
+
$order->addStatusToHistory($order->getStatus(), 'Reference: '.$reference)->save();
|
145 |
+
|
146 |
+
if (Mage::getStoreConfig("payment/ingpsp_banktransfer/send_order_mail", $order->getStoreId())) {
|
147 |
+
if (!$order->getEmailSent()) {
|
148 |
+
$order->setEmailSent(true);
|
149 |
+
$order->sendNewOrderEmail();
|
150 |
+
$order->save();
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true, 'reference' => $reference));
|
155 |
+
} else {
|
156 |
+
$this->_restoreCart();
|
157 |
+
|
158 |
+
// Redirect to failure page
|
159 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
160 |
+
}
|
161 |
+
} catch (Exception $e) {
|
162 |
+
Mage::log($e);
|
163 |
+
Mage::throwException(
|
164 |
+
"Could not start transaction. Contact the owner.<br />
|
165 |
+
Error message: ".$this->_banktransfer->getErrorMessage()
|
166 |
+
);
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Gets the current checkout session with order information
|
172 |
+
*
|
173 |
+
* @return Mage_Checkout_Model_Session
|
174 |
+
*/
|
175 |
+
protected function _getCheckout()
|
176 |
+
{
|
177 |
+
return Mage::getSingleton('checkout/session');
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* @return void
|
182 |
+
*/
|
183 |
+
protected function _restoreCart()
|
184 |
+
{
|
185 |
+
$session = Mage::getSingleton('checkout/session');
|
186 |
+
$orderId = $session->getLastRealOrderId();
|
187 |
+
if (!empty($orderId)) {
|
188 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
189 |
+
}
|
190 |
+
$quoteId = $order->getQuoteId();
|
191 |
+
|
192 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
193 |
+
|
194 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* @param Mage_Sales_Model_Order $order
|
199 |
+
* @return array
|
200 |
+
*/
|
201 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
202 |
+
{
|
203 |
+
$billingAddress = $order->getBillingAddress();
|
204 |
+
|
205 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
206 |
+
|
207 |
+
return array(
|
208 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
209 |
+
'email_address' => $order->getCustomerEmail(),
|
210 |
+
'first_name' => $order->getCustomerFirstname(),
|
211 |
+
'last_name' => $order->getCustomerLastname(),
|
212 |
+
'address_type' => 'billing',
|
213 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
214 |
+
'postal_code' => $billingAddress->getPostcode(),
|
215 |
+
'housenumber' => $houseNumber,
|
216 |
+
'country' => $billingAddress->getCountryId(),
|
217 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
218 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
219 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
220 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
221 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
222 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
223 |
+
// "male", "female", "other", null
|
224 |
+
'birth_date' => $order->getCustomerDob(),
|
225 |
+
// Date (ISO 8601 / RFC 3339)
|
226 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
227 |
+
// "^[a-zA-Z]{2}(_[a-zA-Z]{2})?$"
|
228 |
+
);
|
229 |
+
}
|
230 |
+
}
|
app/code/community/ING/PSP/controllers/CashondeliveryController.php
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_CashondeliveryController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Cashondelivery
|
25 |
+
*/
|
26 |
+
protected $_cashondelivery;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var ING_PSP_Helper_Data
|
30 |
+
*/
|
31 |
+
protected $_helper;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Mage_Core_Helper_Http
|
35 |
+
*/
|
36 |
+
protected $_coreHttp;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
40 |
+
*/
|
41 |
+
protected $_read;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
45 |
+
*/
|
46 |
+
protected $_write;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get iDEAL core
|
50 |
+
* Give $_write mage writing resource
|
51 |
+
* Give $_read mage reading resource
|
52 |
+
*/
|
53 |
+
public function _construct()
|
54 |
+
{
|
55 |
+
$this->_cashondelivery = Mage::helper('ingpsp/cashondelivery');
|
56 |
+
$this->_helper = Mage::helper('ingpsp');
|
57 |
+
$this->_coreHttp = Mage::helper('core/http');
|
58 |
+
|
59 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
60 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
61 |
+
|
62 |
+
parent::_construct();
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Create the order and sets the redirect url
|
67 |
+
*
|
68 |
+
* @return void
|
69 |
+
*/
|
70 |
+
public function paymentAction()
|
71 |
+
{
|
72 |
+
// Load last order
|
73 |
+
/** @var $order Mage_Sales_Model_Order */
|
74 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
75 |
+
|
76 |
+
try {
|
77 |
+
$amount = $order->getGrandTotal();
|
78 |
+
$orderId = $order->getIncrementId();
|
79 |
+
$description = str_replace('%', $orderId,
|
80 |
+
Mage::getStoreConfig("payment/ingpsp_cashondelivery/description", $order->getStoreId())
|
81 |
+
);
|
82 |
+
$customer = $this->_getCustomerData($order);
|
83 |
+
$currency = $order->getOrderCurrencyCode();
|
84 |
+
|
85 |
+
if ($this->_cashondelivery->createOrder($orderId, $amount, $currency, $description, $customer)) {
|
86 |
+
|
87 |
+
if ($order->getPayment()->getMethodInstance() instanceof ING_PSP_Model_Cashondelivery &&
|
88 |
+
$paymentBlock = $order->getPayment()->getMethodInstance()->getMailingAddress($order->getStoreId())
|
89 |
+
) {
|
90 |
+
|
91 |
+
$details = array();
|
92 |
+
$grandTotal = $order->getGrandTotal();
|
93 |
+
$currency = Mage::app()->getLocale()->currency($order->getOrderCurrencyCode())->getSymbol();
|
94 |
+
$amountStr = $currency.' '.number_format(round($grandTotal, 2), 2, '.', '');
|
95 |
+
|
96 |
+
$paymentBlock = str_replace('%AMOUNT%', $amountStr, $paymentBlock);
|
97 |
+
$paymentBlock = str_replace('\n', PHP_EOL, $paymentBlock);
|
98 |
+
|
99 |
+
$details['mailing_address'] = $paymentBlock;
|
100 |
+
if (!empty($details)) {
|
101 |
+
$order->getPayment()->getMethodInstance()->getInfoInstance()->setAdditionalData(serialize($details));
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
if (!$order->getId()) {
|
106 |
+
Mage::log('Geen order voor verwerking gevonden');
|
107 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
108 |
+
}
|
109 |
+
|
110 |
+
// Creates transaction
|
111 |
+
/** @var $payment Mage_Sales_Model_Order_Payment */
|
112 |
+
$payment = $order->getPayment();
|
113 |
+
|
114 |
+
if (!$payment->getId()) {
|
115 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
116 |
+
}
|
117 |
+
|
118 |
+
$payment->setIsTransactionClosed(false)
|
119 |
+
->setIngOrderId($this->_cashondelivery->getOrderId())
|
120 |
+
->setIngIdealIssuerId(null);
|
121 |
+
|
122 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
123 |
+
|
124 |
+
// Sets the above transaction
|
125 |
+
$order->setPayment($payment);
|
126 |
+
|
127 |
+
$order->setIngOrderId($this->_cashondelivery->getOrderId())
|
128 |
+
->setIngIdealIssuerId(null);
|
129 |
+
$order->save();
|
130 |
+
|
131 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Cashondelivery::PAYMENT_FLAG_PENDING);
|
132 |
+
if ($order->getData('ing_order_id')) {
|
133 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
134 |
+
}
|
135 |
+
|
136 |
+
$order->setState(
|
137 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
138 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
139 |
+
$pendingMessage,
|
140 |
+
false
|
141 |
+
);
|
142 |
+
$order->save();
|
143 |
+
|
144 |
+
if (Mage::getStoreConfig("payment/ingpsp_cashondelivery/send_order_mail", $order->getStoreId())) {
|
145 |
+
if (!$order->getEmailSent()) {
|
146 |
+
$order->setEmailSent(true);
|
147 |
+
$order->sendNewOrderEmail();
|
148 |
+
$order->save();
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
153 |
+
} else {
|
154 |
+
$this->_restoreCart();
|
155 |
+
|
156 |
+
// Redirect to failure page
|
157 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
158 |
+
}
|
159 |
+
} catch (Exception $e) {
|
160 |
+
Mage::log($e);
|
161 |
+
Mage::throwException(
|
162 |
+
"Could not start transaction. Contact the owner.<br />
|
163 |
+
Error message: ".$this->_cashondelivery->getErrorMessage()
|
164 |
+
);
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Gets the current checkout session with order information
|
170 |
+
*
|
171 |
+
* @return Mage_Checkout_Model_Session
|
172 |
+
*/
|
173 |
+
protected function _getCheckout()
|
174 |
+
{
|
175 |
+
return Mage::getSingleton('checkout/session');
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* @return void
|
180 |
+
*/
|
181 |
+
protected function _restoreCart()
|
182 |
+
{
|
183 |
+
$session = Mage::getSingleton('checkout/session');
|
184 |
+
$orderId = $session->getLastRealOrderId();
|
185 |
+
if (!empty($orderId)) {
|
186 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
187 |
+
}
|
188 |
+
$quoteId = $order->getQuoteId();
|
189 |
+
|
190 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
191 |
+
|
192 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* @param Mage_Sales_Model_Order $order
|
197 |
+
* @return array
|
198 |
+
*/
|
199 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
200 |
+
{
|
201 |
+
$billingAddress = $order->getBillingAddress();
|
202 |
+
|
203 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
204 |
+
|
205 |
+
return array(
|
206 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
207 |
+
'email_address' => $order->getCustomerEmail(),
|
208 |
+
'first_name' => $order->getCustomerFirstname(),
|
209 |
+
'last_name' => $order->getCustomerLastname(),
|
210 |
+
'address_type' => 'billing',
|
211 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
212 |
+
'postal_code' => $billingAddress->getPostcode(),
|
213 |
+
'housenumber' => $houseNumber,
|
214 |
+
'country' => $billingAddress->getCountryId(),
|
215 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
216 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
217 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
218 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
219 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
220 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
221 |
+
// "male", "female", "other", null
|
222 |
+
'birth_date' => $order->getCustomerDob(),
|
223 |
+
// Date (ISO 8601 / RFC 3339)
|
224 |
+
'locale' => substr(Mage::getStoreConfig('general/locale/code'), 0, 2),
|
225 |
+
// "^[a-zA-Z]{2}(_[a-zA-Z]{2})?$"
|
226 |
+
);
|
227 |
+
}
|
228 |
+
}
|
app/code/community/ING/PSP/controllers/CreditcardController.php
ADDED
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_CreditcardController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Creditcard
|
25 |
+
*/
|
26 |
+
protected $_creditcard;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
30 |
+
*/
|
31 |
+
protected $_read;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
35 |
+
*/
|
36 |
+
protected $_write;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get CreditCard core
|
40 |
+
* Give $_write mage writing resource
|
41 |
+
* Give $_read mage reading resource
|
42 |
+
*/
|
43 |
+
public function _construct()
|
44 |
+
{
|
45 |
+
$this->_creditcard = Mage::helper('ingpsp/creditcard');
|
46 |
+
$this->_helper = Mage::helper('ingpsp');
|
47 |
+
$this->_coreHttp = Mage::helper('core/http');
|
48 |
+
|
49 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
50 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
51 |
+
|
52 |
+
parent::_construct();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the current checkout session with order information
|
57 |
+
*
|
58 |
+
* @return Mage_Checkout_Model_Session
|
59 |
+
*/
|
60 |
+
protected function _getCheckout()
|
61 |
+
{
|
62 |
+
return Mage::getSingleton('checkout/session');
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Creates the order and sets the redirect url
|
67 |
+
*/
|
68 |
+
public function paymentAction()
|
69 |
+
{
|
70 |
+
// Load last order
|
71 |
+
/** @var $order Mage_Sales_Model_Order */
|
72 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
73 |
+
|
74 |
+
try {
|
75 |
+
// Assign required value's
|
76 |
+
$amount = $order->getGrandTotal();
|
77 |
+
$orderId = $order->getIncrementId();
|
78 |
+
$description = str_replace('%', $orderId,
|
79 |
+
Mage::getStoreConfig("payment/ingpsp_creditcard/description", $order->getStoreId())
|
80 |
+
);
|
81 |
+
$currency = $order->getOrderCurrencyCode();
|
82 |
+
$customer = $this->_getCustomerData($order);
|
83 |
+
$returnUrl = Mage::getUrl('ingpsp/creditcard/return');
|
84 |
+
|
85 |
+
if ($this->_creditcard->createOrder($orderId, $amount, $currency, $description, $returnUrl, $customer)) {
|
86 |
+
if (!$order->getId()) {
|
87 |
+
Mage::log('Geen order voor verwerking gevonden');
|
88 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
89 |
+
}
|
90 |
+
|
91 |
+
// Creates transaction
|
92 |
+
/** @var $payment Mage_Sales_Model_Order_Payment */
|
93 |
+
$payment = $order->getPayment();
|
94 |
+
|
95 |
+
if (!$payment->getId()) {
|
96 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
97 |
+
}
|
98 |
+
|
99 |
+
//->setMethod('CreditCard')
|
100 |
+
$payment->setIsTransactionClosed(false)
|
101 |
+
->setIngOrderId($this->_creditcard->getOrderId())
|
102 |
+
->setIngIdealIssuerId(null);
|
103 |
+
|
104 |
+
// Sets the above transaction
|
105 |
+
$order->setPayment($payment);
|
106 |
+
|
107 |
+
$order->setIngOrderId($this->_creditcard->getOrderId())
|
108 |
+
->setIngIdealIssuerId(null);
|
109 |
+
$order->save();
|
110 |
+
|
111 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
112 |
+
|
113 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
114 |
+
if ($order->getData('ing_order_id')) {
|
115 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
116 |
+
}
|
117 |
+
|
118 |
+
$order->setState(
|
119 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
120 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
121 |
+
$pendingMessage,
|
122 |
+
false
|
123 |
+
);
|
124 |
+
$order->save();
|
125 |
+
|
126 |
+
Mage::log("Issuer url: ".$this->_creditcard->getPaymentUrl());
|
127 |
+
$this->_redirectUrl($this->_creditcard->getPaymentUrl());
|
128 |
+
}
|
129 |
+
} catch (Exception $e) {
|
130 |
+
die($e->getMessage());
|
131 |
+
Mage::log($e);
|
132 |
+
Mage::throwException(
|
133 |
+
"Could not start transaction. Contact the owner.<br />
|
134 |
+
Error message: ".$this->_creditcard->getErrorMessage()
|
135 |
+
);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Customer returning with an order_id
|
141 |
+
* Depending on the order state redirected to the corresponding page
|
142 |
+
*/
|
143 |
+
public function returnAction()
|
144 |
+
{
|
145 |
+
$orderId = Mage::app()->getRequest()->getParam('order_id');
|
146 |
+
|
147 |
+
try {
|
148 |
+
if (!empty($orderId)) {
|
149 |
+
$ingOrderDetails = $this->_creditcard->getOrderDetails($orderId);
|
150 |
+
|
151 |
+
$paymentStatus = isset($ingOrderDetails['status']) ? $ingOrderDetails['status'] : null;
|
152 |
+
|
153 |
+
if ($paymentStatus == "completed") {
|
154 |
+
// Redirect to success page
|
155 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
156 |
+
} else {
|
157 |
+
$this->_restoreCart();
|
158 |
+
|
159 |
+
// Redirect to failure page
|
160 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
161 |
+
}
|
162 |
+
}
|
163 |
+
} catch (Exception $e) {
|
164 |
+
$this->_restoreCart();
|
165 |
+
|
166 |
+
Mage::log($e);
|
167 |
+
$this->_redirectUrl(Mage::getBaseUrl());
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
protected function _restoreCart()
|
172 |
+
{
|
173 |
+
$session = Mage::getSingleton('checkout/session');
|
174 |
+
$orderId = $session->getLastRealOrderId();
|
175 |
+
if (!empty($orderId)) {
|
176 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
177 |
+
}
|
178 |
+
$quoteId = $order->getQuoteId();
|
179 |
+
|
180 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
181 |
+
|
182 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* @param Mage_Sales_Model_Order $order
|
187 |
+
* @param float $orderAmount
|
188 |
+
*/
|
189 |
+
protected function _setAmountPaid(Mage_Sales_Model_Order $order, $orderAmount)
|
190 |
+
{
|
191 |
+
// set the amounts paid
|
192 |
+
$currentBase = Mage::app()->getStore()->getBaseCurrencyCode();
|
193 |
+
$currentStore = Mage::app()->getStore()->getCurrentCurrencyCode();
|
194 |
+
|
195 |
+
$amountBase = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentBase);
|
196 |
+
$amountStore = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentStore);
|
197 |
+
|
198 |
+
$order->setBaseTotalPaid($amountBase);
|
199 |
+
$order->setTotalPaid($amountStore);
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* @param Mage_Sales_Model_Order $order
|
204 |
+
* @param null|string $transactionId
|
205 |
+
* @return bool
|
206 |
+
*/
|
207 |
+
protected function _savePaidInvoice(Mage_Sales_Model_Order $order, $transactionId = null)
|
208 |
+
{
|
209 |
+
$invoice = $order->prepareInvoice()
|
210 |
+
->register()
|
211 |
+
->setTransactionId($transactionId)
|
212 |
+
->pay();
|
213 |
+
|
214 |
+
Mage::getModel('core/resource_transaction')
|
215 |
+
->addObject($invoice)
|
216 |
+
->addObject($invoice->getOrder())
|
217 |
+
->save();
|
218 |
+
|
219 |
+
if (Mage::getStoreConfig("payment/ingpsp_creditcard/send_invoice_mail", $order->getStoreId())) {
|
220 |
+
$invoice->sendEmail();
|
221 |
+
}
|
222 |
+
|
223 |
+
return true;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Format price with currency sign
|
228 |
+
*
|
229 |
+
* @param Mage_Sales_Model_Order $order
|
230 |
+
* @param float $amount
|
231 |
+
* @return string
|
232 |
+
*/
|
233 |
+
protected function _formatPrice($order, $amount)
|
234 |
+
{
|
235 |
+
return $order->getBaseCurrency()->formatTxt($amount);
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* @param Mage_Sales_Model_Order $order
|
240 |
+
* @return array
|
241 |
+
*/
|
242 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
243 |
+
{
|
244 |
+
$billingAddress = $order->getBillingAddress();
|
245 |
+
|
246 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
247 |
+
|
248 |
+
return array(
|
249 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
250 |
+
'email_address' => $order->getCustomerEmail(),
|
251 |
+
'first_name' => $order->getCustomerFirstname(),
|
252 |
+
'last_name' => $order->getCustomerLastname(),
|
253 |
+
'address_type' => 'billing',
|
254 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
255 |
+
'postal_code' => $billingAddress->getPostcode(),
|
256 |
+
'housenumber' => $houseNumber,
|
257 |
+
'country' => $billingAddress->getCountryId(),
|
258 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
259 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
260 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
261 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
262 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
263 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
264 |
+
// "male", "female", "other", null
|
265 |
+
'birth_date' => $order->getCustomerDob(),
|
266 |
+
// Date (ISO 8601 / RFC 3339)
|
267 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
268 |
+
// "^[a-zA-Z]{2}(_[a-zA-Z]{2})?$"
|
269 |
+
);
|
270 |
+
}
|
271 |
+
}
|
app/code/community/ING/PSP/controllers/IdealController.php
ADDED
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.2
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
class ING_PSP_IdealController extends Mage_Core_Controller_Front_Action
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @var ING_PSP_Helper_Ideal
|
25 |
+
*/
|
26 |
+
protected $_ideal;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
30 |
+
*/
|
31 |
+
protected $_read;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Varien_Db_Adapter_Pdo_Mysql
|
35 |
+
*/
|
36 |
+
protected $_write;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Get iDEAL core
|
40 |
+
* Give $_write mage writing resource
|
41 |
+
* Give $_read mage reading resource
|
42 |
+
*/
|
43 |
+
public function _construct()
|
44 |
+
{
|
45 |
+
$this->_ideal = Mage::helper('ingpsp/ideal');
|
46 |
+
$this->_helper = Mage::helper('ingpsp');
|
47 |
+
$this->_coreHttp = Mage::helper('core/http');
|
48 |
+
|
49 |
+
$this->_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
50 |
+
$this->_write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
51 |
+
|
52 |
+
parent::_construct();
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the current checkout session with order information
|
57 |
+
*
|
58 |
+
* @return Mage_Checkout_Model_Session
|
59 |
+
*/
|
60 |
+
protected function _getCheckout()
|
61 |
+
{
|
62 |
+
return Mage::getSingleton('checkout/session');
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Creats the order and sets the redirect url
|
67 |
+
*
|
68 |
+
*/
|
69 |
+
public function paymentAction()
|
70 |
+
{
|
71 |
+
// Load last order
|
72 |
+
/** @var $order Mage_Sales_Model_Order */
|
73 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->_getCheckout()->last_real_order_id);
|
74 |
+
|
75 |
+
try {
|
76 |
+
$issuerId = Mage::app()->getRequest()->getParam('issuer_id');
|
77 |
+
$amount = $order->getGrandTotal();
|
78 |
+
$orderId = $order->getIncrementId();
|
79 |
+
$description = str_replace('%', $orderId,
|
80 |
+
Mage::getStoreConfig("payment/ingpsp_ideal/description", $order->getStoreId())
|
81 |
+
);
|
82 |
+
$returnUrl = Mage::getUrl('ingpsp/ideal/return');
|
83 |
+
$customer = $this->_getCustomerData($order);
|
84 |
+
$currency = $order->getOrderCurrencyCode();
|
85 |
+
|
86 |
+
if ($this->_ideal->createOrder($orderId, $issuerId, $amount, $currency, $description, $returnUrl, $customer)) {
|
87 |
+
|
88 |
+
if (!$order->getId()) {
|
89 |
+
Mage::log('Geen order voor verwerking gevonden');
|
90 |
+
Mage::throwException('Geen order voor verwerking gevonden');
|
91 |
+
}
|
92 |
+
|
93 |
+
// Creates transaction
|
94 |
+
/** @var $payment Mage_Sales_Model_Order_Payment */
|
95 |
+
$payment = $order->getPayment();
|
96 |
+
|
97 |
+
if (!$payment->getId()) {
|
98 |
+
$payment = Mage::getModel('sales/order_payment')->setId(null);
|
99 |
+
}
|
100 |
+
|
101 |
+
//->setMethod('iDEAL')
|
102 |
+
$payment->setIsTransactionClosed(false)
|
103 |
+
->setIngOrderId($this->_ideal->getOrderId())
|
104 |
+
->setIngIdealIssuerId($issuerId);
|
105 |
+
|
106 |
+
// Sets the above transaction
|
107 |
+
$order->setPayment($payment);
|
108 |
+
|
109 |
+
$order->setIngOrderId($this->_ideal->getOrderId())
|
110 |
+
->setIngIdealIssuerId($issuerId);
|
111 |
+
$order->save();
|
112 |
+
|
113 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
114 |
+
|
115 |
+
$pendingMessage = Mage::helper('ingpsp')->__(ING_PSP_Model_Banktransfer::PAYMENT_FLAG_PENDING);
|
116 |
+
if ($order->getData('ing_order_id')) {
|
117 |
+
$pendingMessage .= '. '.'ING Order ID: '.$order->getData('ing_order_id');
|
118 |
+
}
|
119 |
+
|
120 |
+
$order->setState(
|
121 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
122 |
+
Mage_Sales_Model_Order::STATE_PENDING_PAYMENT,
|
123 |
+
$pendingMessage,
|
124 |
+
false
|
125 |
+
);
|
126 |
+
$order->save();
|
127 |
+
|
128 |
+
Mage::log("Issuer url: ".$this->_ideal->getPaymentUrl());
|
129 |
+
$this->_redirectUrl($this->_ideal->getPaymentUrl());
|
130 |
+
}
|
131 |
+
} catch (Exception $e) {
|
132 |
+
die($e->getMessage());
|
133 |
+
Mage::log($e);
|
134 |
+
Mage::throwException(
|
135 |
+
"Could not start transaction. Contact the owner.<br />
|
136 |
+
Error message: ".$this->_ideal->getErrorMessage()
|
137 |
+
);
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* This action is getting called by Payment service to report the payment status
|
143 |
+
*/
|
144 |
+
public function webhookAction()
|
145 |
+
{
|
146 |
+
$input = json_decode(file_get_contents("php://input"), true);
|
147 |
+
|
148 |
+
if (!$input) {
|
149 |
+
die("Invalid JSON");
|
150 |
+
}
|
151 |
+
|
152 |
+
if (in_array($input['event'], array("status_changed"))) {
|
153 |
+
|
154 |
+
$ingOrderId = $input['order_id'];
|
155 |
+
|
156 |
+
$ingOrder = $this->_ideal->getOrderDetails($ingOrderId);
|
157 |
+
|
158 |
+
$orderId = $ingOrder['merchant_order_id'];
|
159 |
+
$orderStatus = $ingOrder['status'];
|
160 |
+
|
161 |
+
/** @var $order Mage_Sales_Model_Order */
|
162 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
163 |
+
|
164 |
+
try {
|
165 |
+
if ($order->getData('status') == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) {
|
166 |
+
// Creates transaction
|
167 |
+
$payment = Mage::getModel('sales/order_payment')
|
168 |
+
->setMethod('iDEAL')
|
169 |
+
->setIsTransactionClosed(true);
|
170 |
+
|
171 |
+
// Sets the above transaction
|
172 |
+
$order->setPayment($payment);
|
173 |
+
$orderAmountCents = (int) (100 * round($order->getGrandTotal(), 2, PHP_ROUND_HALF_UP));
|
174 |
+
|
175 |
+
switch ($orderStatus) {
|
176 |
+
case "completed":
|
177 |
+
// store the amount paid in the order
|
178 |
+
$amountPaidCents = (int) $ingOrder['amount'];
|
179 |
+
// $this->_setAmountPaid($order, $amount_paid_cents / 100);
|
180 |
+
|
181 |
+
if ($amountPaidCents == $orderAmountCents) {
|
182 |
+
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
183 |
+
|
184 |
+
$order->setState(
|
185 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
186 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
187 |
+
Mage::helper('ingpsp')->__(ING_PSP_Model_Ideal::PAYMENT_FLAG_COMPLETED),
|
188 |
+
true
|
189 |
+
);
|
190 |
+
$order->save();
|
191 |
+
|
192 |
+
$order->setState(
|
193 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
194 |
+
Mage_Sales_Model_Order::STATE_PROCESSING,
|
195 |
+
Mage::helper('sales')->__('Registered notification about captured amount of %s.',
|
196 |
+
$this->_formatPrice($order, $order->getGrandTotal())),
|
197 |
+
false
|
198 |
+
);
|
199 |
+
$order->save();
|
200 |
+
|
201 |
+
// Sends email to customer.
|
202 |
+
if (Mage::getStoreConfig("payment/ingpsp_ideal/send_invoice_mail",
|
203 |
+
$order->getStoreId())
|
204 |
+
) {
|
205 |
+
$order->sendNewOrderEmail()->setEmailSent(true)->save();
|
206 |
+
}
|
207 |
+
|
208 |
+
// Create invoice.
|
209 |
+
if (Mage::getStoreConfig("payment/ingpsp_ideal/generate_invoice_upon_completion",
|
210 |
+
$order->getStoreId())
|
211 |
+
) {
|
212 |
+
$this->_savePaidInvoice($order);
|
213 |
+
}
|
214 |
+
} else {
|
215 |
+
$order->setState(
|
216 |
+
Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW,
|
217 |
+
Mage_Sales_Model_Order::STATUS_FRAUD,
|
218 |
+
Mage::helper('ingpsp')->__(ING_PSP_Model_Ideal::PAYMENT_FLAG_FRAUD),
|
219 |
+
false
|
220 |
+
);
|
221 |
+
$order->save();
|
222 |
+
}
|
223 |
+
break;
|
224 |
+
case "cancelled":
|
225 |
+
case "expired":
|
226 |
+
$order->cancel();
|
227 |
+
$order->setState(
|
228 |
+
Mage_Sales_Model_Order::STATE_CANCELED,
|
229 |
+
Mage_Sales_Model_Order::STATE_CANCELED,
|
230 |
+
Mage::helper('ingpsp')->__(ING_PSP_Model_Ideal::PAYMENT_FLAG_CANCELLED),
|
231 |
+
true
|
232 |
+
);
|
233 |
+
$order->save();
|
234 |
+
break;
|
235 |
+
case "error":
|
236 |
+
case "pending":
|
237 |
+
case "see-transactions":
|
238 |
+
case "new":
|
239 |
+
default:
|
240 |
+
// just wait
|
241 |
+
break;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
} catch (Exception $e) {
|
245 |
+
Mage::log($e);
|
246 |
+
Mage::throwException($e);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Customer returning with an order_id
|
253 |
+
* Depending on the order state redirected to the corresponding page
|
254 |
+
*/
|
255 |
+
public function returnAction()
|
256 |
+
{
|
257 |
+
$orderId = Mage::app()->getRequest()->getParam('order_id');
|
258 |
+
|
259 |
+
try {
|
260 |
+
if (!empty($orderId)) {
|
261 |
+
$ingOrderDetails = $this->_ideal->getOrderDetails($orderId);
|
262 |
+
|
263 |
+
$paymentStatus = isset($ingOrderDetails['status']) ? $ingOrderDetails['status'] : null;
|
264 |
+
|
265 |
+
if ($paymentStatus == "completed") {
|
266 |
+
// Redirect to success page
|
267 |
+
$this->_redirect('checkout/onepage/success', array('_secure' => true));
|
268 |
+
} else {
|
269 |
+
$this->_restoreCart();
|
270 |
+
|
271 |
+
// Redirect to failure page
|
272 |
+
$this->_redirect('checkout/onepage/failure', array('_secure' => true));
|
273 |
+
}
|
274 |
+
}
|
275 |
+
} catch (Exception $e) {
|
276 |
+
$this->_restoreCart();
|
277 |
+
|
278 |
+
Mage::log($e);
|
279 |
+
$this->_redirectUrl(Mage::getBaseUrl());
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
protected function _restoreCart()
|
284 |
+
{
|
285 |
+
$session = Mage::getSingleton('checkout/session');
|
286 |
+
$orderId = $session->getLastRealOrderId();
|
287 |
+
if (!empty($orderId)) {
|
288 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
289 |
+
}
|
290 |
+
$quoteId = $order->getQuoteId();
|
291 |
+
|
292 |
+
$quote = Mage::getModel('sales/quote')->load($quoteId)->setIsActive(true)->save();
|
293 |
+
|
294 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
295 |
+
}
|
296 |
+
|
297 |
+
/**
|
298 |
+
* @param Mage_Sales_Model_Order $order
|
299 |
+
* @param float $orderAmount
|
300 |
+
*/
|
301 |
+
protected function _setAmountPaid(Mage_Sales_Model_Order $order, $orderAmount)
|
302 |
+
{
|
303 |
+
// set the amounts paid
|
304 |
+
$currentBase = Mage::app()->getStore()->getBaseCurrencyCode();
|
305 |
+
$currentStore = Mage::app()->getStore()->getCurrentCurrencyCode();
|
306 |
+
|
307 |
+
$amountBase = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentBase);
|
308 |
+
$amountStore = Mage::helper('directory')->currencyConvert($orderAmount, 'EUR', $currentStore);
|
309 |
+
|
310 |
+
$order->setBaseTotalPaid($amountBase);
|
311 |
+
$order->setTotalPaid($amountStore);
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* @param Mage_Sales_Model_Order $order
|
316 |
+
* @param null|string $transactionId
|
317 |
+
* @return bool
|
318 |
+
*/
|
319 |
+
protected function _savePaidInvoice(Mage_Sales_Model_Order $order, $transactionId = null)
|
320 |
+
{
|
321 |
+
$invoice = $order->prepareInvoice()
|
322 |
+
->register()
|
323 |
+
->setTransactionId($transactionId)
|
324 |
+
->pay();
|
325 |
+
|
326 |
+
Mage::getModel('core/resource_transaction')
|
327 |
+
->addObject($invoice)
|
328 |
+
->addObject($invoice->getOrder())
|
329 |
+
->save();
|
330 |
+
|
331 |
+
if (Mage::getStoreConfig("payment/ingpsp_ideal/send_invoice_mail", $order->getStoreId())) {
|
332 |
+
$invoice->sendEmail();
|
333 |
+
}
|
334 |
+
|
335 |
+
return true;
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Format price with currency sign
|
340 |
+
*
|
341 |
+
* @param Mage_Sales_Model_Order $order
|
342 |
+
* @param float $amount
|
343 |
+
* @return string
|
344 |
+
*/
|
345 |
+
protected function _formatPrice($order, $amount)
|
346 |
+
{
|
347 |
+
return $order->getBaseCurrency()->formatTxt($amount);
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* @param Mage_Sales_Model_Order $order
|
352 |
+
* @return array
|
353 |
+
*/
|
354 |
+
protected function _getCustomerData(Mage_Sales_Model_Order $order)
|
355 |
+
{
|
356 |
+
$billingAddress = $order->getBillingAddress();
|
357 |
+
|
358 |
+
list($address, $houseNumber) = $this->_helper->parseAddress($billingAddress->getStreetFull());
|
359 |
+
|
360 |
+
return array(
|
361 |
+
'merchant_customer_id' => $order->getCustomerId(),
|
362 |
+
'email_address' => $order->getCustomerEmail(),
|
363 |
+
'first_name' => $order->getCustomerFirstname(),
|
364 |
+
'last_name' => $order->getCustomerLastname(),
|
365 |
+
'address_type' => 'billing',
|
366 |
+
'address' => trim($billingAddress->getCity()).' '.trim($address),
|
367 |
+
'postal_code' => $billingAddress->getPostcode(),
|
368 |
+
'housenumber' => $houseNumber,
|
369 |
+
'country' => $billingAddress->getCountryId(),
|
370 |
+
'phone_numbers' => [$billingAddress->getTelephone()],
|
371 |
+
'user_agent' => $this->_coreHttp->getHttpUserAgent(),
|
372 |
+
'referrer' => $this->_coreHttp->getHttpReferer(),
|
373 |
+
'ip_address' => $this->_coreHttp->getRemoteAddr(),
|
374 |
+
'forwarded_ip' => $this->getRequest()->getServer('HTTP_X_FORWARDED_FOR'),
|
375 |
+
'gender' => $order->getCustomerGender() ? ('1' ? 'male' : ('2' ? 'female' : null)) : null,
|
376 |
+
// "male", "female", "other", null
|
377 |
+
'birth_date' => $order->getCustomerDob(),
|
378 |
+
// Date (ISO 8601 / RFC 3339)
|
379 |
+
'locale' => Mage::app()->getLocale()->getLocaleCode(),
|
380 |
+
// "^[a-zA-Z]{2}(_[a-zA-Z]{2})?$"
|
381 |
+
);
|
382 |
+
}
|
383 |
+
}
|
app/code/community/ING/PSP/etc/adminhtml.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<acl>
|
21 |
+
<resources>
|
22 |
+
<all>
|
23 |
+
<title>Allow Everything</title>
|
24 |
+
</all>
|
25 |
+
<admin>
|
26 |
+
<children>
|
27 |
+
<system>
|
28 |
+
<children>
|
29 |
+
<config>
|
30 |
+
<children>
|
31 |
+
<ingpsp>
|
32 |
+
<title>ING PSP Betaal Methode(s)</title>
|
33 |
+
</ingpsp>
|
34 |
+
</children>
|
35 |
+
</config>
|
36 |
+
</children>
|
37 |
+
</system>
|
38 |
+
</children>
|
39 |
+
</admin>
|
40 |
+
</resources>
|
41 |
+
</acl>
|
42 |
+
</config>
|
app/code/community/ING/PSP/etc/config.xml
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<modules>
|
21 |
+
<ING_PSP>
|
22 |
+
<version>1.1.1</version>
|
23 |
+
</ING_PSP>
|
24 |
+
</modules>
|
25 |
+
<global>
|
26 |
+
<models>
|
27 |
+
<ingpsp>
|
28 |
+
<class>ING_PSP_Model</class>
|
29 |
+
</ingpsp>
|
30 |
+
</models>
|
31 |
+
<blocks>
|
32 |
+
<ingpsp>
|
33 |
+
<class>ING_PSP_Block</class>
|
34 |
+
</ingpsp>
|
35 |
+
<payment>
|
36 |
+
<class>ING_PSP_Block</class>
|
37 |
+
<class>Mage_Payment_Block</class>
|
38 |
+
</payment>
|
39 |
+
</blocks>
|
40 |
+
<helpers>
|
41 |
+
<ingpsp>
|
42 |
+
<class>ING_PSP_Helper</class>
|
43 |
+
</ingpsp>
|
44 |
+
</helpers>
|
45 |
+
<payment>
|
46 |
+
<groups>
|
47 |
+
<ingpsp>ingpsp</ingpsp>
|
48 |
+
</groups>
|
49 |
+
</payment>
|
50 |
+
<resources>
|
51 |
+
<ingpsp_setup>
|
52 |
+
<setup>
|
53 |
+
<module>ING_PSP</module>
|
54 |
+
<class>Mage_Catalog_Model_Resource_Setup</class>
|
55 |
+
</setup>
|
56 |
+
<connection>
|
57 |
+
<use>core_setup</use>
|
58 |
+
</connection>
|
59 |
+
</ingpsp_setup>
|
60 |
+
<ingpsp_write>
|
61 |
+
<connection>
|
62 |
+
<use>core_write</use>
|
63 |
+
</connection>
|
64 |
+
</ingpsp_write>
|
65 |
+
<ingpsp_read>
|
66 |
+
<connection>
|
67 |
+
<use>core_read</use>
|
68 |
+
</connection>
|
69 |
+
</ingpsp_read>
|
70 |
+
</resources>
|
71 |
+
<fieldsets>
|
72 |
+
<sales_convert_quote>
|
73 |
+
<ing_order_id>
|
74 |
+
<to_order>*</to_order>
|
75 |
+
</ing_order_id>
|
76 |
+
<ing_banktransfer_reference>
|
77 |
+
<to_order>*</to_order>
|
78 |
+
</ing_banktransfer_reference>
|
79 |
+
<ing_ideal_issuer_id>
|
80 |
+
<to_order>*</to_order>
|
81 |
+
</ing_ideal_issuer_id>
|
82 |
+
</sales_convert_quote>
|
83 |
+
<sales_convert_order>
|
84 |
+
<ing_order_id>
|
85 |
+
<to_quote>*</to_quote>
|
86 |
+
</ing_order_id>
|
87 |
+
<ing_banktransfer_reference>
|
88 |
+
<to_quote>*</to_quote>
|
89 |
+
</ing_banktransfer_reference>
|
90 |
+
<ing_ideal_issuer_id>
|
91 |
+
<to_quote>*</to_quote>
|
92 |
+
</ing_ideal_issuer_id>
|
93 |
+
</sales_convert_order>
|
94 |
+
</fieldsets>
|
95 |
+
</global>
|
96 |
+
<frontend>
|
97 |
+
<routers>
|
98 |
+
<ingpsp>
|
99 |
+
<use>standard</use>
|
100 |
+
<args>
|
101 |
+
<module>ING_PSP</module>
|
102 |
+
<frontName>ingpsp</frontName>
|
103 |
+
</args>
|
104 |
+
</ingpsp>
|
105 |
+
</routers>
|
106 |
+
<layout>
|
107 |
+
<updates>
|
108 |
+
<ingpsp>
|
109 |
+
<file>ing_psp.xml</file>
|
110 |
+
</ingpsp>
|
111 |
+
</updates>
|
112 |
+
</layout>
|
113 |
+
<translate>
|
114 |
+
<modules>
|
115 |
+
<ING_PSP>
|
116 |
+
<files>
|
117 |
+
<default>ING_PSP.csv</default>
|
118 |
+
</files>
|
119 |
+
</ING_PSP>
|
120 |
+
</modules>
|
121 |
+
</translate>
|
122 |
+
|
123 |
+
<events>
|
124 |
+
<sales_convert_quote_payment_to_order_payment>
|
125 |
+
<observers>
|
126 |
+
<ingpsp_observer>
|
127 |
+
<type>singleton</type>
|
128 |
+
<class>ingpsp/observer</class>
|
129 |
+
<method>convertPayment</method>
|
130 |
+
</ingpsp_observer>
|
131 |
+
</observers>
|
132 |
+
</sales_convert_quote_payment_to_order_payment>
|
133 |
+
|
134 |
+
<payment_method_is_active>
|
135 |
+
<observers>
|
136 |
+
<paymentfilter_payment_method_is_active>
|
137 |
+
<type>singleton</type>
|
138 |
+
<class>ingpsp/observer</class>
|
139 |
+
<method>paymentMethodIsActive</method>
|
140 |
+
</paymentfilter_payment_method_is_active>
|
141 |
+
</observers>
|
142 |
+
</payment_method_is_active>
|
143 |
+
|
144 |
+
</events>
|
145 |
+
</frontend>
|
146 |
+
<adminhtml>
|
147 |
+
<events>
|
148 |
+
|
149 |
+
<adminhtml_init_system_config>
|
150 |
+
<observers>
|
151 |
+
<ingpsp_observer>
|
152 |
+
<type>singleton</type>
|
153 |
+
<class>ingpsp/observer</class>
|
154 |
+
<method>checkPaymentMethodStatus</method>
|
155 |
+
</ingpsp_observer>
|
156 |
+
</observers>
|
157 |
+
</adminhtml_init_system_config>
|
158 |
+
|
159 |
+
</events>
|
160 |
+
<layout>
|
161 |
+
<updates>
|
162 |
+
<ingpsp>
|
163 |
+
<file>ing_psp.xml</file>
|
164 |
+
</ingpsp>
|
165 |
+
</updates>
|
166 |
+
</layout>
|
167 |
+
<translate>
|
168 |
+
<modules>
|
169 |
+
<ING_PSP>
|
170 |
+
<files>
|
171 |
+
<default>ING_PSP.csv</default>
|
172 |
+
</files>
|
173 |
+
</ING_PSP>
|
174 |
+
</modules>
|
175 |
+
</translate>
|
176 |
+
</adminhtml>
|
177 |
+
<default>
|
178 |
+
<payment>
|
179 |
+
<ingpsp_ideal>
|
180 |
+
<group>ingpsp</group>
|
181 |
+
<active>1</active>
|
182 |
+
<title>iDEAL</title>
|
183 |
+
<description>iDEAL</description>
|
184 |
+
<model>ingpsp/ideal</model>
|
185 |
+
<title>iDEAL</title>
|
186 |
+
<currency>EUR</currency>
|
187 |
+
<allowspecific>1</allowspecific>
|
188 |
+
<specificcountry>NL</specificcountry>
|
189 |
+
<sort_order>101</sort_order>
|
190 |
+
</ingpsp_ideal>
|
191 |
+
<ingpsp_banktransfer>
|
192 |
+
<group>ingpsp</group>
|
193 |
+
<active>1</active>
|
194 |
+
<title>Overboeking</title>
|
195 |
+
<description>Overboeking</description>
|
196 |
+
<model>ingpsp/banktransfer</model>
|
197 |
+
<title>Overboeking</title>
|
198 |
+
<currency>EUR</currency>
|
199 |
+
<allowspecific>1</allowspecific>
|
200 |
+
<specificcountry>NL</specificcountry>
|
201 |
+
<sort_order>102</sort_order>
|
202 |
+
<account_details>
|
203 |
+
<iban>NL13INGB0005300060</iban>
|
204 |
+
<bic>INGBNL2A</bic>
|
205 |
+
<holder>ING Bank N.V. PSP</holder>
|
206 |
+
<city>Amsterdam, NL</city>
|
207 |
+
</account_details>
|
208 |
+
</ingpsp_banktransfer>
|
209 |
+
<ingpsp_creditcard>
|
210 |
+
<group>ingpsp</group>
|
211 |
+
<active>1</active>
|
212 |
+
<title>CreditCard</title>
|
213 |
+
<description>CreditCard</description>
|
214 |
+
<model>ingpsp/creditcard</model>
|
215 |
+
<title>CreditCard</title>
|
216 |
+
<currency>EUR</currency>
|
217 |
+
<allowspecific>1</allowspecific>
|
218 |
+
<specificcountry>NL</specificcountry>
|
219 |
+
<sort_order>103</sort_order>
|
220 |
+
</ingpsp_creditcard>
|
221 |
+
<ingpsp_cashondelivery>
|
222 |
+
<group>ingpsp</group>
|
223 |
+
<active>1</active>
|
224 |
+
<title>Rembours</title>
|
225 |
+
<description>Rembours</description>
|
226 |
+
<model>ingpsp/cashondelivery</model>
|
227 |
+
<title>Rembours</title>
|
228 |
+
<currency>EUR</currency>
|
229 |
+
<allowspecific>1</allowspecific>
|
230 |
+
<specificcountry>NL</specificcountry>
|
231 |
+
<sort_order>104</sort_order>
|
232 |
+
</ingpsp_cashondelivery>
|
233 |
+
<ingpsp_bancontact>
|
234 |
+
<group>ingpsp</group>
|
235 |
+
<active>1</active>
|
236 |
+
<title>Bancontact</title>
|
237 |
+
<description>Bancontact</description>
|
238 |
+
<model>ingpsp/bancontact</model>
|
239 |
+
<title>Bancontact</title>
|
240 |
+
<currency>EUR</currency>
|
241 |
+
<allowspecific>1</allowspecific>
|
242 |
+
<specificcountry>NL</specificcountry>
|
243 |
+
<sort_order>105</sort_order>
|
244 |
+
</ingpsp_bancontact>
|
245 |
+
</payment>
|
246 |
+
</default>
|
247 |
+
</config>
|
app/code/community/ING/PSP/etc/system.xml
ADDED
@@ -0,0 +1,515 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger Payments B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
-->
|
20 |
+
<config>
|
21 |
+
<sections>
|
22 |
+
<payment>
|
23 |
+
<groups>
|
24 |
+
<ingpsp translate="label comment">
|
25 |
+
<label>ING PSP - Settings</label>
|
26 |
+
<expanded>1</expanded>
|
27 |
+
<sort_order>116</sort_order>
|
28 |
+
<frontend_type>text</frontend_type>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
<fields>
|
33 |
+
<version>
|
34 |
+
<label>v1.1.2</label>
|
35 |
+
<sort_order>1</sort_order>
|
36 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
37 |
+
<frontend_type>label</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 |
+
</version>
|
42 |
+
<apikey translate="label">
|
43 |
+
<label>API Key</label>
|
44 |
+
<frontend_type>text</frontend_type>
|
45 |
+
<sort_order>2</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
<validate>required-entry validate-alphanum</validate>
|
50 |
+
</apikey>
|
51 |
+
<product translate="label">
|
52 |
+
<label>Product</label>
|
53 |
+
<frontend_type>select</frontend_type>
|
54 |
+
<source_model>ing_psp/system_config_source_dropdown_values</source_model>
|
55 |
+
<sort_order>3</sort_order>
|
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 |
+
</product>
|
60 |
+
<webhook translate="label">
|
61 |
+
<label>Webhook URL</label>
|
62 |
+
<sort_order>4</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 |
+
<comment>Include Webhook URL with every order creation</comment>
|
69 |
+
</webhook>
|
70 |
+
<bundle_cacert translate="label">
|
71 |
+
<label>Bundle CA.cert file</label>
|
72 |
+
<sort_order>5</sort_order>
|
73 |
+
<frontend_type>select</frontend_type>
|
74 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
75 |
+
<show_in_default>1</show_in_default>
|
76 |
+
<show_in_website>1</show_in_website>
|
77 |
+
<show_in_store>1</show_in_store>
|
78 |
+
<comment>Resolves issue when curl.cacert path is not set in PHP.ini</comment>
|
79 |
+
</bundle_cacert>
|
80 |
+
</fields>
|
81 |
+
</ingpsp>
|
82 |
+
<ingpsp_ideal translate="label comment" module="ingpsp">
|
83 |
+
<label>ING PSP - iDEAL</label>
|
84 |
+
<expanded>1</expanded>
|
85 |
+
<sort_order>117</sort_order>
|
86 |
+
<frontend_type>text</frontend_type>
|
87 |
+
<show_in_default>1</show_in_default>
|
88 |
+
<show_in_website>1</show_in_website>
|
89 |
+
<show_in_store>1</show_in_store>
|
90 |
+
<fields>
|
91 |
+
<active translate="label">
|
92 |
+
<label>Enabled</label>
|
93 |
+
<frontend_type>select</frontend_type>
|
94 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
95 |
+
<sort_order>100</sort_order>
|
96 |
+
<show_in_default>1</show_in_default>
|
97 |
+
<show_in_website>1</show_in_website>
|
98 |
+
<show_in_store>0</show_in_store>
|
99 |
+
</active>
|
100 |
+
<title translate="label">
|
101 |
+
<label>Title</label>
|
102 |
+
<frontend_type>text</frontend_type>
|
103 |
+
<sort_order>150</sort_order>
|
104 |
+
<show_in_default>1</show_in_default>
|
105 |
+
<show_in_website>1</show_in_website>
|
106 |
+
<show_in_store>1</show_in_store>
|
107 |
+
<validate>required-entry</validate>
|
108 |
+
</title>
|
109 |
+
<description translate="label">
|
110 |
+
<label>Description</label>
|
111 |
+
<frontend_type>text</frontend_type>
|
112 |
+
<sort_order>200</sort_order>
|
113 |
+
<show_in_default>1</show_in_default>
|
114 |
+
<show_in_website>1</show_in_website>
|
115 |
+
<show_in_store>1</show_in_store>
|
116 |
+
<validate>required-entry</validate>
|
117 |
+
</description>
|
118 |
+
<specificcountry translate="label">
|
119 |
+
<label>Payment from Specific Countries</label>
|
120 |
+
<sort_order>300</sort_order>
|
121 |
+
<frontend_type>multiselect</frontend_type>
|
122 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
123 |
+
<can_be_empty>1</can_be_empty>
|
124 |
+
<show_in_default>1</show_in_default>
|
125 |
+
<show_in_website>1</show_in_website>
|
126 |
+
<show_in_store>1</show_in_store>
|
127 |
+
</specificcountry>
|
128 |
+
<send_order_mail translate="label">
|
129 |
+
<label>Send order mail</label>
|
130 |
+
<sort_order>400</sort_order>
|
131 |
+
<frontend_type>select</frontend_type>
|
132 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
133 |
+
<show_in_default>1</show_in_default>
|
134 |
+
<show_in_website>1</show_in_website>
|
135 |
+
<show_in_store>1</show_in_store>
|
136 |
+
</send_order_mail>
|
137 |
+
<generate_invoice_upon_completion translate="label">
|
138 |
+
<label>Generate invoice upon succesfull transaction</label>
|
139 |
+
<sort_order>500</sort_order>
|
140 |
+
<frontend_type>select</frontend_type>
|
141 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
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 |
+
</generate_invoice_upon_completion>
|
146 |
+
<send_invoice_mail translate="label">
|
147 |
+
<label>Send invoice mail</label>
|
148 |
+
<sort_order>600</sort_order>
|
149 |
+
<frontend_type>select</frontend_type>
|
150 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
151 |
+
<show_in_default>1</show_in_default>
|
152 |
+
<show_in_website>1</show_in_website>
|
153 |
+
<show_in_store>1</show_in_store>
|
154 |
+
<depends>
|
155 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
156 |
+
</depends>
|
157 |
+
</send_invoice_mail>
|
158 |
+
<sort_order translate="label">
|
159 |
+
<label>Sort order</label>
|
160 |
+
<frontend_type>text</frontend_type>
|
161 |
+
<sort_order>700</sort_order>
|
162 |
+
<show_in_default>1</show_in_default>
|
163 |
+
<show_in_website>1</show_in_website>
|
164 |
+
<show_in_store>1</show_in_store>
|
165 |
+
</sort_order>
|
166 |
+
</fields>
|
167 |
+
</ingpsp_ideal>
|
168 |
+
<ingpsp_banktransfer translate="label comment" module="ingpsp">
|
169 |
+
<label>ING PSP - Banktransfer</label>
|
170 |
+
<expanded>1</expanded>
|
171 |
+
<sort_order>118</sort_order>
|
172 |
+
<frontend_type>text</frontend_type>
|
173 |
+
<show_in_default>1</show_in_default>
|
174 |
+
<show_in_website>1</show_in_website>
|
175 |
+
<show_in_store>1</show_in_store>
|
176 |
+
<fields>
|
177 |
+
<active translate="label">
|
178 |
+
<label>Enabled</label>
|
179 |
+
<frontend_type>select</frontend_type>
|
180 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
181 |
+
<sort_order>100</sort_order>
|
182 |
+
<show_in_default>1</show_in_default>
|
183 |
+
<show_in_website>1</show_in_website>
|
184 |
+
<show_in_store>0</show_in_store>
|
185 |
+
</active>
|
186 |
+
<title translate="label">
|
187 |
+
<label>Title</label>
|
188 |
+
<frontend_type>text</frontend_type>
|
189 |
+
<sort_order>150</sort_order>
|
190 |
+
<show_in_default>1</show_in_default>
|
191 |
+
<show_in_website>1</show_in_website>
|
192 |
+
<show_in_store>1</show_in_store>
|
193 |
+
<validate>required-entry</validate>
|
194 |
+
</title>
|
195 |
+
<description translate="label">
|
196 |
+
<label>Description</label>
|
197 |
+
<frontend_type>text</frontend_type>
|
198 |
+
<sort_order>200</sort_order>
|
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 |
+
<validate>required-entry</validate>
|
203 |
+
</description>
|
204 |
+
<specificcountry translate="label">
|
205 |
+
<label>Payment from Specific Countries</label>
|
206 |
+
<sort_order>300</sort_order>
|
207 |
+
<frontend_type>multiselect</frontend_type>
|
208 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
209 |
+
<can_be_empty>1</can_be_empty>
|
210 |
+
<show_in_default>1</show_in_default>
|
211 |
+
<show_in_website>1</show_in_website>
|
212 |
+
<show_in_store>1</show_in_store>
|
213 |
+
</specificcountry>
|
214 |
+
<send_order_mail translate="label">
|
215 |
+
<label>Send order mail</label>
|
216 |
+
<sort_order>400</sort_order>
|
217 |
+
<frontend_type>select</frontend_type>
|
218 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
219 |
+
<show_in_default>1</show_in_default>
|
220 |
+
<show_in_website>1</show_in_website>
|
221 |
+
<show_in_store>1</show_in_store>
|
222 |
+
</send_order_mail>
|
223 |
+
<generate_invoice_upon_completion translate="label">
|
224 |
+
<label>Generate invoice upon succesfull transaction</label>
|
225 |
+
<sort_order>500</sort_order>
|
226 |
+
<frontend_type>select</frontend_type>
|
227 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
228 |
+
<show_in_default>1</show_in_default>
|
229 |
+
<show_in_website>1</show_in_website>
|
230 |
+
<show_in_store>1</show_in_store>
|
231 |
+
</generate_invoice_upon_completion>
|
232 |
+
<send_invoice_mail translate="label">
|
233 |
+
<label>Send invoice mail</label>
|
234 |
+
<sort_order>600</sort_order>
|
235 |
+
<frontend_type>select</frontend_type>
|
236 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
237 |
+
<show_in_default>1</show_in_default>
|
238 |
+
<show_in_website>1</show_in_website>
|
239 |
+
<show_in_store>1</show_in_store>
|
240 |
+
<depends>
|
241 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
242 |
+
</depends>
|
243 |
+
</send_invoice_mail>
|
244 |
+
<sort_order translate="label">
|
245 |
+
<label>Sort order</label>
|
246 |
+
<frontend_type>text</frontend_type>
|
247 |
+
<sort_order>700</sort_order>
|
248 |
+
<show_in_default>1</show_in_default>
|
249 |
+
<show_in_website>1</show_in_website>
|
250 |
+
<show_in_store>1</show_in_store>
|
251 |
+
</sort_order>
|
252 |
+
</fields>
|
253 |
+
</ingpsp_banktransfer>
|
254 |
+
<ingpsp_creditcard translate="label comment" module="ingpsp">
|
255 |
+
<label>ING PSP - Mastercard, VISA, Maestro of V PAY</label>
|
256 |
+
<expanded>1</expanded>
|
257 |
+
<sort_order>119</sort_order>
|
258 |
+
<frontend_type>text</frontend_type>
|
259 |
+
<show_in_default>1</show_in_default>
|
260 |
+
<show_in_website>1</show_in_website>
|
261 |
+
<show_in_store>1</show_in_store>
|
262 |
+
<fields>
|
263 |
+
<active translate="label">
|
264 |
+
<label>Enabled</label>
|
265 |
+
<frontend_type>select</frontend_type>
|
266 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
267 |
+
<sort_order>100</sort_order>
|
268 |
+
<show_in_default>1</show_in_default>
|
269 |
+
<show_in_website>1</show_in_website>
|
270 |
+
<show_in_store>0</show_in_store>
|
271 |
+
</active>
|
272 |
+
<title translate="label">
|
273 |
+
<label>Title</label>
|
274 |
+
<frontend_type>text</frontend_type>
|
275 |
+
<sort_order>150</sort_order>
|
276 |
+
<show_in_default>1</show_in_default>
|
277 |
+
<show_in_website>1</show_in_website>
|
278 |
+
<show_in_store>1</show_in_store>
|
279 |
+
<validate>required-entry</validate>
|
280 |
+
</title>
|
281 |
+
<description translate="label">
|
282 |
+
<label>Description</label>
|
283 |
+
<frontend_type>text</frontend_type>
|
284 |
+
<sort_order>200</sort_order>
|
285 |
+
<show_in_default>1</show_in_default>
|
286 |
+
<show_in_website>1</show_in_website>
|
287 |
+
<show_in_store>1</show_in_store>
|
288 |
+
<validate>required-entry</validate>
|
289 |
+
</description>
|
290 |
+
<specificcountry translate="label">
|
291 |
+
<label>Payment from Specific Countries</label>
|
292 |
+
<sort_order>300</sort_order>
|
293 |
+
<frontend_type>multiselect</frontend_type>
|
294 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
295 |
+
<can_be_empty>1</can_be_empty>
|
296 |
+
<show_in_default>1</show_in_default>
|
297 |
+
<show_in_website>1</show_in_website>
|
298 |
+
<show_in_store>1</show_in_store>
|
299 |
+
</specificcountry>
|
300 |
+
<send_order_mail translate="label">
|
301 |
+
<label>Send order mail</label>
|
302 |
+
<sort_order>400</sort_order>
|
303 |
+
<frontend_type>select</frontend_type>
|
304 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
305 |
+
<show_in_default>1</show_in_default>
|
306 |
+
<show_in_website>1</show_in_website>
|
307 |
+
<show_in_store>1</show_in_store>
|
308 |
+
</send_order_mail>
|
309 |
+
<generate_invoice_upon_completion translate="label">
|
310 |
+
<label>Generate invoice upon succesfull transaction</label>
|
311 |
+
<sort_order>500</sort_order>
|
312 |
+
<frontend_type>select</frontend_type>
|
313 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
314 |
+
<show_in_default>1</show_in_default>
|
315 |
+
<show_in_website>1</show_in_website>
|
316 |
+
<show_in_store>1</show_in_store>
|
317 |
+
</generate_invoice_upon_completion>
|
318 |
+
<send_invoice_mail translate="label">
|
319 |
+
<label>Send invoice mail</label>
|
320 |
+
<sort_order>600</sort_order>
|
321 |
+
<frontend_type>select</frontend_type>
|
322 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
323 |
+
<show_in_default>1</show_in_default>
|
324 |
+
<show_in_website>1</show_in_website>
|
325 |
+
<show_in_store>1</show_in_store>
|
326 |
+
<depends>
|
327 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
328 |
+
</depends>
|
329 |
+
</send_invoice_mail>
|
330 |
+
<sort_order translate="label">
|
331 |
+
<label>Sort order</label>
|
332 |
+
<frontend_type>text</frontend_type>
|
333 |
+
<sort_order>700</sort_order>
|
334 |
+
<show_in_default>1</show_in_default>
|
335 |
+
<show_in_website>1</show_in_website>
|
336 |
+
<show_in_store>1</show_in_store>
|
337 |
+
</sort_order>
|
338 |
+
</fields>
|
339 |
+
</ingpsp_creditcard>
|
340 |
+
<ingpsp_cashondelivery translate="label comment" module="ingpsp">
|
341 |
+
<label>ING PSP - Cashondelivery</label>
|
342 |
+
<expanded>1</expanded>
|
343 |
+
<sort_order>120</sort_order>
|
344 |
+
<frontend_type>text</frontend_type>
|
345 |
+
<show_in_default>1</show_in_default>
|
346 |
+
<show_in_website>1</show_in_website>
|
347 |
+
<show_in_store>1</show_in_store>
|
348 |
+
<fields>
|
349 |
+
<active translate="label">
|
350 |
+
<label>Enabled</label>
|
351 |
+
<frontend_type>select</frontend_type>
|
352 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
353 |
+
<sort_order>100</sort_order>
|
354 |
+
<show_in_default>1</show_in_default>
|
355 |
+
<show_in_website>1</show_in_website>
|
356 |
+
<show_in_store>0</show_in_store>
|
357 |
+
</active>
|
358 |
+
<title translate="label">
|
359 |
+
<label>Title</label>
|
360 |
+
<frontend_type>text</frontend_type>
|
361 |
+
<sort_order>150</sort_order>
|
362 |
+
<show_in_default>1</show_in_default>
|
363 |
+
<show_in_website>1</show_in_website>
|
364 |
+
<show_in_store>1</show_in_store>
|
365 |
+
<validate>required-entry</validate>
|
366 |
+
</title>
|
367 |
+
<description translate="label">
|
368 |
+
<label>Description</label>
|
369 |
+
<frontend_type>text</frontend_type>
|
370 |
+
<sort_order>200</sort_order>
|
371 |
+
<show_in_default>1</show_in_default>
|
372 |
+
<show_in_website>1</show_in_website>
|
373 |
+
<show_in_store>1</show_in_store>
|
374 |
+
<validate>required-entry</validate>
|
375 |
+
</description>
|
376 |
+
<specificcountry translate="label">
|
377 |
+
<label>Payment from Specific Countries</label>
|
378 |
+
<sort_order>300</sort_order>
|
379 |
+
<frontend_type>multiselect</frontend_type>
|
380 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
381 |
+
<can_be_empty>1</can_be_empty>
|
382 |
+
<show_in_default>1</show_in_default>
|
383 |
+
<show_in_website>1</show_in_website>
|
384 |
+
<show_in_store>1</show_in_store>
|
385 |
+
</specificcountry>
|
386 |
+
<send_order_mail translate="label">
|
387 |
+
<label>Send order mail</label>
|
388 |
+
<sort_order>400</sort_order>
|
389 |
+
<frontend_type>select</frontend_type>
|
390 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
391 |
+
<show_in_default>1</show_in_default>
|
392 |
+
<show_in_website>1</show_in_website>
|
393 |
+
<show_in_store>1</show_in_store>
|
394 |
+
</send_order_mail>
|
395 |
+
<generate_invoice_upon_completion translate="label">
|
396 |
+
<label>Generate invoice upon succesfull transaction</label>
|
397 |
+
<sort_order>500</sort_order>
|
398 |
+
<frontend_type>select</frontend_type>
|
399 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
400 |
+
<show_in_default>1</show_in_default>
|
401 |
+
<show_in_website>1</show_in_website>
|
402 |
+
<show_in_store>1</show_in_store>
|
403 |
+
</generate_invoice_upon_completion>
|
404 |
+
<send_invoice_mail translate="label">
|
405 |
+
<label>Send invoice mail</label>
|
406 |
+
<sort_order>600</sort_order>
|
407 |
+
<frontend_type>select</frontend_type>
|
408 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
409 |
+
<show_in_default>1</show_in_default>
|
410 |
+
<show_in_website>1</show_in_website>
|
411 |
+
<show_in_store>1</show_in_store>
|
412 |
+
<depends>
|
413 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
414 |
+
</depends>
|
415 |
+
</send_invoice_mail>
|
416 |
+
<sort_order translate="label">
|
417 |
+
<label>Sort order</label>
|
418 |
+
<frontend_type>text</frontend_type>
|
419 |
+
<sort_order>700</sort_order>
|
420 |
+
<show_in_default>1</show_in_default>
|
421 |
+
<show_in_website>1</show_in_website>
|
422 |
+
<show_in_store>1</show_in_store>
|
423 |
+
</sort_order>
|
424 |
+
</fields>
|
425 |
+
</ingpsp_cashondelivery>
|
426 |
+
<ingpsp_bancontact translate="label comment" module="ingpsp">
|
427 |
+
<label>ING PSP - Bancontact</label>
|
428 |
+
<expanded>1</expanded>
|
429 |
+
<sort_order>121</sort_order>
|
430 |
+
<frontend_type>text</frontend_type>
|
431 |
+
<show_in_default>1</show_in_default>
|
432 |
+
<show_in_website>1</show_in_website>
|
433 |
+
<show_in_store>1</show_in_store>
|
434 |
+
<fields>
|
435 |
+
<active translate="label">
|
436 |
+
<label>Enabled</label>
|
437 |
+
<frontend_type>select</frontend_type>
|
438 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
439 |
+
<sort_order>100</sort_order>
|
440 |
+
<show_in_default>1</show_in_default>
|
441 |
+
<show_in_website>1</show_in_website>
|
442 |
+
<show_in_store>0</show_in_store>
|
443 |
+
</active>
|
444 |
+
<title translate="label">
|
445 |
+
<label>Title</label>
|
446 |
+
<frontend_type>text</frontend_type>
|
447 |
+
<sort_order>150</sort_order>
|
448 |
+
<show_in_default>1</show_in_default>
|
449 |
+
<show_in_website>1</show_in_website>
|
450 |
+
<show_in_store>1</show_in_store>
|
451 |
+
<validate>required-entry</validate>
|
452 |
+
</title>
|
453 |
+
<description translate="label">
|
454 |
+
<label>Description</label>
|
455 |
+
<frontend_type>text</frontend_type>
|
456 |
+
<sort_order>200</sort_order>
|
457 |
+
<show_in_default>1</show_in_default>
|
458 |
+
<show_in_website>1</show_in_website>
|
459 |
+
<show_in_store>1</show_in_store>
|
460 |
+
<validate>required-entry</validate>
|
461 |
+
</description>
|
462 |
+
<specificcountry translate="label">
|
463 |
+
<label>Payment from Specific Countries</label>
|
464 |
+
<sort_order>300</sort_order>
|
465 |
+
<frontend_type>multiselect</frontend_type>
|
466 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
467 |
+
<can_be_empty>1</can_be_empty>
|
468 |
+
<show_in_default>1</show_in_default>
|
469 |
+
<show_in_website>1</show_in_website>
|
470 |
+
<show_in_store>1</show_in_store>
|
471 |
+
</specificcountry>
|
472 |
+
<send_order_mail translate="label">
|
473 |
+
<label>Send order mail</label>
|
474 |
+
<sort_order>400</sort_order>
|
475 |
+
<frontend_type>select</frontend_type>
|
476 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
477 |
+
<show_in_default>1</show_in_default>
|
478 |
+
<show_in_website>1</show_in_website>
|
479 |
+
<show_in_store>1</show_in_store>
|
480 |
+
</send_order_mail>
|
481 |
+
<generate_invoice_upon_completion translate="label">
|
482 |
+
<label>Generate invoice upon succesfull transaction</label>
|
483 |
+
<sort_order>500</sort_order>
|
484 |
+
<frontend_type>select</frontend_type>
|
485 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
486 |
+
<show_in_default>1</show_in_default>
|
487 |
+
<show_in_website>1</show_in_website>
|
488 |
+
<show_in_store>1</show_in_store>
|
489 |
+
</generate_invoice_upon_completion>
|
490 |
+
<send_invoice_mail translate="label">
|
491 |
+
<label>Send invoice mail</label>
|
492 |
+
<sort_order>600</sort_order>
|
493 |
+
<frontend_type>select</frontend_type>
|
494 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
495 |
+
<show_in_default>1</show_in_default>
|
496 |
+
<show_in_website>1</show_in_website>
|
497 |
+
<show_in_store>1</show_in_store>
|
498 |
+
<depends>
|
499 |
+
<generate_invoice_upon_completion>1</generate_invoice_upon_completion>
|
500 |
+
</depends>
|
501 |
+
</send_invoice_mail>
|
502 |
+
<sort_order translate="label">
|
503 |
+
<label>Sort order</label>
|
504 |
+
<frontend_type>text</frontend_type>
|
505 |
+
<sort_order>700</sort_order>
|
506 |
+
<show_in_default>1</show_in_default>
|
507 |
+
<show_in_website>1</show_in_website>
|
508 |
+
<show_in_store>1</show_in_store>
|
509 |
+
</sort_order>
|
510 |
+
</fields>
|
511 |
+
</ingpsp_bancontact>
|
512 |
+
</groups>
|
513 |
+
</payment>
|
514 |
+
</sections>
|
515 |
+
</config>
|
app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-install-0.0.1.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
/** @var $this Mage_Catalog_Model_Resource_Setup */
|
22 |
+
$this->startSetup();
|
23 |
+
|
24 |
+
$this->run(
|
25 |
+
sprintf("CREATE TABLE IF NOT EXISTS `%s` (
|
26 |
+
`order_id` int(11) NOT NULL,
|
27 |
+
`entity_id` int(11) NOT NULL,
|
28 |
+
`method` varchar(3) NOT NULL,
|
29 |
+
`transaction_id` varchar(32) NOT NULL,
|
30 |
+
`bank_account` varchar(15) NOT NULL,
|
31 |
+
`bank_status` varchar(20) NOT NULL
|
32 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;",
|
33 |
+
$this->getTable('ingpsp_payments')
|
34 |
+
)
|
35 |
+
);
|
36 |
+
|
37 |
+
$this->endSetup();
|
app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-uninstall-0.0.1.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
/** @var $this Mage_Catalog_Model_Resource_Setup */
|
22 |
+
$this->startSetup();
|
23 |
+
|
24 |
+
$this->run(
|
25 |
+
sprintf("DROP TABLE IF EXISTS `%s`",
|
26 |
+
$this->getTable('ingpsp_payments')
|
27 |
+
)
|
28 |
+
);
|
29 |
+
|
30 |
+
$this->run("DELETE FROM `{$this->getTable('core_config_data')}` where `path` = 'ingpsp/ideal/active';
|
31 |
+
DELETE FROM `{$this->getTable('core_config_data')}` where `path` = 'ingpsp/ideal/description';
|
32 |
+
DELETE FROM `{$this->getTable('core_config_data')}` where `path` = 'ingpsp/settings/apikey';
|
33 |
+
DELETE FROM `{$this->getTable('core_config_data')}` where `path` = 'ingpsp/settings/product';
|
34 |
+
DELETE FROM `{$this->getTable('core_resource')}` where `code` = 'ingpsp_setup';"
|
35 |
+
);
|
36 |
+
|
37 |
+
$this->endSetup();
|
app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-upgrade-0.0.1-0.0.2.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
/** @var $this Mage_Catalog_Model_Resource_Setup */
|
22 |
+
$this->startSetup();
|
23 |
+
|
24 |
+
|
25 |
+
/** @var $conn Varien_Db_Adapter_Pdo_Mysql */
|
26 |
+
$conn = $this->getConnection();
|
27 |
+
|
28 |
+
$conn->addColumn($this->getTable('sales/quote_payment'), 'ing_order_id', array(
|
29 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
30 |
+
'length' => 255,
|
31 |
+
'nullable' => true,
|
32 |
+
'default' => NULL,
|
33 |
+
'comment' => 'ing order id',
|
34 |
+
));
|
35 |
+
|
36 |
+
$conn->addColumn($this->getTable('sales/quote_payment'), 'ing_banktransfer_reference', array(
|
37 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
38 |
+
'length' => 255,
|
39 |
+
'nullable' => true,
|
40 |
+
'default' => NULL,
|
41 |
+
'comment' => 'ing banktransfer reference',
|
42 |
+
));
|
43 |
+
|
44 |
+
$conn->addColumn($this->getTable('sales/quote_payment'), 'ing_ideal_issuer_id', array(
|
45 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
46 |
+
'length' => 255,
|
47 |
+
'nullable' => true,
|
48 |
+
'default' => NULL,
|
49 |
+
'comment' => 'ing ideal issuer id',
|
50 |
+
));
|
51 |
+
|
52 |
+
$conn->addColumn($this->getTable('sales/order_payment'), 'ing_order_id', array(
|
53 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
54 |
+
'length' => 255,
|
55 |
+
'nullable' => true,
|
56 |
+
'default' => NULL,
|
57 |
+
'comment' => 'ing order id',
|
58 |
+
));
|
59 |
+
|
60 |
+
$conn->addColumn($this->getTable('sales/order_payment'), 'ing_banktransfer_reference', array(
|
61 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
62 |
+
'length' => 255,
|
63 |
+
'nullable' => true,
|
64 |
+
'default' => NULL,
|
65 |
+
'comment' => 'ing banktransfer reference',
|
66 |
+
));
|
67 |
+
|
68 |
+
$conn->addColumn($this->getTable('sales/order_payment'), 'ing_ideal_issuer_id', array(
|
69 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
70 |
+
'length' => 255,
|
71 |
+
'nullable' => true,
|
72 |
+
'default' => NULL,
|
73 |
+
'comment' => 'ing ideal issuer id',
|
74 |
+
));
|
75 |
+
|
76 |
+
$this->endSetup();
|
app/code/community/ING/PSP/sql/ingpsp_setup/mysql4-upgrade-0.0.2-0.0.3.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.2
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
|
21 |
+
/** @var $this Mage_Catalog_Model_Resource_Setup */
|
22 |
+
$this->startSetup();
|
23 |
+
|
24 |
+
/** @var $conn Varien_Db_Adapter_Pdo_Mysql */
|
25 |
+
$conn = $this->getConnection();
|
26 |
+
|
27 |
+
$conn->addColumn($this->getTable('sales/quote'), 'ing_order_id', array(
|
28 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
29 |
+
'length' => 255,
|
30 |
+
'nullable' => true,
|
31 |
+
'default' => NULL,
|
32 |
+
'comment' => 'ing order id',
|
33 |
+
));
|
34 |
+
|
35 |
+
$conn->addColumn($this->getTable('sales/quote'), 'ing_banktransfer_reference', array(
|
36 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
37 |
+
'length' => 255,
|
38 |
+
'nullable' => true,
|
39 |
+
'default' => NULL,
|
40 |
+
'comment' => 'ing banktransfer reference',
|
41 |
+
));
|
42 |
+
|
43 |
+
$conn->addColumn($this->getTable('sales/quote'), 'ing_ideal_issuer_id', array(
|
44 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
45 |
+
'length' => 255,
|
46 |
+
'nullable' => true,
|
47 |
+
'default' => NULL,
|
48 |
+
'comment' => 'ing ideal issuer id',
|
49 |
+
));
|
50 |
+
|
51 |
+
$conn->addColumn($this->getTable('sales/order'), 'ing_order_id', array(
|
52 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
53 |
+
'length' => 255,
|
54 |
+
'nullable' => true,
|
55 |
+
'default' => NULL,
|
56 |
+
'comment' => 'ing order id',
|
57 |
+
));
|
58 |
+
|
59 |
+
$conn->addColumn($this->getTable('sales/order'), 'ing_banktransfer_reference', array(
|
60 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
61 |
+
'length' => 255,
|
62 |
+
'nullable' => true,
|
63 |
+
'default' => NULL,
|
64 |
+
'comment' => 'ing banktransfer reference',
|
65 |
+
));
|
66 |
+
|
67 |
+
$conn->addColumn($this->getTable('sales/order'), 'ing_ideal_issuer_id', array(
|
68 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
69 |
+
'length' => 255,
|
70 |
+
'nullable' => true,
|
71 |
+
'default' => NULL,
|
72 |
+
'comment' => 'ing ideal issuer id',
|
73 |
+
));
|
74 |
+
|
75 |
+
$this->endSetup();
|
app/design/adminhtml/default/default/template/ing_psp/info/banktransfer.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<p><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></p>
|
22 |
+
<?php if ($this->getInfo()->getAdditionalData()): ?>
|
23 |
+
<?php if ($this->getMailingAddress()): ?>
|
24 |
+
<p><strong><?php echo Mage::helper('payment')->__('Payment instructions:') ?></strong></p>
|
25 |
+
<address class="checkmo-mailing-address">
|
26 |
+
<?php echo nl2br($this->escapeHtml($this->getMailingAddress())) ?>
|
27 |
+
</address>
|
28 |
+
<?php endif ?>
|
29 |
+
<?php endif ?>
|
app/design/adminhtml/default/default/template/ing_psp/info/cashondelivery.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<p><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></p>
|
22 |
+
<?php if ($this->getInfo()->getAdditionalData()): ?>
|
23 |
+
<?php if ($this->getMailingAddress()): ?>
|
24 |
+
<p><strong><?php echo Mage::helper('payment')->__('Payment instructions:') ?></strong></p>
|
25 |
+
<address class="checkmo-mailing-address">
|
26 |
+
<?php echo nl2br($this->escapeHtml($this->getMailingAddress())) ?>
|
27 |
+
</address>
|
28 |
+
<?php endif ?>
|
29 |
+
<?php endif ?>
|
app/design/frontend/base/default/layout/ing_psp.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
* @category ING
|
14 |
+
* @package ING_PSP
|
15 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
16 |
+
* @version v1.1.1
|
17 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
18 |
+
* @license The MIT License (MIT)
|
19 |
+
*
|
20 |
+
**/
|
21 |
+
-->
|
22 |
+
<layout version="0.1.0">
|
23 |
+
<checkout_onepage_success translate="label">
|
24 |
+
<reference name="checkout.success">
|
25 |
+
<action method="setTemplate"><template>ing_psp/success.phtml</template></action>
|
26 |
+
</reference>
|
27 |
+
</checkout_onepage_success>
|
28 |
+
</layout>
|
app/design/frontend/base/default/template/ing_psp/form/banktransfer.phtml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<?php
|
22 |
+
$_code = $this->getMethodCode();
|
23 |
+
?>
|
app/design/frontend/base/default/template/ing_psp/form/cashondelivery.phtml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<?php
|
22 |
+
$_code = $this->getMethodCode();
|
23 |
+
?>
|
app/design/frontend/base/default/template/ing_psp/form/ideal.phtml
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<?php
|
22 |
+
$_code = $this->getMethodCode();
|
23 |
+
$_issuers = Mage::helper('ingpsp/ideal')->getIssuers();
|
24 |
+
?>
|
25 |
+
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
26 |
+
<li>
|
27 |
+
<label for="<?php echo $_code ?>_issuer_id" class="required"><em>*</em><?php echo $this->__('Choose your bank:') ?></label>
|
28 |
+
<span class="input-box">
|
29 |
+
<select name="issuer_id" class="required-entry input-text" id="<?php echo $_code; ?>_issuer_id" title="<?php echo $_code ?>_issuer_id">
|
30 |
+
<?php foreach ($_issuers as $issuer): ?>
|
31 |
+
<?php if (isset($issuer['id']) && isset($issuer['id'])): ?>
|
32 |
+
<option value="<?php echo $issuer['id'] ?>"><?php echo $issuer['name'] ?></option>
|
33 |
+
<?php endif ?>
|
34 |
+
<?php endforeach ?>
|
35 |
+
</select>
|
36 |
+
</span>
|
37 |
+
</li>
|
38 |
+
</ul>
|
app/design/frontend/base/default/template/ing_psp/info/banktransfer.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<p><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></p>
|
22 |
+
<?php if ($this->getInfo()->getAdditionalData()): ?>
|
23 |
+
<?php if ($this->getMailingAddress()): ?>
|
24 |
+
<p><strong><?php echo Mage::helper('payment')->__('Payment instructions:') ?></strong></p>
|
25 |
+
<address class="checkmo-mailing-address">
|
26 |
+
<?php echo nl2br($this->escapeHtml($this->getMailingAddress())) ?>
|
27 |
+
</address>
|
28 |
+
<?php endif ?>
|
29 |
+
<?php endif ?>
|
app/design/frontend/base/default/template/ing_psp/info/cashondelivery.phtml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<p><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></p>
|
22 |
+
<?php if ($this->getInfo()->getAdditionalData()): ?>
|
23 |
+
<?php if ($this->getMailingAddress()): ?>
|
24 |
+
<p><strong><?php echo Mage::helper('payment')->__('Payment instructions:') ?></strong></p>
|
25 |
+
<address class="checkmo-mailing-address">
|
26 |
+
<?php echo nl2br($this->escapeHtml($this->getMailingAddress())) ?>
|
27 |
+
</address>
|
28 |
+
<?php endif ?>
|
29 |
+
<?php endif ?>
|
app/design/frontend/base/default/template/ing_psp/success.phtml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ╲ ╱
|
4 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
5 |
+
* │╭──╮ ╭──╮│
|
6 |
+
* ││//│ │//││
|
7 |
+
* │╰──╯ ╰──╯│
|
8 |
+
* ╰──────────────╯
|
9 |
+
* ╭──────────╮ The MIT License (MIT)
|
10 |
+
* │ () () () │
|
11 |
+
*
|
12 |
+
* @category ING
|
13 |
+
* @package ING_PSP
|
14 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
15 |
+
* @version v1.1.1
|
16 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
17 |
+
* @license The MIT License (MIT)
|
18 |
+
*
|
19 |
+
**/
|
20 |
+
?>
|
21 |
+
<?php /** @var $this Mage_Checkout_Block_Onepage_Success */ ?>
|
22 |
+
<div class="page-title">
|
23 |
+
<h1><?php echo $this->__('Your order has been received.') ?></h1>
|
24 |
+
</div>
|
25 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
26 |
+
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
|
27 |
+
|
28 |
+
<?php if ($reference = Mage::app()->getRequest()->getParam('reference')): ?>
|
29 |
+
<?php
|
30 |
+
/** @var $order Mage_Sales_Model_Order */
|
31 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
32 |
+
|
33 |
+
/** @var $_helper ING_PSP_Helper_Banktransfer */
|
34 |
+
$_helper = Mage::helper('ingpsp/banktransfer');
|
35 |
+
?>
|
36 |
+
<b><?php echo $this->__('Payment instructions:') ?></b><br />
|
37 |
+
<?php echo $this->__('Please use the following data to make the banktransfer') ?><br />
|
38 |
+
<?php echo nl2br($_helper->getSuccessHtml($order, $reference)) ?>
|
39 |
+
<br />
|
40 |
+
<?php echo $this->__('ING processes the payments for'); ?> <?php echo Mage::app()->getGroup()->getName() ?><br />
|
41 |
+
<br />
|
42 |
+
<?php echo $this->__("(!) Don't forget to use the reference in your payment. Without the reference the processing of your payment can take more time!"); ?>
|
43 |
+
</p>
|
44 |
+
<?php endif ?>
|
45 |
+
|
46 |
+
<?php if ($this->getOrderId()):?>
|
47 |
+
<?php if ($this->getCanViewOrder()): ?>
|
48 |
+
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
|
49 |
+
<?php else: ?>
|
50 |
+
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
|
51 |
+
<?php endif ?>
|
52 |
+
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
|
53 |
+
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) :?>
|
54 |
+
<p>
|
55 |
+
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
|
56 |
+
<?php echo $this->getChildHtml() ?>
|
57 |
+
</p>
|
58 |
+
<?php endif ?>
|
59 |
+
<?php endif ?>
|
60 |
+
|
61 |
+
<?php if ($this->getAgreementRefId()): ?>
|
62 |
+
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId()))) ?></p>
|
63 |
+
<?php endif ?>
|
64 |
+
|
65 |
+
<?php if ($profiles = $this->getRecurringProfiles()): ?>
|
66 |
+
<p><?php echo $this->__('Your recurring payment profiles:') ?></p>
|
67 |
+
<ul class="disc">
|
68 |
+
<?php foreach($profiles as $profile): ?>
|
69 |
+
<?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) ?>
|
70 |
+
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description'))) ?></li>
|
71 |
+
<?php endforeach ?>
|
72 |
+
</ul>
|
73 |
+
<?php endif ?>
|
74 |
+
|
75 |
+
<div class="buttons-set">
|
76 |
+
<button type="button" class="button" title="<?php echo $this->__('Continue Shopping') ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
|
77 |
+
</div>
|
app/etc/modules/ING_PSP.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* ╲ ╱
|
5 |
+
* ╭──────────────╮ COPYRIGHT (C) 2016 GINGER PAYMENTS B.V.
|
6 |
+
* │╭──╮ ╭──╮│
|
7 |
+
* ││//│ │//││
|
8 |
+
* │╰──╯ ╰──╯│
|
9 |
+
* ╰──────────────╯
|
10 |
+
* ╭──────────╮ The MIT License (MIT)
|
11 |
+
* │ () () () │
|
12 |
+
*
|
13 |
+
*
|
14 |
+
* @category ING
|
15 |
+
* @package ING_PSP
|
16 |
+
* @author Ginger B.V. (info@gingerpayments.com)
|
17 |
+
* @version v1.1.2
|
18 |
+
* @copyright COPYRIGHT (C) 2016 GINGER PAYMENTS B.V. (https://www.gingerpayments.com)
|
19 |
+
* @license The MIT License (MIT)
|
20 |
+
*
|
21 |
+
**/
|
22 |
+
-->
|
23 |
+
<config>
|
24 |
+
<modules>
|
25 |
+
<ING_PSP>
|
26 |
+
<active>true</active>
|
27 |
+
<codePool>community</codePool>
|
28 |
+
<depends>
|
29 |
+
<Mage_Payment />
|
30 |
+
<Mage_Checkout />
|
31 |
+
</depends>
|
32 |
+
<version>1.1.2</version>
|
33 |
+
</ING_PSP>
|
34 |
+
</modules>
|
35 |
+
<global>
|
36 |
+
<models>
|
37 |
+
<ing_psp>
|
38 |
+
<class>ING_PSP_Model</class>
|
39 |
+
</ing_psp>
|
40 |
+
</models>
|
41 |
+
</global>
|
42 |
+
</config>
|
app/locale/en_US/ING_PSP.csv
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"ING PSP - Settings","ING PSP - Settings"
|
2 |
+
"API Key","API Key"
|
3 |
+
"ING PSP - iDEAL","ING PSP - iDEAL"
|
4 |
+
"ING PSP - Banktransfer","ING PSP - Banktransfer"
|
5 |
+
"ING PSP - Mastercard, VISA, Maestro of V PAY","ING PSP - Mastercard, VISA, Maestro of V PAY"
|
6 |
+
"Enabled","Enabled"
|
7 |
+
"Description","Description"
|
8 |
+
|
9 |
+
"Choose your bank:","Choose your bank:"
|
10 |
+
|
11 |
+
"Payment is pending","Payment is pending"
|
12 |
+
"Payment is completed","Payment is completed"
|
13 |
+
"Payment is cancelled","Payment is cancelled"
|
14 |
+
"Payment failed with an error","Payment failed with an error"
|
15 |
+
"Amounts don't match. Possible fraud","Amounts don't match. Possible fraud"
|
16 |
+
|
17 |
+
"Your order has been received.", "Your order has been received."
|
18 |
+
"Thank you for your purchase!","Thank you for your purchase!"
|
19 |
+
"Payment instructions:","Payment instructions:"
|
20 |
+
"Please use the following data to make the banktransfer", "Please use the following data to make the banktransfer"
|
21 |
+
"ING processes the payments for", "ING processes the payments for"
|
22 |
+
"(!) Don't forget to use the reference in your payment. Without the reference the processing of your payment can take more time!", "(!) Don't forget to use the reference in your payment. Without the reference the processing of your payment can take more time!"
|
23 |
+
|
24 |
+
"Amount:","Amount:"
|
25 |
+
"Reference:","Reference:"
|
26 |
+
"Account number:","Account number:"
|
27 |
+
"IBAN:","IBAN:"
|
28 |
+
"BIC:","BIC:"
|
29 |
+
"Account holder:","Account holder:"
|
30 |
+
"City:","City:"
|
app/locale/nl_NL/ING_PSP.csv
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"ING PSP - Settings","ING PSP - Instellingen"
|
2 |
+
"API Key","API Key"
|
3 |
+
"ING PSP - iDEAL","ING PSP - iDEAL"
|
4 |
+
"ING PSP - Banktransfer","ING PSP - Bankoverboeking"
|
5 |
+
"ING PSP - Mastercard, VISA, Maestro of V PAY","ING PSP - Mastercard, VISA, Maestro of V PAY"
|
6 |
+
"Enabled","Enabled"
|
7 |
+
"Description","Omschrijving"
|
8 |
+
|
9 |
+
"Choose your bank:","Kies uw bank:"
|
10 |
+
|
11 |
+
"Payment is pending","Betaling in verwerking"
|
12 |
+
"Payment is completed","Betaling afgerond"
|
13 |
+
"Payment is cancelled","Betaling is geannuleerd"
|
14 |
+
"Payment failed with an error","Betaling mislukt door een fout"
|
15 |
+
"Amounts don't match. Possible fraud","Bedragen komen niet overheen, mogelijk fraude"
|
16 |
+
|
17 |
+
"Your order has been received.", "Uw bestelling is ontvangen."
|
18 |
+
"Thank you for your purchase!","Dank voor uw aankoop!"
|
19 |
+
"Payment instructions:","Betaal instructies:"
|
20 |
+
"Please use the following data to make the banktransfer", "Gebuikt u de volgende gegevens voor de overboeking"
|
21 |
+
"ING processes the payments for", "ING verwerkt de betaling voor"
|
22 |
+
"(!) Don't forget to use the reference in your payment. Without the reference the processing of your payment can take more time!", "(!) Vergeet u niet het juiste betaalkenmerk te vermelden. Zonder het juiste betaalkenmerk kan de verwerking van uw betaling meer tijd kosten."
|
23 |
+
|
24 |
+
"Amount:","Bedrag:"
|
25 |
+
"Reference:","Kenmerk:"
|
26 |
+
"Account number:","Rekeningnummer:"
|
27 |
+
"IBAN:","IBAN:"
|
28 |
+
"BIC:","BIC:"
|
29 |
+
"Account holder:","Rekeninghouder:"
|
30 |
+
"City:","Woonplaats:"
|
package.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>ING_PSP</name>
|
4 |
+
<version>1.1.2</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="https://opensource.org/licenses/MIT">The MIT License (MIT)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>The ING register for your web shop to be used with KassaCompleet, ING Checkout or ING ePay.</summary>
|
10 |
+
<description>ING PSP: The ING register for your web shop to be used with KassaCompleet, ING Checkout or ING ePay.</description>
|
11 |
+
<notes>ING PSP-Magento Extension
|
12 |
+
====================
|
13 |
+

|
14 |
+
# Changelog #
|
15 |
+

|
16 |
+
## Changes in version 1.0.0
|
17 |
+
+ Initial version based upon Ginger Payments version
|
18 |
+

|
19 |
+
## Changes in version 1.0.1
|
20 |
+
+ Updated the README.md
|
21 |
+

|
22 |
+
## Changes in version 1.0.2
|
23 |
+
+ Handle banktransfer correctly
|
24 |
+

|
25 |
+
## Changes in version 1.0.3
|
26 |
+
+ Added version to the webhook
|
27 |
+
+ Added cash on delivery
|
28 |
+

|
29 |
+
## Changes in version 1.1.0
|
30 |
+
+ Added Bancontact
|
31 |
+
+ Added product selection
|
32 |
+

|
33 |
+
## Changes in version 1.1.1
|
34 |
+
+ Renamed bcmc to bancontact
|
35 |
+
</notes>
|
36 |
+
<authors><author><name>ING</name><user>ING</user><email>info@ing.nl</email></author></authors>
|
37 |
+
<date>2017-03-03</date>
|
38 |
+
<time>10:21:12</time>
|
39 |
+
<contents><target name="magecommunity"><dir name="ING"><dir name="PSP"><dir name="Block"><dir name="Payment"><dir name="Banktransfer"><file name="Form.php" hash="db4cf0bd72b9a12b1e33991a0bdbcb6f"/><file name="Info.php" hash="2a519b321b439d4ea7dc1e445aec5c07"/></dir><dir name="Cashondelivery"><file name="Form.php" hash="9eacf0e9c409c038890109cdc0d97645"/><file name="Info.php" hash="f89fabdbac923bfa83a5b6e544e38148"/></dir><dir name="Ideal"><file name="Form.php" hash="c0714c57becf5e32db213f6fe1988721"/><file name="Info.php" hash="d874249a4c565a5c6e2d2e3bf3b539f2"/></dir></dir></dir><dir name="Helper"><file name="Bancontact.php" hash="e33a23da762b7a96b3be2803f6dc92aa"/><file name="Banktransfer.php" hash="60b9f8df17178105bbf135721abc3503"/><file name="Cashondelivery.php" hash="3e7151becffc1e365c4be7cad9e123ec"/><file name="Creditcard.php" hash="89f3780c2ff96fd7893aa3080f315597"/><file name="Data.php" hash="b143e160f6560f96e90f72b20c6c8d42"/><file name="Ideal.php" hash="7321fc74d0ce5b8874c4ba52d71bb881"/></dir><dir name="Model"><file name="Bancontact.php" hash="792cb33ad7d1ac467a365eb6b595412d"/><file name="Banktransfer.php" hash="689f69af49ddcfd5e78346d8fda7d676"/><file name="Cashondelivery.php" hash="2979de56a364fd82cddebcfdfc89c2d2"/><file name="Creditcard.php" hash="20a8bbf80d7e6ea528f2d77972812eaf"/><file name="Ideal.php" hash="50b8c8d2dbc00ee177273f1f07013bf3"/><file name="Observer.php" hash="ef651feb38d5b466f9e159f99e6fa3f9"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Values.php" hash="f156d15f14e426d3b8aa71ded7d25e92"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="BancontactController.php" hash="c45d4a247c36f848b604db1f02cb7f57"/><file name="BanktransferController.php" hash="b931406b982d0b227523fdeb2d574381"/><file name="CashondeliveryController.php" hash="6d9ac6789b53416dedb03207c6553f6e"/><file name="CreditcardController.php" hash="f921489f89146c7533c01145bb7f2f41"/><file name="IdealController.php" hash="1c5d87142f59d58f20e1783c64e2763c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ab40996b103488d5b9198af8df087744"/><file name="config.xml" hash="194aac766fede5906201e1ca1929c0b4"/><file name="system.xml" hash="01d20f900d80144fcec0ad149a762961"/></dir><dir name="sql"><dir name="ingpsp_setup"><file name="mysql4-install-0.0.1.php" hash="8dc7335e6f4c45b1b15313cac9186b25"/><file name="mysql4-uninstall-0.0.1.php" hash="68e8467872718ce3e669462082654b2b"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="ee9a4a61fff75438c00c7e4329141dd3"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="2ededaf2fd41d1201210f481207e40b1"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="ing_psp"><dir name="info"><file name="banktransfer.phtml" hash="ec5c0fa56122e0ced55e3b4c93ee1404"/><file name="cashondelivery.phtml" hash="ec5c0fa56122e0ced55e3b4c93ee1404"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ing_psp"><dir name="form"><file name="banktransfer.phtml" hash="b5eae592b35c9ff113e21a6d68e64b6e"/><file name="cashondelivery.phtml" hash="b5eae592b35c9ff113e21a6d68e64b6e"/><file name="ideal.phtml" hash="a71e36bafa508b3c1e2b0b899b487b84"/></dir><dir name="info"><file name="banktransfer.phtml" hash="ec5c0fa56122e0ced55e3b4c93ee1404"/><file name="cashondelivery.phtml" hash="ec5c0fa56122e0ced55e3b4c93ee1404"/></dir><file name="success.phtml" hash="7f4e6001c102651bee8901e74c4bb8f1"/></dir></dir><dir name="layout"><file name="ing_psp.xml" hash="b8e49175aef2358a37f3029cb3caefc4"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ING_PSP.xml" hash="bec25e3ef38dad27666787a622e4f018"/></dir></target><target name="magelocale"><dir name="en_US"><file name="ING_PSP.csv" hash="54bb4994fbecf10ac2638aa4c05ba7b3"/></dir><dir name="nl_NL"><file name="ING_PSP.csv" hash="0c40afb29c628787200430bffcf0147c"/></dir></target><target name="magelib"><dir name="Ing"><dir name="Services"><file name="ing-php" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></target></contents>
|
40 |
+
<compatible/>
|
41 |
+
<dependencies><required><php><min>5.2.13</min><max>6.2.0</max></php></required></dependencies>
|
42 |
+
</package>
|