Version Notes
1. Fix: JavaScript - Checkout view (icons area & radio buttons) in case of forced preselection
Download this release
Release Info
Developer | Anna Sadriu |
Extension | mPAY24 |
Version | 1.6.5 |
Comparing to | |
See all releases |
Code changes from version 1.6.4 to 1.6.5
- app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Order/Invoice/Totals.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Order/Totals.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Totals.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Adminhtml/System/Config/Fieldset/Fieldset.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Form.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Form/Selectpayment.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Info/Selectpayment.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Mpay24.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/ParentRedirect.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Sales/Order/Creditmemo/Totals.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Sales/Order/Invoice/Totals.php +0 -12
- app/code/community/Mpay24/Mpay24/Block/Sales/Order/Totals.php +0 -12
- app/code/community/Mpay24/Mpay24/Helper/Data.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Api/MPay24Api.php +765 -441
- app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php +7 -11
- app/code/community/Mpay24/Mpay24/Model/Api/MPay24Shop.php +615 -481
- app/code/community/Mpay24/Mpay24/Model/Api/curllog.log +0 -0
- app/code/community/Mpay24/Mpay24/Model/Api/orderXML.php +108 -88
- app/code/community/Mpay24/Mpay24/Model/Api/xmls/.gitignore +0 -1
- app/code/community/Mpay24/Mpay24/Model/Api/xmls/145000006.xml +0 -50
- app/code/community/Mpay24/Mpay24/Model/Api/xmls/145000007.xml +0 -50
- app/code/community/Mpay24/Mpay24/Model/Api/xmls/Example_MDXI.xml +0 -46
- app/code/community/Mpay24/Mpay24/Model/Config.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Entity/Setup.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Method/Abstract.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Method/Selectpayment.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Mpay24/Debug.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug/Collection.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Mysql4/Setup.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Observer.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Sales/Order/Creditmemo/Total/Paymentcharge.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Sales/Order/Invoice/Total/Paymentcharge.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Selectpayment.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Session.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/AllowedIPs.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/BillAddr.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/ClearingAction.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/FormTemplate.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/PaidOrder.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/PaymentCharge.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/PaymentsActive.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/Request.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/Result.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/ShoppingCartRowsAction.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/Source/System.php +0 -12
- app/code/community/Mpay24/Mpay24/Model/System/Config/Backend/Encrypted.php +0 -12
- app/code/community/Mpay24/Mpay24/controllers/IndexController.php +0 -12
- app/code/community/Mpay24/Mpay24/controllers/PaymentController.php +0 -12
- app/code/community/Mpay24/Mpay24/etc/config.xml +1 -1
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.0.php +0 -12
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.1.php +0 -12
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.2.php +0 -12
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.3.php +0 -12
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.4.php +0 -12
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.5.php +41 -0
- app/design/adminhtml/default/default/template/mpay24/info/pdf/selectpayment.phtml +0 -12
- app/design/adminhtml/default/default/template/mpay24/info/selectpayment.phtml +0 -12
- app/design/frontend/base/default/layout/mpay24.xml +0 -12
- app/design/frontend/base/default/template/mpay24/form/area.phtml +0 -12
- app/design/frontend/base/default/template/mpay24/form/dropDown.phtml +0 -12
- app/design/frontend/base/default/template/mpay24/form/radio.phtml +1 -13
- app/design/frontend/base/default/template/mpay24/info/selectpayment.phtml +0 -12
- app/etc/modules/Mpay24_Mpay24.xml +1 -1
- package.xml +5 -5
- skin/frontend/base/default/js/Mpay24/Mpay24/mpay24.js +5 -7
app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Order/Creditmemo/Totals.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Order/Invoice/Totals.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Order/Totals.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Adminhtml/Sales/Totals.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Adminhtml/System/Config/Fieldset/Fieldset.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Form.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Form/Selectpayment.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Info/Selectpayment.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Mpay24.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/ParentRedirect.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Sales/Order/Creditmemo/Totals.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Sales/Order/Invoice/Totals.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Block/Sales/Order/Totals.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Helper/Data.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Api/MPay24Api.php
CHANGED
@@ -1,147 +1,179 @@
|
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
3 |
* The MPay24Api class provides the communication functioanallity. It hold's all the sensitive data (merchant ID, SOAP password, etc) and
|
4 |
-
* build the SOAP request, sent to mPAY24
|
5 |
*
|
6 |
* @author mPAY24 GmbH <support@mpay24.com>
|
7 |
-
* @version $Id: MPay24Api.php
|
8 |
* @filesource MPay24Api.php
|
9 |
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
10 |
*/
|
11 |
class MPay24Api {
|
12 |
/**
|
13 |
* TRUE, when you want to use the test system, and FALSE otherwise
|
14 |
-
*
|
|
|
15 |
*/
|
16 |
-
private $test
|
17 |
/**
|
18 |
* 'test', when you want to use the test system, and 'www' otherwise
|
19 |
-
*
|
|
|
20 |
*/
|
21 |
-
private $flexLINKSystem
|
22 |
/**
|
23 |
* The link where the requests should be sent to
|
24 |
*
|
25 |
-
* DEFAULT : https://test.mpay24.com/app/bin/
|
26 |
-
*
|
|
|
27 |
*/
|
28 |
-
private $etp_url
|
29 |
/**
|
30 |
-
* The merchant ID (supported from mPAY24).
|
|
|
31 |
* for test system, begin with 7 for the live system.
|
32 |
-
*
|
|
|
33 |
*/
|
34 |
-
private $merchantid
|
35 |
/**
|
36 |
* SPID (supported from mPAY24).
|
37 |
-
*
|
|
|
38 |
*/
|
39 |
-
private $spid
|
40 |
/**
|
41 |
* The SOAP password (supproted from mPAY24)
|
42 |
-
*
|
|
|
43 |
*/
|
44 |
-
private $soappass
|
45 |
/**
|
46 |
* The flexLINK password (supproted from mPAY24)
|
47 |
-
*
|
|
|
48 |
*/
|
49 |
-
private $pass
|
50 |
/**
|
51 |
* The fix (envelope) part of the soap xml, which is to be sent to mPAY24
|
52 |
-
*
|
|
|
53 |
*/
|
54 |
-
private $soap_xml
|
55 |
/**
|
56 |
* The host name, in case you are using proxy
|
57 |
-
*
|
|
|
58 |
*/
|
59 |
-
private $proxy_host
|
60 |
/**
|
61 |
* 4-digit port number, in case you are using proxy
|
62 |
-
*
|
|
|
63 |
*/
|
64 |
-
private $proxy_port
|
65 |
/**
|
66 |
* The user name, in case you are using proxy
|
67 |
-
*
|
|
|
68 |
*/
|
69 |
-
private $proxy_user
|
70 |
/**
|
71 |
* The password, in case you are using proxy
|
72 |
-
*
|
|
|
73 |
*/
|
74 |
-
private $proxy_pass
|
75 |
/**
|
76 |
* The whole soap-xml (envelope and body), which is to be sent to mPAY24 as request
|
77 |
-
*
|
|
|
78 |
*/
|
79 |
-
private $request
|
80 |
/**
|
81 |
* The response from mPAY24
|
82 |
-
*
|
|
|
83 |
*/
|
84 |
-
private $response
|
85 |
/**
|
86 |
* FALSE to stop cURL from verifying the peer's certificate, default - TRUE
|
87 |
-
*
|
|
|
88 |
*/
|
89 |
-
private $verify_peer
|
90 |
/**
|
91 |
* TRUE if log files are to be written, by default - FALSE
|
92 |
-
*
|
|
|
93 |
*/
|
94 |
-
private $debug
|
95 |
/**
|
96 |
* The name of the shopsoftware
|
97 |
-
*
|
|
|
98 |
*/
|
99 |
-
public $shop
|
100 |
/**
|
101 |
* The veriosn of the shopsoftware
|
102 |
-
*
|
|
|
103 |
*/
|
104 |
-
public $shopVersion
|
105 |
/**
|
106 |
* The version of the shop module
|
107 |
-
*
|
|
|
108 |
*/
|
109 |
-
public $moduleVersion
|
110 |
-
|
111 |
/**
|
112 |
* Set the basic (mandatory) settings for the requests
|
113 |
-
* @param int $merchantID 5-digit account number, supported by mPAY24
|
114 |
-
*
|
115 |
-
* TEST accounts - starting with 9
|
116 |
-
*
|
117 |
-
* LIVE account - starting with 7
|
118 |
-
* @param string $soapPassword The webservice's password, supported by mPAY24
|
119 |
-
* @param bool $test TRUE - when you want to use the TEST system
|
120 |
*
|
121 |
-
*
|
122 |
-
*
|
123 |
-
*
|
124 |
-
*
|
125 |
-
*
|
126 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
*/
|
128 |
public function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort, $proxyUser, $proxyPass, $verifyPeer) {
|
129 |
/**
|
130 |
* An error message, that will be displayed to the user in case you are using the LIVE system
|
131 |
-
* @const
|
132 |
*/
|
133 |
define('LIVE_ERROR_MSG', "We are sorry, an error occured - please contact the merchant!");
|
134 |
-
|
135 |
/**
|
136 |
* The current directory, where the script is runnig from
|
137 |
-
* @const
|
138 |
*/
|
139 |
-
if
|
140 |
-
|
|
|
141 |
$this->setMerchantID($merchantID);
|
142 |
$this->setSoapPassword($soapPassword);
|
143 |
$this->setSystem($test);
|
144 |
-
|
145 |
if($proxyHost != "" && $proxyPort != "") {
|
146 |
if($proxyUser != "" && $proxyPass != "")
|
147 |
$this->setProxySettings($proxyHost, $proxyPort, $proxyUser, $proxyPass);
|
@@ -151,84 +183,96 @@ class MPay24Api {
|
|
151 |
|
152 |
$this->setVerifyPeer($verifyPeer);
|
153 |
}
|
154 |
-
|
155 |
/**
|
156 |
* Set the basic (mandatory) settings for the requests
|
157 |
-
* @param string $spid The SPID of your account, supported by mPAY24
|
158 |
-
* @param string $password The flexLINK password, supported by mPAY24
|
159 |
-
* @param bool $test TRUE - when you want to use the TEST system
|
160 |
*
|
161 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
*/
|
163 |
public function configureFlexLINK($spid, $password, $test) {
|
164 |
/**
|
165 |
* An error message, that will be displayed to the user in case you are using the LIVE system
|
166 |
-
* @const
|
167 |
*/
|
168 |
define('LIVE_ERROR_MSG', "We are sorry, an error occured - please contact the merchant!");
|
169 |
-
|
170 |
/**
|
171 |
* The current directory, where the script is runnig from
|
172 |
-
* @const
|
173 |
*/
|
174 |
-
if
|
175 |
-
|
|
|
176 |
$this->setSPID($spid);
|
177 |
$this->setPassword($password);
|
178 |
$this->setFlexLINKSystem($test);
|
179 |
}
|
180 |
-
|
181 |
/**
|
182 |
* Get the merchant ID, which was set by the function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort)
|
183 |
-
*
|
|
|
184 |
*/
|
185 |
public function getMerchantID() {
|
186 |
return substr($this->merchantid, 1);
|
187 |
}
|
188 |
-
|
189 |
/**
|
190 |
* Get the SPID, which was set by the function configureFlexLINK($spid, $password, $test)
|
191 |
-
*
|
|
|
192 |
*/
|
193 |
public function getSPID() {
|
194 |
return $this->spid;
|
195 |
}
|
196 |
-
|
197 |
/**
|
198 |
* Get the system, which should be used for flexLINK (test -> 'test' or live -> 'www')
|
199 |
-
*
|
|
|
200 |
*/
|
201 |
public function getFlexLINKSystem() {
|
202 |
return $this->flexLINKSystem;
|
203 |
}
|
204 |
-
|
205 |
/**
|
206 |
* Get the url, where requests are going to be posted
|
207 |
-
*
|
|
|
208 |
*/
|
209 |
public function getEtpURL() {
|
210 |
return $this->etp_url;
|
211 |
}
|
212 |
-
|
213 |
/**
|
214 |
* Get the request, which was sent to mPAY24 (in XML form)
|
215 |
-
*
|
|
|
216 |
*/
|
217 |
public function getRequest() {
|
218 |
return $this->request;
|
219 |
}
|
220 |
-
|
221 |
/**
|
222 |
* Get the response from mPAY24 (in XML form)
|
223 |
-
*
|
|
|
224 |
*/
|
225 |
public function getResponse() {
|
226 |
return $this->response;
|
227 |
}
|
228 |
-
|
229 |
/**
|
230 |
* Check whether a proxy is used
|
231 |
-
*
|
|
|
232 |
*/
|
233 |
public function proxyUsed() {
|
234 |
if($this->proxy_host != '' && $this->proxy_port != '')
|
@@ -236,37 +280,44 @@ class MPay24Api {
|
|
236 |
else
|
237 |
return false;
|
238 |
}
|
239 |
-
|
240 |
/**
|
241 |
* Set debug modus (FALSE by default)
|
242 |
-
*
|
|
|
|
|
243 |
*/
|
244 |
public function setDebug($debug) {
|
245 |
$this->debug = $debug;
|
246 |
}
|
247 |
-
|
248 |
/**
|
249 |
* Check whether the debug modus is turned on or off
|
250 |
-
*
|
|
|
251 |
*/
|
252 |
public function getDebug() {
|
253 |
return $this->debug;
|
254 |
}
|
255 |
-
|
256 |
/**
|
257 |
* In case the test system is used, show die with the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG
|
258 |
-
*
|
|
|
|
|
259 |
*/
|
260 |
-
public function dieWithMsg($msg) {
|
261 |
-
if($
|
262 |
die($msg);
|
263 |
else
|
264 |
die(LIVE_ERROR_MSG);
|
265 |
}
|
266 |
-
|
267 |
/**
|
268 |
* In case the test system is used, show print the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG
|
269 |
-
*
|
|
|
|
|
270 |
*/
|
271 |
public function printMsg($msg) {
|
272 |
if($this->test)
|
@@ -274,294 +325,397 @@ class MPay24Api {
|
|
274 |
else
|
275 |
print(LIVE_ERROR_MSG);
|
276 |
}
|
277 |
-
|
278 |
/**
|
279 |
* Die with an error message, which show the path in case of read/write permission errors
|
280 |
*/
|
281 |
-
public function permissionError() {
|
282 |
$errors = error_get_last();
|
283 |
$message = $errors['message'];
|
284 |
-
$path = substr($message, strpos($message, 'fopen(')+6, strpos($message, ')')-(strpos($message, 'fopen(')+6));
|
285 |
-
|
286 |
}
|
287 |
-
|
288 |
/**
|
289 |
* Get all the payment methods, that are available for the merchant by mPAY24
|
290 |
-
*
|
|
|
291 |
*/
|
292 |
public function ListPaymentMethods() {
|
293 |
$xml = $this->buildEnvelope();
|
294 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
295 |
-
|
296 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ListPaymentMethods');
|
297 |
$operation = $body->appendChild($operation);
|
298 |
-
|
299 |
$xmlMerchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
300 |
$xmlMerchantID = $operation->appendChild($xmlMerchantID);
|
301 |
-
|
302 |
-
$this->request
|
303 |
-
|
304 |
$this->send();
|
305 |
-
|
306 |
$result = new ListPaymentMethodsResponse($this->response);
|
307 |
-
|
308 |
return $result;
|
309 |
}
|
310 |
-
|
311 |
/**
|
312 |
* Start a secure payment through the mPAY24 payment window -
|
313 |
* the sensible data (credit card numbers, bank account numbers etc)
|
314 |
* is (will be) not saved in the shop
|
315 |
-
*
|
316 |
-
* @
|
|
|
|
|
317 |
*/
|
318 |
public function SelectPayment($mdxi) {
|
319 |
$xml = $this->buildEnvelope();
|
320 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
321 |
-
|
322 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:SelectPayment');
|
323 |
$operation = $body->appendChild($operation);
|
324 |
-
|
325 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
326 |
$merchantID = $operation->appendChild($merchantID);
|
327 |
-
|
328 |
$xmlMDXI = $xml->createElement('mdxi', htmlspecialchars($mdxi));
|
329 |
$xmlMDXI = $operation->appendChild($xmlMDXI);
|
330 |
-
|
331 |
$getDataURL = $xml->createElement('getDataURL', "dummy_getDataURL");
|
332 |
$getDataURL = $operation->appendChild($getDataURL);
|
333 |
-
|
334 |
$tid = $xml->createElement('tid', 'tid');
|
335 |
$tid = $operation->appendChild($tid);
|
336 |
-
|
337 |
-
$this->request
|
338 |
-
|
339 |
$this->send();
|
340 |
-
|
341 |
$result = new PaymentResponse($this->response);
|
342 |
-
|
343 |
return $result;
|
344 |
}
|
345 |
-
|
346 |
/**
|
347 |
* Start a secure payment using a PROFILE (mPAY24 proSAFE), supported by mPAY24 -
|
348 |
* a customer profile (you have already created) will be used for the payment.
|
349 |
* The payment window will not be called, the payment source (for example credit card),
|
350 |
* which was used from the customer by the last payment will be used for the transaction.
|
351 |
-
*
|
352 |
-
* @
|
|
|
|
|
353 |
*/
|
354 |
public function ProfilePayment($requestString) {
|
355 |
$xml = $this->buildEnvelope();
|
356 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
357 |
-
|
358 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:AcceptPayment');
|
359 |
$operation = $body->appendChild($operation);
|
360 |
-
|
361 |
$requestXML = new DOMDocument("1.0", "UTF-8");
|
362 |
$requestXML->formatOutput = true;
|
363 |
$requestXML->loadXML($requestString);
|
364 |
-
|
365 |
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
366 |
-
|
367 |
foreach($requestNode->childNodes as $child) {
|
368 |
$child = $xml->importNode($child, true);
|
369 |
$operation->appendChild($child);
|
|
|
|
|
|
|
370 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
|
372 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
|
|
|
|
|
374 |
$this->send();
|
375 |
-
|
376 |
$result = new PaymentResponse($this->response);
|
377 |
-
|
378 |
return $result;
|
379 |
}
|
380 |
-
|
381 |
/**
|
382 |
-
* Start
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
|
|
390 |
$xml = $this->buildEnvelope();
|
391 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
392 |
-
|
393 |
$operation = $xml->createElement('etp:AcceptPayment');
|
394 |
$operation = $body->appendChild($operation);
|
395 |
-
|
396 |
$requestXML = new DOMDocument("1.0", "UTF-8");
|
397 |
$requestXML->formatOutput = true;
|
398 |
$requestXML->loadXML($requestString);
|
399 |
-
|
400 |
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
401 |
-
|
402 |
foreach($requestNode->childNodes as $child) {
|
403 |
$child = $xml->importNode($child, true);
|
404 |
$operation->appendChild($child);
|
405 |
-
|
406 |
if($child->nodeName == 'payment')
|
407 |
-
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance'
|
408 |
}
|
409 |
-
|
410 |
-
$this->request
|
411 |
-
|
412 |
$this->send();
|
413 |
-
|
414 |
$result = new PaymentResponse($this->response);
|
415 |
-
|
416 |
return $result;
|
417 |
}
|
418 |
-
|
419 |
/**
|
420 |
* Initialize a manual callback to mPAY24 in order to check the information provided by PayPal
|
421 |
-
*
|
422 |
-
* @
|
|
|
|
|
|
|
|
|
423 |
*/
|
424 |
-
public function
|
425 |
$xml = $this->buildEnvelope();
|
426 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
427 |
-
|
428 |
$operation = $xml->createElement('etp:ManualCallback');
|
429 |
$operation = $body->appendChild($operation);
|
430 |
-
|
431 |
$requestXML = new DOMDocument("1.0", "UTF-8");
|
432 |
$requestXML->formatOutput = true;
|
433 |
$requestXML->loadXML($requestString);
|
434 |
-
|
435 |
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
436 |
-
|
437 |
foreach($requestNode->childNodes as $child) {
|
438 |
$child = $xml->importNode($child, true);
|
439 |
$operation->appendChild($child);
|
440 |
-
|
441 |
if($child->nodeName == 'paymentCallback')
|
442 |
-
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance'
|
443 |
}
|
444 |
-
|
445 |
-
$this->request
|
446 |
-
|
447 |
$this->send();
|
448 |
-
|
449 |
$result = new PaymentResponse($this->response);
|
450 |
-
|
451 |
return $result;
|
452 |
}
|
453 |
-
|
454 |
/**
|
455 |
* Clear a transaction with an amount
|
456 |
-
*
|
457 |
-
* @param
|
458 |
-
*
|
459 |
-
* @
|
|
|
|
|
|
|
|
|
460 |
*/
|
461 |
public function ManualClear($mPAYTid, $amount, $currency) {
|
462 |
$xml = $this->buildEnvelope();
|
463 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
464 |
-
|
465 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualClear');
|
466 |
$operation = $body->appendChild($operation);
|
467 |
-
|
468 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
469 |
$merchantID = $operation->appendChild($merchantID);
|
470 |
-
|
471 |
$clearingDetails = $xml->createElement('clearingDetails');
|
472 |
$clearingDetails = $operation->appendChild($clearingDetails);
|
473 |
-
|
474 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
475 |
$xmlMPayTid = $clearingDetails->appendChild($xmlMPayTid);
|
476 |
-
|
477 |
$price = $xml->createElement('amount', $amount);
|
478 |
$price = $clearingDetails->appendChild($price);
|
479 |
-
|
480 |
-
$this->request
|
481 |
-
|
482 |
$this->send();
|
483 |
-
|
484 |
$result = new ManagePaymentResponse($this->response);
|
485 |
-
|
486 |
return $result;
|
487 |
}
|
488 |
-
|
489 |
/**
|
490 |
* Credit a transaction with an amount
|
491 |
-
*
|
492 |
-
* @param
|
493 |
-
*
|
494 |
-
* @param
|
495 |
-
*
|
|
|
|
|
|
|
|
|
|
|
496 |
*/
|
497 |
public function ManualCredit($mPAYTid, $amount, $currency, $customer) {
|
498 |
$xml = $this->buildEnvelope();
|
499 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
500 |
-
|
501 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualCredit');
|
502 |
$operation = $body->appendChild($operation);
|
503 |
-
|
504 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
505 |
$merchantID = $operation->appendChild($merchantID);
|
506 |
-
|
507 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
508 |
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
509 |
-
|
510 |
$price = $xml->createElement('amount', $amount);
|
511 |
$price = $operation->appendChild($price);
|
512 |
-
|
513 |
-
$this->request
|
514 |
-
|
515 |
$this->send();
|
516 |
-
|
517 |
$result = new ManagePaymentResponse($this->response);
|
518 |
-
|
519 |
return $result;
|
520 |
}
|
521 |
-
|
522 |
/**
|
523 |
* Cancel a transaction
|
524 |
-
*
|
525 |
-
* @
|
|
|
|
|
526 |
*/
|
527 |
public function ManualReverse($mPAYTid) {
|
528 |
$xml = $this->buildEnvelope();
|
529 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
530 |
-
|
531 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualReverse');
|
532 |
$operation = $body->appendChild($operation);
|
533 |
-
|
534 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
535 |
$merchantID = $operation->appendChild($merchantID);
|
536 |
-
|
537 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
538 |
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
539 |
-
|
540 |
-
$this->request
|
541 |
-
|
542 |
$this->send();
|
543 |
-
|
544 |
$result = new ManagePaymentResponse($this->response);
|
545 |
-
|
546 |
return $result;
|
547 |
}
|
548 |
-
|
549 |
/**
|
550 |
* Get all the information for a transaction, supported by mPAY24
|
551 |
-
*
|
552 |
-
* @param
|
553 |
-
*
|
|
|
|
|
|
|
554 |
*/
|
555 |
-
public function TransactionStatus($mPAYTid=null, $tid=null) {
|
556 |
$xml = $this->buildEnvelope();
|
557 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
558 |
-
|
559 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:TransactionStatus');
|
560 |
$operation = $body->appendChild($operation);
|
561 |
-
|
562 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
563 |
$merchantID = $operation->appendChild($merchantID);
|
564 |
-
|
565 |
if($mPAYTid) {
|
566 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
567 |
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
@@ -569,70 +723,80 @@ class MPay24Api {
|
|
569 |
$xmlTid = $xml->createElement('tid', $tid);
|
570 |
$xmlTid = $operation->appendChild($xmlTid);
|
571 |
}
|
572 |
-
|
573 |
-
$this->request
|
574 |
-
|
575 |
$this->send();
|
576 |
-
|
577 |
$result = new TransactionStatusResponse($this->response);
|
578 |
-
|
579 |
return $result;
|
580 |
}
|
581 |
-
|
582 |
/**
|
583 |
* Encoded the parameters (AES256-CBC) for the pay link and retunr them
|
584 |
-
*
|
585 |
-
* @
|
|
|
|
|
586 |
*/
|
587 |
public function flexLINK($params) {
|
588 |
$paramsString = "";
|
589 |
-
|
590 |
foreach($params as $key => $value)
|
591 |
$paramsString .= "$key=$value&";
|
592 |
-
|
593 |
$encryptedParams = $this->ssl_encrypt($this->pass, $paramsString);
|
594 |
-
|
595 |
return $encryptedParams;
|
596 |
}
|
597 |
-
|
598 |
/**
|
599 |
* Set the merchant ID (without 'u')
|
600 |
-
*
|
|
|
|
|
601 |
*/
|
602 |
-
private function setMerchantID($merchantID=null) {
|
603 |
-
if($merchantID==null)
|
604 |
$this->merchantid = 'u' . MERCHANT_ID;
|
605 |
else
|
606 |
$this->merchantid = 'u' . $merchantID;
|
607 |
}
|
608 |
-
|
609 |
/**
|
610 |
* Set the SPID, in order to make flexLINK transactions
|
611 |
-
*
|
|
|
|
|
612 |
*/
|
613 |
private function setSPID($spid) {
|
614 |
$this->spid = $spid;
|
615 |
}
|
616 |
-
|
617 |
/**
|
618 |
* Set the Web-Services/SOAP password
|
619 |
-
*
|
|
|
|
|
620 |
*/
|
621 |
-
private function setSoapPassword($pass=null) {
|
622 |
if(defined("SOAP_PASSWORD"))
|
623 |
$this->soappass = SOAP_PASSWORD;
|
624 |
else
|
625 |
$this->soappass = $pass;
|
626 |
}
|
627 |
-
|
628 |
/**
|
629 |
* Set the flexLINK password
|
630 |
-
*
|
|
|
|
|
631 |
*/
|
632 |
private function setPassword($pass) {
|
633 |
$this->pass = $pass;
|
634 |
}
|
635 |
-
|
636 |
/**
|
637 |
* Set whether the tets system (true) or the live system (false) will be used for the SOAP requests
|
638 |
* Set the POST url
|
@@ -640,36 +804,47 @@ class MPay24Api {
|
|
640 |
* ("https://test.mpay24.com/app/bin/etpproxy_v14" or
|
641 |
*
|
642 |
* "https://www.mpay24.com/app/bin/etpproxy_v14")
|
643 |
-
* @param bool $test TRUE for TEST system and FALSE for LIVE system.
|
644 |
*
|
|
|
|
|
|
|
645 |
*/
|
646 |
-
private function setSystem($test=null) {
|
647 |
if($test) {
|
648 |
$this->test = true;
|
649 |
$this->etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";
|
650 |
-
|
651 |
-
|
652 |
-
|
|
|
653 |
}
|
654 |
-
|
655 |
-
|
656 |
/**
|
657 |
* Set whether the tets system (true) or the live system (false) will be used for the flexLINK requests
|
658 |
-
*
|
|
|
|
|
659 |
*/
|
660 |
-
private function setFlexLINKSystem($test=null) {
|
661 |
if($test)
|
662 |
$this->flexLINKSystem = "test";
|
663 |
else
|
664 |
$this->flexLINKSystem = "www";
|
665 |
}
|
666 |
-
|
667 |
/**
|
668 |
* Set the used proxy host and proxy port in case proxy is used
|
669 |
-
*
|
670 |
-
* @param
|
671 |
-
|
672 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
if($proxy_host != "" && $proxy_port != "") {
|
674 |
$this->proxy_host = $proxy_host;
|
675 |
$this->proxy_port = $proxy_port;
|
@@ -683,208 +858,220 @@ class MPay24Api {
|
|
683 |
|
684 |
/**
|
685 |
* Set whether to stop cURL from verifying the peer's certificate
|
686 |
-
*
|
|
|
|
|
687 |
*/
|
688 |
private function setVerifyPeer($verify_peer) {
|
689 |
$this->verify_peer = $verify_peer;
|
690 |
}
|
691 |
-
|
692 |
/**
|
693 |
* Create a DOMDocument and prepare it for SOAP request:
|
694 |
* set Envelope, NameSpaces, create empty Body
|
695 |
-
*
|
|
|
696 |
*/
|
697 |
private function buildEnvelope() {
|
698 |
$this->soap_xml = new DOMDocument("1.0", "UTF-8");
|
699 |
$this->soap_xml->formatOutput = true;
|
700 |
-
|
701 |
$envelope = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Envelope');
|
702 |
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
703 |
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:etp', 'https://www.mpay24.com/soap/etp/1.5/ETP.wsdl');
|
704 |
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
705 |
$envelope = $this->soap_xml->appendChild($envelope);
|
706 |
-
|
707 |
$body = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Body');
|
708 |
$body = $envelope->appendChild($body);
|
709 |
-
|
710 |
return $this->soap_xml;
|
711 |
}
|
712 |
-
|
713 |
/**
|
714 |
* Create a curl request and send the cretaed SOAP XML
|
715 |
*/
|
716 |
private function send() {
|
717 |
-
$userAgent = 'mPAY24 PHP API $Rev:
|
718 |
-
|
719 |
if($this->shop != '') {
|
720 |
$userAgent = $this->shop;
|
721 |
-
|
722 |
if($this->shopVersion != '')
|
723 |
$userAgent .= " v. " . $this->shopVersion;
|
724 |
if($this->shopVersion != '')
|
725 |
$userAgent .= " - Module v. " . $this->moduleVersion;
|
726 |
}
|
727 |
-
|
728 |
$ch = curl_init($this->etp_url);
|
729 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
730 |
curl_setopt($ch, CURLOPT_POST, 1);
|
731 |
-
curl_setopt($ch,CURLOPT_USERPWD,"$this->merchantid:$this->soappass");
|
732 |
-
curl_setopt($ch,CURLOPT_USERAGENT
|
733 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->request);
|
734 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
735 |
-
|
736 |
if($this->debug) {
|
737 |
-
$fh = fopen(
|
738 |
-
|
739 |
curl_setopt($ch, CURLOPT_VERBOSE, 1);
|
740 |
curl_setopt($ch, CURLOPT_STDERR, $fh);
|
741 |
}
|
742 |
-
|
743 |
try {
|
744 |
-
curl_setopt($ch, CURLOPT_CAINFO, __DIR__.'/cacert.pem');
|
745 |
-
|
746 |
if($this->proxy_host !== '' && $this->proxy_port !== '') {
|
747 |
-
curl_setopt($ch, CURLOPT_PROXY, $this->proxy_host.':'
|
748 |
|
749 |
if($this->proxy_user !== '' && $this->proxy_pass !== '')
|
750 |
-
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxy_user.':'
|
751 |
|
752 |
if($this->verify_peer !== true)
|
753 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
|
754 |
}
|
755 |
-
|
756 |
$this->response = curl_exec($ch);
|
757 |
curl_close($ch);
|
758 |
-
|
759 |
if($this->debug)
|
760 |
fclose($fh);
|
761 |
-
} catch
|
762 |
if($this->test)
|
763 |
-
$dieMSG = "Your request couldn't be sent because of the following error:" . "\n" .
|
764 |
-
curl_error($ch) . "\n" .
|
765 |
-
$e->getMessage() .
|
766 |
-
' in '.$e->getFile().', line: '.
|
767 |
-
$e->getLine().'.';
|
768 |
else
|
769 |
$dieMSG = LIVE_ERROR_MSG;
|
770 |
-
|
771 |
echo $dieMSG;
|
772 |
}
|
773 |
}
|
774 |
-
|
775 |
/**
|
776 |
* Encode data (AES256-CBC) using a password
|
777 |
-
*
|
778 |
-
* @param
|
779 |
-
*
|
|
|
|
|
|
|
780 |
*/
|
781 |
private function ssl_encrypt($pass, $data) {
|
782 |
// Set a random salt
|
783 |
$salt = substr(md5(mt_rand(), true), 8);
|
784 |
-
|
785 |
$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
|
786 |
$pad = $block - (strlen($data) % $block);
|
787 |
-
|
788 |
$data = $data . str_repeat(chr($pad), $pad);
|
789 |
-
|
790 |
// Setup encryption parameters
|
791 |
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, "", MCRYPT_MODE_CBC, "");
|
792 |
-
|
793 |
-
$key_len =
|
794 |
-
$iv_len =
|
795 |
-
|
796 |
$total_len = $key_len + $iv_len;
|
797 |
$salted = '';
|
798 |
$dx = '';
|
799 |
-
|
800 |
// Salt the key and iv
|
801 |
-
while
|
802 |
-
$dx = md5($dx
|
803 |
$salted .= $dx;
|
804 |
}
|
805 |
-
|
806 |
-
$key = substr($salted,0
|
807 |
-
$iv = substr($salted
|
808 |
-
|
809 |
mcrypt_generic_init($td, $key, $iv);
|
810 |
$encrypted_data = mcrypt_generic($td, $data);
|
811 |
mcrypt_generic_deinit($td);
|
812 |
mcrypt_module_close($td);
|
813 |
-
|
814 |
-
return chunk_split(
|
815 |
}
|
816 |
}
|
817 |
|
818 |
/**
|
819 |
* The GeneralResponse class contains the status of a response and return code, which was delivered by mPAY24 as an answer of your request
|
820 |
*
|
821 |
-
* @author
|
822 |
-
* @version
|
823 |
-
* @filesource
|
824 |
-
* @license
|
825 |
*/
|
826 |
class GeneralResponse {
|
827 |
/**
|
828 |
* The status of the request, which was sent to mPAY24
|
829 |
-
*
|
|
|
830 |
*/
|
831 |
var $status;
|
832 |
/**
|
833 |
* The return code from the request, which was sent to mPAY24
|
834 |
-
*
|
|
|
835 |
*/
|
836 |
var $returnCode;
|
837 |
-
|
838 |
/**
|
839 |
* Sets the basic values from the response from mPAY24: status and return code
|
840 |
-
*
|
|
|
|
|
841 |
*/
|
842 |
function GeneralResponse($response) {
|
843 |
if($response != '') {
|
844 |
$responseAsDOM = new DOMDocument();
|
845 |
$responseAsDOM->loadXML($response);
|
846 |
-
|
847 |
-
if(!empty($responseAsDOM) && is_object($responseAsDOM))
|
848 |
-
if(
|
849 |
-
$this->status
|
850 |
-
$this->returnCode
|
851 |
} else {
|
852 |
-
$this->status
|
853 |
-
$this->returnCode
|
854 |
}
|
855 |
} else {
|
856 |
-
$this->status
|
857 |
-
$this->returnCode
|
858 |
}
|
859 |
}
|
860 |
-
|
861 |
/**
|
862 |
* Get the status of the request, which was sent to mPAY24
|
863 |
-
*
|
|
|
864 |
*/
|
865 |
public function getStatus() {
|
866 |
return $this->status;
|
867 |
}
|
868 |
-
|
869 |
/**
|
870 |
* Get the return code from the request, which was sent to mPAY24
|
871 |
-
*
|
|
|
872 |
*/
|
873 |
public function getReturnCode() {
|
874 |
return $this->returnCode;
|
875 |
}
|
876 |
-
|
877 |
/**
|
878 |
* Set the status in the response, which was delivered by mPAY24
|
879 |
-
*
|
|
|
|
|
880 |
*/
|
881 |
public function setStatus($status) {
|
882 |
$this->status = $status;
|
883 |
}
|
884 |
-
|
885 |
/**
|
886 |
* Set the return code in the response, which was delivered by mPAY24
|
887 |
-
*
|
|
|
|
|
888 |
*/
|
889 |
public function setReturnCode($returnCode) {
|
890 |
return $this->returnCode = $returnCode;
|
@@ -894,124 +1081,227 @@ class GeneralResponse {
|
|
894 |
/**
|
895 |
* The PaymentResponse class contains a generalResponse object and the location(URL), which will be used for the payment session
|
896 |
*
|
897 |
-
* @author
|
898 |
-
* @version
|
899 |
-
* @filesource
|
900 |
-
* @license
|
901 |
*/
|
902 |
class PaymentResponse extends GeneralResponse {
|
903 |
/**
|
904 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
905 |
-
*
|
|
|
906 |
*/
|
907 |
var $generalResponse;
|
908 |
/**
|
909 |
* An URL (of the mPAY24 payment fenster), where the customer would be redirected to, in case of successfull request
|
910 |
-
*
|
|
|
911 |
*/
|
912 |
var $location;
|
913 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
914 |
/**
|
915 |
* Sets the values for a payment from the response from mPAY24: mPAY transaction ID, error number and location (URL)
|
916 |
-
*
|
|
|
|
|
917 |
*/
|
918 |
function PaymentResponse($response) {
|
919 |
$this->generalResponse = new GeneralResponse($response);
|
920 |
-
|
921 |
if($response != '') {
|
922 |
$responseAsDOM = new DOMDocument();
|
923 |
$responseAsDOM->loadXML($response);
|
924 |
-
|
925 |
-
if(!empty($responseAsDOM) && is_object($responseAsDOM) && $responseAsDOM->getElementsByTagName('location')->length != 0)
|
926 |
-
$this->location
|
|
|
|
|
927 |
} else {
|
928 |
$this->generalResponse->setStatus("ERROR");
|
929 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
930 |
}
|
931 |
}
|
932 |
-
|
933 |
/**
|
934 |
* Get the location (URL), returned from mPAY24
|
935 |
-
*
|
|
|
936 |
*/
|
937 |
-
public function getLocation(){
|
938 |
return $this->location;
|
939 |
}
|
940 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
941 |
/**
|
942 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
943 |
-
*
|
|
|
944 |
*/
|
945 |
-
public function getGeneralResponse(){
|
946 |
return $this->generalResponse;
|
947 |
}
|
948 |
}
|
949 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
950 |
/**
|
951 |
* The ManagePaymentResponse class contains a generalResponse object and the mPAYTID and/or tid of the transaction which was managed
|
952 |
*
|
953 |
-
* @author
|
954 |
-
* @version
|
955 |
-
* @filesource
|
956 |
-
* @license
|
957 |
*/
|
958 |
class ManagePaymentResponse extends GeneralResponse {
|
959 |
/**
|
960 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
961 |
-
*
|
|
|
962 |
*/
|
963 |
var $generalResponse;
|
964 |
/**
|
965 |
* The mPAY transaction ID
|
966 |
-
*
|
|
|
967 |
*/
|
968 |
var $mpayTID;
|
969 |
/**
|
970 |
* The transaction ID of the shop
|
971 |
-
*
|
|
|
972 |
*/
|
973 |
var $tid;
|
974 |
-
|
975 |
/**
|
976 |
* Sets the values for a payment from the response from mPAY24: mPAY transaction IDand transaction ID from the shop
|
977 |
-
*
|
|
|
|
|
978 |
*/
|
979 |
function ManagePaymentResponse($response) {
|
980 |
$this->generalResponse = new GeneralResponse($response);
|
981 |
-
|
982 |
if($response != '') {
|
983 |
$responseAsDOM = new DOMDocument();
|
984 |
$responseAsDOM->loadXML($response);
|
985 |
-
|
986 |
if($responseAsDOM && $responseAsDOM->getElementsByTagName('mpayTID')->length != 0 && $responseAsDOM->getElementsByTagName('tid')->length != 0) {
|
987 |
-
$this->mpayTID
|
988 |
-
$this->tid
|
989 |
}
|
990 |
} else {
|
991 |
$this->generalResponse->setStatus("ERROR");
|
992 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
993 |
}
|
994 |
}
|
995 |
-
|
996 |
/**
|
997 |
* Get the mPAY transaction ID, returned from mPAY24
|
998 |
-
*
|
|
|
999 |
*/
|
1000 |
public function getMpayTID() {
|
1001 |
return $this->mpayTID;
|
1002 |
}
|
1003 |
-
|
1004 |
/**
|
1005 |
* Get the transaction ID of the shop, returned from mPAY24
|
1006 |
-
*
|
|
|
1007 |
*/
|
1008 |
public function getTid() {
|
1009 |
return $this->tid;
|
1010 |
}
|
1011 |
-
|
1012 |
/**
|
1013 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
1014 |
-
*
|
|
|
1015 |
*/
|
1016 |
public function getGeneralResponse() {
|
1017 |
return $this->generalResponse;
|
@@ -1021,59 +1311,67 @@ class ManagePaymentResponse extends GeneralResponse {
|
|
1021 |
/**
|
1022 |
* The ListPaymentMethodsResponse class contains a generalResponse object and all the needed informarion for the active payment mothods (payment methods count, payment types, brands and descriptions)
|
1023 |
*
|
1024 |
-
* @author
|
1025 |
-
* @version
|
1026 |
-
* @filesource
|
1027 |
-
* @license
|
1028 |
*/
|
1029 |
class ListPaymentMethodsResponse extends GeneralResponse {
|
1030 |
/**
|
1031 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
1032 |
-
*
|
|
|
1033 |
*/
|
1034 |
var $generalResponse;
|
1035 |
/**
|
1036 |
* The count of the payment methods, which are activated by mPAY24
|
1037 |
-
*
|
|
|
1038 |
*/
|
1039 |
-
var $all
|
1040 |
/**
|
1041 |
* A list with the payment types, activated by mPAY24
|
1042 |
-
*
|
|
|
1043 |
*/
|
1044 |
-
var $pTypes
|
1045 |
/**
|
1046 |
* A list with the brands, activated by mPAY24
|
1047 |
-
*
|
|
|
1048 |
*/
|
1049 |
-
var $brands
|
1050 |
/**
|
1051 |
* A list with the descriptions of the payment methods, activated by mPAY24
|
1052 |
-
*
|
|
|
1053 |
*/
|
1054 |
-
var $descriptions
|
1055 |
-
|
1056 |
/**
|
1057 |
* A list with the IDs of the payment methods, activated by mPAY24
|
1058 |
-
*
|
|
|
1059 |
*/
|
1060 |
-
var $pMethIds
|
1061 |
-
|
1062 |
/**
|
1063 |
* Sets the values for a payment from the response from mPAY24: count, payment types, brands and descriptions
|
1064 |
-
*
|
|
|
|
|
1065 |
*/
|
1066 |
function ListPaymentMethodsResponse($response) {
|
1067 |
$this->generalResponse = new GeneralResponse($response);
|
1068 |
-
|
1069 |
if($response != '') {
|
1070 |
$responseAsDOM = new DOMDocument();
|
1071 |
$responseAsDOM->loadXML($response);
|
1072 |
-
|
1073 |
if($responseAsDOM && $responseAsDOM->getElementsByTagName('all')->length != 0) {
|
1074 |
-
$this->all
|
1075 |
-
|
1076 |
-
for($i = 0; $i < $this->all; $i++) {
|
1077 |
$this->pTypes[$i] = $responseAsDOM->getElementsByTagName('pType')->item($i)->nodeValue;
|
1078 |
$this->brands[$i] = $responseAsDOM->getElementsByTagName('brand')->item($i)->nodeValue;
|
1079 |
$this->descriptions[$i] = $responseAsDOM->getElementsByTagName('description')->item($i)->nodeValue;
|
@@ -1085,86 +1383,100 @@ class ListPaymentMethodsResponse extends GeneralResponse {
|
|
1085 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
1086 |
}
|
1087 |
}
|
1088 |
-
|
1089 |
/**
|
1090 |
* Get the count of the payment methods, returned from mPAY24
|
1091 |
-
*
|
|
|
1092 |
*/
|
1093 |
public function getAll() {
|
1094 |
return $this->all;
|
1095 |
}
|
1096 |
-
|
1097 |
/**
|
1098 |
* Get the payment types, returned from mPAY24
|
1099 |
-
*
|
|
|
1100 |
*/
|
1101 |
public function getPTypes() {
|
1102 |
return $this->pTypes;
|
1103 |
}
|
1104 |
-
|
1105 |
/**
|
1106 |
* Get the brands, returned from mPAY24
|
1107 |
-
*
|
|
|
1108 |
*/
|
1109 |
public function getBrands() {
|
1110 |
return $this->brands;
|
1111 |
}
|
1112 |
-
|
1113 |
/**
|
1114 |
* Get the descriptions, returned from mPAY24
|
1115 |
-
*
|
|
|
1116 |
*/
|
1117 |
public function getDescriptions() {
|
1118 |
return $this->descriptions;
|
1119 |
}
|
1120 |
-
|
1121 |
/**
|
1122 |
* Get the payment method IDs, returned from mPAY24
|
1123 |
-
*
|
|
|
1124 |
*/
|
1125 |
public function getPMethIDs() {
|
1126 |
return $this->pMethIds;
|
1127 |
}
|
1128 |
-
|
1129 |
/**
|
1130 |
* Get payment type, returned from mPAY24
|
1131 |
-
*
|
1132 |
-
* @
|
|
|
|
|
1133 |
*/
|
1134 |
public function getPType($i) {
|
1135 |
return $this->pTypes[$i];
|
1136 |
}
|
1137 |
-
|
1138 |
/**
|
1139 |
* Get brand, returned from mPAY24
|
1140 |
-
*
|
1141 |
-
* @
|
|
|
|
|
1142 |
*/
|
1143 |
public function getBrand($i) {
|
1144 |
return $this->brands[$i];
|
1145 |
}
|
1146 |
-
|
1147 |
/**
|
1148 |
* Get description, returned from mPAY24
|
1149 |
-
*
|
1150 |
-
* @
|
|
|
|
|
1151 |
*/
|
1152 |
public function getDescription($i) {
|
1153 |
return $this->descriptions[$i];
|
1154 |
}
|
1155 |
-
|
1156 |
/**
|
1157 |
* Get payment method ID, returned from mPAY24
|
1158 |
-
*
|
1159 |
-
* @
|
|
|
|
|
1160 |
*/
|
1161 |
public function getPMethID($i) {
|
1162 |
return $this->pMethIds[$i];
|
1163 |
}
|
1164 |
-
|
1165 |
/**
|
1166 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
1167 |
-
*
|
|
|
1168 |
*/
|
1169 |
public function getGeneralResponse() {
|
1170 |
return $this->generalResponse;
|
@@ -1174,49 +1486,53 @@ class ListPaymentMethodsResponse extends GeneralResponse {
|
|
1174 |
/**
|
1175 |
* The TransactionStatusResponse class contains a generalResponse object and all the parameters, returned with the confirmation from mPAY24
|
1176 |
*
|
1177 |
-
* @author
|
1178 |
-
* @version
|
1179 |
-
* @filesource
|
1180 |
-
* @license
|
1181 |
*/
|
1182 |
class TransactionStatusResponse extends GeneralResponse {
|
1183 |
/**
|
1184 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
1185 |
-
*
|
|
|
1186 |
*/
|
1187 |
var $generalResponse;
|
1188 |
/**
|
1189 |
* A list with all the parameters for a transaction
|
1190 |
-
*
|
|
|
1191 |
*/
|
1192 |
-
var $params
|
1193 |
/**
|
1194 |
* The count of all the paramerters for a transaction
|
1195 |
-
*
|
|
|
1196 |
*/
|
1197 |
-
var $paramCount
|
1198 |
-
|
1199 |
/**
|
1200 |
* Sets the values for a transaction from the response from mPAY24: STATUS, PRICE, CURRENCY, LANGUAGE, etc
|
1201 |
-
*
|
|
|
|
|
1202 |
*/
|
1203 |
function TransactionStatusResponse($response) {
|
1204 |
$this->generalResponse = new GeneralResponse($response);
|
1205 |
-
|
1206 |
if($response != '') {
|
1207 |
$responseAsDOM = new DOMDocument();
|
1208 |
$responseAsDOM->loadXML($response);
|
1209 |
-
|
1210 |
if($responseAsDOM && $responseAsDOM->getElementsByTagName('name')->length != 0) {
|
1211 |
$this->paramCount = $responseAsDOM->getElementsByTagName('name')->length;
|
1212 |
$this->params['STATUS'] = $this->generalResponse->getStatus();
|
1213 |
-
|
1214 |
-
for($i = 0; $i < $this->paramCount; $i++){
|
1215 |
if($responseAsDOM->getElementsByTagName("name")->item($i)->nodeValue == "STATUS")
|
1216 |
$this->params["TSTATUS"] = $responseAsDOM->getElementsByTagName("value")->item($i)->nodeValue;
|
1217 |
else
|
1218 |
-
$this->params[$responseAsDOM->getElementsByTagName('name')->item($i)->nodeValue]
|
1219 |
-
= $responseAsDOM->getElementsByTagName('value')->item($i)->nodeValue;
|
1220 |
}
|
1221 |
}
|
1222 |
} else {
|
@@ -1224,27 +1540,31 @@ class TransactionStatusResponse extends GeneralResponse {
|
|
1224 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
1225 |
}
|
1226 |
}
|
1227 |
-
|
1228 |
/**
|
1229 |
* Get the count of all the paramerters for a transaction
|
1230 |
-
*
|
|
|
1231 |
*/
|
1232 |
public function getParamCount() {
|
1233 |
return $this->paramCount;
|
1234 |
}
|
1235 |
-
|
1236 |
/**
|
1237 |
* Get the parameters for a transaction, returned from mPAY24
|
1238 |
-
*
|
|
|
1239 |
*/
|
1240 |
public function getParams() {
|
1241 |
return $this->params;
|
1242 |
}
|
1243 |
-
|
1244 |
/**
|
1245 |
* Get the parameter's value, returned from mPAY24
|
1246 |
-
*
|
1247 |
-
* @
|
|
|
|
|
1248 |
*/
|
1249 |
public function getParam($i) {
|
1250 |
if(isset($this->params[$i]))
|
@@ -1252,19 +1572,23 @@ class TransactionStatusResponse extends GeneralResponse {
|
|
1252 |
else
|
1253 |
return false;
|
1254 |
}
|
1255 |
-
|
1256 |
/**
|
1257 |
* Set a value for a parameter
|
1258 |
-
*
|
1259 |
-
* @param
|
|
|
|
|
|
|
1260 |
*/
|
1261 |
public function setParam($name, $value) {
|
1262 |
$this->params[$name] = $value;
|
1263 |
}
|
1264 |
-
|
1265 |
/**
|
1266 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
1267 |
-
*
|
|
|
1268 |
*/
|
1269 |
public function getGeneralResponse() {
|
1270 |
return $this->generalResponse;
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Main mPAY24 PHP APIs Class.
|
4 |
+
*
|
5 |
* The MPay24Api class provides the communication functioanallity. It hold's all the sensitive data (merchant ID, SOAP password, etc) and
|
6 |
+
* build the SOAP request, sent to mPAY24.
|
7 |
*
|
8 |
* @author mPAY24 GmbH <support@mpay24.com>
|
9 |
+
* @version $Id: MPay24Api.php 6231 2015-03-13 16:29:56Z anna $
|
10 |
* @filesource MPay24Api.php
|
11 |
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
12 |
*/
|
13 |
class MPay24Api {
|
14 |
/**
|
15 |
* TRUE, when you want to use the test system, and FALSE otherwise
|
16 |
+
*
|
17 |
+
* @var bool
|
18 |
*/
|
19 |
+
private $test = false;
|
20 |
/**
|
21 |
* 'test', when you want to use the test system, and 'www' otherwise
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
*/
|
25 |
+
private $flexLINKSystem = "test";
|
26 |
/**
|
27 |
* The link where the requests should be sent to
|
28 |
*
|
29 |
+
* DEFAULT : https://test.mpay24.com/app/bin/etpproxy_v15 (TEST SYSTEM)
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
*/
|
33 |
+
private $etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";
|
34 |
/**
|
35 |
+
* The merchant ID (supported from mPAY24).
|
36 |
+
* 5-digit number. Begin with 9
|
37 |
* for test system, begin with 7 for the live system.
|
38 |
+
*
|
39 |
+
* @var int
|
40 |
*/
|
41 |
+
private $merchantid = "9xxxx";
|
42 |
/**
|
43 |
* SPID (supported from mPAY24).
|
44 |
+
*
|
45 |
+
* @var string
|
46 |
*/
|
47 |
+
private $spid = "";
|
48 |
/**
|
49 |
* The SOAP password (supproted from mPAY24)
|
50 |
+
*
|
51 |
+
* @var string
|
52 |
*/
|
53 |
+
private $soappass = "";
|
54 |
/**
|
55 |
* The flexLINK password (supproted from mPAY24)
|
56 |
+
*
|
57 |
+
* @var string
|
58 |
*/
|
59 |
+
private $pass = "";
|
60 |
/**
|
61 |
* The fix (envelope) part of the soap xml, which is to be sent to mPAY24
|
62 |
+
*
|
63 |
+
* @var string
|
64 |
*/
|
65 |
+
private $soap_xml = "";
|
66 |
/**
|
67 |
* The host name, in case you are using proxy
|
68 |
+
*
|
69 |
+
* @var string
|
70 |
*/
|
71 |
+
private $proxy_host = "";
|
72 |
/**
|
73 |
* 4-digit port number, in case you are using proxy
|
74 |
+
*
|
75 |
+
* @var int
|
76 |
*/
|
77 |
+
private $proxy_port = "";
|
78 |
/**
|
79 |
* The user name, in case you are using proxy
|
80 |
+
*
|
81 |
+
* @var string
|
82 |
*/
|
83 |
+
private $proxy_user = "";
|
84 |
/**
|
85 |
* The password, in case you are using proxy
|
86 |
+
*
|
87 |
+
* @var string
|
88 |
*/
|
89 |
+
private $proxy_pass = "";
|
90 |
/**
|
91 |
* The whole soap-xml (envelope and body), which is to be sent to mPAY24 as request
|
92 |
+
*
|
93 |
+
* @var string
|
94 |
*/
|
95 |
+
private $request = "";
|
96 |
/**
|
97 |
* The response from mPAY24
|
98 |
+
*
|
99 |
+
* @var string
|
100 |
*/
|
101 |
+
private $response = "";
|
102 |
/**
|
103 |
* FALSE to stop cURL from verifying the peer's certificate, default - TRUE
|
104 |
+
*
|
105 |
+
* @var bool
|
106 |
*/
|
107 |
+
private $verify_peer = true;
|
108 |
/**
|
109 |
* TRUE if log files are to be written, by default - FALSE
|
110 |
+
*
|
111 |
+
* @var bool
|
112 |
*/
|
113 |
+
private $debug = true;
|
114 |
/**
|
115 |
* The name of the shopsoftware
|
116 |
+
*
|
117 |
+
* @var string
|
118 |
*/
|
119 |
+
public $shop = "mPAY24 GmbH";
|
120 |
/**
|
121 |
* The veriosn of the shopsoftware
|
122 |
+
*
|
123 |
+
* @var string
|
124 |
*/
|
125 |
+
public $shopVersion = "PHP APIs";
|
126 |
/**
|
127 |
* The version of the shop module
|
128 |
+
*
|
129 |
+
* @var string
|
130 |
*/
|
131 |
+
public $moduleVersion = '$Rev: 6231 $ ($Date:: 2015-03-13 #$)';
|
132 |
+
|
133 |
/**
|
134 |
* Set the basic (mandatory) settings for the requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
*
|
136 |
+
* @param int $merchantID
|
137 |
+
* 5-digit account number, supported by mPAY24
|
138 |
+
*
|
139 |
+
* TEST accounts - starting with 9
|
140 |
+
*
|
141 |
+
* LIVE account - starting with 7
|
142 |
+
* @param string $soapPassword
|
143 |
+
* The webservice's password, supported by mPAY24
|
144 |
+
* @param bool $test
|
145 |
+
* TRUE - when you want to use the TEST system
|
146 |
+
*
|
147 |
+
* FALSE - when you want to use the LIVE system
|
148 |
+
* @param string $proxyHost
|
149 |
+
* The host name in case you are behind a proxy server ("" when not)
|
150 |
+
* @param int $proxyPort
|
151 |
+
* 4-digit port number in case you are behind a proxy server ("" when not)
|
152 |
+
* @param string $proxyUser
|
153 |
+
* The proxy user in case you are behind a proxy server ("" when not)
|
154 |
+
* @param string $proxyPass
|
155 |
+
* The proxy password in case you are behind a proxy server ("" when not)
|
156 |
+
* @param bool $verifyPeer
|
157 |
+
* Set as FALSE to stop cURL from verifying the peer's certificate
|
158 |
*/
|
159 |
public function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort, $proxyUser, $proxyPass, $verifyPeer) {
|
160 |
/**
|
161 |
* An error message, that will be displayed to the user in case you are using the LIVE system
|
162 |
+
* @const LIVE_ERROR_MSG
|
163 |
*/
|
164 |
define('LIVE_ERROR_MSG', "We are sorry, an error occured - please contact the merchant!");
|
165 |
+
|
166 |
/**
|
167 |
* The current directory, where the script is runnig from
|
168 |
+
* @const __DIR__
|
169 |
*/
|
170 |
+
if(! defined('__DIR__'))
|
171 |
+
define('__DIR__', dirname(__FILE__));
|
172 |
+
|
173 |
$this->setMerchantID($merchantID);
|
174 |
$this->setSoapPassword($soapPassword);
|
175 |
$this->setSystem($test);
|
176 |
+
|
177 |
if($proxyHost != "" && $proxyPort != "") {
|
178 |
if($proxyUser != "" && $proxyPass != "")
|
179 |
$this->setProxySettings($proxyHost, $proxyPort, $proxyUser, $proxyPass);
|
183 |
|
184 |
$this->setVerifyPeer($verifyPeer);
|
185 |
}
|
186 |
+
|
187 |
/**
|
188 |
* Set the basic (mandatory) settings for the requests
|
|
|
|
|
|
|
189 |
*
|
190 |
+
* @param string $spid
|
191 |
+
* The SPID of your account, supported by mPAY24
|
192 |
+
* @param string $password
|
193 |
+
* The flexLINK password, supported by mPAY24
|
194 |
+
* @param bool $test
|
195 |
+
* TRUE - when you want to use the TEST system
|
196 |
+
*
|
197 |
+
* FALSE - when you want to use the LIVE system
|
198 |
*/
|
199 |
public function configureFlexLINK($spid, $password, $test) {
|
200 |
/**
|
201 |
* An error message, that will be displayed to the user in case you are using the LIVE system
|
202 |
+
* @const LIVE_ERROR_MSG
|
203 |
*/
|
204 |
define('LIVE_ERROR_MSG', "We are sorry, an error occured - please contact the merchant!");
|
205 |
+
|
206 |
/**
|
207 |
* The current directory, where the script is runnig from
|
208 |
+
* @const __DIR__
|
209 |
*/
|
210 |
+
if(! defined('__DIR__'))
|
211 |
+
define('__DIR__', dirname(__FILE__));
|
212 |
+
|
213 |
$this->setSPID($spid);
|
214 |
$this->setPassword($password);
|
215 |
$this->setFlexLINKSystem($test);
|
216 |
}
|
217 |
+
|
218 |
/**
|
219 |
* Get the merchant ID, which was set by the function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort)
|
220 |
+
*
|
221 |
+
* @return string
|
222 |
*/
|
223 |
public function getMerchantID() {
|
224 |
return substr($this->merchantid, 1);
|
225 |
}
|
226 |
+
|
227 |
/**
|
228 |
* Get the SPID, which was set by the function configureFlexLINK($spid, $password, $test)
|
229 |
+
*
|
230 |
+
* @return string
|
231 |
*/
|
232 |
public function getSPID() {
|
233 |
return $this->spid;
|
234 |
}
|
235 |
+
|
236 |
/**
|
237 |
* Get the system, which should be used for flexLINK (test -> 'test' or live -> 'www')
|
238 |
+
*
|
239 |
+
* @return string
|
240 |
*/
|
241 |
public function getFlexLINKSystem() {
|
242 |
return $this->flexLINKSystem;
|
243 |
}
|
244 |
+
|
245 |
/**
|
246 |
* Get the url, where requests are going to be posted
|
247 |
+
*
|
248 |
+
* @return string
|
249 |
*/
|
250 |
public function getEtpURL() {
|
251 |
return $this->etp_url;
|
252 |
}
|
253 |
+
|
254 |
/**
|
255 |
* Get the request, which was sent to mPAY24 (in XML form)
|
256 |
+
*
|
257 |
+
* @return string
|
258 |
*/
|
259 |
public function getRequest() {
|
260 |
return $this->request;
|
261 |
}
|
262 |
+
|
263 |
/**
|
264 |
* Get the response from mPAY24 (in XML form)
|
265 |
+
*
|
266 |
+
* @return string
|
267 |
*/
|
268 |
public function getResponse() {
|
269 |
return $this->response;
|
270 |
}
|
271 |
+
|
272 |
/**
|
273 |
* Check whether a proxy is used
|
274 |
+
*
|
275 |
+
* @return bool
|
276 |
*/
|
277 |
public function proxyUsed() {
|
278 |
if($this->proxy_host != '' && $this->proxy_port != '')
|
280 |
else
|
281 |
return false;
|
282 |
}
|
283 |
+
|
284 |
/**
|
285 |
* Set debug modus (FALSE by default)
|
286 |
+
*
|
287 |
+
* @param bool $debug
|
288 |
+
* TRUE if is turned on, otherwise FALSE
|
289 |
*/
|
290 |
public function setDebug($debug) {
|
291 |
$this->debug = $debug;
|
292 |
}
|
293 |
+
|
294 |
/**
|
295 |
* Check whether the debug modus is turned on or off
|
296 |
+
*
|
297 |
+
* @return bool
|
298 |
*/
|
299 |
public function getDebug() {
|
300 |
return $this->debug;
|
301 |
}
|
302 |
+
|
303 |
/**
|
304 |
* In case the test system is used, show die with the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG
|
305 |
+
*
|
306 |
+
* @param string $msg
|
307 |
+
* The message, which is shown to the user
|
308 |
*/
|
309 |
+
public static function dieWithMsg($msg) {
|
310 |
+
if(isset($msg) && $msg != '')
|
311 |
die($msg);
|
312 |
else
|
313 |
die(LIVE_ERROR_MSG);
|
314 |
}
|
315 |
+
|
316 |
/**
|
317 |
* In case the test system is used, show print the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG
|
318 |
+
*
|
319 |
+
* @param string $msg
|
320 |
+
* The message, which is shown to the user
|
321 |
*/
|
322 |
public function printMsg($msg) {
|
323 |
if($this->test)
|
325 |
else
|
326 |
print(LIVE_ERROR_MSG);
|
327 |
}
|
328 |
+
|
329 |
/**
|
330 |
* Die with an error message, which show the path in case of read/write permission errors
|
331 |
*/
|
332 |
+
public static function permissionError() {
|
333 |
$errors = error_get_last();
|
334 |
$message = $errors['message'];
|
335 |
+
$path = substr($message, strpos($message, 'fopen(') + 6, strpos($message, ')') - (strpos($message, 'fopen(') + 6));
|
336 |
+
MPay24Api::dieWithMsg("Can't open file '$path'! Please set the needed read/write rights!");
|
337 |
}
|
338 |
+
|
339 |
/**
|
340 |
* Get all the payment methods, that are available for the merchant by mPAY24
|
341 |
+
*
|
342 |
+
* @return ListPaymentMethodsResponse
|
343 |
*/
|
344 |
public function ListPaymentMethods() {
|
345 |
$xml = $this->buildEnvelope();
|
346 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
347 |
+
|
348 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ListPaymentMethods');
|
349 |
$operation = $body->appendChild($operation);
|
350 |
+
|
351 |
$xmlMerchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
352 |
$xmlMerchantID = $operation->appendChild($xmlMerchantID);
|
353 |
+
|
354 |
+
$this->request = $xml->saveXML();
|
355 |
+
|
356 |
$this->send();
|
357 |
+
|
358 |
$result = new ListPaymentMethodsResponse($this->response);
|
359 |
+
|
360 |
return $result;
|
361 |
}
|
362 |
+
|
363 |
/**
|
364 |
* Start a secure payment through the mPAY24 payment window -
|
365 |
* the sensible data (credit card numbers, bank account numbers etc)
|
366 |
* is (will be) not saved in the shop
|
367 |
+
*
|
368 |
+
* @param ORDER $mdxi
|
369 |
+
* The mdxi xml, which contains the shopping cart
|
370 |
+
* @return PaymentResponse
|
371 |
*/
|
372 |
public function SelectPayment($mdxi) {
|
373 |
$xml = $this->buildEnvelope();
|
374 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
375 |
+
|
376 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:SelectPayment');
|
377 |
$operation = $body->appendChild($operation);
|
378 |
+
|
379 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
380 |
$merchantID = $operation->appendChild($merchantID);
|
381 |
+
|
382 |
$xmlMDXI = $xml->createElement('mdxi', htmlspecialchars($mdxi));
|
383 |
$xmlMDXI = $operation->appendChild($xmlMDXI);
|
384 |
+
|
385 |
$getDataURL = $xml->createElement('getDataURL', "dummy_getDataURL");
|
386 |
$getDataURL = $operation->appendChild($getDataURL);
|
387 |
+
|
388 |
$tid = $xml->createElement('tid', 'tid');
|
389 |
$tid = $operation->appendChild($tid);
|
390 |
+
|
391 |
+
$this->request = $xml->saveXML();
|
392 |
+
|
393 |
$this->send();
|
394 |
+
|
395 |
$result = new PaymentResponse($this->response);
|
396 |
+
|
397 |
return $result;
|
398 |
}
|
399 |
+
|
400 |
/**
|
401 |
* Start a secure payment using a PROFILE (mPAY24 proSAFE), supported by mPAY24 -
|
402 |
* a customer profile (you have already created) will be used for the payment.
|
403 |
* The payment window will not be called, the payment source (for example credit card),
|
404 |
* which was used from the customer by the last payment will be used for the transaction.
|
405 |
+
*
|
406 |
+
* @param ORDER $requestString
|
407 |
+
* The order xml, which contains the shopping cart
|
408 |
+
* @return PaymentResponse
|
409 |
*/
|
410 |
public function ProfilePayment($requestString) {
|
411 |
$xml = $this->buildEnvelope();
|
412 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
413 |
+
|
414 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:AcceptPayment');
|
415 |
$operation = $body->appendChild($operation);
|
416 |
+
|
417 |
$requestXML = new DOMDocument("1.0", "UTF-8");
|
418 |
$requestXML->formatOutput = true;
|
419 |
$requestXML->loadXML($requestString);
|
420 |
+
|
421 |
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
422 |
+
|
423 |
foreach($requestNode->childNodes as $child) {
|
424 |
$child = $xml->importNode($child, true);
|
425 |
$operation->appendChild($child);
|
426 |
+
|
427 |
+
if($child->nodeName == 'payment')
|
428 |
+
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:type', 'etp:PaymentPROFILE');
|
429 |
}
|
430 |
+
|
431 |
+
$this->request = $xml->saveXML();
|
432 |
+
|
433 |
+
$this->send();
|
434 |
+
|
435 |
+
$result = new PaymentResponse($this->response);
|
436 |
+
|
437 |
+
return $result;
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Start a secure payment using the mPAY24 Tokenizer.
|
442 |
+
*
|
443 |
+
* @param string $pType
|
444 |
+
* The payment type used for the tokenization (currently supported 'CC')
|
445 |
+
* @return PaymentTokenResponse
|
446 |
+
*/
|
447 |
+
public function CreateToken($pType) {
|
448 |
+
$xml = $this->buildEnvelope();
|
449 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
450 |
+
|
451 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:CreatePaymentToken');
|
452 |
+
$operation = $body->appendChild($operation);
|
453 |
+
|
454 |
+
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
455 |
+
$merchantID = $operation->appendChild($merchantID);
|
456 |
+
|
457 |
+
$pType = $xml->createElement('pType', $pType);
|
458 |
+
$pType = $operation->appendChild($pType);
|
459 |
+
|
460 |
+
$this->request = $xml->saveXML();
|
461 |
+
|
462 |
+
$this->send();
|
463 |
+
|
464 |
+
$result = new PaymentTokenResponse($this->response);
|
465 |
+
|
466 |
+
return $result;
|
467 |
+
}
|
468 |
+
|
469 |
+
/**
|
470 |
+
* Initialize a manual callback to mPAY24 in order to check the information provided by PayPal
|
471 |
+
*
|
472 |
+
* @param string $tid The TID used for the transaction
|
473 |
+
* @param string $amount The AMOUNT used for the transaction
|
474 |
+
* @param string $currency The CURRENCY used for the transaction
|
475 |
+
* @param string $token The TOKEN used for the transaction
|
476 |
+
* @return PaymentResponse
|
477 |
+
*/
|
478 |
+
public function PayWithToken($tid, $amount, $currency, $token) {
|
479 |
+
$xml = $this->buildEnvelope();
|
480 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
481 |
+
|
482 |
+
$operation = $xml->createElement('etp:AcceptPayment');
|
483 |
+
$operation = $body->appendChild($operation);
|
484 |
+
|
485 |
+
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
486 |
+
$merchantID = $operation->appendChild($merchantID);
|
487 |
|
488 |
+
$xmlTID = $xml->createElement('tid', $tid);
|
489 |
+
$xmlTID = $operation->appendChild($xmlTID);
|
490 |
+
|
491 |
+
$xmlPType = $xml->createElement('pType', "TOKEN");
|
492 |
+
$xmlPType = $operation->appendChild($xmlPType);
|
493 |
+
|
494 |
+
$xmlPayment = $xml->createElement('payment');
|
495 |
+
$xmlPayment = $operation->appendChild($xmlPayment);
|
496 |
+
$xmlPayment->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:type', 'etp:PaymentTOKEN');
|
497 |
+
|
498 |
+
$xmlAmount = $xml->createElement('amount', $amount);
|
499 |
+
$xmlAmount = $xmlPayment->appendChild($xmlAmount);
|
500 |
+
|
501 |
+
$xmlCurrency = $xml->createElement('currency', $currency);
|
502 |
+
$xmlCurrency = $xmlPayment->appendChild($xmlCurrency);
|
503 |
+
|
504 |
+
$xmlToken = $xml->createElement('token', $token);
|
505 |
+
$xmlToken = $xmlPayment->appendChild($xmlToken);
|
506 |
|
507 |
+
$this->request = $xml->saveXML();
|
508 |
+
|
509 |
$this->send();
|
510 |
+
|
511 |
$result = new PaymentResponse($this->response);
|
512 |
+
|
513 |
return $result;
|
514 |
}
|
515 |
+
|
516 |
/**
|
517 |
+
* Start an AcceptPayment transaction, supported by mPAY24.
|
518 |
+
*
|
519 |
+
* @param ORDER $requestString
|
520 |
+
* The order xml, which contains the shopping cart
|
521 |
+
* @param string $paymentType
|
522 |
+
* The payment type which will be used for the acceptpayment request (EPS, SOFORT, PAYPAL, MASTERPASS or TOKEN)
|
523 |
+
* @return PaymentResponse
|
524 |
+
*/
|
525 |
+
public function AcceptPayment($requestString, $paymentType) {
|
526 |
$xml = $this->buildEnvelope();
|
527 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
528 |
+
|
529 |
$operation = $xml->createElement('etp:AcceptPayment');
|
530 |
$operation = $body->appendChild($operation);
|
531 |
+
|
532 |
$requestXML = new DOMDocument("1.0", "UTF-8");
|
533 |
$requestXML->formatOutput = true;
|
534 |
$requestXML->loadXML($requestString);
|
535 |
+
|
536 |
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
537 |
+
|
538 |
foreach($requestNode->childNodes as $child) {
|
539 |
$child = $xml->importNode($child, true);
|
540 |
$operation->appendChild($child);
|
541 |
+
|
542 |
if($child->nodeName == 'payment')
|
543 |
+
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:type', "etp:Payment$paymentType");
|
544 |
}
|
545 |
+
|
546 |
+
$this->request = $xml->saveXML();
|
547 |
+
|
548 |
$this->send();
|
549 |
+
|
550 |
$result = new PaymentResponse($this->response);
|
551 |
+
|
552 |
return $result;
|
553 |
}
|
554 |
+
|
555 |
/**
|
556 |
* Initialize a manual callback to mPAY24 in order to check the information provided by PayPal
|
557 |
+
*
|
558 |
+
* @param string $requestString
|
559 |
+
* The callback request to mPAY24
|
560 |
+
* @param string $paymentType
|
561 |
+
* The payment type which will be used for the express checkout (PAYPAL or MASTERPASS)
|
562 |
+
* @return PaymentResponse
|
563 |
*/
|
564 |
+
public function Callback($requestString, $paymentType) {
|
565 |
$xml = $this->buildEnvelope();
|
566 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
567 |
+
|
568 |
$operation = $xml->createElement('etp:ManualCallback');
|
569 |
$operation = $body->appendChild($operation);
|
570 |
+
|
571 |
$requestXML = new DOMDocument("1.0", "UTF-8");
|
572 |
$requestXML->formatOutput = true;
|
573 |
$requestXML->loadXML($requestString);
|
574 |
+
|
575 |
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
576 |
+
|
577 |
foreach($requestNode->childNodes as $child) {
|
578 |
$child = $xml->importNode($child, true);
|
579 |
$operation->appendChild($child);
|
580 |
+
|
581 |
if($child->nodeName == 'paymentCallback')
|
582 |
+
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:type', "etp:Callback$paymentType");
|
583 |
}
|
584 |
+
|
585 |
+
$this->request = $xml->saveXML();
|
586 |
+
|
587 |
$this->send();
|
588 |
+
|
589 |
$result = new PaymentResponse($this->response);
|
590 |
+
|
591 |
return $result;
|
592 |
}
|
593 |
+
|
594 |
/**
|
595 |
* Clear a transaction with an amount
|
596 |
+
*
|
597 |
+
* @param int $mPAYTid
|
598 |
+
* The mPAY24 transaction ID
|
599 |
+
* @param int $amount
|
600 |
+
* The amount to be cleared multiplay by 100
|
601 |
+
* @param string $currency
|
602 |
+
* 3-digit ISO currency code: EUR, USD, etc
|
603 |
+
* @return ManagePaymentResponse
|
604 |
*/
|
605 |
public function ManualClear($mPAYTid, $amount, $currency) {
|
606 |
$xml = $this->buildEnvelope();
|
607 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
608 |
+
|
609 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualClear');
|
610 |
$operation = $body->appendChild($operation);
|
611 |
+
|
612 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
613 |
$merchantID = $operation->appendChild($merchantID);
|
614 |
+
|
615 |
$clearingDetails = $xml->createElement('clearingDetails');
|
616 |
$clearingDetails = $operation->appendChild($clearingDetails);
|
617 |
+
|
618 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
619 |
$xmlMPayTid = $clearingDetails->appendChild($xmlMPayTid);
|
620 |
+
|
621 |
$price = $xml->createElement('amount', $amount);
|
622 |
$price = $clearingDetails->appendChild($price);
|
623 |
+
|
624 |
+
$this->request = $xml->saveXML();
|
625 |
+
|
626 |
$this->send();
|
627 |
+
|
628 |
$result = new ManagePaymentResponse($this->response);
|
629 |
+
|
630 |
return $result;
|
631 |
}
|
632 |
+
|
633 |
/**
|
634 |
* Credit a transaction with an amount
|
635 |
+
*
|
636 |
+
* @param int $mPAYTid
|
637 |
+
* The mPAY24 transaction ID
|
638 |
+
* @param int $amount
|
639 |
+
* The amount to be credited multiplay by 100
|
640 |
+
* @param string $currency
|
641 |
+
* 3-digit ISO currency code: EUR, USD, etc
|
642 |
+
* @param string $customer
|
643 |
+
* The name of the customer, who has paid
|
644 |
+
* @return ManagePaymentResponse
|
645 |
*/
|
646 |
public function ManualCredit($mPAYTid, $amount, $currency, $customer) {
|
647 |
$xml = $this->buildEnvelope();
|
648 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
649 |
+
|
650 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualCredit');
|
651 |
$operation = $body->appendChild($operation);
|
652 |
+
|
653 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
654 |
$merchantID = $operation->appendChild($merchantID);
|
655 |
+
|
656 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
657 |
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
658 |
+
|
659 |
$price = $xml->createElement('amount', $amount);
|
660 |
$price = $operation->appendChild($price);
|
661 |
+
|
662 |
+
$this->request = $xml->saveXML();
|
663 |
+
|
664 |
$this->send();
|
665 |
+
|
666 |
$result = new ManagePaymentResponse($this->response);
|
667 |
+
|
668 |
return $result;
|
669 |
}
|
670 |
+
|
671 |
/**
|
672 |
* Cancel a transaction
|
673 |
+
*
|
674 |
+
* @param int $mPAYTid
|
675 |
+
* The mPAY24 transaction ID for the transaction you want to cancel
|
676 |
+
* @return ManagePaymentResponse
|
677 |
*/
|
678 |
public function ManualReverse($mPAYTid) {
|
679 |
$xml = $this->buildEnvelope();
|
680 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
681 |
+
|
682 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualReverse');
|
683 |
$operation = $body->appendChild($operation);
|
684 |
+
|
685 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
686 |
$merchantID = $operation->appendChild($merchantID);
|
687 |
+
|
688 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
689 |
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
690 |
+
|
691 |
+
$this->request = $xml->saveXML();
|
692 |
+
|
693 |
$this->send();
|
694 |
+
|
695 |
$result = new ManagePaymentResponse($this->response);
|
696 |
+
|
697 |
return $result;
|
698 |
}
|
699 |
+
|
700 |
/**
|
701 |
* Get all the information for a transaction, supported by mPAY24
|
702 |
+
*
|
703 |
+
* @param int $mPAYTid
|
704 |
+
* The mPAY24 transaction ID
|
705 |
+
* @param string $tid
|
706 |
+
* The transaction ID from your shop
|
707 |
+
* @return TransactionStatusResponse
|
708 |
*/
|
709 |
+
public function TransactionStatus($mPAYTid = null, $tid = null) {
|
710 |
$xml = $this->buildEnvelope();
|
711 |
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
712 |
+
|
713 |
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:TransactionStatus');
|
714 |
$operation = $body->appendChild($operation);
|
715 |
+
|
716 |
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
717 |
$merchantID = $operation->appendChild($merchantID);
|
718 |
+
|
719 |
if($mPAYTid) {
|
720 |
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
721 |
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
723 |
$xmlTid = $xml->createElement('tid', $tid);
|
724 |
$xmlTid = $operation->appendChild($xmlTid);
|
725 |
}
|
726 |
+
|
727 |
+
$this->request = $xml->saveXML();
|
728 |
+
|
729 |
$this->send();
|
730 |
+
|
731 |
$result = new TransactionStatusResponse($this->response);
|
732 |
+
|
733 |
return $result;
|
734 |
}
|
735 |
+
|
736 |
/**
|
737 |
* Encoded the parameters (AES256-CBC) for the pay link and retunr them
|
738 |
+
*
|
739 |
+
* @param array $params
|
740 |
+
* The parameters, which are going to be posted to mPAY24
|
741 |
+
* @return string
|
742 |
*/
|
743 |
public function flexLINK($params) {
|
744 |
$paramsString = "";
|
745 |
+
|
746 |
foreach($params as $key => $value)
|
747 |
$paramsString .= "$key=$value&";
|
748 |
+
|
749 |
$encryptedParams = $this->ssl_encrypt($this->pass, $paramsString);
|
750 |
+
|
751 |
return $encryptedParams;
|
752 |
}
|
753 |
+
|
754 |
/**
|
755 |
* Set the merchant ID (without 'u')
|
756 |
+
*
|
757 |
+
* @param string $merchantID
|
758 |
+
* The merchant ID
|
759 |
*/
|
760 |
+
private function setMerchantID($merchantID = null) {
|
761 |
+
if($merchantID == null)
|
762 |
$this->merchantid = 'u' . MERCHANT_ID;
|
763 |
else
|
764 |
$this->merchantid = 'u' . $merchantID;
|
765 |
}
|
766 |
+
|
767 |
/**
|
768 |
* Set the SPID, in order to make flexLINK transactions
|
769 |
+
*
|
770 |
+
* @param string $spid
|
771 |
+
* The SPID of your account, supported by mPAY24
|
772 |
*/
|
773 |
private function setSPID($spid) {
|
774 |
$this->spid = $spid;
|
775 |
}
|
776 |
+
|
777 |
/**
|
778 |
* Set the Web-Services/SOAP password
|
779 |
+
*
|
780 |
+
* @param string $pass
|
781 |
+
* The SOAP password, provided by mPAY24
|
782 |
*/
|
783 |
+
private function setSoapPassword($pass = null) {
|
784 |
if(defined("SOAP_PASSWORD"))
|
785 |
$this->soappass = SOAP_PASSWORD;
|
786 |
else
|
787 |
$this->soappass = $pass;
|
788 |
}
|
789 |
+
|
790 |
/**
|
791 |
* Set the flexLINK password
|
792 |
+
*
|
793 |
+
* @param string $pass
|
794 |
+
* The flexLINK password, provided by mPAY24
|
795 |
*/
|
796 |
private function setPassword($pass) {
|
797 |
$this->pass = $pass;
|
798 |
}
|
799 |
+
|
800 |
/**
|
801 |
* Set whether the tets system (true) or the live system (false) will be used for the SOAP requests
|
802 |
* Set the POST url
|
804 |
* ("https://test.mpay24.com/app/bin/etpproxy_v14" or
|
805 |
*
|
806 |
* "https://www.mpay24.com/app/bin/etpproxy_v14")
|
|
|
807 |
*
|
808 |
+
* @param bool $test
|
809 |
+
* TRUE for TEST system and FALSE for LIVE system.
|
810 |
+
*
|
811 |
*/
|
812 |
+
private function setSystem($test = null) {
|
813 |
if($test) {
|
814 |
$this->test = true;
|
815 |
$this->etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";
|
816 |
+
} else {
|
817 |
+
$this->test = false;
|
818 |
+
$this->etp_url = "https://www.mpay24.com/app/bin/etpproxy_v15";
|
819 |
+
}
|
820 |
}
|
821 |
+
|
|
|
822 |
/**
|
823 |
* Set whether the tets system (true) or the live system (false) will be used for the flexLINK requests
|
824 |
+
*
|
825 |
+
* @param bool $test
|
826 |
+
* TRUE for TEST system and FALSE for LIVE system.
|
827 |
*/
|
828 |
+
private function setFlexLINKSystem($test = null) {
|
829 |
if($test)
|
830 |
$this->flexLINKSystem = "test";
|
831 |
else
|
832 |
$this->flexLINKSystem = "www";
|
833 |
}
|
834 |
+
|
835 |
/**
|
836 |
* Set the used proxy host and proxy port in case proxy is used
|
837 |
+
*
|
838 |
+
* @param string $proxy_host
|
839 |
+
* Proxy host
|
840 |
+
* @param string $proxy_port
|
841 |
+
* Proxy port
|
842 |
+
* @param string $proxy_user
|
843 |
+
* Proxy user
|
844 |
+
* @param string $proxy_pass
|
845 |
+
* Proxy pass
|
846 |
+
*/
|
847 |
+
private function setProxySettings($proxy_host = "", $proxy_port = "", $proxy_user = "", $proxy_pass = "") {
|
848 |
if($proxy_host != "" && $proxy_port != "") {
|
849 |
$this->proxy_host = $proxy_host;
|
850 |
$this->proxy_port = $proxy_port;
|
858 |
|
859 |
/**
|
860 |
* Set whether to stop cURL from verifying the peer's certificate
|
861 |
+
*
|
862 |
+
* @param bool $verify_peer
|
863 |
+
* Set as FALSE to stop cURL from verifying the peer's certificate
|
864 |
*/
|
865 |
private function setVerifyPeer($verify_peer) {
|
866 |
$this->verify_peer = $verify_peer;
|
867 |
}
|
868 |
+
|
869 |
/**
|
870 |
* Create a DOMDocument and prepare it for SOAP request:
|
871 |
* set Envelope, NameSpaces, create empty Body
|
872 |
+
*
|
873 |
+
* @return DOMDocument
|
874 |
*/
|
875 |
private function buildEnvelope() {
|
876 |
$this->soap_xml = new DOMDocument("1.0", "UTF-8");
|
877 |
$this->soap_xml->formatOutput = true;
|
878 |
+
|
879 |
$envelope = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Envelope');
|
880 |
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
881 |
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:etp', 'https://www.mpay24.com/soap/etp/1.5/ETP.wsdl');
|
882 |
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
883 |
$envelope = $this->soap_xml->appendChild($envelope);
|
884 |
+
|
885 |
$body = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Body');
|
886 |
$body = $envelope->appendChild($body);
|
887 |
+
|
888 |
return $this->soap_xml;
|
889 |
}
|
890 |
+
|
891 |
/**
|
892 |
* Create a curl request and send the cretaed SOAP XML
|
893 |
*/
|
894 |
private function send() {
|
895 |
+
$userAgent = 'mPAY24 PHP API $Rev: 6231 $ ($Date:: 2015-03-13 #$)';
|
896 |
+
|
897 |
if($this->shop != '') {
|
898 |
$userAgent = $this->shop;
|
899 |
+
|
900 |
if($this->shopVersion != '')
|
901 |
$userAgent .= " v. " . $this->shopVersion;
|
902 |
if($this->shopVersion != '')
|
903 |
$userAgent .= " - Module v. " . $this->moduleVersion;
|
904 |
}
|
905 |
+
|
906 |
$ch = curl_init($this->etp_url);
|
907 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
908 |
curl_setopt($ch, CURLOPT_POST, 1);
|
909 |
+
curl_setopt($ch, CURLOPT_USERPWD, "$this->merchantid:$this->soappass");
|
910 |
+
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
|
911 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->request);
|
912 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
913 |
+
|
914 |
if($this->debug) {
|
915 |
+
$fh = fopen(Mage::getBaseDir('code') . "/../../var/log/mpay24/curllog.log", 'a+') or $this->permissionError();
|
916 |
+
|
917 |
curl_setopt($ch, CURLOPT_VERBOSE, 1);
|
918 |
curl_setopt($ch, CURLOPT_STDERR, $fh);
|
919 |
}
|
920 |
+
|
921 |
try {
|
922 |
+
curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . '/cacert.pem');
|
923 |
+
|
924 |
if($this->proxy_host !== '' && $this->proxy_port !== '') {
|
925 |
+
curl_setopt($ch, CURLOPT_PROXY, $this->proxy_host . ':' . $this->proxy_port);
|
926 |
|
927 |
if($this->proxy_user !== '' && $this->proxy_pass !== '')
|
928 |
+
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxy_user . ':' . $this->proxy_pass);
|
929 |
|
930 |
if($this->verify_peer !== true)
|
931 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
|
932 |
}
|
933 |
+
|
934 |
$this->response = curl_exec($ch);
|
935 |
curl_close($ch);
|
936 |
+
|
937 |
if($this->debug)
|
938 |
fclose($fh);
|
939 |
+
} catch(Exception $e) {
|
940 |
if($this->test)
|
941 |
+
$dieMSG = "Your request couldn't be sent because of the following error:" . "\n" . curl_error($ch) . "\n" . $e->getMessage() . ' in ' . $e->getFile() . ', line: ' . $e->getLine() . '.';
|
|
|
|
|
|
|
|
|
942 |
else
|
943 |
$dieMSG = LIVE_ERROR_MSG;
|
944 |
+
|
945 |
echo $dieMSG;
|
946 |
}
|
947 |
}
|
948 |
+
|
949 |
/**
|
950 |
* Encode data (AES256-CBC) using a password
|
951 |
+
*
|
952 |
+
* @param string $pass
|
953 |
+
* The password, used for the encoding
|
954 |
+
* @param string $data
|
955 |
+
* The data, that should be encoded
|
956 |
+
* @return string
|
957 |
*/
|
958 |
private function ssl_encrypt($pass, $data) {
|
959 |
// Set a random salt
|
960 |
$salt = substr(md5(mt_rand(), true), 8);
|
961 |
+
|
962 |
$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
|
963 |
$pad = $block - (strlen($data) % $block);
|
964 |
+
|
965 |
$data = $data . str_repeat(chr($pad), $pad);
|
966 |
+
|
967 |
// Setup encryption parameters
|
968 |
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, "", MCRYPT_MODE_CBC, "");
|
969 |
+
|
970 |
+
$key_len = mcrypt_enc_get_key_size($td);
|
971 |
+
$iv_len = mcrypt_enc_get_iv_size($td);
|
972 |
+
|
973 |
$total_len = $key_len + $iv_len;
|
974 |
$salted = '';
|
975 |
$dx = '';
|
976 |
+
|
977 |
// Salt the key and iv
|
978 |
+
while(strlen($salted) < $total_len) {
|
979 |
+
$dx = md5($dx . $pass . $salt, true);
|
980 |
$salted .= $dx;
|
981 |
}
|
982 |
+
|
983 |
+
$key = substr($salted, 0, $key_len);
|
984 |
+
$iv = substr($salted, $key_len, $iv_len);
|
985 |
+
|
986 |
mcrypt_generic_init($td, $key, $iv);
|
987 |
$encrypted_data = mcrypt_generic($td, $data);
|
988 |
mcrypt_generic_deinit($td);
|
989 |
mcrypt_module_close($td);
|
990 |
+
|
991 |
+
return chunk_split(array_shift( unpack('H*', 'Salted__' . $salt . $encrypted_data)), 32, "\r\n");
|
992 |
}
|
993 |
}
|
994 |
|
995 |
/**
|
996 |
* The GeneralResponse class contains the status of a response and return code, which was delivered by mPAY24 as an answer of your request
|
997 |
*
|
998 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
999 |
+
* @version $Id: MPay24Api.php 6231 2015-03-13 16:29:56Z anna $
|
1000 |
+
* @filesource MPay24Api.php
|
1001 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
1002 |
*/
|
1003 |
class GeneralResponse {
|
1004 |
/**
|
1005 |
* The status of the request, which was sent to mPAY24
|
1006 |
+
*
|
1007 |
+
* @var string
|
1008 |
*/
|
1009 |
var $status;
|
1010 |
/**
|
1011 |
* The return code from the request, which was sent to mPAY24
|
1012 |
+
*
|
1013 |
+
* @var string
|
1014 |
*/
|
1015 |
var $returnCode;
|
1016 |
+
|
1017 |
/**
|
1018 |
* Sets the basic values from the response from mPAY24: status and return code
|
1019 |
+
*
|
1020 |
+
* @param string $response
|
1021 |
+
* The SOAP response from mPAY24 (in XML form)
|
1022 |
*/
|
1023 |
function GeneralResponse($response) {
|
1024 |
if($response != '') {
|
1025 |
$responseAsDOM = new DOMDocument();
|
1026 |
$responseAsDOM->loadXML($response);
|
1027 |
+
|
1028 |
+
if(! empty($responseAsDOM) && is_object($responseAsDOM))
|
1029 |
+
if(! $responseAsDOM || $responseAsDOM->getElementsByTagName('status')->length == 0 || $responseAsDOM->getElementsByTagName('returnCode')->length == 0) {
|
1030 |
+
$this->status = "ERROR";
|
1031 |
+
$this->returnCode = urldecode($response);
|
1032 |
} else {
|
1033 |
+
$this->status = $responseAsDOM->getElementsByTagName('status')->item(0)->nodeValue;
|
1034 |
+
$this->returnCode = $responseAsDOM->getElementsByTagName('returnCode')->item(0)->nodeValue;
|
1035 |
}
|
1036 |
} else {
|
1037 |
+
$this->status = "ERROR";
|
1038 |
+
$this->returnCode = "The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!";
|
1039 |
}
|
1040 |
}
|
1041 |
+
|
1042 |
/**
|
1043 |
* Get the status of the request, which was sent to mPAY24
|
1044 |
+
*
|
1045 |
+
* @return string
|
1046 |
*/
|
1047 |
public function getStatus() {
|
1048 |
return $this->status;
|
1049 |
}
|
1050 |
+
|
1051 |
/**
|
1052 |
* Get the return code from the request, which was sent to mPAY24
|
1053 |
+
*
|
1054 |
+
* @return string
|
1055 |
*/
|
1056 |
public function getReturnCode() {
|
1057 |
return $this->returnCode;
|
1058 |
}
|
1059 |
+
|
1060 |
/**
|
1061 |
* Set the status in the response, which was delivered by mPAY24
|
1062 |
+
*
|
1063 |
+
* @param string $status
|
1064 |
+
* Status
|
1065 |
*/
|
1066 |
public function setStatus($status) {
|
1067 |
$this->status = $status;
|
1068 |
}
|
1069 |
+
|
1070 |
/**
|
1071 |
* Set the return code in the response, which was delivered by mPAY24
|
1072 |
+
*
|
1073 |
+
* @param string $returnCode
|
1074 |
+
* Return code
|
1075 |
*/
|
1076 |
public function setReturnCode($returnCode) {
|
1077 |
return $this->returnCode = $returnCode;
|
1081 |
/**
|
1082 |
* The PaymentResponse class contains a generalResponse object and the location(URL), which will be used for the payment session
|
1083 |
*
|
1084 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
1085 |
+
* @version $Id: MPay24Api.php 6231 2015-03-13 16:29:56Z anna $
|
1086 |
+
* @filesource MPay24Api.php
|
1087 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
1088 |
*/
|
1089 |
class PaymentResponse extends GeneralResponse {
|
1090 |
/**
|
1091 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
1092 |
+
*
|
1093 |
+
* @var string
|
1094 |
*/
|
1095 |
var $generalResponse;
|
1096 |
/**
|
1097 |
* An URL (of the mPAY24 payment fenster), where the customer would be redirected to, in case of successfull request
|
1098 |
+
*
|
1099 |
+
* @var string
|
1100 |
*/
|
1101 |
var $location;
|
1102 |
+
/**
|
1103 |
+
* The unique ID returned by mPAY24 for every transaction
|
1104 |
+
*
|
1105 |
+
* @var string
|
1106 |
+
*/
|
1107 |
+
var $mpayTID;
|
1108 |
+
|
1109 |
/**
|
1110 |
* Sets the values for a payment from the response from mPAY24: mPAY transaction ID, error number and location (URL)
|
1111 |
+
*
|
1112 |
+
* @param string $response
|
1113 |
+
* The SOAP response from mPAY24 (in XML form)
|
1114 |
*/
|
1115 |
function PaymentResponse($response) {
|
1116 |
$this->generalResponse = new GeneralResponse($response);
|
1117 |
+
|
1118 |
if($response != '') {
|
1119 |
$responseAsDOM = new DOMDocument();
|
1120 |
$responseAsDOM->loadXML($response);
|
1121 |
+
|
1122 |
+
if(! empty($responseAsDOM) && is_object($responseAsDOM) && $responseAsDOM->getElementsByTagName('location')->length != 0)
|
1123 |
+
$this->location = $responseAsDOM->getElementsByTagName('location')->item(0)->nodeValue;
|
1124 |
+
if(! empty($responseAsDOM) && is_object($responseAsDOM) && $responseAsDOM->getElementsByTagName('mpayTID')->length != 0)
|
1125 |
+
$this->mpayTID = $responseAsDOM->getElementsByTagName('mpayTID')->item(0)->nodeValue;
|
1126 |
} else {
|
1127 |
$this->generalResponse->setStatus("ERROR");
|
1128 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
1129 |
}
|
1130 |
}
|
1131 |
+
|
1132 |
/**
|
1133 |
* Get the location (URL), returned from mPAY24
|
1134 |
+
*
|
1135 |
+
* @return string
|
1136 |
*/
|
1137 |
+
public function getLocation() {
|
1138 |
return $this->location;
|
1139 |
}
|
1140 |
+
|
1141 |
+
/**
|
1142 |
+
* Get the unique ID, returned from mPAY24
|
1143 |
+
*
|
1144 |
+
* @return string
|
1145 |
+
*/
|
1146 |
+
public function getMpayTID() {
|
1147 |
+
return $this->mpayTID;
|
1148 |
+
}
|
1149 |
+
|
1150 |
/**
|
1151 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
1152 |
+
*
|
1153 |
+
* @return string
|
1154 |
*/
|
1155 |
+
public function getGeneralResponse() {
|
1156 |
return $this->generalResponse;
|
1157 |
}
|
1158 |
}
|
1159 |
|
1160 |
+
class PaymentTokenResponse extends PaymentResponse {
|
1161 |
+
/**
|
1162 |
+
* An object, that represents the basic payment values from the response from mPAY24: status, return code and location
|
1163 |
+
*
|
1164 |
+
* @var string
|
1165 |
+
*/
|
1166 |
+
var $paymentResponse;
|
1167 |
+
/**
|
1168 |
+
* The token, got back from mPAY24, which will be used for the actual payment
|
1169 |
+
*
|
1170 |
+
* @var string
|
1171 |
+
*/
|
1172 |
+
var $token;
|
1173 |
+
|
1174 |
+
/**
|
1175 |
+
* The api key, got back from mPAY24, which will be used for the actual payment
|
1176 |
+
*
|
1177 |
+
* @var string
|
1178 |
+
*/
|
1179 |
+
var $apiKey;
|
1180 |
+
|
1181 |
+
/**
|
1182 |
+
* Sets the values for a payment from the response from mPAY24: mPAY transaction ID, error number, location (URL), token and apiKey
|
1183 |
+
*
|
1184 |
+
* @param string $response
|
1185 |
+
* The SOAP response from mPAY24 (in XML form)
|
1186 |
+
*/
|
1187 |
+
function PaymentTokenResponse($response) {
|
1188 |
+
$this->paymentResponse = new PaymentResponse($response);
|
1189 |
+
|
1190 |
+
if($response != '') {
|
1191 |
+
$responseAsDOM = new DOMDocument();
|
1192 |
+
$responseAsDOM->loadXML($response);
|
1193 |
+
|
1194 |
+
if(! empty($responseAsDOM) && is_object($responseAsDOM) && $responseAsDOM->getElementsByTagName('token')->length != 0)
|
1195 |
+
$this->token = $responseAsDOM->getElementsByTagName('token')->item(0)->nodeValue;
|
1196 |
+
if(! empty($responseAsDOM) && is_object($responseAsDOM) && $responseAsDOM->getElementsByTagName('apiKey')->length != 0)
|
1197 |
+
$this->apiKey = $responseAsDOM->getElementsByTagName('apiKey')->item(0)->nodeValue;
|
1198 |
+
} else {
|
1199 |
+
$this->paymentResponse->generalResponse->setStatus("ERROR");
|
1200 |
+
$this->paymentResponse->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
1201 |
+
}
|
1202 |
+
}
|
1203 |
+
|
1204 |
+
/**
|
1205 |
+
* Get the token, returned from mPAY24
|
1206 |
+
*
|
1207 |
+
* @return string
|
1208 |
+
*/
|
1209 |
+
public function getToken() {
|
1210 |
+
return $this->token;
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
/**
|
1214 |
+
* Get the api key, returned from mPAY24
|
1215 |
+
*
|
1216 |
+
* @return string
|
1217 |
+
*/
|
1218 |
+
public function getApiKey() {
|
1219 |
+
return $this->apiKey;
|
1220 |
+
}
|
1221 |
+
|
1222 |
+
/**
|
1223 |
+
* Get the object, that contains the basic payment values from the response from mPAY24: status, return code and location
|
1224 |
+
*
|
1225 |
+
* @return string
|
1226 |
+
*/
|
1227 |
+
public function getPaymentResponse() {
|
1228 |
+
return $this->paymentResponse;
|
1229 |
+
}
|
1230 |
+
}
|
1231 |
+
|
1232 |
/**
|
1233 |
* The ManagePaymentResponse class contains a generalResponse object and the mPAYTID and/or tid of the transaction which was managed
|
1234 |
*
|
1235 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
1236 |
+
* @version $Id: MPay24Api.php 6231 2015-03-13 16:29:56Z anna $
|
1237 |
+
* @filesource MPay24Api.php
|
1238 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
1239 |
*/
|
1240 |
class ManagePaymentResponse extends GeneralResponse {
|
1241 |
/**
|
1242 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
1243 |
+
*
|
1244 |
+
* @var string
|
1245 |
*/
|
1246 |
var $generalResponse;
|
1247 |
/**
|
1248 |
* The mPAY transaction ID
|
1249 |
+
*
|
1250 |
+
* @var string
|
1251 |
*/
|
1252 |
var $mpayTID;
|
1253 |
/**
|
1254 |
* The transaction ID of the shop
|
1255 |
+
*
|
1256 |
+
* @var string
|
1257 |
*/
|
1258 |
var $tid;
|
1259 |
+
|
1260 |
/**
|
1261 |
* Sets the values for a payment from the response from mPAY24: mPAY transaction IDand transaction ID from the shop
|
1262 |
+
*
|
1263 |
+
* @param string $response
|
1264 |
+
* The SOAP response from mPAY24 (in XML form)
|
1265 |
*/
|
1266 |
function ManagePaymentResponse($response) {
|
1267 |
$this->generalResponse = new GeneralResponse($response);
|
1268 |
+
|
1269 |
if($response != '') {
|
1270 |
$responseAsDOM = new DOMDocument();
|
1271 |
$responseAsDOM->loadXML($response);
|
1272 |
+
|
1273 |
if($responseAsDOM && $responseAsDOM->getElementsByTagName('mpayTID')->length != 0 && $responseAsDOM->getElementsByTagName('tid')->length != 0) {
|
1274 |
+
$this->mpayTID = $responseAsDOM->getElementsByTagName('mpayTID')->item(0)->nodeValue;
|
1275 |
+
$this->tid = $responseAsDOM->getElementsByTagName('tid')->item(0)->nodeValue;
|
1276 |
}
|
1277 |
} else {
|
1278 |
$this->generalResponse->setStatus("ERROR");
|
1279 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
1280 |
}
|
1281 |
}
|
1282 |
+
|
1283 |
/**
|
1284 |
* Get the mPAY transaction ID, returned from mPAY24
|
1285 |
+
*
|
1286 |
+
* @return string
|
1287 |
*/
|
1288 |
public function getMpayTID() {
|
1289 |
return $this->mpayTID;
|
1290 |
}
|
1291 |
+
|
1292 |
/**
|
1293 |
* Get the transaction ID of the shop, returned from mPAY24
|
1294 |
+
*
|
1295 |
+
* @return string
|
1296 |
*/
|
1297 |
public function getTid() {
|
1298 |
return $this->tid;
|
1299 |
}
|
1300 |
+
|
1301 |
/**
|
1302 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
1303 |
+
*
|
1304 |
+
* @return string
|
1305 |
*/
|
1306 |
public function getGeneralResponse() {
|
1307 |
return $this->generalResponse;
|
1311 |
/**
|
1312 |
* The ListPaymentMethodsResponse class contains a generalResponse object and all the needed informarion for the active payment mothods (payment methods count, payment types, brands and descriptions)
|
1313 |
*
|
1314 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
1315 |
+
* @version $Id: MPay24Api.php 6231 2015-03-13 16:29:56Z anna $
|
1316 |
+
* @filesource MPay24Api.php
|
1317 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
1318 |
*/
|
1319 |
class ListPaymentMethodsResponse extends GeneralResponse {
|
1320 |
/**
|
1321 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
1322 |
+
*
|
1323 |
+
* @var string
|
1324 |
*/
|
1325 |
var $generalResponse;
|
1326 |
/**
|
1327 |
* The count of the payment methods, which are activated by mPAY24
|
1328 |
+
*
|
1329 |
+
* @var int
|
1330 |
*/
|
1331 |
+
var $all = 0;
|
1332 |
/**
|
1333 |
* A list with the payment types, activated by mPAY24
|
1334 |
+
*
|
1335 |
+
* @var array
|
1336 |
*/
|
1337 |
+
var $pTypes = array();
|
1338 |
/**
|
1339 |
* A list with the brands, activated by mPAY24
|
1340 |
+
*
|
1341 |
+
* @var array
|
1342 |
*/
|
1343 |
+
var $brands = array();
|
1344 |
/**
|
1345 |
* A list with the descriptions of the payment methods, activated by mPAY24
|
1346 |
+
*
|
1347 |
+
* @var array
|
1348 |
*/
|
1349 |
+
var $descriptions = array();
|
1350 |
+
|
1351 |
/**
|
1352 |
* A list with the IDs of the payment methods, activated by mPAY24
|
1353 |
+
*
|
1354 |
+
* @var array
|
1355 |
*/
|
1356 |
+
var $pMethIds = array();
|
1357 |
+
|
1358 |
/**
|
1359 |
* Sets the values for a payment from the response from mPAY24: count, payment types, brands and descriptions
|
1360 |
+
*
|
1361 |
+
* @param string $response
|
1362 |
+
* The SOAP response from mPAY24 (in XML form)
|
1363 |
*/
|
1364 |
function ListPaymentMethodsResponse($response) {
|
1365 |
$this->generalResponse = new GeneralResponse($response);
|
1366 |
+
|
1367 |
if($response != '') {
|
1368 |
$responseAsDOM = new DOMDocument();
|
1369 |
$responseAsDOM->loadXML($response);
|
1370 |
+
|
1371 |
if($responseAsDOM && $responseAsDOM->getElementsByTagName('all')->length != 0) {
|
1372 |
+
$this->all = $responseAsDOM->getElementsByTagName('all')->item(0)->nodeValue;
|
1373 |
+
|
1374 |
+
for($i = 0; $i < $this->all; $i ++) {
|
1375 |
$this->pTypes[$i] = $responseAsDOM->getElementsByTagName('pType')->item($i)->nodeValue;
|
1376 |
$this->brands[$i] = $responseAsDOM->getElementsByTagName('brand')->item($i)->nodeValue;
|
1377 |
$this->descriptions[$i] = $responseAsDOM->getElementsByTagName('description')->item($i)->nodeValue;
|
1383 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
1384 |
}
|
1385 |
}
|
1386 |
+
|
1387 |
/**
|
1388 |
* Get the count of the payment methods, returned from mPAY24
|
1389 |
+
*
|
1390 |
+
* @return int
|
1391 |
*/
|
1392 |
public function getAll() {
|
1393 |
return $this->all;
|
1394 |
}
|
1395 |
+
|
1396 |
/**
|
1397 |
* Get the payment types, returned from mPAY24
|
1398 |
+
*
|
1399 |
+
* @return array
|
1400 |
*/
|
1401 |
public function getPTypes() {
|
1402 |
return $this->pTypes;
|
1403 |
}
|
1404 |
+
|
1405 |
/**
|
1406 |
* Get the brands, returned from mPAY24
|
1407 |
+
*
|
1408 |
+
* @return array
|
1409 |
*/
|
1410 |
public function getBrands() {
|
1411 |
return $this->brands;
|
1412 |
}
|
1413 |
+
|
1414 |
/**
|
1415 |
* Get the descriptions, returned from mPAY24
|
1416 |
+
*
|
1417 |
+
* @return array
|
1418 |
*/
|
1419 |
public function getDescriptions() {
|
1420 |
return $this->descriptions;
|
1421 |
}
|
1422 |
+
|
1423 |
/**
|
1424 |
* Get the payment method IDs, returned from mPAY24
|
1425 |
+
*
|
1426 |
+
* @return array
|
1427 |
*/
|
1428 |
public function getPMethIDs() {
|
1429 |
return $this->pMethIds;
|
1430 |
}
|
1431 |
+
|
1432 |
/**
|
1433 |
* Get payment type, returned from mPAY24
|
1434 |
+
*
|
1435 |
+
* @param int $i
|
1436 |
+
* The index of a payment type
|
1437 |
+
* @return string
|
1438 |
*/
|
1439 |
public function getPType($i) {
|
1440 |
return $this->pTypes[$i];
|
1441 |
}
|
1442 |
+
|
1443 |
/**
|
1444 |
* Get brand, returned from mPAY24
|
1445 |
+
*
|
1446 |
+
* @param int $i
|
1447 |
+
* The index of a brand
|
1448 |
+
* @return string
|
1449 |
*/
|
1450 |
public function getBrand($i) {
|
1451 |
return $this->brands[$i];
|
1452 |
}
|
1453 |
+
|
1454 |
/**
|
1455 |
* Get description, returned from mPAY24
|
1456 |
+
*
|
1457 |
+
* @param int $i
|
1458 |
+
* The index of a description
|
1459 |
+
* @return string
|
1460 |
*/
|
1461 |
public function getDescription($i) {
|
1462 |
return $this->descriptions[$i];
|
1463 |
}
|
1464 |
+
|
1465 |
/**
|
1466 |
* Get payment method ID, returned from mPAY24
|
1467 |
+
*
|
1468 |
+
* @param int $i
|
1469 |
+
* The index of an payment method ID
|
1470 |
+
* @return int
|
1471 |
*/
|
1472 |
public function getPMethID($i) {
|
1473 |
return $this->pMethIds[$i];
|
1474 |
}
|
1475 |
+
|
1476 |
/**
|
1477 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
1478 |
+
*
|
1479 |
+
* @return string
|
1480 |
*/
|
1481 |
public function getGeneralResponse() {
|
1482 |
return $this->generalResponse;
|
1486 |
/**
|
1487 |
* The TransactionStatusResponse class contains a generalResponse object and all the parameters, returned with the confirmation from mPAY24
|
1488 |
*
|
1489 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
1490 |
+
* @version $Id: MPay24Api.php 6231 2015-03-13 16:29:56Z anna $
|
1491 |
+
* @filesource MPay24Api.php
|
1492 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
1493 |
*/
|
1494 |
class TransactionStatusResponse extends GeneralResponse {
|
1495 |
/**
|
1496 |
* An object, that represents the basic values from the response from mPAY24: status and return code
|
1497 |
+
*
|
1498 |
+
* @var string
|
1499 |
*/
|
1500 |
var $generalResponse;
|
1501 |
/**
|
1502 |
* A list with all the parameters for a transaction
|
1503 |
+
*
|
1504 |
+
* @var array
|
1505 |
*/
|
1506 |
+
var $params = array();
|
1507 |
/**
|
1508 |
* The count of all the paramerters for a transaction
|
1509 |
+
*
|
1510 |
+
* @var int
|
1511 |
*/
|
1512 |
+
var $paramCount = 0;
|
1513 |
+
|
1514 |
/**
|
1515 |
* Sets the values for a transaction from the response from mPAY24: STATUS, PRICE, CURRENCY, LANGUAGE, etc
|
1516 |
+
*
|
1517 |
+
* @param string $response
|
1518 |
+
* The SOAP response from mPAY24 (in XML form)
|
1519 |
*/
|
1520 |
function TransactionStatusResponse($response) {
|
1521 |
$this->generalResponse = new GeneralResponse($response);
|
1522 |
+
|
1523 |
if($response != '') {
|
1524 |
$responseAsDOM = new DOMDocument();
|
1525 |
$responseAsDOM->loadXML($response);
|
1526 |
+
|
1527 |
if($responseAsDOM && $responseAsDOM->getElementsByTagName('name')->length != 0) {
|
1528 |
$this->paramCount = $responseAsDOM->getElementsByTagName('name')->length;
|
1529 |
$this->params['STATUS'] = $this->generalResponse->getStatus();
|
1530 |
+
|
1531 |
+
for($i = 0; $i < $this->paramCount; $i ++) {
|
1532 |
if($responseAsDOM->getElementsByTagName("name")->item($i)->nodeValue == "STATUS")
|
1533 |
$this->params["TSTATUS"] = $responseAsDOM->getElementsByTagName("value")->item($i)->nodeValue;
|
1534 |
else
|
1535 |
+
$this->params[$responseAsDOM->getElementsByTagName('name')->item($i)->nodeValue] = $responseAsDOM->getElementsByTagName('value')->item($i)->nodeValue;
|
|
|
1536 |
}
|
1537 |
}
|
1538 |
} else {
|
1540 |
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
1541 |
}
|
1542 |
}
|
1543 |
+
|
1544 |
/**
|
1545 |
* Get the count of all the paramerters for a transaction
|
1546 |
+
*
|
1547 |
+
* @return int
|
1548 |
*/
|
1549 |
public function getParamCount() {
|
1550 |
return $this->paramCount;
|
1551 |
}
|
1552 |
+
|
1553 |
/**
|
1554 |
* Get the parameters for a transaction, returned from mPAY24
|
1555 |
+
*
|
1556 |
+
* @return array
|
1557 |
*/
|
1558 |
public function getParams() {
|
1559 |
return $this->params;
|
1560 |
}
|
1561 |
+
|
1562 |
/**
|
1563 |
* Get the parameter's value, returned from mPAY24
|
1564 |
+
*
|
1565 |
+
* @param string $i
|
1566 |
+
* The name of a parameter (for example: STATUS, PRICE, CURRENCY, etc)
|
1567 |
+
* @return array
|
1568 |
*/
|
1569 |
public function getParam($i) {
|
1570 |
if(isset($this->params[$i]))
|
1572 |
else
|
1573 |
return false;
|
1574 |
}
|
1575 |
+
|
1576 |
/**
|
1577 |
* Set a value for a parameter
|
1578 |
+
*
|
1579 |
+
* @param string $name
|
1580 |
+
* The name of a parameter (for example: STATUS, PRICE, CURRENCY, etc)
|
1581 |
+
* @param string $value
|
1582 |
+
* The value of the parameter
|
1583 |
*/
|
1584 |
public function setParam($name, $value) {
|
1585 |
$this->params[$name] = $value;
|
1586 |
}
|
1587 |
+
|
1588 |
/**
|
1589 |
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
1590 |
+
*
|
1591 |
+
* @return string
|
1592 |
*/
|
1593 |
public function getGeneralResponse() {
|
1594 |
return $this->generalResponse;
|
app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
*/
|
8 |
|
9 |
include_once(Mage::getBaseDir('code')."/community/Mpay24/Mpay24/Model/Api/MPay24Shop.php");
|
10 |
-
define("MAGENTO_VERSION", "Magento v " . Mage::getVersion() . " Module v 1.6.
|
11 |
|
12 |
class MPay24MagentoShop extends MPay24Shop {
|
13 |
|
@@ -235,11 +235,11 @@ class MPay24MagentoShop extends MPay24Shop {
|
|
235 |
}
|
236 |
|
237 |
function createProfileOrder($tid) {}
|
238 |
-
function
|
239 |
function createFinishExpressCheckoutOrder($tid, $s, $a, $c) {}
|
240 |
|
241 |
function write_log($operation, $info_to_log) {
|
242 |
-
Mage::log("$operation : $info_to_log", null, "
|
243 |
}
|
244 |
|
245 |
function createSecret($tid, $amount, $currency, $timeStamp) {}
|
@@ -288,7 +288,7 @@ class MPay24MagentoShop extends MPay24Shop {
|
|
288 |
else
|
289 |
$mdxi->Order->TemplateSet->setLanguage("EN");
|
290 |
|
291 |
-
$mdxi->Order->TemplateSet->setCSSName("
|
292 |
|
293 |
if($this->ps) {
|
294 |
$this->order->getPayment()->setCcType($this->type . " => " . $this->brand)->save();
|
@@ -610,12 +610,8 @@ class MPay24MagentoShop extends MPay24Shop {
|
|
610 |
$mdxi->Order->URL->Confirmation = Mage::getUrl(MPay24MagentoShop::CONFIRMATION_URL,array('_secure' => true));
|
611 |
$mdxi->Order->URL->Cancel = Mage::getUrl(MPay24MagentoShop::CANCEL_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
612 |
|
613 |
-
if(Mage::getStoreConfig('mpay24/mpay24as/debug') == 1)
|
614 |
-
|
615 |
-
$fh = fopen($myFile, 'w') or die("can't open file");
|
616 |
-
fwrite($fh, $mdxi->toXML());
|
617 |
-
fclose($fh);
|
618 |
-
}
|
619 |
|
620 |
return $mdxi;
|
621 |
}
|
@@ -730,7 +726,7 @@ class MPay24MagentoShop extends MPay24Shop {
|
|
730 |
$proxy_pass = null;
|
731 |
}
|
732 |
|
733 |
-
$mPay24MagentoShop = new MPay24MagentoShop(Mage::getStoreConfig('mpay24/mpay24as/merchantid'), Mage::getStoreConfig('mpay24/mpay24as/soap_pass'), $test, $debug, $
|
734 |
return $mPay24MagentoShop;
|
735 |
}
|
736 |
}
|
7 |
*/
|
8 |
|
9 |
include_once(Mage::getBaseDir('code')."/community/Mpay24/Mpay24/Model/Api/MPay24Shop.php");
|
10 |
+
define("MAGENTO_VERSION", "Magento v " . Mage::getVersion() . " Module v 1.6.5 ");
|
11 |
|
12 |
class MPay24MagentoShop extends MPay24Shop {
|
13 |
|
235 |
}
|
236 |
|
237 |
function createProfileOrder($tid) {}
|
238 |
+
function createBackend2BackendOrder($tid, $paymentType) {}
|
239 |
function createFinishExpressCheckoutOrder($tid, $s, $a, $c) {}
|
240 |
|
241 |
function write_log($operation, $info_to_log) {
|
242 |
+
Mage::log("$operation : $info_to_log", null, "mpay24/mPAY24.log",true);
|
243 |
}
|
244 |
|
245 |
function createSecret($tid, $amount, $currency, $timeStamp) {}
|
288 |
else
|
289 |
$mdxi->Order->TemplateSet->setLanguage("EN");
|
290 |
|
291 |
+
$mdxi->Order->TemplateSet->setCSSName("MODERN");
|
292 |
|
293 |
if($this->ps) {
|
294 |
$this->order->getPayment()->setCcType($this->type . " => " . $this->brand)->save();
|
610 |
$mdxi->Order->URL->Confirmation = Mage::getUrl(MPay24MagentoShop::CONFIRMATION_URL,array('_secure' => true));
|
611 |
$mdxi->Order->URL->Cancel = Mage::getUrl(MPay24MagentoShop::CANCEL_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
612 |
|
613 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/debug') == 1)
|
614 |
+
Mage::log($mdxi->toXML(), null, "mpay24/xmls/".$transaction->TID.".xml",true);
|
|
|
|
|
|
|
|
|
615 |
|
616 |
return $mdxi;
|
617 |
}
|
726 |
$proxy_pass = null;
|
727 |
}
|
728 |
|
729 |
+
$mPay24MagentoShop = new MPay24MagentoShop(Mage::getStoreConfig('mpay24/mpay24as/merchantid'), Mage::getStoreConfig('mpay24/mpay24as/soap_pass'), $test, $debug, $proxy_host, $proxy_port, $proxy_user, $proxy_pass, $verify_peer);
|
730 |
return $mPay24MagentoShop;
|
731 |
}
|
732 |
}
|
app/code/community/Mpay24/Mpay24/Model/Api/MPay24Shop.php
CHANGED
@@ -1,51 +1,62 @@
|
|
1 |
<?php
|
2 |
-
include_once(
|
3 |
-
include_once(
|
4 |
|
5 |
/**
|
6 |
* The abstract MPay24Shop class provides abstract functions, which are used from the other functions in order to make a payment or a request to mPAY24
|
7 |
*
|
8 |
-
* @author
|
9 |
-
* @version
|
10 |
-
* @filesource
|
11 |
-
* @license
|
12 |
*/
|
13 |
abstract class MPay24Shop extends Transaction {
|
14 |
/**
|
15 |
* The mPAY24API Object, with you are going to work
|
16 |
-
*
|
|
|
17 |
*/
|
18 |
var $mPay24Api = null;
|
19 |
-
|
20 |
/**
|
21 |
* The constructor, which sets all the initial values, in order to be able making transactions
|
22 |
-
*
|
23 |
-
*
|
24 |
-
*
|
25 |
-
*
|
26 |
-
*
|
27 |
-
*
|
28 |
-
*
|
29 |
-
*
|
30 |
-
*
|
31 |
-
*
|
32 |
-
* @param
|
33 |
-
|
34 |
-
*
|
35 |
-
* @param
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
die("The test parameter '$test' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
40 |
-
|
41 |
-
if(!is_bool($debug))
|
42 |
die("The debug parameter '$debug' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
43 |
|
44 |
-
if(!is_bool($verfiyPeer))
|
45 |
die("The verifyPeer parameter '$verfiyPeer' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
46 |
-
|
47 |
$this->mPay24Api = new MPay24Api();
|
48 |
-
|
49 |
if($proxyHost == null) {
|
50 |
$pHost = "";
|
51 |
$pPort = "";
|
@@ -63,92 +74,115 @@ abstract class MPay24Shop extends Transaction {
|
|
63 |
$pPass = $proxyPass;
|
64 |
}
|
65 |
}
|
66 |
-
|
67 |
$this->mPay24Api->configure($merchantID, $soapPassword, $test, $pHost, $pPort, $pUser, $pPass, $verfiyPeer);
|
68 |
$this->mPay24Api->setDebug($debug);
|
69 |
-
|
70 |
-
if
|
71 |
$this->mPay24Api->printMsg("ERROR: You don't meet the needed requirements for this example shop.<br>");
|
72 |
-
|
73 |
-
if(version_compare(phpversion(), '5.0.0', '<')===true)
|
74 |
$this->mPay24Api->printMsg("You need PHP version 5.0.0 or newer!<br>");
|
75 |
-
if(!in_array('curl', get_loaded_extensions()))
|
76 |
$this->mPay24Api->printMsg("You need cURL extension!<br>");
|
77 |
-
if(!in_array('dom', get_loaded_extensions()))
|
78 |
$this->mPay24Api->printMsg("You need DOM extension!<br>");
|
79 |
-
|
80 |
$this->mPay24Api->dieWithMsg("Please load the required extensions!");
|
81 |
}
|
82 |
-
|
83 |
if(strlen($merchantID) != 5 || (substr($merchantID, 0, 1) != "7" && substr($merchantID, 0, 1) != "9"))
|
84 |
$this->mPay24Api->dieWithMsg("The merchant ID '$merchantID' you have given is wrong, it must be 5-digit number and starts with 7 or 9!");
|
85 |
-
|
86 |
-
if($proxyPort != null && (!is_numeric($proxyPort) || strlen($proxyPort) != 4))
|
87 |
$this->mPay24Api->dieWithMsg("The proxy port '$proxyPort' you have given must be numeric!");
|
88 |
-
|
89 |
if(($proxyHost == null && $proxyHost != $proxyPort) || ($proxyPort == null && $proxyHost != $proxyPort))
|
90 |
$this->mPay24Api->dieWithMsg("You must setup both variables 'proxyHost' and 'proxyPort'!");
|
91 |
}
|
92 |
-
|
93 |
/**
|
94 |
* Create a transaction and save/return this (in a data base or file system (for example XML))
|
95 |
-
*
|
|
|
96 |
*/
|
97 |
abstract function createTransaction();
|
98 |
-
|
99 |
/**
|
100 |
* Actualize the transaction, which has a transaction ID = $tid with the values from $args in your shop and return it
|
101 |
-
*
|
102 |
-
* @param
|
103 |
-
*
|
|
|
|
|
|
|
|
|
104 |
*/
|
105 |
abstract function updateTransaction($tid, $args, $shippingConfirmed);
|
106 |
-
|
107 |
/**
|
108 |
* Give the transaction object back, for a transaction which has a transaction ID = $tid
|
109 |
-
*
|
110 |
-
* @
|
|
|
|
|
111 |
*/
|
112 |
abstract function getTransaction($tid);
|
113 |
-
|
114 |
/**
|
115 |
* Using the ORDER object from order.php, create a MDXI-XML, which is needed for a transaction to be started
|
116 |
-
*
|
117 |
-
* @
|
|
|
|
|
118 |
*/
|
119 |
abstract function createMDXI($transaction);
|
120 |
-
|
121 |
/**
|
122 |
* Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with profiles to be started
|
123 |
-
*
|
124 |
-
* @
|
|
|
|
|
125 |
*/
|
126 |
abstract function createProfileOrder($tid);
|
127 |
-
|
128 |
/**
|
129 |
-
* Using the ORDER object from order.php, create a order-xml, which is needed for a
|
130 |
-
*
|
131 |
-
* @
|
|
|
|
|
|
|
|
|
132 |
*/
|
133 |
-
abstract function
|
134 |
-
|
135 |
/**
|
136 |
-
* Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with PayPal Express Checkout to be finished
|
137 |
-
*
|
138 |
-
* @param
|
139 |
-
*
|
140 |
-
* @param
|
141 |
-
*
|
|
|
|
|
|
|
|
|
|
|
142 |
*/
|
143 |
abstract function createFinishExpressCheckoutOrder($tid, $shippingCosts, $amount, $cancel);
|
144 |
-
|
145 |
/**
|
146 |
* Write a log into a file, file system, data base
|
147 |
-
*
|
148 |
-
* @param
|
|
|
|
|
|
|
149 |
*/
|
150 |
abstract function write_log($operation, $info_to_log);
|
151 |
-
|
152 |
/**
|
153 |
* This is an optional function, but it's strongly recomended that you implement it - see details.
|
154 |
* It should build a hash from the transaction ID of your shop, the amount of the transaction,
|
@@ -156,235 +190,314 @@ abstract class MPay24Shop extends Transaction {
|
|
156 |
* with this hash (parameter name 'token'), so you would be able to check whether the confirmation is
|
157 |
* really coming from mPAY24 or not. The hash should be then saved in the transaction object, so that
|
158 |
* every transaction has an unique secret token.
|
159 |
-
*
|
160 |
-
* @param
|
161 |
-
*
|
162 |
-
* @param
|
163 |
-
*
|
|
|
|
|
|
|
|
|
|
|
164 |
*/
|
165 |
abstract function createSecret($tid, $amount, $currency, $timeStamp);
|
166 |
-
|
167 |
/**
|
168 |
* Get the secret (hashed) token for a transaction
|
169 |
-
*
|
170 |
-
* @
|
|
|
|
|
171 |
*/
|
172 |
abstract function getSecret($tid);
|
173 |
-
|
174 |
/**
|
175 |
* Get a list which includes all the payment methods (activated by mPAY24) for your mechant ID
|
176 |
-
*
|
|
|
177 |
*/
|
178 |
function getPaymentMethods() {
|
179 |
-
if(
|
180 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
181 |
-
|
182 |
$paymentMethods = $this->mPay24Api->ListPaymentMethods();
|
183 |
-
|
184 |
if($this->mPay24Api->getDebug()) {
|
185 |
-
$this->write_log("GetPaymentMethods",
|
186 |
-
|
187 |
-
$this->write_log("GetPaymentMethods",
|
188 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
189 |
}
|
190 |
-
|
191 |
return $paymentMethods;
|
192 |
}
|
193 |
-
|
194 |
/**
|
195 |
* Return a redirect URL to start a payment
|
196 |
-
*
|
|
|
197 |
*/
|
198 |
function pay() {
|
199 |
-
if(
|
200 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
201 |
-
|
202 |
$transaction = $this->createTransaction();
|
203 |
-
|
204 |
$this->checkTransaction($transaction);
|
205 |
-
|
206 |
libxml_use_internal_errors(true);
|
207 |
-
|
208 |
$mdxi = $this->createMDXI($transaction);
|
209 |
-
|
210 |
-
if(
|
211 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php) and fulfill it with a MDXI!");
|
212 |
-
|
213 |
$mdxiXML = $mdxi->toXML();
|
214 |
-
|
215 |
-
if(
|
216 |
-
if(
|
217 |
$errors = "";
|
218 |
-
|
219 |
foreach(libxml_get_errors() as $error)
|
220 |
-
$errors.= trim($error->message) . "<br>";
|
221 |
-
|
222 |
-
$this->mPay24Api->dieWithMsg("The schema you have created is not valid!". "<br><br>"
|
223 |
-
"<textarea cols='100' rows='30'>$mdxiXML</textarea>");
|
224 |
}
|
225 |
-
|
226 |
$mdxiXML = $mdxi->toXML();
|
227 |
-
|
228 |
$payResult = $this->mPay24Api->SelectPayment($mdxiXML);
|
229 |
-
|
230 |
if($this->mPay24Api->getDebug()) {
|
231 |
-
$this->write_log("Pay",
|
232 |
-
|
233 |
-
$this->write_log("Pay",
|
234 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
235 |
}
|
236 |
-
|
237 |
return $payResult;
|
238 |
}
|
239 |
-
|
240 |
/**
|
241 |
* Start a payment with customer profile
|
242 |
-
*
|
|
|
243 |
*/
|
244 |
function payWithProfile() {
|
245 |
-
if(
|
246 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
247 |
-
|
248 |
$transaction = $this->createTransaction();
|
249 |
-
|
250 |
$this->checkTransaction($transaction);
|
251 |
-
|
252 |
$order = $this->createProfileOrder($transaction);
|
253 |
-
|
254 |
-
if(
|
255 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
256 |
-
|
257 |
$payWithProfileResult = $this->mPay24Api->ProfilePayment($order->toXML());
|
258 |
-
|
259 |
if($this->mPay24Api->getDebug()) {
|
260 |
-
$this->write_log("PayWithProfile",
|
261 |
-
|
262 |
-
$this->write_log("PayWithProfile",
|
263 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
264 |
}
|
265 |
-
|
266 |
return $payWithProfileResult;
|
267 |
}
|
268 |
-
|
269 |
/**
|
270 |
-
* Start a
|
271 |
-
*
|
|
|
|
|
|
|
272 |
*/
|
273 |
-
function
|
274 |
-
if(
|
275 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
276 |
-
|
|
|
|
|
|
|
277 |
$transaction = $this->createTransaction();
|
278 |
-
|
279 |
$this->checkTransaction($transaction);
|
280 |
-
|
281 |
-
$order = $this->
|
282 |
-
|
283 |
-
if(
|
284 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
285 |
-
|
286 |
-
$
|
287 |
-
|
288 |
if($this->mPay24Api->getDebug()) {
|
289 |
-
$this->write_log("
|
290 |
-
|
291 |
-
$this->write_log("PayWithExpressCheckout",
|
292 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
293 |
}
|
294 |
-
|
295 |
-
return $
|
296 |
}
|
297 |
-
|
298 |
/**
|
299 |
-
* Finish the payment, started with PayPal Express Checkout - reserve, bill or cancel it: Whether are you going to reserve or bill a payment is setted at the beginning of the payment.
|
300 |
-
*
|
301 |
-
*
|
302 |
-
* @param
|
303 |
-
*
|
304 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
*/
|
306 |
-
function finishExpressCheckoutPayment($tid, $shippingCosts, $amount, $cancel) {
|
307 |
-
if(
|
308 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
309 |
-
|
310 |
if($cancel !== "true" && $cancel !== "false")
|
311 |
$this->mPay24Api->dieWithMsg("The allowed values for the parameter 'cancel' by finishing a PayPal (Express Checkout) payment are 'true' or 'false'!");
|
312 |
-
|
|
|
|
|
|
|
313 |
$transaction = $this->getTransaction($tid);
|
314 |
-
|
315 |
$this->checkTransaction($transaction);
|
316 |
-
|
317 |
$mPAYTid = $transaction->MPAYTID;
|
318 |
-
|
319 |
-
if(
|
320 |
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to finish with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
321 |
-
|
322 |
-
if(
|
323 |
-
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to pay by
|
324 |
-
|
325 |
-
if(
|
326 |
$this->mPay24Api->dieWithMsg("The shipping costs '$shippingCosts' you are trying to set are not valid!");
|
327 |
-
|
328 |
$order = $this->createFinishExpressCheckoutOrder($transaction, $shippingCosts, $amount, $cancel);
|
329 |
-
|
330 |
-
if(
|
331 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
332 |
-
|
333 |
-
$finishExpressCheckoutResult = $this->mPay24Api->
|
334 |
-
|
335 |
if($this->mPay24Api->getDebug()) {
|
336 |
-
$this->write_log("FinishExpressCheckoutResult",
|
337 |
-
|
338 |
-
$this->write_log("FinishExpressCheckoutResult",
|
339 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
340 |
}
|
341 |
-
|
342 |
return $finishExpressCheckoutResult;
|
343 |
}
|
344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
/**
|
346 |
* Proceed the confirmation call
|
347 |
-
*
|
348 |
-
* @param
|
|
|
|
|
|
|
349 |
*/
|
350 |
function confirm($tid, $args) {
|
351 |
$to_log = '';
|
352 |
$shippingConfirmed = "";
|
353 |
-
|
354 |
foreach($args as $name => $value)
|
355 |
-
$to_log.= $name . " = " . $value . "\n";
|
356 |
-
|
357 |
if($this->mPay24Api->getDebug())
|
358 |
-
$this->write_log("Confirmation for transaction '" . $tid . "'\n", utf8_encode($to_log)."\n");
|
359 |
-
|
360 |
$transactionStatus = $this->updateTransactionStatus($tid);
|
361 |
-
|
362 |
$newArgs = $transactionStatus->getParams();
|
363 |
-
|
364 |
foreach($newArgs as $name => $value)
|
365 |
-
$to_log.= $name . " = " . $value . "\n";
|
366 |
-
|
367 |
if($this->mPay24Api->getDebug())
|
368 |
-
$this->write_log("Status for transaction " . $tid . ":", utf8_encode($to_log)."\n");
|
369 |
-
|
370 |
if($transactionStatus->getParam("SHIPPING_ADDR")) {
|
371 |
$order = new DOMDocument();
|
372 |
$order->loadXML($transactionStatus->getParam("SHIPPING_ADDR"));
|
373 |
}
|
374 |
-
|
375 |
if(isset($order)) {
|
376 |
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
377 |
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
378 |
}
|
379 |
-
|
380 |
if($this->getSecret($tid) == $args['token']) {
|
381 |
if($shippingConfirmed == "false") {
|
382 |
$newArgs["SHIPP_NAME"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Name")->item(0)->nodeValue;
|
383 |
$newArgs["SHIPP_STREET"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street")->item(0)->nodeValue;
|
384 |
-
|
385 |
if($order->getElementsByTagName("Shipping")->item(0)->hasAttribute("Street2"))
|
386 |
$newArgs["SHIPP_STREET2"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street2")->item(0)->nodeValue;
|
387 |
-
|
388 |
$newArgs["SHIPP_ZIP"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Zip")->item(0)->nodeValue;
|
389 |
$newArgs["SHIPP_CITY"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("City")->item(0)->nodeValue;
|
390 |
$newArgs["SHIPP_COUNTRY"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Country")->item(0)->getAttribute("code");
|
@@ -393,7 +506,7 @@ abstract class MPay24Shop extends Transaction {
|
|
393 |
return $this->updateTransaction($tid, $newArgs, true);
|
394 |
}
|
395 |
}
|
396 |
-
|
397 |
/**
|
398 |
* Get the transaction's current information - see details
|
399 |
*
|
@@ -407,220 +520,210 @@ abstract class MPay24Shop extends Transaction {
|
|
407 |
* * SUSPENDED - in case the transaction is not fully compleated yet
|
408 |
* * NOT FOUND - in case there is not such a transaction in the mPAY24 database
|
409 |
* * ERROR - in case the transaction was not successful
|
410 |
-
*
|
411 |
-
* @
|
|
|
|
|
412 |
*/
|
413 |
function updateTransactionStatus($tid) {
|
414 |
-
if(
|
415 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
416 |
-
|
417 |
$transaction = $this->getTransaction($tid);
|
418 |
-
|
419 |
$this->checkTransaction($transaction);
|
420 |
-
|
421 |
-
if(
|
422 |
$tidTransactionStatusResult = $this->mPay24Api->TransactionStatus(null, $tid);
|
423 |
-
|
424 |
if($this->mPay24Api->getDebug()) {
|
425 |
-
$this->write_log("TidTransactionStatus",
|
426 |
-
|
427 |
-
$this->write_log("TidTransactionStatus",
|
428 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
429 |
}
|
430 |
-
|
431 |
if($tidTransactionStatusResult->getParam("SHIPPING_ADDR")) {
|
432 |
$order = new DOMDocument();
|
433 |
$order->loadXML($tidTransactionStatusResult->getParam("SHIPPING_ADDR"));
|
434 |
}
|
435 |
-
|
436 |
if(isset($order)) {
|
437 |
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
438 |
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
439 |
-
|
440 |
if($shippingConfirmed == "false") {
|
441 |
$tidTransactionStatusResult->setParam("shippingConfirmed", false);
|
442 |
-
$tidTransactionStatusResult->setParam("SHIPP_NAME", $order->getElementsByTagName("Shipping")->item(0)
|
443 |
-
|
444 |
-
$tidTransactionStatusResult->setParam("SHIPP_STREET", $order->getElementsByTagName("Shipping")->item(0)
|
445 |
-
->getElementsByTagName("Street")->item(0)->nodeValue);
|
446 |
if($tidTransactionStatusResult->getParam("SHIPP_STREET2"))
|
447 |
-
$tidTransactionStatusResult->setParam("SHIPP_STREET2", $order->getElementsByTagName("Shipping")->item(0)
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
$tidTransactionStatusResult->setParam("SHIPP_CITY", $order->getElementsByTagName("Shipping")->item(0)
|
452 |
-
->getElementsByTagName("City")->item(0)->nodeValue);
|
453 |
-
$tidTransactionStatusResult->setParam("SHIPP_COUNTRY", $order->getElementsByTagName("Shipping")->item(0)
|
454 |
-
->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
455 |
} else
|
456 |
-
|
457 |
} else
|
458 |
$tidTransactionStatusResult->setParam("shippingConfirmed", true);
|
459 |
-
|
460 |
return $tidTransactionStatusResult;
|
461 |
-
} else{
|
462 |
$mPAYTidTransactionStatusResult = $this->mPay24Api->TransactionStatus($transaction->MPAYTID, null);
|
463 |
-
|
464 |
if($this->mPay24Api->getDebug()) {
|
465 |
-
$this->write_log("mPAYTidTransactionStatus",
|
466 |
-
|
467 |
-
$this->write_log("mPAYTidTransactionStatus",
|
468 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
469 |
}
|
470 |
-
|
471 |
if($mPAYTidTransactionStatusResult->getParam("SHIPPING_ADDR")) {
|
472 |
$order = new DOMDocument();
|
473 |
$order->loadXML($mPAYTidTransactionStatusResult->getParam("SHIPPING_ADDR"));
|
474 |
}
|
475 |
-
|
476 |
if(isset($order)) {
|
477 |
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
478 |
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
479 |
-
|
480 |
if($shippingConfirmed == "false") {
|
481 |
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", false);
|
482 |
-
$mPAYTidTransactionStatusResult->setParam("SHIPP_NAME", $order->getElementsByTagName("Shipping")->item(0)
|
483 |
-
|
484 |
-
$mPAYTidTransactionStatusResult->setParam("
|
485 |
-
|
486 |
-
$mPAYTidTransactionStatusResult->setParam("
|
487 |
-
|
488 |
-
$mPAYTidTransactionStatusResult->setParam("SHIPP_ZIP", $order->getElementsByTagName("Shipping")->item(0)
|
489 |
-
->getElementsByTagName("Zip")->item(0)->nodeValue);
|
490 |
-
$mPAYTidTransactionStatusResult->setParam("SHIPP_CITY", $order->getElementsByTagName("Shipping")->item(0)
|
491 |
-
->getElementsByTagName("City")->item(0)->nodeValue);
|
492 |
-
$mPAYTidTransactionStatusResult->setParam("SHIPP_COUNTRY", $order->getElementsByTagName("Shipping")->item(0)
|
493 |
-
->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
494 |
} else
|
495 |
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", true);
|
496 |
} else
|
497 |
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", true);
|
498 |
-
|
499 |
return $mPAYTidTransactionStatusResult;
|
500 |
}
|
501 |
}
|
502 |
-
|
503 |
/**
|
504 |
* Clear an amount of an authorized transaction
|
505 |
-
*
|
506 |
-
* @param
|
|
|
|
|
|
|
507 |
*/
|
508 |
function clearAmount($tid, $amount) {
|
509 |
-
if(
|
510 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
511 |
-
|
512 |
$transaction = $this->getTransaction($tid);
|
513 |
-
|
514 |
$this->checkTransaction($transaction);
|
515 |
-
|
516 |
$mPAYTid = $transaction->MPAYTID;
|
517 |
$currency = $transaction->CURRENCY;
|
518 |
-
|
519 |
-
if(
|
520 |
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to clear with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
521 |
-
|
522 |
-
if(
|
523 |
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to clear is not valid!");
|
524 |
-
|
525 |
-
if(
|
526 |
$this->mPay24Api->dieWithMsg("The currency code '$currency' for the amount you are trying to clear is not valid (3-digit ISO-Currency-Code)!");
|
527 |
-
|
528 |
$clearAmountResult = $this->mPay24Api->ManualClear($mPAYTid, $amount, $currency);
|
529 |
-
|
530 |
if($this->mPay24Api->getDebug()) {
|
531 |
-
$this->write_log("ClearAmount",
|
532 |
-
|
533 |
-
$this->write_log("ClearAmount",
|
534 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
535 |
}
|
536 |
-
|
537 |
return $clearAmountResult;
|
538 |
}
|
539 |
-
|
540 |
/**
|
541 |
* Credit an amount of a billed transaction
|
542 |
-
*
|
543 |
-
* @param
|
|
|
|
|
|
|
544 |
*/
|
545 |
function creditAmount($tid, $amount) {
|
546 |
-
if(
|
547 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
548 |
-
|
549 |
$transaction = $this->getTransaction($tid);
|
550 |
-
|
551 |
$this->checkTransaction($transaction);
|
552 |
-
|
553 |
$mPAYTid = $transaction->MPAYTID;
|
554 |
$currency = $transaction->CURRENCY;
|
555 |
$customer = $transaction->CUSTOMER;
|
556 |
-
|
557 |
-
if(
|
558 |
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to credit with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
559 |
-
|
560 |
-
if(
|
561 |
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to credit is not valid!");
|
562 |
-
|
563 |
-
if(
|
564 |
$this->mPay24Api->dieWithMsg("The currency code '$currency' for the amount you are trying to credit is not valid (3-digit ISO-Currency-Code)!");
|
565 |
-
|
566 |
$creditAmountResult = $this->mPay24Api->ManualCredit($mPAYTid, $amount, $currency, $customer);
|
567 |
-
|
568 |
if($this->mPay24Api->getDebug()) {
|
569 |
-
$this->write_log("CreditAmount",
|
570 |
-
|
571 |
-
$this->write_log("CreditAmount",
|
572 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
573 |
}
|
574 |
-
|
575 |
return $creditAmountResult;
|
576 |
}
|
577 |
-
|
578 |
/**
|
579 |
* Cancel a authorized transaction
|
580 |
-
*
|
|
|
|
|
581 |
*/
|
582 |
function cancelTransaction($tid) {
|
583 |
-
if(
|
584 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
585 |
-
|
586 |
$transaction = $this->getTransaction($tid);
|
587 |
-
|
588 |
$this->checkTransaction($transaction);
|
589 |
-
|
590 |
$mPAYTid = $transaction->MPAYTID;
|
591 |
-
|
592 |
-
if(
|
593 |
$this->mPay24Api->dieWithMsgie("The transaction '$tid' you want to cancel with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
594 |
-
|
595 |
$cancelTransactionResult = $this->mPay24Api->ManualReverse($mPAYTid);
|
596 |
-
|
597 |
if($this->mPay24Api->getDebug()) {
|
598 |
-
$this->write_log("CancelTransaction",
|
599 |
-
|
600 |
-
$this->write_log("CancelTransaction",
|
601 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
602 |
}
|
603 |
-
|
604 |
return $cancelTransactionResult;
|
605 |
}
|
606 |
-
|
607 |
/**
|
608 |
* Check if the a transaction is created, whether the object is from type Transaction and whether the mandatory settings (TID and PRICE) of a transaction are setted
|
609 |
-
*
|
|
|
|
|
610 |
*/
|
611 |
private function checkTransaction($transaction) {
|
612 |
-
if(
|
613 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create a Transaction object, which contains at least TID and PRICE!");
|
614 |
-
else if(
|
615 |
$this->mPay24Api->dieWithMsg("The Transaction must contain TID!");
|
616 |
-
else if(
|
617 |
$this->mPay24Api->dieWithMsg("The Transaction must contain PRICE!");
|
618 |
}
|
619 |
}
|
620 |
|
621 |
/**
|
622 |
* The properties, which are allowed for a transaction
|
623 |
-
* @const
|
624 |
*/
|
625 |
define("TRANSACTION_PROPERTIES", "SECRET,TID,STATUS,MPAYTID,APPR_CODE,P_TYPE,
|
626 |
BRAND,PRICE,CURRENCY,OPERATION,LANGUAGE,
|
@@ -630,89 +733,102 @@ define("TRANSACTION_PROPERTIES", "SECRET,TID,STATUS,MPAYTID,APPR_CODE,P_TYPE,
|
|
630 |
/**
|
631 |
* The Transaction class allows you to set and get different trnasaction's properties - see details
|
632 |
*
|
633 |
-
* TYPE:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
634 |
*
|
635 |
-
*
|
636 |
-
*
|
637 |
-
*
|
638 |
-
*
|
639 |
-
* * INT: PRICE - length = 11 (e. g. "10" = "0,10")
|
640 |
-
* * STRING: CURRENCY - length = 3 (ISO currency code, e. g. "EUR")
|
641 |
-
* * STRING: P_TYPE - CC, ELV, EPS, GIROPAY, MAESTRO, PB, PSC, QUICK, etc
|
642 |
-
* * STRING: BRAND - AMEX, DINERS, JCB, MASTERCARD, VISA, ATOS, HOBEX-AT, HOBEX-DE, etc
|
643 |
-
* * INT: MPAYTID - length = 11
|
644 |
-
* * STRING: USER_FIELD
|
645 |
-
* * STRING: ORDERDESC
|
646 |
-
* * STRING: CUSTOMER
|
647 |
-
* * STRING: CUSTOMER_EMAIL
|
648 |
-
* * STRING: LANGUAGE - length = 2
|
649 |
-
* * STRING: CUSTOMER_ID - length = 11
|
650 |
-
* * STRING: PROFILE_STATUS - IGNORED, USED, ERROR, CREATED, UPDATED, DELETED
|
651 |
-
* * STRING: FILTER_STATUS
|
652 |
-
* * STRING: APPR_CODE
|
653 |
-
* @author mPAY24 GmbH <support@mpay24.com>
|
654 |
-
* @version $Id: MPay24Shop.php 6252 2015-03-26 15:57:57Z anna $
|
655 |
-
* @filesource MPay24Shop.php
|
656 |
-
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
657 |
*/
|
658 |
class Transaction {
|
659 |
/**
|
660 |
* An array, which contains the allowed properties for an transaction
|
661 |
-
*
|
|
|
662 |
*/
|
663 |
-
var $allowedProperties
|
664 |
/**
|
665 |
* An array, which contains the set properties for this transaction object
|
666 |
-
*
|
|
|
667 |
*/
|
668 |
-
var $properties
|
669 |
-
|
670 |
/**
|
671 |
* Create a transaction object and set the allowed properties from the TRANSACTION_PROPERTIES
|
672 |
-
*
|
|
|
|
|
673 |
*/
|
674 |
function Transaction($tid) {
|
675 |
-
$this->allowedProperties =
|
676 |
$this->TID = $tid;
|
677 |
}
|
678 |
-
|
679 |
/**
|
680 |
* Get the property of the Transaction object
|
681 |
-
*
|
682 |
-
* @
|
|
|
|
|
683 |
*/
|
684 |
public function __get($property) {
|
685 |
-
if(!in_array($property, $this->allowedProperties))
|
686 |
die("The transaction's property " . $property . ", you want to get is not defined!");
|
687 |
-
|
688 |
if(isset($this->properties[$property]))
|
689 |
return $this->properties[$property];
|
690 |
else
|
691 |
return false;
|
692 |
}
|
693 |
-
|
694 |
/**
|
695 |
* Set the property of the Transaction object
|
696 |
-
*
|
697 |
-
* @param
|
|
|
|
|
|
|
698 |
*/
|
699 |
public function __set($property, $value) {
|
700 |
-
if(!in_array($property, $this->allowedProperties))
|
701 |
die("The transaction's property " . $property . ", you want to set is not defined!");
|
702 |
$this->properties[$property] = $value;
|
703 |
}
|
704 |
-
|
705 |
/**
|
706 |
* Set all the allowed properties for this transaction
|
707 |
-
*
|
|
|
|
|
708 |
*/
|
709 |
protected function setProperties($args) {
|
710 |
$this->properties = $args;
|
711 |
}
|
712 |
-
|
713 |
/**
|
714 |
* Get all the allowed properties for this transaction
|
715 |
-
*
|
|
|
716 |
*/
|
717 |
protected function getProperties() {
|
718 |
return $this->properties;
|
@@ -722,195 +838,213 @@ class Transaction {
|
|
722 |
/**
|
723 |
* The abstract MPay24flexLINK class provides abstract functions, which are used from the other functions in order to create a flexLINK
|
724 |
*
|
725 |
-
* @author
|
726 |
-
* @version
|
727 |
-
* @filesource
|
728 |
-
* @license
|
729 |
*/
|
730 |
abstract class MPay24flexLINK {
|
731 |
/**
|
732 |
* The mPAY24API Object, you are going to work with
|
733 |
-
*
|
|
|
734 |
*/
|
735 |
var $mPay24Api = null;
|
736 |
-
|
737 |
/**
|
738 |
-
* The constructor, which sets all the initial values to be able making flexLINK transactions.
|
739 |
-
*
|
740 |
-
* @param string $password The flexLINK password, supported by mPAY24
|
741 |
-
* @param bool $test TRUE - when you want to use the TEST system
|
742 |
-
*
|
743 |
-
* FALSE - when you want to use the LIVE system
|
744 |
-
* @param bool $debug TRUE - when you want to write log files
|
745 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
746 |
*/
|
747 |
-
function MPay24flexLINK($spid, $password, $test, $debug=false) {
|
748 |
-
if(!is_bool($test))
|
749 |
die("The test parameter '$test' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
750 |
-
|
751 |
-
if(!is_bool($debug))
|
752 |
die("The debug parameter '$debug' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
753 |
-
|
754 |
$this->mPay24Api = new MPay24Api();
|
755 |
-
|
756 |
$this->mPay24Api->configureFlexLINK($spid, $password, $test);
|
757 |
$this->mPay24Api->setDebug($debug);
|
758 |
-
|
759 |
-
if
|
760 |
$this->mPay24Api->printMsg("ERROR: You don't meet the needed requirements for this example shop.<br>");
|
761 |
-
|
762 |
-
if(version_compare(phpversion(), '5.0.0', '<')===true)
|
763 |
$this->mPay24Api->printMsg("You need PHP version 5.0.0 or newer!<br>");
|
764 |
-
if(!in_array('mcrypt', get_loaded_extensions()))
|
765 |
$this->mPay24Api->printMsg("You need mcrypt extension!<br>");
|
766 |
-
|
767 |
}
|
768 |
}
|
769 |
-
|
770 |
/**
|
771 |
* Encrypt the parameters you want to post to mPAY24 - see details
|
772 |
-
*
|
773 |
-
* @param
|
774 |
-
*
|
775 |
-
* @param
|
776 |
-
*
|
777 |
-
* @param
|
778 |
-
*
|
779 |
-
* @param
|
780 |
-
*
|
781 |
-
* @param
|
782 |
-
*
|
783 |
-
* @param
|
784 |
-
*
|
785 |
-
* @param
|
786 |
-
*
|
787 |
-
* @param
|
788 |
-
*
|
789 |
-
* @param
|
790 |
-
*
|
791 |
-
* @param
|
792 |
-
*
|
793 |
-
* @param
|
794 |
-
*
|
795 |
-
* @param
|
796 |
-
*
|
797 |
-
* @param
|
798 |
-
*
|
799 |
-
* @param
|
800 |
-
*
|
801 |
-
* @param
|
802 |
-
*
|
803 |
-
* @param
|
804 |
-
*
|
805 |
-
* @param
|
806 |
-
*
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
845 |
die("You are not allowed to define a constructor in the child class of MPay24flexLINK!");
|
846 |
-
|
847 |
$params[$invoice_idVar] = $invoice_id;
|
848 |
$params[$amountVar] = $amount;
|
849 |
-
|
850 |
if($currency == NULL)
|
851 |
$currency = "EUR";
|
852 |
-
|
853 |
$params[$currencyVar] = $currency;
|
854 |
-
|
855 |
if($language == NULL)
|
856 |
$language = "DE";
|
857 |
-
|
858 |
$params[$languageVar] = $language;
|
859 |
$params[$user_fieldVar] = $user_field;
|
860 |
-
|
861 |
if($description == NULL)
|
862 |
$description = "Rechnungsnummer:";
|
863 |
-
|
864 |
$params[$descriptionVar] = $description;
|
865 |
-
|
866 |
if($mode == NULL)
|
867 |
$mode = "ReadWrite";
|
868 |
-
|
869 |
$params[$modeVar] = $mode;
|
870 |
-
|
871 |
$params[$nameVar] = $name;
|
872 |
$params[$streetVar] = $street;
|
873 |
$params[$street2Var] = $street2;
|
874 |
$params[$zipVar] = $zip;
|
875 |
$params[$cityVar] = $city;
|
876 |
-
|
877 |
if($country == NULL)
|
878 |
$country = "AT";
|
879 |
-
|
880 |
$params[$countryVar] = $country;
|
881 |
-
|
882 |
$params[$emailVar] = $email;
|
883 |
$params[$successVar] = $success;
|
884 |
$params[$errorVar] = $error;
|
885 |
$params[$confirmationVar] = $confirmation;
|
886 |
-
|
887 |
foreach($params as $key => $value)
|
888 |
if($this->mPay24Api->getDebug())
|
889 |
$this->write_flexLINK_log("flexLINK:\t\t\tParameters: $key = $value\n");
|
890 |
-
|
891 |
$parameters = $this->mPay24Api->flexLINK($params);
|
892 |
-
|
893 |
if($this->mPay24Api->getDebug())
|
894 |
$this->write_flexLINK_log("flexLINK:\t\t\tEncrypted parameters: $parameters\n");
|
895 |
-
|
896 |
return $parameters;
|
897 |
}
|
898 |
-
|
899 |
/**
|
900 |
* Get the whole URL (flexLINK) to the mPAY24 pay page, used to pay an invoice
|
901 |
-
*
|
902 |
-
* @
|
|
|
|
|
903 |
*/
|
904 |
public function getPayLink($encryptedParams) {
|
905 |
if($this->mPay24Api->getDebug())
|
906 |
-
$this->write_flexLINK_log("flexLINK:\t\t\tURL: https://"
|
907 |
-
|
908 |
-
return "https://"
|
909 |
}
|
910 |
-
|
911 |
/**
|
912 |
* Write a flexLINK log into a file, file system, data base
|
913 |
-
*
|
|
|
|
|
914 |
*/
|
915 |
abstract function write_flexLINK_log($info_to_log);
|
916 |
}
|
1 |
<?php
|
2 |
+
include_once ("MPay24Api.php");
|
3 |
+
include_once ("orderXML.php");
|
4 |
|
5 |
/**
|
6 |
* The abstract MPay24Shop class provides abstract functions, which are used from the other functions in order to make a payment or a request to mPAY24
|
7 |
*
|
8 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
9 |
+
* @version $Id: MPay24Shop.php 6271 2015-04-09 08:38:50Z anna $
|
10 |
+
* @filesource MPay24Shop.php
|
11 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
12 |
*/
|
13 |
abstract class MPay24Shop extends Transaction {
|
14 |
/**
|
15 |
* The mPAY24API Object, with you are going to work
|
16 |
+
*
|
17 |
+
* @var $mPay24Api
|
18 |
*/
|
19 |
var $mPay24Api = null;
|
20 |
+
|
21 |
/**
|
22 |
* The constructor, which sets all the initial values, in order to be able making transactions
|
23 |
+
*
|
24 |
+
* @param int $merchantID
|
25 |
+
* 5-digit account number, supported by mPAY24:
|
26 |
+
* TEST accounts - starting with 9
|
27 |
+
* LIVE account - starting with 7
|
28 |
+
* @param string $soapPassword
|
29 |
+
* The webservice's password, supported by mPAY24
|
30 |
+
* @param bool $test
|
31 |
+
* TRUE - when you want to use the TEST system,
|
32 |
+
* FALSE - when you want to use the LIVE system
|
33 |
+
* @param bool $debug
|
34 |
+
* TRUE - when you want to write log files,
|
35 |
+
* FALSE - when you don't want write log files
|
36 |
+
* @param string $proxyHost
|
37 |
+
* The host name in case you are behind a proxy server ("" when not)
|
38 |
+
* @param int $proxyPort
|
39 |
+
* 4-digit port number in case you are behind a proxy server ("" when not)
|
40 |
+
*
|
41 |
+
* @param string $proxyUser
|
42 |
+
* The proxy user in case you are behind a proxy server ("" when not)
|
43 |
+
* @param string $proxyPass
|
44 |
+
* The proxy password in case you are behind a proxy server ("" when not)
|
45 |
+
* @param bool $verfiyPeer
|
46 |
+
* Set as FALSE to stop cURL from verifying the peer's certificate
|
47 |
+
*/
|
48 |
+
function MPay24Shop($merchantID, $soapPassword, $test, $debug = false, $proxyHost = null, $proxyPort = null, $proxyUser = null, $proxyPass = null, $verfiyPeer = true) {
|
49 |
+
if(! is_bool($test))
|
50 |
die("The test parameter '$test' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
51 |
+
|
52 |
+
if(! is_bool($debug))
|
53 |
die("The debug parameter '$debug' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
54 |
|
55 |
+
if(! is_bool($verfiyPeer))
|
56 |
die("The verifyPeer parameter '$verfiyPeer' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
57 |
+
|
58 |
$this->mPay24Api = new MPay24Api();
|
59 |
+
|
60 |
if($proxyHost == null) {
|
61 |
$pHost = "";
|
62 |
$pPort = "";
|
74 |
$pPass = $proxyPass;
|
75 |
}
|
76 |
}
|
77 |
+
|
78 |
$this->mPay24Api->configure($merchantID, $soapPassword, $test, $pHost, $pPort, $pUser, $pPass, $verfiyPeer);
|
79 |
$this->mPay24Api->setDebug($debug);
|
80 |
+
|
81 |
+
if(version_compare(phpversion(), '5.0.0', '<') === true || ! in_array('curl', get_loaded_extensions()) || ! in_array('dom', get_loaded_extensions())) {
|
82 |
$this->mPay24Api->printMsg("ERROR: You don't meet the needed requirements for this example shop.<br>");
|
83 |
+
|
84 |
+
if(version_compare(phpversion(), '5.0.0', '<') === true)
|
85 |
$this->mPay24Api->printMsg("You need PHP version 5.0.0 or newer!<br>");
|
86 |
+
if(! in_array('curl', get_loaded_extensions()))
|
87 |
$this->mPay24Api->printMsg("You need cURL extension!<br>");
|
88 |
+
if(! in_array('dom', get_loaded_extensions()))
|
89 |
$this->mPay24Api->printMsg("You need DOM extension!<br>");
|
90 |
+
|
91 |
$this->mPay24Api->dieWithMsg("Please load the required extensions!");
|
92 |
}
|
93 |
+
|
94 |
if(strlen($merchantID) != 5 || (substr($merchantID, 0, 1) != "7" && substr($merchantID, 0, 1) != "9"))
|
95 |
$this->mPay24Api->dieWithMsg("The merchant ID '$merchantID' you have given is wrong, it must be 5-digit number and starts with 7 or 9!");
|
96 |
+
|
97 |
+
if($proxyPort != null && (! is_numeric($proxyPort) || strlen($proxyPort) != 4))
|
98 |
$this->mPay24Api->dieWithMsg("The proxy port '$proxyPort' you have given must be numeric!");
|
99 |
+
|
100 |
if(($proxyHost == null && $proxyHost != $proxyPort) || ($proxyPort == null && $proxyHost != $proxyPort))
|
101 |
$this->mPay24Api->dieWithMsg("You must setup both variables 'proxyHost' and 'proxyPort'!");
|
102 |
}
|
103 |
+
|
104 |
/**
|
105 |
* Create a transaction and save/return this (in a data base or file system (for example XML))
|
106 |
+
*
|
107 |
+
* @return Transaction
|
108 |
*/
|
109 |
abstract function createTransaction();
|
110 |
+
|
111 |
/**
|
112 |
* Actualize the transaction, which has a transaction ID = $tid with the values from $args in your shop and return it
|
113 |
+
*
|
114 |
+
* @param string $tid
|
115 |
+
* The transaction ID you want to update with the confirmation
|
116 |
+
* @param array $args
|
117 |
+
* Arrguments with them the transaction is to be updated
|
118 |
+
* @param bool $shippingConfirmed
|
119 |
+
* TRUE if the shipping address is confirmed, FALSE - otherwise (in case of PayPal or MasterPass Express Checkout)
|
120 |
*/
|
121 |
abstract function updateTransaction($tid, $args, $shippingConfirmed);
|
122 |
+
|
123 |
/**
|
124 |
* Give the transaction object back, for a transaction which has a transaction ID = $tid
|
125 |
+
*
|
126 |
+
* @param string $tid
|
127 |
+
* The transaction ID of the transaction you want get
|
128 |
+
* @return Transaction
|
129 |
*/
|
130 |
abstract function getTransaction($tid);
|
131 |
+
|
132 |
/**
|
133 |
* Using the ORDER object from order.php, create a MDXI-XML, which is needed for a transaction to be started
|
134 |
+
*
|
135 |
+
* @param Transaction $transaction
|
136 |
+
* The transaction you want to make a MDXI XML file for
|
137 |
+
* @return ORDER
|
138 |
*/
|
139 |
abstract function createMDXI($transaction);
|
140 |
+
|
141 |
/**
|
142 |
* Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with profiles to be started
|
143 |
+
*
|
144 |
+
* @param string $tid
|
145 |
+
* The transaction ID of the transaction you want to make an order transaction XML file for
|
146 |
+
* @return XML
|
147 |
*/
|
148 |
abstract function createProfileOrder($tid);
|
149 |
+
|
150 |
/**
|
151 |
+
* Using the ORDER object from order.php, create a order-xml, which is needed for a backend to backend transaction to be started
|
152 |
+
*
|
153 |
+
* @param string $tid
|
154 |
+
* The transaction ID of the transaction you want to make an order transaction XML file for
|
155 |
+
* @param string $paymentType
|
156 |
+
* The payment type which will be used for the backend to backend payment (EPS, SOFORT, PAYPAL, MASTERPASS or TOKEN)
|
157 |
+
* @return XML
|
158 |
*/
|
159 |
+
abstract function createBackend2BackendOrder($tid, $paymentType);
|
160 |
+
|
161 |
/**
|
162 |
+
* Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with PayPal or MasterPass Express Checkout to be finished
|
163 |
+
*
|
164 |
+
* @param string $tid
|
165 |
+
* The transaction ID of the transaction you want to make an order transaction XML file for
|
166 |
+
* @param string $shippingCosts
|
167 |
+
* The shipping costs amount for the transaction, provided by PayPal or MasterPass, after changing the shipping address
|
168 |
+
* @param string $amount
|
169 |
+
* The new amount for the transaction, provided by PayPal or MasterPass, after changing the shipping address
|
170 |
+
* @param bool $cancel
|
171 |
+
* TRUE if the a cancelation is wanted after renewing the amounts and FALSE otherwise
|
172 |
+
* @return XML
|
173 |
*/
|
174 |
abstract function createFinishExpressCheckoutOrder($tid, $shippingCosts, $amount, $cancel);
|
175 |
+
|
176 |
/**
|
177 |
* Write a log into a file, file system, data base
|
178 |
+
*
|
179 |
+
* @param string $operation
|
180 |
+
* The operation, which is to log: GetPaymentMethods, Pay, PayWithProfile, Confirmation, UpdateTransactionStatus, ClearAmount, CreditAmount, CancelTransaction, etc.
|
181 |
+
* @param string $info_to_log
|
182 |
+
* The information, which is to log: request, response, etc.
|
183 |
*/
|
184 |
abstract function write_log($operation, $info_to_log);
|
185 |
+
|
186 |
/**
|
187 |
* This is an optional function, but it's strongly recomended that you implement it - see details.
|
188 |
* It should build a hash from the transaction ID of your shop, the amount of the transaction,
|
190 |
* with this hash (parameter name 'token'), so you would be able to check whether the confirmation is
|
191 |
* really coming from mPAY24 or not. The hash should be then saved in the transaction object, so that
|
192 |
* every transaction has an unique secret token.
|
193 |
+
*
|
194 |
+
* @param string $tid
|
195 |
+
* The transaction ID you want to make a secret key for
|
196 |
+
* @param string $amount
|
197 |
+
* The amount, reserved for this transaction
|
198 |
+
* @param string $currency
|
199 |
+
* The currency (3-digit ISO-Currency-Code) at the moment the transaction is created
|
200 |
+
* @param string $timeStamp
|
201 |
+
* The timeStamp at the moment the transaction is created
|
202 |
+
* @return string
|
203 |
*/
|
204 |
abstract function createSecret($tid, $amount, $currency, $timeStamp);
|
205 |
+
|
206 |
/**
|
207 |
* Get the secret (hashed) token for a transaction
|
208 |
+
*
|
209 |
+
* @param string $tid
|
210 |
+
* The transaction ID you want to get the secret key for
|
211 |
+
* @return string
|
212 |
*/
|
213 |
abstract function getSecret($tid);
|
214 |
+
|
215 |
/**
|
216 |
* Get a list which includes all the payment methods (activated by mPAY24) for your mechant ID
|
217 |
+
*
|
218 |
+
* @return ListPaymentMethodsResponse
|
219 |
*/
|
220 |
function getPaymentMethods() {
|
221 |
+
if(! $this->mPay24Api)
|
222 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
223 |
+
|
224 |
$paymentMethods = $this->mPay24Api->ListPaymentMethods();
|
225 |
+
|
226 |
if($this->mPay24Api->getDebug()) {
|
227 |
+
$this->write_log("GetPaymentMethods", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
228 |
+
$this->write_log("GetPaymentMethods", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
229 |
}
|
230 |
+
|
231 |
return $paymentMethods;
|
232 |
}
|
233 |
+
|
234 |
/**
|
235 |
* Return a redirect URL to start a payment
|
236 |
+
*
|
237 |
+
* @return PaymentResponse
|
238 |
*/
|
239 |
function pay() {
|
240 |
+
if(! $this->mPay24Api)
|
241 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
242 |
+
|
243 |
$transaction = $this->createTransaction();
|
244 |
+
|
245 |
$this->checkTransaction($transaction);
|
246 |
+
|
247 |
libxml_use_internal_errors(true);
|
248 |
+
|
249 |
$mdxi = $this->createMDXI($transaction);
|
250 |
+
|
251 |
+
if(! $mdxi || ! $mdxi instanceof ORDER)
|
252 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php) and fulfill it with a MDXI!");
|
253 |
+
|
254 |
$mdxiXML = $mdxi->toXML();
|
255 |
+
|
256 |
+
if(! $this->mPay24Api->proxyUsed())
|
257 |
+
if(! $mdxi->validate()) {
|
258 |
$errors = "";
|
259 |
+
|
260 |
foreach(libxml_get_errors() as $error)
|
261 |
+
$errors .= trim($error->message) . "<br>";
|
262 |
+
|
263 |
+
$this->mPay24Api->dieWithMsg("The schema you have created is not valid!" . "<br><br>" . $errors . "<textarea cols='100' rows='30'>$mdxiXML</textarea>");
|
|
|
264 |
}
|
265 |
+
|
266 |
$mdxiXML = $mdxi->toXML();
|
267 |
+
|
268 |
$payResult = $this->mPay24Api->SelectPayment($mdxiXML);
|
269 |
+
|
270 |
if($this->mPay24Api->getDebug()) {
|
271 |
+
$this->write_log("Pay", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
272 |
+
$this->write_log("Pay", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
273 |
}
|
274 |
+
|
275 |
return $payResult;
|
276 |
}
|
277 |
+
|
278 |
/**
|
279 |
* Start a payment with customer profile
|
280 |
+
*
|
281 |
+
* @return PaymentResponse
|
282 |
*/
|
283 |
function payWithProfile() {
|
284 |
+
if(! $this->mPay24Api)
|
285 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
286 |
+
|
287 |
$transaction = $this->createTransaction();
|
288 |
+
|
289 |
$this->checkTransaction($transaction);
|
290 |
+
|
291 |
$order = $this->createProfileOrder($transaction);
|
292 |
+
|
293 |
+
if(! $order || ! $order instanceof ORDER)
|
294 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
295 |
+
|
296 |
$payWithProfileResult = $this->mPay24Api->ProfilePayment($order->toXML());
|
297 |
+
|
298 |
if($this->mPay24Api->getDebug()) {
|
299 |
+
$this->write_log("PayWithProfile", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
300 |
+
$this->write_log("PayWithProfile", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
301 |
}
|
302 |
+
|
303 |
return $payWithProfileResult;
|
304 |
}
|
305 |
+
|
306 |
/**
|
307 |
+
* Start a backend to backend payment
|
308 |
+
*
|
309 |
+
* @param string $paymentType
|
310 |
+
* The payment type which will be used for the payment (EPS, SOFORT, PAYPAL, MASTERPASS or TOKEN)
|
311 |
+
* @return PaymentResponse
|
312 |
*/
|
313 |
+
function payBackend2Backend($paymentType) {
|
314 |
+
if(! $this->mPay24Api)
|
315 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
316 |
+
|
317 |
+
if($paymentType !== 'PAYPAL' && $paymentType !== 'MASTERPASS' && $paymentType !== 'EPS' && $paymentType !== 'SOFORT' && $paymentType !== 'TOKEN')
|
318 |
+
die("The payment type '$paymentType' is not allowed! Allowed are: 'EPS', 'SOFORT', 'PAYPAL', 'MASTERPASS', 'TOKEN'!");
|
319 |
+
|
320 |
$transaction = $this->createTransaction();
|
321 |
+
|
322 |
$this->checkTransaction($transaction);
|
323 |
+
|
324 |
+
$order = $this->createBackend2BackendOrder($transaction, $paymentType);
|
325 |
+
|
326 |
+
if(! $order || ! $order instanceof ORDER)
|
327 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
328 |
+
|
329 |
+
$payBackend2BackendResult = $this->mPay24Api->AcceptPayment($order->toXML(), $paymentType);
|
330 |
+
|
331 |
if($this->mPay24Api->getDebug()) {
|
332 |
+
$this->write_log("PayBackend2Backend", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
333 |
+
$this->write_log("PayBackend2Backend", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
334 |
}
|
335 |
+
|
336 |
+
return $payBackend2BackendResult;
|
337 |
}
|
338 |
+
|
339 |
/**
|
340 |
+
* Finish the payment, started with PayPal Express Checkout - reserve, bill or cancel it: Whether are you going to reserve or bill a payment is setted at the beginning of the payment.
|
341 |
+
* With the 'cancel' parameter you are able also to cancel the transaction
|
342 |
+
*
|
343 |
+
* @param string $tid
|
344 |
+
* The transaction ID in the shop
|
345 |
+
* @param int $shippingCosts
|
346 |
+
* The shippingcosts for the transaction multiply by 100
|
347 |
+
* @param int $amount
|
348 |
+
* The amount you want to reserve/bill multiply by 100
|
349 |
+
* @param string $cancel
|
350 |
+
* ALLOWED: "true" or "false" - in case of 'true' the transaction will be canceled, otherwise reserved/billed
|
351 |
+
* @param string $paymentType
|
352 |
+
* The payment type which will be used for the express checkout (PAYPAL or MASTERPASS)
|
353 |
+
* @return PaymentResponse
|
354 |
*/
|
355 |
+
function finishExpressCheckoutPayment($tid, $shippingCosts, $amount, $cancel, $paymentType) {
|
356 |
+
if(! $this->mPay24Api)
|
357 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
358 |
+
|
359 |
if($cancel !== "true" && $cancel !== "false")
|
360 |
$this->mPay24Api->dieWithMsg("The allowed values for the parameter 'cancel' by finishing a PayPal (Express Checkout) payment are 'true' or 'false'!");
|
361 |
+
|
362 |
+
if($paymentType !== 'PAYPAL' && $paymentType !== 'MASTERPASS')
|
363 |
+
die("The payment type '$paymentType' is not allowed! Allowed are: 'PAYPAL' and 'MASTERPASS'");
|
364 |
+
|
365 |
$transaction = $this->getTransaction($tid);
|
366 |
+
|
367 |
$this->checkTransaction($transaction);
|
368 |
+
|
369 |
$mPAYTid = $transaction->MPAYTID;
|
370 |
+
|
371 |
+
if(! $mPAYTid)
|
372 |
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to finish with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
373 |
+
|
374 |
+
if(! $amount || ! is_numeric($amount))
|
375 |
+
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to pay by '$paymentType' is not valid!");
|
376 |
+
|
377 |
+
if(! $shippingCosts || ! is_numeric($shippingCosts))
|
378 |
$this->mPay24Api->dieWithMsg("The shipping costs '$shippingCosts' you are trying to set are not valid!");
|
379 |
+
|
380 |
$order = $this->createFinishExpressCheckoutOrder($transaction, $shippingCosts, $amount, $cancel);
|
381 |
+
|
382 |
+
if(! $order || ! $order instanceof ORDER)
|
383 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
384 |
+
|
385 |
+
$finishExpressCheckoutResult = $this->mPay24Api->Callback($order->toXML(), $paymentType);
|
386 |
+
|
387 |
if($this->mPay24Api->getDebug()) {
|
388 |
+
$this->write_log("FinishExpressCheckoutResult", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
389 |
+
$this->write_log("FinishExpressCheckoutResult", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
390 |
}
|
391 |
+
|
392 |
return $finishExpressCheckoutResult;
|
393 |
}
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Return a redirect URL to include in your web page
|
397 |
+
*
|
398 |
+
* @param string $paymentType
|
399 |
+
* The payment type which will be used for the express checkout (CC)
|
400 |
+
*
|
401 |
+
* @return PaymentTokenResponse
|
402 |
+
*/
|
403 |
+
function payWithToken($paymentType) {
|
404 |
+
if(! $this->mPay24Api)
|
405 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
406 |
+
|
407 |
+
if($paymentType !== 'CC')
|
408 |
+
die("The payment type '$paymentType' is not allowed! Currently allowed is only: 'CC'");
|
409 |
+
|
410 |
+
$tokenResult = $this->mPay24Api->CreateToken($paymentType);
|
411 |
+
|
412 |
+
if($this->mPay24Api->getDebug()) {
|
413 |
+
$this->write_log("CreateToken", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
414 |
+
$this->write_log("CreateToken", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
415 |
+
}
|
416 |
+
|
417 |
+
return $tokenResult;
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Finish the payment, started with PayPal Express Checkout - reserve, bill or cancel it: Whether are you going to reserve or bill a payment is setted at the beginning of the payment.
|
422 |
+
* With the 'cancel' parameter you are able also to cancel the transaction
|
423 |
+
*
|
424 |
+
* @param string $tid
|
425 |
+
* The transaction ID in the shop
|
426 |
+
* @param int $amount
|
427 |
+
* The amount you want to reserve/bill multiply by 100
|
428 |
+
* @param int $currency
|
429 |
+
* The currency you want to use for the transaction in ISO (EUR, USD, etc)
|
430 |
+
* @param string $token
|
431 |
+
* The token which was returned by the payWithToken function
|
432 |
+
* @return PaymentResponse
|
433 |
+
*/
|
434 |
+
function finishTokenPayment($tid, $amount, $currency, $token) {
|
435 |
+
if(! $this->mPay24Api)
|
436 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
437 |
+
|
438 |
+
$transaction = $this->getTransaction($tid);
|
439 |
+
|
440 |
+
$this->checkTransaction($transaction);
|
441 |
+
|
442 |
+
if(! $amount || ! is_numeric($amount))
|
443 |
+
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to pay is not valid!");
|
444 |
+
|
445 |
+
$finishTokenPaymentResult = $this->mPay24Api->PayWithToken($tid, $amount, $currency, $token);
|
446 |
+
|
447 |
+
if($this->mPay24Api->getDebug()) {
|
448 |
+
$this->write_log("FinishTokenPaymentResult", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
449 |
+
$this->write_log("FinishTokenPaymentResult", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
450 |
+
}
|
451 |
+
|
452 |
+
return $finishTokenPaymentResult;
|
453 |
+
}
|
454 |
+
|
455 |
/**
|
456 |
* Proceed the confirmation call
|
457 |
+
*
|
458 |
+
* @param string $tid
|
459 |
+
* The transaction ID in the shop
|
460 |
+
* @param array $args
|
461 |
+
* A list with the arguments, provided with the confirmation
|
462 |
*/
|
463 |
function confirm($tid, $args) {
|
464 |
$to_log = '';
|
465 |
$shippingConfirmed = "";
|
466 |
+
|
467 |
foreach($args as $name => $value)
|
468 |
+
$to_log .= $name . " = " . $value . "\n";
|
469 |
+
|
470 |
if($this->mPay24Api->getDebug())
|
471 |
+
$this->write_log("Confirmation for transaction '" . $tid . "'\n", utf8_encode($to_log) . "\n");
|
472 |
+
|
473 |
$transactionStatus = $this->updateTransactionStatus($tid);
|
474 |
+
|
475 |
$newArgs = $transactionStatus->getParams();
|
476 |
+
|
477 |
foreach($newArgs as $name => $value)
|
478 |
+
$to_log .= $name . " = " . $value . "\n";
|
479 |
+
|
480 |
if($this->mPay24Api->getDebug())
|
481 |
+
$this->write_log("Status for transaction " . $tid . ":", utf8_encode($to_log) . "\n");
|
482 |
+
|
483 |
if($transactionStatus->getParam("SHIPPING_ADDR")) {
|
484 |
$order = new DOMDocument();
|
485 |
$order->loadXML($transactionStatus->getParam("SHIPPING_ADDR"));
|
486 |
}
|
487 |
+
|
488 |
if(isset($order)) {
|
489 |
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
490 |
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
491 |
}
|
492 |
+
|
493 |
if($this->getSecret($tid) == $args['token']) {
|
494 |
if($shippingConfirmed == "false") {
|
495 |
$newArgs["SHIPP_NAME"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Name")->item(0)->nodeValue;
|
496 |
$newArgs["SHIPP_STREET"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street")->item(0)->nodeValue;
|
497 |
+
|
498 |
if($order->getElementsByTagName("Shipping")->item(0)->hasAttribute("Street2"))
|
499 |
$newArgs["SHIPP_STREET2"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street2")->item(0)->nodeValue;
|
500 |
+
|
501 |
$newArgs["SHIPP_ZIP"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Zip")->item(0)->nodeValue;
|
502 |
$newArgs["SHIPP_CITY"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("City")->item(0)->nodeValue;
|
503 |
$newArgs["SHIPP_COUNTRY"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Country")->item(0)->getAttribute("code");
|
506 |
return $this->updateTransaction($tid, $newArgs, true);
|
507 |
}
|
508 |
}
|
509 |
+
|
510 |
/**
|
511 |
* Get the transaction's current information - see details
|
512 |
*
|
520 |
* * SUSPENDED - in case the transaction is not fully compleated yet
|
521 |
* * NOT FOUND - in case there is not such a transaction in the mPAY24 database
|
522 |
* * ERROR - in case the transaction was not successful
|
523 |
+
*
|
524 |
+
* @param string $tid
|
525 |
+
* The transaction ID (in your shop), for the transaction you are asking for
|
526 |
+
* @return array
|
527 |
*/
|
528 |
function updateTransactionStatus($tid) {
|
529 |
+
if(! $this->mPay24Api)
|
530 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
531 |
+
|
532 |
$transaction = $this->getTransaction($tid);
|
533 |
+
|
534 |
$this->checkTransaction($transaction);
|
535 |
+
|
536 |
+
if(! $transaction->MPAYTID || ! is_numeric($transaction->MPAYTID)) {
|
537 |
$tidTransactionStatusResult = $this->mPay24Api->TransactionStatus(null, $tid);
|
538 |
+
|
539 |
if($this->mPay24Api->getDebug()) {
|
540 |
+
$this->write_log("TidTransactionStatus", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
541 |
+
$this->write_log("TidTransactionStatus", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
542 |
}
|
543 |
+
|
544 |
if($tidTransactionStatusResult->getParam("SHIPPING_ADDR")) {
|
545 |
$order = new DOMDocument();
|
546 |
$order->loadXML($tidTransactionStatusResult->getParam("SHIPPING_ADDR"));
|
547 |
}
|
548 |
+
|
549 |
if(isset($order)) {
|
550 |
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
551 |
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
552 |
+
|
553 |
if($shippingConfirmed == "false") {
|
554 |
$tidTransactionStatusResult->setParam("shippingConfirmed", false);
|
555 |
+
$tidTransactionStatusResult->setParam("SHIPP_NAME", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Name")->item(0)->nodeValue);
|
556 |
+
$tidTransactionStatusResult->setParam("SHIPP_STREET", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street")->item(0)->nodeValue);
|
|
|
|
|
557 |
if($tidTransactionStatusResult->getParam("SHIPP_STREET2"))
|
558 |
+
$tidTransactionStatusResult->setParam("SHIPP_STREET2", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street2")->item(0)->nodeValue);
|
559 |
+
$tidTransactionStatusResult->setParam("SHIPP_ZIP", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Zip")->item(0)->nodeValue);
|
560 |
+
$tidTransactionStatusResult->setParam("SHIPP_CITY", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("City")->item(0)->nodeValue);
|
561 |
+
$tidTransactionStatusResult->setParam("SHIPP_COUNTRY", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
|
|
|
|
|
|
|
|
562 |
} else
|
563 |
+
$tidTransactionStatusResult->setParam("shippingConfirmed", true);
|
564 |
} else
|
565 |
$tidTransactionStatusResult->setParam("shippingConfirmed", true);
|
566 |
+
|
567 |
return $tidTransactionStatusResult;
|
568 |
+
} else {
|
569 |
$mPAYTidTransactionStatusResult = $this->mPay24Api->TransactionStatus($transaction->MPAYTID, null);
|
570 |
+
|
571 |
if($this->mPay24Api->getDebug()) {
|
572 |
+
$this->write_log("mPAYTidTransactionStatus", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
573 |
+
$this->write_log("mPAYTidTransactionStatus", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
574 |
}
|
575 |
+
|
576 |
if($mPAYTidTransactionStatusResult->getParam("SHIPPING_ADDR")) {
|
577 |
$order = new DOMDocument();
|
578 |
$order->loadXML($mPAYTidTransactionStatusResult->getParam("SHIPPING_ADDR"));
|
579 |
}
|
580 |
+
|
581 |
if(isset($order)) {
|
582 |
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
583 |
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
584 |
+
|
585 |
if($shippingConfirmed == "false") {
|
586 |
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", false);
|
587 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_NAME", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Name")->item(0)->nodeValue);
|
588 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_STREET", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street")->item(0)->nodeValue);
|
589 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_STREET2", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street2")->item(0)->nodeValue);
|
590 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_ZIP", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Zip")->item(0)->nodeValue);
|
591 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_CITY", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("City")->item(0)->nodeValue);
|
592 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_COUNTRY", $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
} else
|
594 |
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", true);
|
595 |
} else
|
596 |
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", true);
|
597 |
+
|
598 |
return $mPAYTidTransactionStatusResult;
|
599 |
}
|
600 |
}
|
601 |
+
|
602 |
/**
|
603 |
* Clear an amount of an authorized transaction
|
604 |
+
*
|
605 |
+
* @param string $tid
|
606 |
+
* The transaction ID, for the transaction you want to clear
|
607 |
+
* @param int $amount
|
608 |
+
* The amount you want to clear multiply by 100
|
609 |
*/
|
610 |
function clearAmount($tid, $amount) {
|
611 |
+
if(! $this->mPay24Api)
|
612 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
613 |
+
|
614 |
$transaction = $this->getTransaction($tid);
|
615 |
+
|
616 |
$this->checkTransaction($transaction);
|
617 |
+
|
618 |
$mPAYTid = $transaction->MPAYTID;
|
619 |
$currency = $transaction->CURRENCY;
|
620 |
+
|
621 |
+
if(! $mPAYTid)
|
622 |
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to clear with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
623 |
+
|
624 |
+
if(! $amount || ! is_numeric($amount))
|
625 |
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to clear is not valid!");
|
626 |
+
|
627 |
+
if(! $currency || strlen($currency) != 3)
|
628 |
$this->mPay24Api->dieWithMsg("The currency code '$currency' for the amount you are trying to clear is not valid (3-digit ISO-Currency-Code)!");
|
629 |
+
|
630 |
$clearAmountResult = $this->mPay24Api->ManualClear($mPAYTid, $amount, $currency);
|
631 |
+
|
632 |
if($this->mPay24Api->getDebug()) {
|
633 |
+
$this->write_log("ClearAmount", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
634 |
+
$this->write_log("ClearAmount", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
635 |
}
|
636 |
+
|
637 |
return $clearAmountResult;
|
638 |
}
|
639 |
+
|
640 |
/**
|
641 |
* Credit an amount of a billed transaction
|
642 |
+
*
|
643 |
+
* @param string $tid
|
644 |
+
* The transaction ID, for the transaction you want to credit
|
645 |
+
* @param int $amount
|
646 |
+
* The amount you want to credit multiply by 100
|
647 |
*/
|
648 |
function creditAmount($tid, $amount) {
|
649 |
+
if(! $this->mPay24Api)
|
650 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
651 |
+
|
652 |
$transaction = $this->getTransaction($tid);
|
653 |
+
|
654 |
$this->checkTransaction($transaction);
|
655 |
+
|
656 |
$mPAYTid = $transaction->MPAYTID;
|
657 |
$currency = $transaction->CURRENCY;
|
658 |
$customer = $transaction->CUSTOMER;
|
659 |
+
|
660 |
+
if(! $mPAYTid)
|
661 |
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to credit with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
662 |
+
|
663 |
+
if(! $amount || ! is_numeric($amount))
|
664 |
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to credit is not valid!");
|
665 |
+
|
666 |
+
if(! $currency || strlen($currency) != 3)
|
667 |
$this->mPay24Api->dieWithMsg("The currency code '$currency' for the amount you are trying to credit is not valid (3-digit ISO-Currency-Code)!");
|
668 |
+
|
669 |
$creditAmountResult = $this->mPay24Api->ManualCredit($mPAYTid, $amount, $currency, $customer);
|
670 |
+
|
671 |
if($this->mPay24Api->getDebug()) {
|
672 |
+
$this->write_log("CreditAmount", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
673 |
+
$this->write_log("CreditAmount", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
674 |
}
|
675 |
+
|
676 |
return $creditAmountResult;
|
677 |
}
|
678 |
+
|
679 |
/**
|
680 |
* Cancel a authorized transaction
|
681 |
+
*
|
682 |
+
* @param string $tid
|
683 |
+
* The transaction ID, for the transaction you want to cancel
|
684 |
*/
|
685 |
function cancelTransaction($tid) {
|
686 |
+
if(! $this->mPay24Api)
|
687 |
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
688 |
+
|
689 |
$transaction = $this->getTransaction($tid);
|
690 |
+
|
691 |
$this->checkTransaction($transaction);
|
692 |
+
|
693 |
$mPAYTid = $transaction->MPAYTID;
|
694 |
+
|
695 |
+
if(! $mPAYTid)
|
696 |
$this->mPay24Api->dieWithMsgie("The transaction '$tid' you want to cancel with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
697 |
+
|
698 |
$cancelTransactionResult = $this->mPay24Api->ManualReverse($mPAYTid);
|
699 |
+
|
700 |
if($this->mPay24Api->getDebug()) {
|
701 |
+
$this->write_log("CancelTransaction", "REQUEST to " . $this->mPay24Api->getEtpURL() . " - " . str_replace("><", ">\n<", $this->mPay24Api->getRequest()) . "\n");
|
702 |
+
$this->write_log("CancelTransaction", "RESPONSE - " . str_replace("><", ">\n<", $this->mPay24Api->getResponse()) . "\n");
|
|
|
|
|
703 |
}
|
704 |
+
|
705 |
return $cancelTransactionResult;
|
706 |
}
|
707 |
+
|
708 |
/**
|
709 |
* Check if the a transaction is created, whether the object is from type Transaction and whether the mandatory settings (TID and PRICE) of a transaction are setted
|
710 |
+
*
|
711 |
+
* @param Transaction $tid
|
712 |
+
* The transaction, which should be checked
|
713 |
*/
|
714 |
private function checkTransaction($transaction) {
|
715 |
+
if(! $transaction || ! $transaction instanceof Transaction)
|
716 |
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create a Transaction object, which contains at least TID and PRICE!");
|
717 |
+
else if(! $transaction->TID)
|
718 |
$this->mPay24Api->dieWithMsg("The Transaction must contain TID!");
|
719 |
+
else if(! $transaction->PRICE)
|
720 |
$this->mPay24Api->dieWithMsg("The Transaction must contain PRICE!");
|
721 |
}
|
722 |
}
|
723 |
|
724 |
/**
|
725 |
* The properties, which are allowed for a transaction
|
726 |
+
* @const TRANSACTION_PROPERTIES
|
727 |
*/
|
728 |
define("TRANSACTION_PROPERTIES", "SECRET,TID,STATUS,MPAYTID,APPR_CODE,P_TYPE,
|
729 |
BRAND,PRICE,CURRENCY,OPERATION,LANGUAGE,
|
733 |
/**
|
734 |
* The Transaction class allows you to set and get different trnasaction's properties - see details
|
735 |
*
|
736 |
+
* TYPE: PARAMETER - VALUE(s), description
|
737 |
+
*
|
738 |
+
* * STRING: STATUS - OK, ERROR
|
739 |
+
* * STRING: OPERATION - CONFIRMATION
|
740 |
+
* * STRING: TID - length <= 32
|
741 |
+
* * STRING: TRANSACTION_STATUS - RESERVED, BILLED, REVERSED, CREDITED, ERROR
|
742 |
+
* * INT: PRICE - length = 11 (e. g. "10" = "0,10")
|
743 |
+
* * STRING: CURRENCY - length = 3 (ISO currency code, e. g. "EUR")
|
744 |
+
* * STRING: P_TYPE - CC, ELV, EPS, GIROPAY, MAESTRO, PB, PSC, QUICK, etc
|
745 |
+
* * STRING: BRAND - AMEX, DINERS, JCB, MASTERCARD, VISA, ATOS, HOBEX-AT, HOBEX-DE, etc
|
746 |
+
* * INT: MPAYTID - length = 11
|
747 |
+
* * STRING: USER_FIELD
|
748 |
+
* * STRING: ORDERDESC
|
749 |
+
* * STRING: CUSTOMER
|
750 |
+
* * STRING: CUSTOMER_EMAIL
|
751 |
+
* * STRING: LANGUAGE - length = 2
|
752 |
+
* * STRING: CUSTOMER_ID - length = 11
|
753 |
+
* * STRING: PROFILE_STATUS - IGNORED, USED, ERROR, CREATED, UPDATED, DELETED
|
754 |
+
* * STRING: FILTER_STATUS
|
755 |
+
* * STRING: APPR_CODE
|
756 |
*
|
757 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
758 |
+
* @version $Id: MPay24Shop.php 6271 2015-04-09 08:38:50Z anna $
|
759 |
+
* @filesource MPay24Shop.php
|
760 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
761 |
*/
|
762 |
class Transaction {
|
763 |
/**
|
764 |
* An array, which contains the allowed properties for an transaction
|
765 |
+
*
|
766 |
+
* @var $allowedProperties
|
767 |
*/
|
768 |
+
var $allowedProperties = array();
|
769 |
/**
|
770 |
* An array, which contains the set properties for this transaction object
|
771 |
+
*
|
772 |
+
* @var $allowedProperties
|
773 |
*/
|
774 |
+
var $properties = array();
|
775 |
+
|
776 |
/**
|
777 |
* Create a transaction object and set the allowed properties from the TRANSACTION_PROPERTIES
|
778 |
+
*
|
779 |
+
* @param string $tid
|
780 |
+
* The ID of a transaction
|
781 |
*/
|
782 |
function Transaction($tid) {
|
783 |
+
$this->allowedProperties = explode(",", preg_replace('/\s*/m', '', TRANSACTION_PROPERTIES));
|
784 |
$this->TID = $tid;
|
785 |
}
|
786 |
+
|
787 |
/**
|
788 |
* Get the property of the Transaction object
|
789 |
+
*
|
790 |
+
* @param string $property
|
791 |
+
* The name of the property, which is searched
|
792 |
+
* @return string|bool
|
793 |
*/
|
794 |
public function __get($property) {
|
795 |
+
if(! in_array($property, $this->allowedProperties))
|
796 |
die("The transaction's property " . $property . ", you want to get is not defined!");
|
797 |
+
|
798 |
if(isset($this->properties[$property]))
|
799 |
return $this->properties[$property];
|
800 |
else
|
801 |
return false;
|
802 |
}
|
803 |
+
|
804 |
/**
|
805 |
* Set the property of the Transaction object
|
806 |
+
*
|
807 |
+
* @param string $property
|
808 |
+
* The name of the property you want to set, see TRANSACTION_PROPERTIES
|
809 |
+
* @param mixed $value
|
810 |
+
* The value of the property you want to set
|
811 |
*/
|
812 |
public function __set($property, $value) {
|
813 |
+
if(! in_array($property, $this->allowedProperties))
|
814 |
die("The transaction's property " . $property . ", you want to set is not defined!");
|
815 |
$this->properties[$property] = $value;
|
816 |
}
|
817 |
+
|
818 |
/**
|
819 |
* Set all the allowed properties for this transaction
|
820 |
+
*
|
821 |
+
* @param array $args
|
822 |
+
* An array with the allowed properties
|
823 |
*/
|
824 |
protected function setProperties($args) {
|
825 |
$this->properties = $args;
|
826 |
}
|
827 |
+
|
828 |
/**
|
829 |
* Get all the allowed properties for this transaction
|
830 |
+
*
|
831 |
+
* @return array
|
832 |
*/
|
833 |
protected function getProperties() {
|
834 |
return $this->properties;
|
838 |
/**
|
839 |
* The abstract MPay24flexLINK class provides abstract functions, which are used from the other functions in order to create a flexLINK
|
840 |
*
|
841 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
842 |
+
* @version $Id: MPay24Shop.php 6271 2015-04-09 08:38:50Z anna $
|
843 |
+
* @filesource MPay24Shop.php
|
844 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
845 |
*/
|
846 |
abstract class MPay24flexLINK {
|
847 |
/**
|
848 |
* The mPAY24API Object, you are going to work with
|
849 |
+
*
|
850 |
+
* @var $mPay24Api
|
851 |
*/
|
852 |
var $mPay24Api = null;
|
853 |
+
|
854 |
/**
|
855 |
+
* The constructor, which sets all the initial values to be able making flexLINK transactions.
|
856 |
+
* In order to be able use this functionality, you should contact mPAY24 first.
|
|
|
|
|
|
|
|
|
|
|
857 |
*
|
858 |
+
* @param string $spid
|
859 |
+
* SPID, supported by mPAY24
|
860 |
+
* @param string $password
|
861 |
+
* The flexLINK password, supported by mPAY24
|
862 |
+
* @param bool $test
|
863 |
+
* TRUE - when you want to use the TEST system
|
864 |
+
*
|
865 |
+
* FALSE - when you want to use the LIVE system
|
866 |
+
* @param bool $debug
|
867 |
+
* TRUE - when you want to write log files
|
868 |
+
*
|
869 |
*/
|
870 |
+
function MPay24flexLINK($spid, $password, $test, $debug = false) {
|
871 |
+
if(! is_bool($test))
|
872 |
die("The test parameter '$test' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
873 |
+
|
874 |
+
if(! is_bool($debug))
|
875 |
die("The debug parameter '$debug' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
876 |
+
|
877 |
$this->mPay24Api = new MPay24Api();
|
878 |
+
|
879 |
$this->mPay24Api->configureFlexLINK($spid, $password, $test);
|
880 |
$this->mPay24Api->setDebug($debug);
|
881 |
+
|
882 |
+
if(version_compare(phpversion(), '5.0.0', '<') === true || ! in_array('mcrypt', get_loaded_extensions())) {
|
883 |
$this->mPay24Api->printMsg("ERROR: You don't meet the needed requirements for this example shop.<br>");
|
884 |
+
|
885 |
+
if(version_compare(phpversion(), '5.0.0', '<') === true)
|
886 |
$this->mPay24Api->printMsg("You need PHP version 5.0.0 or newer!<br>");
|
887 |
+
if(! in_array('mcrypt', get_loaded_extensions()))
|
888 |
$this->mPay24Api->printMsg("You need mcrypt extension!<br>");
|
889 |
+
$this->mPay24Api->dieWithMsg("Please load the required extensions!");
|
890 |
}
|
891 |
}
|
892 |
+
|
893 |
/**
|
894 |
* Encrypt the parameters you want to post to mPAY24 - see details
|
895 |
+
*
|
896 |
+
* @param string $invoice_id
|
897 |
+
* The invoice ID of the transaction
|
898 |
+
* @param string $amount
|
899 |
+
* The amount which should be invoiced in 12.34
|
900 |
+
* @param string $currency
|
901 |
+
* length = 3 (ISO currency code, e. g. "EUR")
|
902 |
+
* @param string $language
|
903 |
+
* length = 2 (ISO currency code, e. g. "DE")
|
904 |
+
* @param string $user_field
|
905 |
+
* A place hollder for free chosen user information
|
906 |
+
* @param string $mode
|
907 |
+
* BillingAddress Mode (ReadWrite or ReadOnly)
|
908 |
+
* @param string $salutation
|
909 |
+
* Salutation of the customer
|
910 |
+
* @param string $name
|
911 |
+
* Name of the customer
|
912 |
+
* @param string $street
|
913 |
+
* Billing address street
|
914 |
+
* @param string $street2
|
915 |
+
* Billing address street2
|
916 |
+
* @param string $zip
|
917 |
+
* Billing address zip
|
918 |
+
* @param string $city
|
919 |
+
* Billing address city
|
920 |
+
* @param string $country
|
921 |
+
* Billing address country, length = 2 (ISO country code, e. g. "AT")
|
922 |
+
* @param string $email
|
923 |
+
* Billing address e-mail
|
924 |
+
* @param string $phone
|
925 |
+
* Billing address phone
|
926 |
+
* @param string $success
|
927 |
+
* Success-URL
|
928 |
+
* @param string $error
|
929 |
+
* Error-URL
|
930 |
+
* @param string $confirmation
|
931 |
+
* Confirmation-URL
|
932 |
+
* @param string $invoice_idVar
|
933 |
+
* Default = TID
|
934 |
+
* @param string $amountVar
|
935 |
+
* Default = AMOUNT
|
936 |
+
* @param string $currencyVar
|
937 |
+
* Default = CURRENCY
|
938 |
+
* @param string $languageVar
|
939 |
+
* Default = LANGUAGE
|
940 |
+
* @param string $user_fieldVar
|
941 |
+
* Default = USER_FIELD
|
942 |
+
* @param string $modeVar
|
943 |
+
* Default = MODE
|
944 |
+
* @param string $salutationVar
|
945 |
+
* Default = SALUTATION
|
946 |
+
* @param string $nameVar
|
947 |
+
* Default = NAME
|
948 |
+
* @param string $streetVar
|
949 |
+
* Default = STREET
|
950 |
+
* @param string $street2Var
|
951 |
+
* Default = STREET2
|
952 |
+
* @param string $zipVar
|
953 |
+
* Default = ZIP
|
954 |
+
* @param string $cityVar
|
955 |
+
* Default = CITY
|
956 |
+
* @param string $countryVar
|
957 |
+
* Default = COUNTRY
|
958 |
+
* @param string $emailVar
|
959 |
+
* Default = EMAIL
|
960 |
+
* @param string $phoneVar
|
961 |
+
* Default = PHONE
|
962 |
+
* @param string $successVar
|
963 |
+
* Default = SUCCCESS_URL
|
964 |
+
* @param string $errorVar
|
965 |
+
* Default = ERROR_URL
|
966 |
+
* @param string $confirmationVar
|
967 |
+
* Default = CONFIRMATION_URL
|
968 |
+
* @return string
|
969 |
+
*/
|
970 |
+
function getEncryptedParams( // parameter values
|
971 |
+
$invoice_id, $amount, $currency = NULL, $language = NULL, $user_field = NULL, $mode = NULL, $salutation = NULL, $name = NULL, $street = NULL, $street2 = NULL, $zip = NULL, $city = NULL, $country = NULL, $email = NULL, $phone = NULL, $success = NULL, $error = NULL, $confirmation = NULL,
|
972 |
+
// parameters names
|
973 |
+
$invoice_idVar = "TID", $amountVar = "AMOUNT", $currencyVar = "CURRENCY", $languageVar = "LANGUAGE", $user_fieldVar = "USER_FIELD", $modeVar = "MODE", $salutationVar = "SALUTATION", $nameVar = "NAME", $streetVar = "STREET", $street2Var = "STREET2", $zipVar = "ZIP", $cityVar = "CITY", $countryVar = "COUNTRY", $emailVar = "EMAIL", $phoneVar = "PHONE", $successVar = "SUCCESS_URL", $errorVar = "ERROR_URL", $confirmationVar = "CONFIRMATION_URL") {
|
974 |
+
if(! $this->mPay24Api)
|
975 |
die("You are not allowed to define a constructor in the child class of MPay24flexLINK!");
|
976 |
+
|
977 |
$params[$invoice_idVar] = $invoice_id;
|
978 |
$params[$amountVar] = $amount;
|
979 |
+
|
980 |
if($currency == NULL)
|
981 |
$currency = "EUR";
|
982 |
+
|
983 |
$params[$currencyVar] = $currency;
|
984 |
+
|
985 |
if($language == NULL)
|
986 |
$language = "DE";
|
987 |
+
|
988 |
$params[$languageVar] = $language;
|
989 |
$params[$user_fieldVar] = $user_field;
|
990 |
+
|
991 |
if($description == NULL)
|
992 |
$description = "Rechnungsnummer:";
|
993 |
+
|
994 |
$params[$descriptionVar] = $description;
|
995 |
+
|
996 |
if($mode == NULL)
|
997 |
$mode = "ReadWrite";
|
998 |
+
|
999 |
$params[$modeVar] = $mode;
|
1000 |
+
|
1001 |
$params[$nameVar] = $name;
|
1002 |
$params[$streetVar] = $street;
|
1003 |
$params[$street2Var] = $street2;
|
1004 |
$params[$zipVar] = $zip;
|
1005 |
$params[$cityVar] = $city;
|
1006 |
+
|
1007 |
if($country == NULL)
|
1008 |
$country = "AT";
|
1009 |
+
|
1010 |
$params[$countryVar] = $country;
|
1011 |
+
|
1012 |
$params[$emailVar] = $email;
|
1013 |
$params[$successVar] = $success;
|
1014 |
$params[$errorVar] = $error;
|
1015 |
$params[$confirmationVar] = $confirmation;
|
1016 |
+
|
1017 |
foreach($params as $key => $value)
|
1018 |
if($this->mPay24Api->getDebug())
|
1019 |
$this->write_flexLINK_log("flexLINK:\t\t\tParameters: $key = $value\n");
|
1020 |
+
|
1021 |
$parameters = $this->mPay24Api->flexLINK($params);
|
1022 |
+
|
1023 |
if($this->mPay24Api->getDebug())
|
1024 |
$this->write_flexLINK_log("flexLINK:\t\t\tEncrypted parameters: $parameters\n");
|
1025 |
+
|
1026 |
return $parameters;
|
1027 |
}
|
1028 |
+
|
1029 |
/**
|
1030 |
* Get the whole URL (flexLINK) to the mPAY24 pay page, used to pay an invoice
|
1031 |
+
*
|
1032 |
+
* @param string $encryptedParams
|
1033 |
+
* The encrypted parameters, returned by the function getEncryptedParams
|
1034 |
+
* @return stringAn URL to pay
|
1035 |
*/
|
1036 |
public function getPayLink($encryptedParams) {
|
1037 |
if($this->mPay24Api->getDebug())
|
1038 |
+
$this->write_flexLINK_log("flexLINK:\t\t\tURL: https://" . $this->mPay24Api->getFlexLINKSystem() . ".mpay24.com/app/bin/checkout/" . $this->mPay24Api->getSPID() . "/$encryptedParams\n");
|
1039 |
+
|
1040 |
+
return "https://" . $this->mPay24Api->getFlexLINKSystem() . ".mpay24.com/app/bin/checkout/" . $this->mPay24Api->getSPID() . "/$encryptedParams";
|
1041 |
}
|
1042 |
+
|
1043 |
/**
|
1044 |
* Write a flexLINK log into a file, file system, data base
|
1045 |
+
*
|
1046 |
+
* @param string $info_to_log
|
1047 |
+
* The information, which is to log: request, response, etc.
|
1048 |
*/
|
1049 |
abstract function write_flexLINK_log($info_to_log);
|
1050 |
}
|
app/code/community/Mpay24/Mpay24/Model/Api/curllog.log
DELETED
File without changes
|
app/code/community/Mpay24/Mpay24/Model/Api/orderXML.php
CHANGED
@@ -3,190 +3,208 @@
|
|
3 |
* The URL specified from mPAY24, where MDXI schema will be download from
|
4 |
* @const MDXI_SCHEMA
|
5 |
*/
|
6 |
-
define
|
7 |
|
8 |
/**
|
9 |
* The ORDER class provides the functioanallity to create a XML, which is validatable with the MDXI.xsd
|
10 |
*
|
11 |
-
* @author
|
12 |
-
* @version
|
13 |
-
* @filesource
|
14 |
-
* @license
|
15 |
*/
|
16 |
class ORDER {
|
17 |
/**
|
18 |
* The DOMDocument, which the MDXI XML will be build on
|
19 |
-
*
|
|
|
20 |
*/
|
21 |
private $doc;
|
22 |
/**
|
23 |
* A DOMNode from the MDXI XML, or the whole MDXI XML, represented as DOMDocument
|
24 |
-
*
|
|
|
25 |
*/
|
26 |
private $node;
|
27 |
-
|
28 |
/**
|
29 |
* Create a DOMDocument or a ORDER-Object with root $doc
|
30 |
-
*
|
31 |
-
* @param
|
|
|
|
|
|
|
32 |
*/
|
33 |
-
public function ORDER($doc=null
|
34 |
-
if
|
35 |
$this->doc = $doc;
|
36 |
else {
|
37 |
$this->doc = new DOMDocument("1.0", "UTF-8");
|
38 |
$this->doc->formatOutput = true;
|
39 |
}
|
40 |
-
|
41 |
-
if
|
42 |
$this->node = $node;
|
43 |
else
|
44 |
$this->node = $this->doc;
|
45 |
}
|
46 |
-
|
47 |
/**
|
48 |
* Generic call-Method instead of numerous setter methods
|
49 |
-
*
|
50 |
-
* @param
|
51 |
-
*
|
52 |
-
*
|
|
|
|
|
|
|
53 |
*/
|
54 |
public function __call($method, $args) {
|
55 |
if(substr($method, 0, 3) == "set" && $args[0] != '') {
|
56 |
$attributeName = substr($method, 3);
|
57 |
-
|
58 |
$value = $args[0];
|
59 |
-
|
60 |
if(preg_match('/\b[0-9]+,[0-9]+\b/', $value, $match))
|
61 |
$value = str_replace(',', '.', $match[0]);
|
62 |
-
|
63 |
if(preg_match('/\b[0-9]+.[0-9]+\b/', $value, $match) && $value == $match[0] && $attributeName != 'shippingCosts' && (is_int(strpos($attributeName, 'price')) || is_int(strpos($attributeName, 'Price')) || is_int(strpos($attributeName, 'Tax')) || is_int(strpos($attributeName, 'cost')) || is_int(strpos($attributeName, 'Cost'))))
|
64 |
$value = number_format(floatval($match[0]), 2, '.', '');
|
65 |
-
|
66 |
-
|
67 |
} elseif($args[0] != '') {
|
68 |
-
if(sizeof($args)>2)
|
69 |
die("It is not allowed to set more than 2 arguments for the node '$method'!");
|
70 |
-
if(!is_int($args[0]) || $args[0] < 1)
|
71 |
die("The first argument for the node '$method' must be whole number, bigger than 0!");
|
72 |
-
|
73 |
$name = $method . '[' . $args[0] . ']';
|
74 |
-
|
75 |
$xpath = new DOMXPath($this->doc);
|
76 |
-
$qry = $xpath->query($name
|
77 |
-
|
78 |
-
if
|
79 |
-
return new ORDER($this->doc
|
80 |
else {
|
81 |
if(array_key_exists(1, $args)) {
|
82 |
$value = $args[1];
|
83 |
-
|
84 |
if(preg_match('/\b[0-9]+,[0-9]+\b/', $value, $match))
|
85 |
$value = str_replace(',', '.', $match[0]);
|
86 |
-
|
87 |
if(preg_match('/\b[0-9]+.[0-9]+\b/', $value, $match) && $value == $match[0] && $name != 'shippingCosts' && (is_int(strpos($name, 'price')) || is_int(strpos($name, 'Price')) || is_int(strpos($name, 'Tax')) || is_int(strpos($name, 'cost')) || is_int(strpos($name, 'Cost'))))
|
88 |
$value = number_format(floatval($match[0]), 2, '.', '');
|
89 |
-
|
90 |
$node = $this->doc->createElement($method, $value);
|
91 |
} else
|
92 |
$node = $this->doc->createElement($method);
|
93 |
-
|
94 |
$node = $this->node->appendChild($node);
|
95 |
-
|
96 |
-
return new ORDER($this->doc
|
97 |
}
|
98 |
}
|
99 |
}
|
100 |
-
|
101 |
/**
|
102 |
* Get the value of a ORDER-Variable
|
103 |
-
*
|
104 |
-
* @
|
|
|
|
|
105 |
*/
|
106 |
public function __get($name) {
|
107 |
$xpath = new DOMXPath($this->doc);
|
108 |
-
$qry = $xpath->query($name
|
109 |
-
|
110 |
-
if
|
111 |
-
return new ORDER($this->doc
|
112 |
else {
|
113 |
$node = $this->doc->createElement($name);
|
114 |
$node = $this->node->appendChild($node);
|
115 |
-
return new ORDER($this->doc
|
116 |
}
|
117 |
}
|
118 |
-
|
119 |
/**
|
120 |
* Set the value of a ORDER-Variable
|
121 |
-
*
|
122 |
-
* @param
|
|
|
|
|
|
|
123 |
*/
|
124 |
public function __set($name, $value) {
|
125 |
$xpath = new DOMXPath($this->doc);
|
126 |
-
$qry = $xpath->query($name
|
127 |
-
|
128 |
$value = str_replace('&', '&', $value);
|
129 |
-
|
130 |
if(preg_match('/\b[0-9]+,[0-9]+\b/', $value, $match))
|
131 |
$value = str_replace(',', '.', $match[0]);
|
132 |
-
|
133 |
if(preg_match('/\b[0-9]+.[0-9]+\b/', $value, $match) && $value == $match[0] && $name != 'shippingCosts' && (is_int(strpos($name, 'price')) || is_int(strpos($name, 'Price')) || is_int(strpos($name, 'Tax')) || is_int(strpos($name, 'cost')) || is_int(strpos($name, 'Cost'))))
|
134 |
$value = number_format(floatval($match[0]), 2, '.', '');
|
135 |
-
|
136 |
if(strpos($value, "<") || strpos($value, ">"))
|
137 |
$value = "<![CDATA[" . $this->xmlencode($value) . "]]>";
|
138 |
-
|
139 |
-
if
|
140 |
$qry->item(0)->nodeValue = $value;
|
141 |
else {
|
142 |
-
$node = $this->doc->createElement($name
|
143 |
$this->node = $this->node->appendChild($node);
|
144 |
}
|
145 |
}
|
146 |
-
|
147 |
/**
|
148 |
* Create a XML-Object from the ORDER-Object and return it
|
149 |
-
*
|
|
|
150 |
*/
|
151 |
public function toXML() {
|
152 |
return $this->doc->saveXML();
|
153 |
}
|
154 |
-
|
155 |
/**
|
156 |
* Validate the ORDER with the schema, defined in the constant MDXI_SCHEMA and return TRUE if the validation was successful or FALSE
|
157 |
-
*
|
|
|
158 |
*/
|
159 |
public function validate() {
|
160 |
$mdxi = "/MDXI.xsd";
|
161 |
-
|
162 |
-
if($this->olderThanOneWeek(__DIR__ . $mdxi)) {
|
163 |
set_time_limit(0);
|
164 |
-
ini_set('display_errors',true);
|
165 |
-
|
166 |
-
$fp = fopen
|
167 |
$ch = curl_init(MDXI_SCHEMA);
|
168 |
curl_setopt($ch, CURLOPT_FILE, $fp);
|
169 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
170 |
-
curl_setopt($ch, CURLOPT_CAINFO, __DIR__.'/cacert.pem');
|
|
|
171 |
$result = curl_exec($ch);
|
172 |
-
|
173 |
if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200 && file_exists(__DIR__ . '/MDXInew.xsd')) {
|
174 |
unlink(__DIR__ . $mdxi);
|
175 |
fclose($fp);
|
176 |
rename(__DIR__ . "/MDXInew.xsd", __DIR__ . $mdxi);
|
177 |
} else
|
178 |
fclose($fp);
|
179 |
-
|
180 |
curl_close($ch);
|
181 |
}
|
182 |
-
|
183 |
return $this->doc->schemaValidate(__DIR__ . $mdxi);
|
184 |
}
|
185 |
-
|
186 |
/**
|
187 |
* Encode the XML-characters in a string
|
188 |
-
*
|
189 |
-
* @
|
|
|
|
|
190 |
*/
|
191 |
private function xmlencode($txt) {
|
192 |
$txt = str_replace('<', '<', $txt);
|
@@ -195,35 +213,37 @@ class ORDER {
|
|
195 |
$txt = str_replace('&quot;', '"', $txt);
|
196 |
return $txt;
|
197 |
}
|
198 |
-
|
199 |
/**
|
200 |
* Check whether the MDXI.xsd is older than one week
|
201 |
-
*
|
202 |
-
* @
|
|
|
|
|
203 |
*/
|
204 |
-
private function olderThanOneWeek($filename){
|
205 |
-
$year = date
|
206 |
-
$month = date
|
207 |
-
$day = date
|
208 |
-
|
209 |
-
$tyear = date
|
210 |
-
$tmonth = date
|
211 |
-
$tday = date
|
212 |
-
|
213 |
if($tyear > $year)
|
214 |
return true;
|
215 |
else {
|
216 |
-
if($tmonth > $month){
|
217 |
if($tday > 7)
|
218 |
return true;
|
219 |
else {
|
220 |
-
if($tday-7+30 < $day)
|
221 |
return false;
|
222 |
else
|
223 |
return true;
|
224 |
}
|
225 |
} else {
|
226 |
-
if($tday-7 > $day)
|
227 |
return true;
|
228 |
else
|
229 |
return false;
|
3 |
* The URL specified from mPAY24, where MDXI schema will be download from
|
4 |
* @const MDXI_SCHEMA
|
5 |
*/
|
6 |
+
define("MDXI_SCHEMA", "https://www.mpay24.com/schemas/MDXI/v3.0/MDXI.xsd");
|
7 |
|
8 |
/**
|
9 |
* The ORDER class provides the functioanallity to create a XML, which is validatable with the MDXI.xsd
|
10 |
*
|
11 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
12 |
+
* @version $Id: orderXML.php 6231 2015-03-13 16:29:56Z anna $
|
13 |
+
* @filesource orderXML.php
|
14 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
15 |
*/
|
16 |
class ORDER {
|
17 |
/**
|
18 |
* The DOMDocument, which the MDXI XML will be build on
|
19 |
+
*
|
20 |
+
* @var DOMDocument
|
21 |
*/
|
22 |
private $doc;
|
23 |
/**
|
24 |
* A DOMNode from the MDXI XML, or the whole MDXI XML, represented as DOMDocument
|
25 |
+
*
|
26 |
+
* @var DOMDocument|DOMNode
|
27 |
*/
|
28 |
private $node;
|
29 |
+
|
30 |
/**
|
31 |
* Create a DOMDocument or a ORDER-Object with root $doc
|
32 |
+
*
|
33 |
+
* @param DOMNode $doc
|
34 |
+
* The root DOMNode of an XML tree
|
35 |
+
* @param DOMNode $node
|
36 |
+
* The child DOMNode
|
37 |
*/
|
38 |
+
public function ORDER($doc = null, $node = null) {
|
39 |
+
if($doc)
|
40 |
$this->doc = $doc;
|
41 |
else {
|
42 |
$this->doc = new DOMDocument("1.0", "UTF-8");
|
43 |
$this->doc->formatOutput = true;
|
44 |
}
|
45 |
+
|
46 |
+
if($node)
|
47 |
$this->node = $node;
|
48 |
else
|
49 |
$this->node = $this->doc;
|
50 |
}
|
51 |
+
|
52 |
/**
|
53 |
* Generic call-Method instead of numerous setter methods
|
54 |
+
*
|
55 |
+
* @param string $method
|
56 |
+
* The name of the method, which is called for the Item-Object
|
57 |
+
* @param array $args
|
58 |
+
* The arguments with them the method is called - minOccurance = 0, maxOccurance = 2:
|
59 |
+
* The first argument must be a positive integer (will be used as a index)
|
60 |
+
* The second argument is optional and would be used as value for the DOMNode
|
61 |
*/
|
62 |
public function __call($method, $args) {
|
63 |
if(substr($method, 0, 3) == "set" && $args[0] != '') {
|
64 |
$attributeName = substr($method, 3);
|
65 |
+
|
66 |
$value = $args[0];
|
67 |
+
|
68 |
if(preg_match('/\b[0-9]+,[0-9]+\b/', $value, $match))
|
69 |
$value = str_replace(',', '.', $match[0]);
|
70 |
+
|
71 |
if(preg_match('/\b[0-9]+.[0-9]+\b/', $value, $match) && $value == $match[0] && $attributeName != 'shippingCosts' && (is_int(strpos($attributeName, 'price')) || is_int(strpos($attributeName, 'Price')) || is_int(strpos($attributeName, 'Tax')) || is_int(strpos($attributeName, 'cost')) || is_int(strpos($attributeName, 'Cost'))))
|
72 |
$value = number_format(floatval($match[0]), 2, '.', '');
|
73 |
+
|
74 |
+
$this->node->setAttribute($attributeName, $value);
|
75 |
} elseif($args[0] != '') {
|
76 |
+
if(sizeof($args) > 2)
|
77 |
die("It is not allowed to set more than 2 arguments for the node '$method'!");
|
78 |
+
if(! is_int($args[0]) || $args[0] < 1)
|
79 |
die("The first argument for the node '$method' must be whole number, bigger than 0!");
|
80 |
+
|
81 |
$name = $method . '[' . $args[0] . ']';
|
82 |
+
|
83 |
$xpath = new DOMXPath($this->doc);
|
84 |
+
$qry = $xpath->query($name, $this->node);
|
85 |
+
|
86 |
+
if($qry->length > 0)
|
87 |
+
return new ORDER($this->doc, $qry->item(0));
|
88 |
else {
|
89 |
if(array_key_exists(1, $args)) {
|
90 |
$value = $args[1];
|
91 |
+
|
92 |
if(preg_match('/\b[0-9]+,[0-9]+\b/', $value, $match))
|
93 |
$value = str_replace(',', '.', $match[0]);
|
94 |
+
|
95 |
if(preg_match('/\b[0-9]+.[0-9]+\b/', $value, $match) && $value == $match[0] && $name != 'shippingCosts' && (is_int(strpos($name, 'price')) || is_int(strpos($name, 'Price')) || is_int(strpos($name, 'Tax')) || is_int(strpos($name, 'cost')) || is_int(strpos($name, 'Cost'))))
|
96 |
$value = number_format(floatval($match[0]), 2, '.', '');
|
97 |
+
|
98 |
$node = $this->doc->createElement($method, $value);
|
99 |
} else
|
100 |
$node = $this->doc->createElement($method);
|
101 |
+
|
102 |
$node = $this->node->appendChild($node);
|
103 |
+
|
104 |
+
return new ORDER($this->doc, $node);
|
105 |
}
|
106 |
}
|
107 |
}
|
108 |
+
|
109 |
/**
|
110 |
* Get the value of a ORDER-Variable
|
111 |
+
*
|
112 |
+
* @param string $name
|
113 |
+
* The name of the method, which is called for the Item-Object
|
114 |
+
* @return ORDER
|
115 |
*/
|
116 |
public function __get($name) {
|
117 |
$xpath = new DOMXPath($this->doc);
|
118 |
+
$qry = $xpath->query($name, $this->node);
|
119 |
+
|
120 |
+
if($qry->length > 0)
|
121 |
+
return new ORDER($this->doc, $qry->item(0));
|
122 |
else {
|
123 |
$node = $this->doc->createElement($name);
|
124 |
$node = $this->node->appendChild($node);
|
125 |
+
return new ORDER($this->doc, $node);
|
126 |
}
|
127 |
}
|
128 |
+
|
129 |
/**
|
130 |
* Set the value of a ORDER-Variable
|
131 |
+
*
|
132 |
+
* @param string $name
|
133 |
+
* The name of the Node you want to set
|
134 |
+
* @param mixed $value
|
135 |
+
* The value of the Node you want to set
|
136 |
*/
|
137 |
public function __set($name, $value) {
|
138 |
$xpath = new DOMXPath($this->doc);
|
139 |
+
$qry = $xpath->query($name, $this->node);
|
140 |
+
|
141 |
$value = str_replace('&', '&', $value);
|
142 |
+
|
143 |
if(preg_match('/\b[0-9]+,[0-9]+\b/', $value, $match))
|
144 |
$value = str_replace(',', '.', $match[0]);
|
145 |
+
|
146 |
if(preg_match('/\b[0-9]+.[0-9]+\b/', $value, $match) && $value == $match[0] && $name != 'shippingCosts' && (is_int(strpos($name, 'price')) || is_int(strpos($name, 'Price')) || is_int(strpos($name, 'Tax')) || is_int(strpos($name, 'cost')) || is_int(strpos($name, 'Cost'))))
|
147 |
$value = number_format(floatval($match[0]), 2, '.', '');
|
148 |
+
|
149 |
if(strpos($value, "<") || strpos($value, ">"))
|
150 |
$value = "<![CDATA[" . $this->xmlencode($value) . "]]>";
|
151 |
+
|
152 |
+
if($qry->length > 0)
|
153 |
$qry->item(0)->nodeValue = $value;
|
154 |
else {
|
155 |
+
$node = $this->doc->createElement($name, $value);
|
156 |
$this->node = $this->node->appendChild($node);
|
157 |
}
|
158 |
}
|
159 |
+
|
160 |
/**
|
161 |
* Create a XML-Object from the ORDER-Object and return it
|
162 |
+
*
|
163 |
+
* @return XML
|
164 |
*/
|
165 |
public function toXML() {
|
166 |
return $this->doc->saveXML();
|
167 |
}
|
168 |
+
|
169 |
/**
|
170 |
* Validate the ORDER with the schema, defined in the constant MDXI_SCHEMA and return TRUE if the validation was successful or FALSE
|
171 |
+
*
|
172 |
+
* @return bool
|
173 |
*/
|
174 |
public function validate() {
|
175 |
$mdxi = "/MDXI.xsd";
|
176 |
+
|
177 |
+
if(! file_exists($mdxi) || $this->olderThanOneWeek(__DIR__ . $mdxi)) {
|
178 |
set_time_limit(0);
|
179 |
+
ini_set('display_errors', true);
|
180 |
+
|
181 |
+
$fp = fopen(__DIR__ . '/MDXInew.xsd', 'w');
|
182 |
$ch = curl_init(MDXI_SCHEMA);
|
183 |
curl_setopt($ch, CURLOPT_FILE, $fp);
|
184 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
185 |
+
curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . '/cacert.pem');
|
186 |
+
|
187 |
$result = curl_exec($ch);
|
188 |
+
|
189 |
if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200 && file_exists(__DIR__ . '/MDXInew.xsd')) {
|
190 |
unlink(__DIR__ . $mdxi);
|
191 |
fclose($fp);
|
192 |
rename(__DIR__ . "/MDXInew.xsd", __DIR__ . $mdxi);
|
193 |
} else
|
194 |
fclose($fp);
|
195 |
+
|
196 |
curl_close($ch);
|
197 |
}
|
198 |
+
|
199 |
return $this->doc->schemaValidate(__DIR__ . $mdxi);
|
200 |
}
|
201 |
+
|
202 |
/**
|
203 |
* Encode the XML-characters in a string
|
204 |
+
*
|
205 |
+
* @param string $txt
|
206 |
+
* A string to be encoded
|
207 |
+
* @return string
|
208 |
*/
|
209 |
private function xmlencode($txt) {
|
210 |
$txt = str_replace('<', '<', $txt);
|
213 |
$txt = str_replace('&quot;', '"', $txt);
|
214 |
return $txt;
|
215 |
}
|
216 |
+
|
217 |
/**
|
218 |
* Check whether the MDXI.xsd is older than one week
|
219 |
+
*
|
220 |
+
* @param string $filename
|
221 |
+
* The path to the file (MDXI.xsd)
|
222 |
+
* @return bool
|
223 |
*/
|
224 |
+
private function olderThanOneWeek($filename) {
|
225 |
+
$year = date("Y", filemtime($filename));
|
226 |
+
$month = date("m", filemtime($filename));
|
227 |
+
$day = date("d", filemtime($filename));
|
228 |
+
|
229 |
+
$tyear = date("Y");
|
230 |
+
$tmonth = date("m");
|
231 |
+
$tday = date("d");
|
232 |
+
|
233 |
if($tyear > $year)
|
234 |
return true;
|
235 |
else {
|
236 |
+
if($tmonth > $month) {
|
237 |
if($tday > 7)
|
238 |
return true;
|
239 |
else {
|
240 |
+
if($tday - 7 + 30 < $day)
|
241 |
return false;
|
242 |
else
|
243 |
return true;
|
244 |
}
|
245 |
} else {
|
246 |
+
if($tday - 7 > $day)
|
247 |
return true;
|
248 |
else
|
249 |
return false;
|
app/code/community/Mpay24/Mpay24/Model/Api/xmls/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/*.xml
|
|
app/code/community/Mpay24/Mpay24/Model/Api/xmls/145000006.xml
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<Order Style="margin-left: auto; margin-right: auto; color:#647378" PageHeaderStyle="background-color: #FFF;margin-bottom:14px;" PageCaptionStyle="background-color:#FFF;background:transparent;color:#647378;padding-left:0px;" PageStyle="border:1px solid #838F93;background-color:#FFF;" InputFieldsStyle="background-color:#ffffff;border:1px solid #DDE1E7;padding:2px 0px;margin-bottom:5px;" DropDownListsStyle="padding:2px 0px;margin-bottom:5px;" ButtonsStyle="background-color: #005AC1;border: none;color: #FFFFFF;cursor: pointer;font-size:10px;font-weight:bold;padding:5px 10px;text-transform:uppercase;" ErrorsStyle="background-color: #FFF;padding: 10px 0px;" SuccessTitleStyle="background-color: #FFF;" ErrorTitleStyle="background-color: #FFF;">
|
3 |
-
<ClientIP>127.0.0.1</ClientIP>
|
4 |
-
<UserField>Magento v 1.9.2.2 Module v 1.6.2 145000006_2015-11-04</UserField>
|
5 |
-
<Tid>145000006</Tid>
|
6 |
-
<TemplateSet Language="DE" CSSName="MOBILE"/>
|
7 |
-
<PaymentTypes Enable="true">
|
8 |
-
<Payment Type="CC" Brand="VISA"/>
|
9 |
-
</PaymentTypes>
|
10 |
-
<ShoppingCart Header="WARENKORB" HeaderStyle="background-color:#FFF;margin-bottom:14px;color:#647378" CaptionStyle="background-color:#FFF;background:transparent;color:#647378;padding-left:0px;font-size:14px;" DescriptionHeader="BESCHREIBUNG" DescriptionStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;" QuantityHeader="ANZAHL" QuantityStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;" ItemPriceHeader="EINZELPREIS" ItemPriceStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;" PriceHeader="PREIS" PriceStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;">
|
11 |
-
<Description>BESTELLUNGSBESCHREIBUNG</Description>
|
12 |
-
<Item>
|
13 |
-
<Description Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">Tori Tank</Description>
|
14 |
-
<Quantity Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">1</Quantity>
|
15 |
-
<ItemPrice Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">60.00</ItemPrice>
|
16 |
-
<Price Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">60</Price>
|
17 |
-
</Item>
|
18 |
-
<SubTotal Header="ZWISCHENSUMME" HeaderStyle="background-color:#FFF;color: #647378;padding:3px;font-weight:normal;" Style="background-color:#FFF;color:#647378;border:none;font-weight:normal;padding:3px 20px;">60.00</SubTotal>
|
19 |
-
<ShippingCosts Header="Flat Rate - Fixed" HeaderStyle="background-color: #FFF; color: #647378;font-weight:normal;padding:3px;" Style="background-color:#FFF;color:#647378;border:none;padding:3px 20px;">5.00</ShippingCosts>
|
20 |
-
</ShoppingCart>
|
21 |
-
<Price Header="ENDSUMME" HeaderStyle="background-color:#FFF;color: #647378;padding:3px;font-weight:normal;border-top: 1px solid #838F93;" Style="background-color:#FFF;color:#005AC1;border:none;padding:4px;font-weight:bold;padding:3px 20px;font-size:14px;border-top: 1px solid #838F93;">65.00</Price>
|
22 |
-
<Currency>USD</Currency>
|
23 |
-
<Customer Id="140">Max Musterman</Customer>
|
24 |
-
<BillingAddr Mode="ReadOnly">
|
25 |
-
<Name Birthday="1970-01-01">Max Musterman</Name>
|
26 |
-
<Street>Teststraße 123</Street>
|
27 |
-
<Zip>1234</Zip>
|
28 |
-
<City>Wien</City>
|
29 |
-
<State>Wien</State>
|
30 |
-
<Country Code="AT"/>
|
31 |
-
<Email>sapolhei@hotmail.com</Email>
|
32 |
-
<Phone>0043123456789</Phone>
|
33 |
-
</BillingAddr>
|
34 |
-
<ShippingAddr Mode="ReadOnly">
|
35 |
-
<Name Birthday="1970-01-01">Max Musterman</Name>
|
36 |
-
<Street>Teststraße 123</Street>
|
37 |
-
<Zip>1234</Zip>
|
38 |
-
<City>Wien</City>
|
39 |
-
<State>Wien</State>
|
40 |
-
<Country Code="AT"/>
|
41 |
-
<Email>sapolhei@hotmail.com</Email>
|
42 |
-
<Phone>0043123456789</Phone>
|
43 |
-
</ShippingAddr>
|
44 |
-
<URL>
|
45 |
-
<Success>http://localhost/magento/mpay24/payment/success/?TID=145000006</Success>
|
46 |
-
<Error>http://localhost/magento/mpay24/payment/error/?TID=145000006</Error>
|
47 |
-
<Confirmation>http://localhost/magento/mpay24/payment/confirmation/</Confirmation>
|
48 |
-
<Cancel>http://localhost/magento/mpay24/payment/cancel/?TID=145000006</Cancel>
|
49 |
-
</URL>
|
50 |
-
</Order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Api/xmls/145000007.xml
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<Order Style="margin-left: auto; margin-right: auto; color:#647378" PageHeaderStyle="background-color: #FFF;margin-bottom:14px;" PageCaptionStyle="background-color:#FFF;background:transparent;color:#647378;padding-left:0px;" PageStyle="border:1px solid #838F93;background-color:#FFF;" InputFieldsStyle="background-color:#ffffff;border:1px solid #DDE1E7;padding:2px 0px;margin-bottom:5px;" DropDownListsStyle="padding:2px 0px;margin-bottom:5px;" ButtonsStyle="background-color: #005AC1;border: none;color: #FFFFFF;cursor: pointer;font-size:10px;font-weight:bold;padding:5px 10px;text-transform:uppercase;" ErrorsStyle="background-color: #FFF;padding: 10px 0px;" SuccessTitleStyle="background-color: #FFF;" ErrorTitleStyle="background-color: #FFF;">
|
3 |
-
<ClientIP>127.0.0.1</ClientIP>
|
4 |
-
<UserField>Magento v 1.9.2.2 Module v 1.6.2 145000007_2015-11-04</UserField>
|
5 |
-
<Tid>145000007</Tid>
|
6 |
-
<TemplateSet Language="DE" CSSName="MOBILE"/>
|
7 |
-
<PaymentTypes Enable="true">
|
8 |
-
<Payment Type="CC" Brand="VISA"/>
|
9 |
-
</PaymentTypes>
|
10 |
-
<ShoppingCart Header="WARENKORB" HeaderStyle="background-color:#FFF;margin-bottom:14px;color:#647378" CaptionStyle="background-color:#FFF;background:transparent;color:#647378;padding-left:0px;font-size:14px;" DescriptionHeader="BESCHREIBUNG" DescriptionStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;" QuantityHeader="ANZAHL" QuantityStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;" ItemPriceHeader="EINZELPREIS" ItemPriceStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;" PriceHeader="PREIS" PriceStyle="width:80px;background-color:#FFF;color:#647378;border: 1px solid #838F93;text-transform:uppercase;padding:5px;text-align:center;">
|
11 |
-
<Description>BESTELLUNGSBESCHREIBUNG</Description>
|
12 |
-
<Item>
|
13 |
-
<Description Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">Tori Tank</Description>
|
14 |
-
<Quantity Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">1</Quantity>
|
15 |
-
<ItemPrice Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">60.00</ItemPrice>
|
16 |
-
<Price Style="background-color: #FFF;color: #647378; border: 1px solid #838F93;text-align:center;padding:5px 0px;">60</Price>
|
17 |
-
</Item>
|
18 |
-
<SubTotal Header="ZWISCHENSUMME" HeaderStyle="background-color:#FFF;color: #647378;padding:3px;font-weight:normal;" Style="background-color:#FFF;color:#647378;border:none;font-weight:normal;padding:3px 20px;">60.00</SubTotal>
|
19 |
-
<ShippingCosts Header="Flat Rate - Fixed" HeaderStyle="background-color: #FFF; color: #647378;font-weight:normal;padding:3px;" Style="background-color:#FFF;color:#647378;border:none;padding:3px 20px;">5.00</ShippingCosts>
|
20 |
-
</ShoppingCart>
|
21 |
-
<Price Header="ENDSUMME" HeaderStyle="background-color:#FFF;color: #647378;padding:3px;font-weight:normal;border-top: 1px solid #838F93;" Style="background-color:#FFF;color:#005AC1;border:none;padding:4px;font-weight:bold;padding:3px 20px;font-size:14px;border-top: 1px solid #838F93;">65.00</Price>
|
22 |
-
<Currency>USD</Currency>
|
23 |
-
<Customer Id="140">Max Musterman</Customer>
|
24 |
-
<BillingAddr Mode="ReadOnly">
|
25 |
-
<Name Birthday="1970-01-01">Max Musterman</Name>
|
26 |
-
<Street>Teststraße 123</Street>
|
27 |
-
<Zip>1234</Zip>
|
28 |
-
<City>Wien</City>
|
29 |
-
<State>Wien</State>
|
30 |
-
<Country Code="AT"/>
|
31 |
-
<Email>sapolhei@hotmail.com</Email>
|
32 |
-
<Phone>0043123456789</Phone>
|
33 |
-
</BillingAddr>
|
34 |
-
<ShippingAddr Mode="ReadOnly">
|
35 |
-
<Name Birthday="1970-01-01">Max Musterman</Name>
|
36 |
-
<Street>Teststraße 123</Street>
|
37 |
-
<Zip>1234</Zip>
|
38 |
-
<City>Wien</City>
|
39 |
-
<State>Wien</State>
|
40 |
-
<Country Code="AT"/>
|
41 |
-
<Email>sapolhei@hotmail.com</Email>
|
42 |
-
<Phone>0043123456789</Phone>
|
43 |
-
</ShippingAddr>
|
44 |
-
<URL>
|
45 |
-
<Success>http://localhost/magento/mpay24/payment/success/?TID=145000007</Success>
|
46 |
-
<Error>http://localhost/magento/mpay24/payment/error/?TID=145000007</Error>
|
47 |
-
<Confirmation>http://localhost/magento/mpay24/payment/confirmation/</Confirmation>
|
48 |
-
<Cancel>http://localhost/magento/mpay24/payment/cancel/?TID=145000007</Cancel>
|
49 |
-
</URL>
|
50 |
-
</Order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Api/xmls/Example_MDXI.xml
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<Order>
|
3 |
-
<UserField>UserField_1234567890</UserField>
|
4 |
-
<Tid>1234567890</Tid>
|
5 |
-
<TemplateSet Language="EN"/>
|
6 |
-
<PaymentTypes Enable="true">
|
7 |
-
<Payment Type="CC"/>
|
8 |
-
<Payment Type="EPS" Brand="ARZ"/>
|
9 |
-
<Payment Type="EPS" Brand="BAWAG"/>
|
10 |
-
<Payment Type="EPS" Brand="ERSTE"/>
|
11 |
-
</PaymentTypes>
|
12 |
-
<ShoppingCart>
|
13 |
-
<Description>ShoppingCart Description</Description>
|
14 |
-
<Item>
|
15 |
-
<Number>1</Number>
|
16 |
-
<ProductNr>Product 1</ProductNr>
|
17 |
-
<Description>Description 1</Description>
|
18 |
-
<Quantity>1</Quantity>
|
19 |
-
<ItemPrice>17.99</ItemPrice>
|
20 |
-
</Item>
|
21 |
-
<SubTotal>17.99</SubTotal>
|
22 |
-
<ShippingCosts>8.00</ShippingCosts>
|
23 |
-
</ShoppingCart>
|
24 |
-
<Price>25.99</Price>
|
25 |
-
<Currency>EUR</Currency>
|
26 |
-
<BillingAddr Mode="ReadWrite">
|
27 |
-
<Name>Max Musterman</Name>
|
28 |
-
<Street>Teststraße 123</Street>
|
29 |
-
<Zip>1234</Zip>
|
30 |
-
<City>Wien</City>
|
31 |
-
<Country Code="AT"/>
|
32 |
-
</BillingAddr>
|
33 |
-
<ShippingAddr Mode="ReadOnly">
|
34 |
-
<Name>Name Surname</Name>
|
35 |
-
<Street>Teststreet 123</Street>
|
36 |
-
<Zip>9876</Zip>
|
37 |
-
<City>Salzburg</City>
|
38 |
-
<Country Code="AT"/>
|
39 |
-
</ShippingAddr>
|
40 |
-
<URL>
|
41 |
-
<Success>https://www.test.com/success</Success>
|
42 |
-
<Error>https://www.test.com/error</Error>
|
43 |
-
<Confirmation>https://www.test.com/confirmation</Confirmation>
|
44 |
-
<Cancel>https://www.test.com/cancel</Cancel>
|
45 |
-
</URL>
|
46 |
-
</Order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Config.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Entity/Setup.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Method/Abstract.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Method/Selectpayment.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Mpay24/Debug.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug/Collection.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Mysql4/Setup.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Observer.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Sales/Order/Creditmemo/Total/Paymentcharge.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Sales/Order/Invoice/Total/Paymentcharge.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Selectpayment.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Session.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/AllowedIPs.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/BillAddr.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/ClearingAction.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/FormTemplate.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/PaidOrder.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/PaymentCharge.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/PaymentsActive.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/Request.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/Result.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/ShoppingCartRowsAction.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/Source/System.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/Model/System/Config/Backend/Encrypted.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/controllers/IndexController.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/controllers/PaymentController.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/etc/config.xml
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<config>
|
6 |
<modules>
|
7 |
<Mpay24_Mpay24>
|
8 |
-
<version>1.6.
|
9 |
</Mpay24_Mpay24>
|
10 |
</modules>
|
11 |
|
5 |
<config>
|
6 |
<modules>
|
7 |
<Mpay24_Mpay24>
|
8 |
+
<version>1.6.5</version>
|
9 |
</Mpay24_Mpay24>
|
10 |
</modules>
|
11 |
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.0.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.1.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.2.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.3.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.4.php
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category Mpay24
|
16 |
* @package Mpay24_Mpay24
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category Mpay24
|
4 |
* @package Mpay24_Mpay24
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.6.5.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Mpay24
|
4 |
+
* @package Mpay24_Mpay24
|
5 |
+
* @author Anna Sadriu (mPAY24 GmbH)
|
6 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
7 |
+
* @version $Id: mysql4-install-1.6.5.php 6404 2015-07-08 09:25:24Z anna $
|
8 |
+
*/
|
9 |
+
if(class_exists('Mage_Sales_Model_Resource_Setup'))
|
10 |
+
$install = new Mage_Sales_Model_Resource_Setup('sales_setup');
|
11 |
+
else
|
12 |
+
$install = $this;
|
13 |
+
|
14 |
+
$install->startSetup();
|
15 |
+
|
16 |
+
$install->run("DELETE FROM {$this->getTable('core_config_data')} WHERE `path` LIKE '%mpay%'");
|
17 |
+
|
18 |
+
$install->run("DROP TABLE if exists {$this->getTable('mpay24_debug')};");
|
19 |
+
|
20 |
+
$install->run("UPDATE {$this->getTable('sales_flat_quote_payment')} SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_%';");
|
21 |
+
|
22 |
+
$install->run("UPDATE {$this->getTable('sales_flat_order_payment')} SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_%';");
|
23 |
+
|
24 |
+
$install->addAttribute('quote_address', 'payment_charge_type', array('type' => 'varchar'));
|
25 |
+
$install->addAttribute('quote_address', 'payment_charge', array('type' => 'decimal'));
|
26 |
+
$install->addAttribute('quote_address', 'base_payment_charge', array('type' => 'decimal'));
|
27 |
+
|
28 |
+
$install->addAttribute('order', 'payment_charge_type', array('type' => 'varchar'));
|
29 |
+
$install->addAttribute('order', 'payment_charge', array('type' => 'decimal'));
|
30 |
+
$install->addAttribute('order', 'base_payment_charge', array('type' => 'decimal'));
|
31 |
+
|
32 |
+
$install->addAttribute('invoice', 'payment_charge_type', array('type' => 'varchar'));
|
33 |
+
$install->addAttribute('invoice', 'payment_charge', array('type' => 'decimal'));
|
34 |
+
$install->addAttribute('invoice', 'base_payment_charge', array('type' => 'decimal'));
|
35 |
+
|
36 |
+
$install->addAttribute('creditmemo', 'payment_charge_type', array('type' => 'varchar'));
|
37 |
+
$install->addAttribute('creditmemo', 'payment_charge', array('type' => 'decimal'));
|
38 |
+
$install->addAttribute('creditmemo', 'base_payment_charge', array('type' => 'decimal'));
|
39 |
+
|
40 |
+
$install->endSetup();
|
41 |
+
?>
|
app/design/adminhtml/default/default/template/mpay24/info/pdf/selectpayment.phtml
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category design
|
16 |
* @package default_defaut
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category design
|
4 |
* @package default_defaut
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/design/adminhtml/default/default/template/mpay24/info/selectpayment.phtml
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category design
|
16 |
* @package default_defaut
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category design
|
4 |
* @package default_defaut
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/design/frontend/base/default/layout/mpay24.xml
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category design
|
16 |
* @package base_defaut
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category design
|
4 |
* @package base_defaut
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/design/frontend/base/default/template/mpay24/form/area.phtml
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category design
|
16 |
* @package base_defaut
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category design
|
4 |
* @package base_defaut
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/design/frontend/base/default/template/mpay24/form/dropDown.phtml
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category design
|
16 |
* @package base_defaut
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category design
|
4 |
* @package base_defaut
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/design/frontend/base/default/template/mpay24/form/radio.phtml
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category design
|
16 |
* @package base_defaut
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
@@ -90,7 +78,7 @@ window.onload = function() {
|
|
90 |
document.getElementById(id).disabled = false;
|
91 |
}
|
92 |
</script>
|
93 |
-
<div id="myDIV" style="min-height:100px; padding-top:10px; padding-bottom: 15px;
|
94 |
<?php
|
95 |
if(Mage::app()->getRequest()->getParam('mpay24_ps') != null && Mage::app()->getRequest()->getParam('mpay24_ps') != "")
|
96 |
$firstID = Mage::app()->getRequest()->getParam('mpay24_ps');
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category design
|
4 |
* @package base_defaut
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
78 |
document.getElementById(id).disabled = false;
|
79 |
}
|
80 |
</script>
|
81 |
+
<div id="myDIV" style="min-height:100px; padding-top:10px; padding-bottom: 15px;">
|
82 |
<?php
|
83 |
if(Mage::app()->getRequest()->getParam('mpay24_ps') != null && Mage::app()->getRequest()->getParam('mpay24_ps') != "")
|
84 |
$firstID = Mage::app()->getRequest()->getParam('mpay24_ps');
|
app/design/frontend/base/default/template/mpay24/info/selectpayment.phtml
CHANGED
@@ -1,17 +1,5 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
* @category design
|
16 |
* @package base_defaut
|
17 |
* @author Anna Sadriu (mPAY24 GmbH)
|
1 |
<?php
|
2 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @category design
|
4 |
* @package base_defaut
|
5 |
* @author Anna Sadriu (mPAY24 GmbH)
|
app/etc/modules/Mpay24_Mpay24.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<depends>
|
11 |
<Mage_Payment />
|
12 |
</depends>
|
13 |
-
<version>1.6.
|
14 |
</Mpay24_Mpay24>
|
15 |
</modules>
|
16 |
</config>
|
10 |
<depends>
|
11 |
<Mage_Payment />
|
12 |
</depends>
|
13 |
+
<version>1.6.5</version>
|
14 |
</Mpay24_Mpay24>
|
15 |
</modules>
|
16 |
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>mPAY24</name>
|
4 |
-
<version>1.6.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -26,11 +26,11 @@ Die Payment Lösung der mPAY24 GmbH unterstützt folgende Bezahlarten un
|
|
26 |

|
27 |

|
28 |
Weitere Informationen unter www.mPAY24.com</description>
|
29 |
-
<notes>1. Fix:
|
30 |
<authors><author><name>Anna Sadriu</name><user>mPAY24</user><email>modules@mpay24.com</email></author></authors>
|
31 |
-
<date>2015-
|
32 |
-
<time>
|
33 |
-
<contents><target name="magelocale"><dir name="de_AT"><file name="Mpay24_Mpay24.csv" hash="b2e19c4b5634ee84ddfe4736aad7fba5"/></dir><dir name="de_DE"><file name="Mpay24_Mpay24.csv" hash="b2e19c4b5634ee84ddfe4736aad7fba5"/></dir><dir name="de_CH"><file name="Mpay24_Mpay24.csv" hash="b2e19c4b5634ee84ddfe4736aad7fba5"/></dir><dir name="en_US"><file name="Mpay24_Mpay24.csv" hash="3359dee12a89e6869e5f85aef7b26f50"/></dir></target><target name="mageetc"><dir name="modules"><file name="Mpay24_Mpay24.xml" hash="
|
34 |
<compatible/>
|
35 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
36 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>mPAY24</name>
|
4 |
+
<version>1.6.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
26 |

|
27 |

|
28 |
Weitere Informationen unter www.mPAY24.com</description>
|
29 |
+
<notes>1. Fix: JavaScript - Checkout view (icons area & radio buttons) in case of forced preselection</notes>
|
30 |
<authors><author><name>Anna Sadriu</name><user>mPAY24</user><email>modules@mpay24.com</email></author></authors>
|
31 |
+
<date>2015-12-10</date>
|
32 |
+
<time>13:30:31</time>
|
33 |
+
<contents><target name="magelocale"><dir name="de_AT"><file name="Mpay24_Mpay24.csv" hash="b2e19c4b5634ee84ddfe4736aad7fba5"/></dir><dir name="de_DE"><file name="Mpay24_Mpay24.csv" hash="b2e19c4b5634ee84ddfe4736aad7fba5"/></dir><dir name="de_CH"><file name="Mpay24_Mpay24.csv" hash="b2e19c4b5634ee84ddfe4736aad7fba5"/></dir><dir name="en_US"><file name="Mpay24_Mpay24.csv" hash="3359dee12a89e6869e5f85aef7b26f50"/></dir></target><target name="mageetc"><dir name="modules"><file name="Mpay24_Mpay24.xml" hash="0f6931d822854934b2ca44cf92d75a82"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="mpay24"><dir name="form"><file name="area.phtml" hash="9acb8be74e5792e5c4a8e45895fc5655"/><file name="dropDown.phtml" hash="d6f9cd887dc0b4e81eacb5d310c2e0e7"/><file name="radio.phtml" hash="b4c05de5fab3c6e21879a9da5e9827fb"/></dir><dir name="info"><file name="selectpayment.phtml" hash="e1f7c3123010ae561f8802d03fc66a93"/></dir></dir></dir><dir name="layout"><file name="mpay24.xml" hash="4b615891c11e510ed4c868048e736f7c"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="mpay24"><dir name="info"><dir name="pdf"><file name="selectpayment.phtml" hash="6da1758a64f1cf156652983f170597ee"/></dir><file name="selectpayment.phtml" hash="c96745f5e2c57f9f4f3d5dc9a5305666"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Mpay24"><dir name="Mpay24"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="5caf74977717cc63576d9f09de204ed5"/></dir><dir name="Invoice"><file name="Totals.php" hash="70421fdcc5c9ab1df96f48664597ae79"/></dir><file name="Totals.php" hash="488d684da078859ff410041edcbe14ee"/></dir><file name="Totals.php" hash="b02e6f7695758503e747812414e82915"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Fieldset.php" hash="c8741afafa8efad57a4e986f5a85eb8d"/></dir></dir></dir></dir><dir name="Form"><file name="Selectpayment.php" hash="d05ed73eb4f42af38e6a12c98aa2425f"/></dir><file name="Form.php" hash="0692de0738ea97c8c0e9768c8913a131"/><dir name="Info"><file name="Selectpayment.php" hash="0bec3952c2be207592b70b2435884f9c"/></dir><file name="Mpay24.php" hash="ebc148879256065c02c39c5b3ac9c3f4"/><file name="ParentRedirect.php" hash="eb7e120ba3c76a90bfc875ffc6bde722"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Totals.php" hash="a3721656ae7b051b7bd92698de0a00b8"/></dir><dir name="Invoice"><file name="Totals.php" hash="002410ea09e2f1e5e0e8afcd0ad96a21"/></dir><file name="Totals.php" hash="7df91ced05a62b1b205a95f04d4f4201"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a33818b46e3adf1ce89de8733b4c21c9"/></dir><dir name="Model"><dir name="Api"><file name="MDXI.xsd" hash="a76b18809aee2b2ff879cc4f7641c682"/><file name="MPay24Api.php" hash="687fd2db87454382d840185d19e609f6"/><file name="MPay24MagentoShop.php" hash="836540abe3c298593334fdb7d90f732f"/><file name="MPay24Shop.php" hash="14be49b51728d077686478e66faf727a"/><file name="cacert.pem" hash="d4dbe330c1629261efdeac206ecf73e5"/><file name="orderXML.php" hash="c1b725887202d4c014bee92ab36e62eb"/><file name=".gitignore" hash="bbb0dcf6f5f6f4c43539774615a27ba7"/></dir><file name="Config.php" hash="ba81af1020459ada26ee8fad4f3b5451"/><dir name="Entity"><file name="Setup.php" hash="04d00a0f1b46aa0190eafe475778d7cf"/></dir><dir name="Method"><file name="Abstract.php" hash="93f0ab4f301a17c0d5bcadbda28f026f"/><file name="Selectpayment.php" hash="8a64ed6b487cdcb27f3e28a38f28d783"/></dir><dir name="Mpay24"><file name="Debug.php" hash="7ca92d1d06f3d106abb12276da7cdfb1"/></dir><dir name="Mysql4"><dir name="Mpay24"><dir name="Debug"><file name="Collection.php" hash="afa7844ca60694e6249d92d90be7d87d"/></dir><file name="Debug.php" hash="1465a78bb7b57ea0822ced61d7cc8589"/></dir><file name="Setup.php" hash="7c7a3340e4c8ed5f38c7bdf91b38c742"/></dir><file name="Observer.php" hash="01b5f6f6892aa3b095aae312adc938c6"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Total"><file name="Paymentcharge.php" hash="2fec0b22ac3d34e8f8e833c280951390"/></dir></dir><dir name="Invoice"><dir name="Total"><file name="Paymentcharge.php" hash="ab846115b55b99fb1509dcbc8c1355e1"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Paymentcharge.php" hash="159fe1fbf65fbbd053da24e4e194a4f0"/></dir></dir></dir></dir><file name="Selectpayment.php" hash="61702c660088d8500daa74ace9f5a33c"/><file name="Session.php" hash="1696ec9f1e1c2203571102b0b66e97ae"/><dir name="Source"><file name="AllowedIPs.php" hash="966d1f393cbdf0f3bf882dde61ed58db"/><file name="BillAddr.php" hash="b5964754dc46ccf1987a2c6ce2632d1c"/><file name="ClearingAction.php" hash="e433734d35aa31f3c0d73505da4d4fc7"/><file name="FormTemplate.php" hash="ec1401c452eb0e78fe1dc9fb35210855"/><file name="PaidOrder.php" hash="91b3bb6453d0b10e3513e6e4bf8be89a"/><file name="PaymentCharge.php" hash="0c85b98865dbd07676b7e22464db93f3"/><file name="PaymentsActive.php" hash="58506408fb2c4500615269fdbb10b62f"/><file name="Request.php" hash="23d38e55fdeac60ef7c2d0a2a141196a"/><file name="Result.php" hash="206212de254c26f1f67105e0af90cead"/><file name="ShoppingCartRowsAction.php" hash="fa2dfa1c1300aae466fa84a1cdab0b5c"/><file name="System.php" hash="46627d5621849106c9adc81e1189242d"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Encrypted.php" hash="f71580a5ed57289981d4e07596564952"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="51862927061918c6614773da48ccb804"/><file name="PaymentController.php" hash="1f9e9dc2a4b24d0d703281983c2f22a8"/></dir><dir name="etc"><file name="config.xml" hash="ed46dc9542237a009e10b751f711bf04"/><file name="system.xml" hash="a92fce0219aea7291457c556bd44a496"/></dir><dir name="sql"><dir name="mpay24_setup"><file name="mysql4-install-1.6.0.php" hash="4c7e3c5e6b3ecd21f987d286be985c1b"/><file name="mysql4-install-1.6.1.php" hash="da1bb5f70005f386f7da4bb1dca47a84"/><file name="mysql4-install-1.6.2.php" hash="c5aa1d9dd7a326843ca113afa138956e"/><file name="mysql4-install-1.6.3.php" hash="10e2c11b5c45fb64fd900780af2a76e8"/><file name="mysql4-install-1.6.4.php" hash="b0ddf1bb3e99806bc01a93f0cefe2902"/><file name="mysql4-install-1.6.5.php" hash="9fef1a4997d29ead7d2d8326ac1c46ab"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="Mpay24"><dir name="Mpay24"><file name="mpay24.css" hash="438f1e67fb76b15eb521580141da4aff"/></dir></dir></dir><dir name="js"><dir name="Mpay24"><dir name="Mpay24"><file name="mpay24.js" hash="3e404561c2407693fc4cc9d6ac9fab1d"/></dir></dir></dir></dir></dir></dir></target></contents>
|
34 |
<compatible/>
|
35 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
36 |
</package>
|
skin/frontend/base/default/js/Mpay24/Mpay24/mpay24.js
CHANGED
@@ -1,24 +1,22 @@
|
|
1 |
function setOnClick(text) {
|
2 |
var radios = document.getElementsByName( 'payment[method]' );
|
3 |
-
var onclick = "";
|
4 |
for( i = 0; i < radios.length; i++ ) {
|
5 |
if(radios[i].id == 'p_method_mpay24' || radios[i].id.substring(0, 15) != 'p_method_mpay24') {
|
6 |
-
|
7 |
-
radios[i].setAttribute('onClick', onclick + "forceSelection('" + text + "');");
|
8 |
}
|
9 |
}
|
10 |
}
|
11 |
|
12 |
-
function forceSelection(text) {
|
13 |
var savePaymentButton = document.getElementById('payment-buttons-container')
|
14 |
.getElementsByTagName('button')[0];
|
15 |
|
16 |
-
if (savePaymentButton)
|
17 |
if (document.getElementById('p_method_mpay24').checked == true)
|
18 |
savePaymentButton.setAttribute('onClick', 'alert("' + text
|
19 |
+ '");return false;');
|
20 |
else
|
21 |
savePaymentButton.setAttribute('onClick', 'payment.save();');
|
22 |
-
|
23 |
-
payment.switchMethod(
|
24 |
}
|
1 |
function setOnClick(text) {
|
2 |
var radios = document.getElementsByName( 'payment[method]' );
|
|
|
3 |
for( i = 0; i < radios.length; i++ ) {
|
4 |
if(radios[i].id == 'p_method_mpay24' || radios[i].id.substring(0, 15) != 'p_method_mpay24') {
|
5 |
+
radios[i].setAttribute('onClick', "forceSelection('" + text + "', '" + radios[i].id.substring(9) + "'); " + radios[i].onclick);
|
|
|
6 |
}
|
7 |
}
|
8 |
}
|
9 |
|
10 |
+
function forceSelection(text, pm) {
|
11 |
var savePaymentButton = document.getElementById('payment-buttons-container')
|
12 |
.getElementsByTagName('button')[0];
|
13 |
|
14 |
+
if (savePaymentButton) {
|
15 |
if (document.getElementById('p_method_mpay24').checked == true)
|
16 |
savePaymentButton.setAttribute('onClick', 'alert("' + text
|
17 |
+ '");return false;');
|
18 |
else
|
19 |
savePaymentButton.setAttribute('onClick', 'payment.save();');
|
20 |
+
}
|
21 |
+
payment.switchMethod(pm);
|
22 |
}
|