Version Notes
Bug fixing and Klarna upgrades
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | mPAY24 |
| Version | 1.4.5 |
| Comparing to | |
| See all releases | |
Code changes from version 1.4.4 to 1.4.5
- app/code/community/Mpay24/Mpay24/Block/Adminhtml/System/Config/Fieldset/Fieldset.php +244 -242
- app/code/community/Mpay24/Mpay24/Block/Form.php +33 -33
- app/code/community/Mpay24/Mpay24/Block/Form/Selectpayment.php +67 -72
- app/code/community/Mpay24/Mpay24/Block/Info/Selectpayment.php +102 -32
- app/code/community/Mpay24/Mpay24/Block/Mpay24.php +14 -14
- app/code/community/Mpay24/Mpay24/Block/ParentRedirect.php +10 -10
- app/code/community/Mpay24/Mpay24/Helper/Data.php +5 -7
- app/code/community/Mpay24/Mpay24/Model/Api/MDXI.xsd +1 -0
- app/code/community/Mpay24/Mpay24/Model/Api/MPay24Api.php +1212 -937
- app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php +729 -704
- app/code/community/Mpay24/Mpay24/Model/Api/MPay24Shop.php +889 -710
- app/code/community/Mpay24/Mpay24/Model/Api/logs/curllog.log +0 -0
- app/code/community/Mpay24/Mpay24/Model/Api/logs/mPAY24log.log +0 -0
- app/code/community/Mpay24/Mpay24/Model/Api/orderXML.php +212 -197
- app/code/community/Mpay24/Mpay24/Model/Api/xmls/Example_MDXI.xml +10 -10
- app/code/community/Mpay24/Mpay24/Model/Config.php +35 -34
- app/code/community/Mpay24/Mpay24/Model/Entity/Setup.php +20 -20
- app/code/community/Mpay24/Mpay24/Model/Method/Abstract.php +65 -65
- app/code/community/Mpay24/Mpay24/Model/Method/Selectpayment.php +56 -44
- app/code/community/Mpay24/Mpay24/Model/Mpay24/Debug.php +7 -7
- app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug.php +7 -7
- app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug/Collection.php +7 -7
- app/code/community/Mpay24/Mpay24/Model/Mysql4/Setup.php +5 -7
- app/code/community/Mpay24/Mpay24/Model/Observer.php +67 -59
- app/code/community/Mpay24/Mpay24/Model/Selectpayment.php +141 -137
- app/code/community/Mpay24/Mpay24/Model/Session.php +7 -7
- app/code/community/Mpay24/Mpay24/Model/Source/AllowedIPs.php +13 -13
- app/code/community/Mpay24/Mpay24/Model/Source/BillAddr.php +15 -15
- app/code/community/Mpay24/Mpay24/Model/Source/ClearingAction.php +10 -10
- app/code/community/Mpay24/Mpay24/Model/Source/FormTemplate.php +15 -15
- app/code/community/Mpay24/Mpay24/Model/Source/PaidOrder.php +13 -13
- app/code/community/Mpay24/Mpay24/Model/Source/PaymentsActive.php +15 -15
- app/code/community/Mpay24/Mpay24/Model/Source/Request.php +5 -7
- app/code/community/Mpay24/Mpay24/Model/Source/Result.php +5 -7
- app/code/community/Mpay24/Mpay24/Model/Source/ShoppingCartRowsAction.php +15 -15
- app/code/community/Mpay24/Mpay24/Model/Source/System.php +15 -15
- app/code/community/Mpay24/Mpay24/Model/System/Config/Backend/Encrypted.php +33 -35
- app/code/community/Mpay24/Mpay24/controllers/IndexController.php +7 -7
- app/code/community/Mpay24/Mpay24/controllers/PaymentController.php +530 -525
- app/code/community/Mpay24/Mpay24/etc/config.xml +240 -239
- app/code/community/Mpay24/Mpay24/etc/system.xml +519 -518
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.4.3.php +53 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.4.4.php +5 -6
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.4.5.php +32 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-0.6.2-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-0.6.2-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-0.6.2-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.0-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.0-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.0-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.4-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.4-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.4-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.6-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.6-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.6-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.7-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.7-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.7-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.1-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.1-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.1-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.7-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.7-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.7-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.8-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.8-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.8-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.9-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.9-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.9-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.0-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.0-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.0-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.1-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.1-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.1-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.2-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.2-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.2-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.3.0-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.3.0-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.3.0-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.0-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.0-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.0-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.1-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.1-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.1-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.2-1.4.3.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.2-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.2-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.3-1.4.4.php +21 -21
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.3-1.4.5.php +38 -0
- app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.4-1.4.5.php +38 -0
- app/design/adminhtml/default/default/template/mpay24/info/selectpayment.phtml +9 -9
- app/design/frontend/default/default/layout/mpay24.xml +14 -15
- app/design/frontend/default/default/template/mpay24/form/area.phtml +137 -126
- app/design/frontend/default/default/template/mpay24/form/dropDown.phtml +135 -125
- app/design/frontend/default/default/template/mpay24/info/selectpayment.phtml +13 -8
- app/etc/modules/Mpay24_Mpay24.xml +11 -11
- package.xml +5 -11
app/code/community/Mpay24/Mpay24/Block/Adminhtml/System/Config/Fieldset/Fieldset.php
CHANGED
|
@@ -12,260 +12,262 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
class Mpay24_Mpay24_Block_Adminhtml_System_Config_Fieldset_Fieldset
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
$html .= "<h1>Extension Version: " . MPay24MagentoShop::MAGENTO_VERSION . "</h1>";
|
| 59 |
-
|
| 60 |
-
$comment = Mage::helper('mpay24')->__("The payment systems will be synchronized when the settings are saved!");
|
| 61 |
-
|
| 62 |
-
$html .= "
|
| 63 |
-
<script type='text/javascript'>
|
| 64 |
-
window.onload = function() {
|
| 65 |
-
document.getElementById('mpay24_mpay24as_title').setAttribute('class', document.getElementById('mpay24_mpay24as_title').getAttribute('class') + ' required-entry');
|
| 66 |
-
var merchantID = document.getElementById('mpay24_mpay24as_merchantid');
|
| 67 |
-
var mpay24Active = document.getElementById('mpay24_mpay24as_active');
|
| 68 |
-
var mpay24System = document.getElementById('mpay24_mpay24as_system');
|
| 69 |
-
var mpay24SOAPPass = document.getElementById('mpay24_mpay24as_soap_pass');
|
| 70 |
-
var mpay24UseProxy = document.getElementById('mpay24_mpay24as_use_proxy');
|
| 71 |
-
var mpay24ProxyPort = document.getElementById('mpay24_mpay24as_proxy_port');
|
| 72 |
-
var mpay24ProxyHost = document.getElementById('mpay24_mpay24as_proxy_host');
|
| 73 |
-
|
| 74 |
-
merchantID.onchange = function() {
|
| 75 |
-
if(merchantID.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 76 |
-
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 77 |
-
merchantID.parentElement.childNodes[2].innerHTML = merchantID.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 78 |
-
}
|
| 79 |
-
}
|
| 80 |
-
|
| 81 |
-
mpay24Active.onchange = function() {
|
| 82 |
-
if(mpay24Active.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 83 |
-
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 84 |
-
mpay24Active.parentElement.childNodes[2].innerHTML = mpay24Active.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 85 |
-
}
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
mpay24System.onchange = function() {
|
| 89 |
-
if(mpay24System.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 90 |
-
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 91 |
-
mpay24System.parentElement.childNodes[2].innerHTML = mpay24System.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 92 |
-
}
|
| 93 |
-
}
|
| 94 |
-
|
| 95 |
-
mpay24SOAPPass.onchange = function() {
|
| 96 |
-
if(mpay24SOAPPass.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 97 |
-
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 98 |
-
mpay24SOAPPass.parentElement.childNodes[2].innerHTML = mpay24SOAPPass.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 99 |
-
}
|
| 100 |
-
}
|
| 101 |
-
|
| 102 |
-
mpay24UseProxy.onchange = function() {
|
| 103 |
-
if(mpay24UseProxy.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 104 |
-
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 105 |
-
mpay24UseProxy.parentElement.childNodes[2].innerHTML = mpay24UseProxy.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 106 |
-
}
|
| 107 |
-
}
|
| 108 |
-
|
| 109 |
-
mpay24ProxyPort.onchange = function() {
|
| 110 |
-
if(mpay24ProxyPort.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 111 |
-
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 112 |
-
mpay24ProxyPort.parentElement.childNodes[2].innerHTML = mpay24ProxyPort.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 113 |
}
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
}
|
| 121 |
-
|
|
|
|
|
|
|
| 122 |
}
|
| 123 |
-
</script>
|
| 124 |
-
";
|
| 125 |
-
|
| 126 |
-
return $html;
|
| 127 |
-
}
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
$elementName = $element->getHtmlId();
|
| 140 |
-
|
| 141 |
-
$html = '<div class="entry-edit-head collapseable" ><a id="'.$element->getHtmlId().'-head" href="#" onclick="Fieldset.toggleCollapse(\''.$element->getHtmlId().'\', \''.$this->getUrl('*/*/state').'\'); return false;">'.$element->getLegend().'</a></div>';
|
| 142 |
-
$html.= '<input id="'.$element->getHtmlId().'-state" name="config_state['.$element->getId().']" type="hidden" value="'.(int)$this->_getCollapseState($element).'" />';
|
| 143 |
-
$html.= '<fieldset class="'.$this->_getFieldsetCss().'" id="'.$element->getHtmlId().'">';
|
| 144 |
-
$html.= '<legend>'.$element->getLegend().'</legend>';
|
| 145 |
-
|
| 146 |
-
if ($element->getComment()) {
|
| 147 |
-
$html .= '<div class="comment">'.$element->getComment().'</div>';
|
| 148 |
-
}
|
| 149 |
-
|
| 150 |
-
// field label column
|
| 151 |
-
$html.= '<table cellspacing="0" class="form-list"><colgroup class="label" /><colgroup class="value" />';
|
| 152 |
-
if (!$default) {
|
| 153 |
-
$html.= '<colgroup class="use-default" />';
|
| 154 |
-
}
|
| 155 |
-
$html.= '<colgroup class="scope-label" /><colgroup class="" /><tbody>';
|
| 156 |
-
|
| 157 |
-
return $html;
|
| 158 |
-
}
|
| 159 |
|
| 160 |
-
|
| 161 |
-
* Return full css class name for form fieldset
|
| 162 |
-
*
|
| 163 |
-
* @return string
|
| 164 |
-
*/
|
| 165 |
-
protected function _getFieldsetCss() {
|
| 166 |
-
// $configCss = (string)$this->getGroup()->fieldset_css;
|
| 167 |
-
// return 'config collapseable'.($configCss ? ' ' . $configCss : '');
|
| 168 |
-
}
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
| 175 |
-
* @return string
|
| 176 |
-
*/
|
| 177 |
-
protected function _getFooterHtml($element) {
|
| 178 |
-
$tooltipsExist = false;
|
| 179 |
-
$html = '</tbody></table>';
|
| 180 |
-
foreach ($element->getSortedElements() as $field) {
|
| 181 |
-
if ($field->getTooltip()) {
|
| 182 |
-
$tooltipsExist = true;
|
| 183 |
-
$html .= sprintf('<div id="row_%s_comment" class="system-tooltip-box" style="display:none;">%s</div>',
|
| 184 |
-
$field->getId(), $field->getTooltip()
|
| 185 |
-
);
|
| 186 |
-
}
|
| 187 |
-
}
|
| 188 |
-
$html .= '</fieldset>' . $this->_getExtraJs($element, $tooltipsExist);
|
| 189 |
-
return $html;
|
| 190 |
-
}
|
| 191 |
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
protected function _getExtraJs($element, $tooltipsExist = false) {
|
| 202 |
-
$id = $element->getHtmlId();
|
| 203 |
-
$js = "Fieldset.applyCollapse('{$id}');";
|
| 204 |
-
if ($tooltipsExist) {
|
| 205 |
-
$js.= "$$('#{$id} table')[0].addClassName('system-tooltip-wrap');
|
| 206 |
-
$$('#{$id} table tbody tr').each(function(tr) {
|
| 207 |
-
Event.observe(tr, 'mouseover', function (event) {
|
| 208 |
-
var relatedTarget = $(event.relatedTarget || event.fromElement);
|
| 209 |
-
if(relatedTarget && (relatedTarget == this || relatedTarget.descendantOf(this))) {
|
| 210 |
-
return;
|
| 211 |
-
}
|
| 212 |
-
showTooltip(event);
|
| 213 |
-
});
|
| 214 |
-
Event.observe(tr, 'mouseout', function (event) {
|
| 215 |
-
var relatedTarget = $(event.relatedTarget || event.toElement);
|
| 216 |
-
if(relatedTarget && (relatedTarget == this || relatedTarget.childOf(this))) {
|
| 217 |
-
return;
|
| 218 |
-
}
|
| 219 |
-
hideTooltip(event);
|
| 220 |
-
});
|
| 221 |
-
});
|
| 222 |
-
$$('#{$id} table')[0].select('input','select').each(function(field) {
|
| 223 |
-
Event.observe(field, 'focus', function (event) {
|
| 224 |
-
showTooltip(event);
|
| 225 |
-
});
|
| 226 |
-
Event.observe(field, 'blur', function (event) {
|
| 227 |
-
hideTooltip(event);
|
| 228 |
-
});
|
| 229 |
-
});
|
| 230 |
-
function showTooltip(event) {
|
| 231 |
-
var tableHeight = Event.findElement(event, 'table').getStyle('height');
|
| 232 |
-
var tr = Event.findElement(event, 'tr');
|
| 233 |
-
var id = tr.id + '_comment';
|
| 234 |
-
$$('div.system-tooltip-box').invoke('hide');
|
| 235 |
-
if ($(id)) {
|
| 236 |
-
$(id).show().setStyle({height : tableHeight});
|
| 237 |
-
if(document.viewport.getWidth() < 1200) {
|
| 238 |
-
$(id).addClassName('system-tooltip-small').setStyle({height : 'auto'});
|
| 239 |
-
} else {
|
| 240 |
-
$(id).removeClassName('system-tooltip-small');
|
| 241 |
-
}
|
| 242 |
-
}
|
| 243 |
-
};
|
| 244 |
-
function hideTooltip(event) {
|
| 245 |
-
var tr = Event.findElement(event, 'tr');
|
| 246 |
-
var id = tr.id + '_comment';
|
| 247 |
-
if ($(id)) {
|
| 248 |
-
setTimeout(function() { $(id).hide(); }, 1);
|
| 249 |
-
}
|
| 250 |
-
};";
|
| 251 |
-
}
|
| 252 |
-
return Mage::helper('adminhtml/js')->getScript($js);
|
| 253 |
-
}
|
| 254 |
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 271 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
class Mpay24_Mpay24_Block_Adminhtml_System_Config_Fieldset_Fieldset
|
| 24 |
+
extends Mage_Adminhtml_Block_Abstract
|
| 25 |
+
implements Varien_Data_Form_Element_Renderer_Interface {
|
| 26 |
+
public $pTypes = array();
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Render fieldset html
|
| 30 |
+
*
|
| 31 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
| 32 |
+
* @return string
|
| 33 |
+
*/
|
| 34 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
| 35 |
+
$html = $this->_getHeaderHtml($element);
|
| 36 |
+
|
| 37 |
+
if(Mage::getStoreConfig('payment/mpay24/active') && Mage::getStoreConfig('mpay24/mpay24/active_payments') != '') {
|
| 38 |
+
$elementName = $element->getHtmlId();
|
| 39 |
+
|
| 40 |
+
$payments = Mage::getStoreConfig('mpay24/mpay24/active_payments');
|
| 41 |
+
$paymentsArray = unserialize($payments);
|
| 42 |
+
$keys = array_keys($paymentsArray);
|
| 43 |
+
|
| 44 |
+
foreach ($element->getSortedElements() as $field) {
|
| 45 |
+
if(substr($field->getHtmlId(), strrpos($field->getHtmlId(), "_")+1) <= Mage::getStoreConfig('mpay24/mpay24/payments_count')) {
|
| 46 |
+
$first_paymentID = array_shift($keys);
|
| 47 |
+
$payment = array_shift($paymentsArray);
|
| 48 |
+
|
| 49 |
+
if(strlen($first_paymentID) == 1)
|
| 50 |
+
$first_paymentID = "00$first_paymentID";
|
| 51 |
+
elseif(strlen($first_paymentID) == 2)
|
| 52 |
+
$first_paymentID = "0$first_paymentID";
|
| 53 |
+
|
| 54 |
+
$field->setLabel("<img src='https://www.mpay24.com/merchadm/img/ptypes/$first_paymentID.png' alt='" . $payment['BRAND'] . ":" . $payment['DESCR'] . "' title='" . $payment['P_TYPE'] . ":" . $payment['DESCR'] . "'>");
|
| 55 |
+
$html.= $field->toHtml();
|
| 56 |
+
} elseif(substr($field->getHtmlId(), 0, 17) != 'mpay24_mpay24_ps_')
|
| 57 |
+
$html.= $field->toHtml();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
}
|
| 59 |
+
} else
|
| 60 |
+
$html .= '<div style="color:red;">' . Mage::getStoreConfig('mpay24/mpay24/payments_error') . "</div>";
|
| 61 |
+
|
| 62 |
+
$html .= $this->_getFooterHtml($element);
|
| 63 |
+
$html .= "<h1>Extension Version: " . MPay24MagentoShop::MAGENTO_VERSION . "</h1>";
|
| 64 |
+
|
| 65 |
+
$comment = Mage::helper('mpay24')->__("The payment systems will be synchronized when the settings are saved!");
|
| 66 |
+
|
| 67 |
+
$html .= "
|
| 68 |
+
<script type='text/javascript'>
|
| 69 |
+
window.onload = function() {
|
| 70 |
+
document.getElementById('mpay24_mpay24as_title').setAttribute('class', document.getElementById('mpay24_mpay24as_title').getAttribute('class') + ' required-entry');
|
| 71 |
+
var merchantID = document.getElementById('mpay24_mpay24as_merchantid');
|
| 72 |
+
var mpay24Active = document.getElementById('mpay24_mpay24as_active');
|
| 73 |
+
var mpay24System = document.getElementById('mpay24_mpay24as_system');
|
| 74 |
+
var mpay24SOAPPass = document.getElementById('mpay24_mpay24as_soap_pass');
|
| 75 |
+
var mpay24UseProxy = document.getElementById('mpay24_mpay24as_use_proxy');
|
| 76 |
+
var mpay24ProxyPort = document.getElementById('mpay24_mpay24as_proxy_port');
|
| 77 |
+
var mpay24ProxyHost = document.getElementById('mpay24_mpay24as_proxy_host');
|
| 78 |
+
|
| 79 |
+
merchantID.onchange = function() {
|
| 80 |
+
if(merchantID.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 81 |
+
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 82 |
+
merchantID.parentElement.childNodes[2].innerHTML = merchantID.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
mpay24Active.onchange = function() {
|
| 87 |
+
if(mpay24Active.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 88 |
+
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 89 |
+
mpay24Active.parentElement.childNodes[2].innerHTML = mpay24Active.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
mpay24System.onchange = function() {
|
| 94 |
+
if(mpay24System.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 95 |
+
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 96 |
+
mpay24System.parentElement.childNodes[2].innerHTML = mpay24System.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
mpay24SOAPPass.onchange = function() {
|
| 101 |
+
if(mpay24SOAPPass.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 102 |
+
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 103 |
+
mpay24SOAPPass.parentElement.childNodes[2].innerHTML = mpay24SOAPPass.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
mpay24UseProxy.onchange = function() {
|
| 108 |
+
if(mpay24UseProxy.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 109 |
+
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 110 |
+
mpay24UseProxy.parentElement.childNodes[2].innerHTML = mpay24UseProxy.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
mpay24ProxyPort.onchange = function() {
|
| 115 |
+
if(mpay24ProxyPort.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 116 |
+
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 117 |
+
mpay24ProxyPort.parentElement.childNodes[2].innerHTML = mpay24ProxyPort.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
mpay24ProxyHost.onchange = function() {
|
| 122 |
+
if(mpay24ProxyHost.parentElement.childNodes[2].innerHTML.indexOf('$comment') == -1) {
|
| 123 |
+
document.getElementById('mpay24_mpay24').style.display = 'none';
|
| 124 |
+
mpay24ProxyHost.parentElement.childNodes[2].innerHTML = mpay24ProxyHost.parentElement.childNodes[2].innerHTML + '<br/><span style=\'color: red;\'>$comment</span>';
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
}
|
| 128 |
+
</script>";
|
| 129 |
+
|
| 130 |
+
return $html;
|
| 131 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
+
/**
|
| 134 |
+
* Return header html for fieldset
|
| 135 |
+
*
|
| 136 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
| 137 |
+
* @return string
|
| 138 |
+
*/
|
| 139 |
+
protected function _getHeaderHtml($element) {
|
| 140 |
+
$html = '';
|
| 141 |
+
$default = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
+
$elementName = $element->getHtmlId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
+
$html = '<div class="entry-edit-head collapseable" ><a id="'.$element->getHtmlId().'-head" href="#" onclick="Fieldset.toggleCollapse(\''.$element->getHtmlId().'\', \''.$this->getUrl('*/*/state').'\'); return false;">'.$element->getLegend().'</a></div>';
|
| 146 |
+
$html.= '<input id="'.$element->getHtmlId().'-state" name="config_state['.$element->getId().']" type="hidden" value="'.(int)$this->_getCollapseState($element).'" />';
|
| 147 |
+
$html.= '<fieldset class="'.$this->_getFieldsetCss().'" id="'.$element->getHtmlId().'">';
|
| 148 |
+
$html.= '<legend>'.$element->getLegend().'</legend>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
+
if ($element->getComment())
|
| 151 |
+
$html .= '<div class="comment">'.$element->getComment().'</div>';
|
| 152 |
+
|
| 153 |
+
// field label column
|
| 154 |
+
$html.= '<table cellspacing="0" class="form-list"><colgroup class="label" /><colgroup class="value" />';
|
| 155 |
+
if (!$default)
|
| 156 |
+
$html.= '<colgroup class="use-default" />';
|
| 157 |
+
|
| 158 |
+
$html.= '<colgroup class="scope-label" /><colgroup class="" /><tbody>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
|
| 160 |
+
return $html;
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
/**
|
| 164 |
+
* Return full css class name for form fieldset
|
| 165 |
+
*
|
| 166 |
+
* @return string
|
| 167 |
+
*/
|
| 168 |
+
protected function _getFieldsetCss() {
|
| 169 |
+
// $configCss = (string)$this->getGroup()->fieldset_css;
|
| 170 |
+
// return 'config collapseable'.($configCss ? ' ' . $configCss : '');
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
/**
|
| 174 |
+
* Return footer html for fieldset
|
| 175 |
+
* Add extra tooltip comments to elements
|
| 176 |
+
*
|
| 177 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
| 178 |
+
* @return string
|
| 179 |
+
*/
|
| 180 |
+
protected function _getFooterHtml($element) {
|
| 181 |
+
$tooltipsExist = false;
|
| 182 |
+
$html = '</tbody></table>';
|
| 183 |
+
foreach ($element->getSortedElements() as $field)
|
| 184 |
+
if ($field->getTooltip())
|
| 185 |
+
$tooltipsExist = true;
|
| 186 |
+
$html .= sprintf('<div id="row_%s_comment" class="system-tooltip-box" style="display:none;">%s</div>',
|
| 187 |
+
$field->getId(), $field->getTooltip()
|
| 188 |
+
);
|
| 189 |
+
$html .= '</fieldset>' . $this->_getExtraJs($element, $tooltipsExist);
|
| 190 |
+
return $html;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
/**
|
| 194 |
+
* Return js code for fieldset:
|
| 195 |
+
* - observe fieldset rows;
|
| 196 |
+
* - apply collapse;
|
| 197 |
+
*
|
| 198 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
| 199 |
+
* @param bool $tooltipsExist Init tooltips observer or not
|
| 200 |
+
* @return string
|
| 201 |
+
*/
|
| 202 |
+
protected function _getExtraJs($element, $tooltipsExist = false) {
|
| 203 |
+
$id = $element->getHtmlId();
|
| 204 |
+
$js = "Fieldset.applyCollapse('{$id}');";
|
| 205 |
+
if ($tooltipsExist)
|
| 206 |
+
$js.= "$$('#{$id} table')[0].addClassName('system-tooltip-wrap');
|
| 207 |
+
$$('#{$id} table tbody tr').each(function(tr) {
|
| 208 |
+
Event.observe(tr, 'mouseover', function (event) {
|
| 209 |
+
var relatedTarget = $(event.relatedTarget || event.fromElement);
|
| 210 |
+
if(relatedTarget && (relatedTarget == this || relatedTarget.descendantOf(this))) {
|
| 211 |
+
return;
|
| 212 |
+
}
|
| 213 |
+
showTooltip(event);
|
| 214 |
+
});
|
| 215 |
+
Event.observe(tr, 'mouseout', function (event) {
|
| 216 |
+
var relatedTarget = $(event.relatedTarget || event.toElement);
|
| 217 |
+
if(relatedTarget && (relatedTarget == this || relatedTarget.childOf(this))) {
|
| 218 |
+
return;
|
| 219 |
+
}
|
| 220 |
+
hideTooltip(event);
|
| 221 |
+
});
|
| 222 |
+
});
|
| 223 |
+
$$('#{$id} table')[0].select('input','select').each(function(field) {
|
| 224 |
+
Event.observe(field, 'focus', function (event) {
|
| 225 |
+
showTooltip(event);
|
| 226 |
+
});
|
| 227 |
+
Event.observe(field, 'blur', function (event) {
|
| 228 |
+
hideTooltip(event);
|
| 229 |
+
});
|
| 230 |
+
});
|
| 231 |
+
function showTooltip(event) {
|
| 232 |
+
var tableHeight = Event.findElement(event, 'table').getStyle('height');
|
| 233 |
+
var tr = Event.findElement(event, 'tr');
|
| 234 |
+
var id = tr.id + '_comment';
|
| 235 |
+
$$('div.system-tooltip-box').invoke('hide');
|
| 236 |
+
if ($(id)) {
|
| 237 |
+
$(id).show().setStyle({height : tableHeight});
|
| 238 |
+
if(document.viewport.getWidth() < 1200) {
|
| 239 |
+
$(id).addClassName('system-tooltip-small').setStyle({height : 'auto'});
|
| 240 |
+
} else {
|
| 241 |
+
$(id).removeClassName('system-tooltip-small');
|
| 242 |
+
}
|
| 243 |
+
}
|
| 244 |
+
};
|
| 245 |
+
function hideTooltip(event) {
|
| 246 |
+
var tr = Event.findElement(event, 'tr');
|
| 247 |
+
var id = tr.id + '_comment';
|
| 248 |
+
if ($(id)) {
|
| 249 |
+
setTimeout(function() { $(id).hide(); }, 1);
|
| 250 |
+
}
|
| 251 |
+
};";
|
| 252 |
+
|
| 253 |
+
return Mage::helper('adminhtml/js')->getScript($js);
|
| 254 |
}
|
| 255 |
+
|
| 256 |
+
/**
|
| 257 |
+
* Collapsed or expanded fieldset when page loaded?
|
| 258 |
+
*
|
| 259 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
| 260 |
+
* @return bool
|
| 261 |
+
*/
|
| 262 |
+
protected function _getCollapseState($element) {
|
| 263 |
+
if ($element->getExpanded() !== null)
|
| 264 |
+
return 1;
|
| 265 |
+
|
| 266 |
+
$extra = Mage::getSingleton('admin/session')->getUser()->getExtra();
|
| 267 |
+
|
| 268 |
+
if (isset($extra['configState'][$element->getId()]))
|
| 269 |
+
return $extra['configState'][$element->getId()];
|
| 270 |
+
|
| 271 |
+
return false;
|
| 272 |
+
}
|
| 273 |
}
|
app/code/community/Mpay24/Mpay24/Block/Form.php
CHANGED
|
@@ -12,43 +12,43 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Form extends Mage_Core_Block_Template {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
}
|
| 33 |
-
return $method;
|
| 34 |
-
}
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
*
|
| 39 |
-
* @return string
|
| 40 |
-
*/
|
| 41 |
-
public function getMethodCode() {
|
| 42 |
-
return $this->getMethod()->getCode();
|
| 43 |
-
}
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Form extends Mage_Core_Block_Template {
|
| 22 |
+
/**
|
| 23 |
+
* Retrieve payment method model
|
| 24 |
+
*
|
| 25 |
+
* @return Mage_Payment_Model_Method_Abstract
|
| 26 |
+
*/
|
| 27 |
+
public function getMethod() {
|
| 28 |
+
$method = $this->getData('method');
|
| 29 |
|
| 30 |
+
if (!($method instanceof Mage_Payment_Model_Method_Abstract))
|
| 31 |
+
Mage::throwException($this->__('Can not retrieve payment method model object.'));
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
return $method;
|
| 34 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
/**
|
| 37 |
+
* Retrieve payment method code
|
| 38 |
+
*
|
| 39 |
+
* @return string
|
| 40 |
+
*/
|
| 41 |
+
public function getMethodCode() {
|
| 42 |
+
return $this->getMethod()->getCode();
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* Retrieve field value data from payment info object
|
| 47 |
+
*
|
| 48 |
+
* @param string $field
|
| 49 |
+
* @return mixed
|
| 50 |
+
*/
|
| 51 |
+
public function getInfoData($field) {
|
| 52 |
+
return $this->htmlEscape($this->getMethod()->getInfoInstance()->getData($field));
|
| 53 |
+
}
|
| 54 |
}
|
app/code/community/Mpay24/Mpay24/Block/Form/Selectpayment.php
CHANGED
|
@@ -12,83 +12,78 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Form_Selectpayment extends Mage_Payment_Block_Form {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
protected function _getConfig() {
|
| 33 |
-
return Mage::getSingleton('mpay24/config');
|
| 34 |
}
|
| 35 |
-
|
| 36 |
-
/**
|
| 37 |
-
* @abstract Get the payment systems for the merchant from the core_config_data and explode it into an array
|
| 38 |
-
* @return Array $method
|
| 39 |
-
*/
|
| 40 |
-
public function getActiveMethods() {
|
| 41 |
-
$methods = array();
|
| 42 |
-
$brandsAndDescriptions = explode(", ", Mage::getStoreConfig('mpay24/mpay24/active_payments'));
|
| 43 |
-
|
| 44 |
-
$firstPS = Mage::getStoreConfig('mpay24/mpay24/ps_1');
|
| 45 |
-
$allPS = true;
|
| 46 |
-
|
| 47 |
-
for($i=2; $i<=Mage::getStoreConfig('mpay24/mpay24/payments_count'); $i++) {
|
| 48 |
-
if($firstPS != Mage::getStoreConfig('mpay24/mpay24/ps_'.$i)) {
|
| 49 |
-
$allPS = false;
|
| 50 |
-
break;
|
| 51 |
-
}
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
if($allPS) {
|
| 55 |
-
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false') {
|
| 56 |
-
if($firstPS == 1) {
|
| 57 |
-
Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 58 |
-
Mage::getConfig()->reinit();
|
| 59 |
-
Mage::app()->reinitStores();
|
| 60 |
-
}
|
| 61 |
-
} else {
|
| 62 |
-
if($firstPS == 0) {
|
| 63 |
-
Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 64 |
-
Mage::getConfig()->reinit();
|
| 65 |
-
Mage::app()->reinitStores();
|
| 66 |
-
}
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
foreach($brandsAndDescriptions as $brandAndDescr) {
|
| 70 |
-
$brand = substr($brandAndDescr, 0, strpos($brandAndDescr, "=>"));
|
| 71 |
-
$description = substr($brandAndDescr, strpos($brandAndDescr, "=>")+2);
|
| 72 |
-
$methods[$brand] = $description;
|
| 73 |
-
}
|
| 74 |
-
|
| 75 |
-
} else {
|
| 76 |
-
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false')
|
| 77 |
-
$check = 0;
|
| 78 |
-
else
|
| 79 |
-
$check = 1;
|
| 80 |
-
|
| 81 |
-
$i=1;
|
| 82 |
-
foreach($brandsAndDescriptions as $brandAndDescr) {
|
| 83 |
-
if(Mage::getStoreConfig('mpay24/mpay24/ps_'.$i) == $check) {
|
| 84 |
-
$brand = substr($brandAndDescr, 0, strpos($brandAndDescr, "=>"));
|
| 85 |
-
$description = substr($brandAndDescr, strpos($brandAndDescr, "=>")+2);
|
| 86 |
-
$methods[$brand] = $description;
|
| 87 |
-
}
|
| 88 |
-
$i++;
|
| 89 |
-
}
|
| 90 |
-
}
|
| 91 |
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
}
|
|
|
|
|
|
|
|
|
|
| 94 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Form_Selectpayment extends Mage_Payment_Block_Form {
|
| 22 |
+
protected function _construct() {
|
| 23 |
+
parent::_construct();
|
| 24 |
+
$this->setTemplate('mpay24/form/'.Mage::getStoreConfig('mpay24/mpay24/form_template'));
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Retrieve payment configuration object
|
| 29 |
+
*
|
| 30 |
+
* @return Mage_Payment_Model_Config
|
| 31 |
+
*/
|
| 32 |
+
protected function _getConfig() {
|
| 33 |
+
return Mage::getSingleton('mpay24/config');
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Get the payment systems for the merchant from the core_config_data and explode it into an array
|
| 38 |
+
* @return array $method
|
| 39 |
+
*/
|
| 40 |
+
public function getActiveMethods() {
|
| 41 |
+
$methods = array();
|
| 42 |
+
$payments = Mage::getStoreConfig('mpay24/mpay24/active_payments');
|
| 43 |
+
$paymentsArray = unserialize($payments);
|
| 44 |
+
|
| 45 |
+
$firstPS = Mage::getStoreConfig('mpay24/mpay24/ps_1');
|
| 46 |
+
$allPS = true;
|
| 47 |
|
| 48 |
+
for($i=2; $i<=Mage::getStoreConfig('mpay24/mpay24/payments_count'); $i++) {
|
| 49 |
+
if($firstPS != Mage::getStoreConfig('mpay24/mpay24/ps_'.$i)) {
|
| 50 |
+
$allPS = false;
|
| 51 |
+
break;
|
| 52 |
+
}
|
|
|
|
|
|
|
| 53 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
+
if($allPS) {
|
| 56 |
+
// if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false')
|
| 57 |
+
// if($firstPS == 1) {
|
| 58 |
+
// Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 59 |
+
// Mage::getConfig()->reinit();
|
| 60 |
+
// Mage::app()->reinitStores();
|
| 61 |
+
// }
|
| 62 |
+
// else
|
| 63 |
+
if($firstPS == 0) {
|
| 64 |
+
Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 65 |
+
Mage::getConfig()->reinit();
|
| 66 |
+
Mage::app()->reinitStores();
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
return $paymentsArray;
|
| 70 |
+
} else {
|
| 71 |
+
// if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false')
|
| 72 |
+
// $check = 0;
|
| 73 |
+
// else
|
| 74 |
+
// $check = 1;
|
| 75 |
+
|
| 76 |
+
$i=1;
|
| 77 |
+
$payments = array();
|
| 78 |
+
foreach($paymentsArray as $id => $payment) {
|
| 79 |
+
if(Mage::getStoreConfig('mpay24/mpay24/ps_'.$i) == 1) {
|
| 80 |
+
$payments[$id] = $payment;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
$i++;
|
| 84 |
+
}
|
| 85 |
}
|
| 86 |
+
|
| 87 |
+
return $payments;
|
| 88 |
+
}
|
| 89 |
}
|
app/code/community/Mpay24/Mpay24/Block/Info/Selectpayment.php
CHANGED
|
@@ -12,42 +12,112 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Info_Selectpayment extends Mage_Payment_Block_Info {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
}
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
public function getMethod() {
|
| 40 |
-
$payment = $this->getInfo()->getMethodInstance();
|
| 41 |
-
|
| 42 |
-
return $this->getInfo()->getMethodInstance();
|
| 43 |
-
}
|
| 44 |
-
|
| 45 |
-
public function getBrand() {
|
| 46 |
-
return $this->getInfo()->getCcType();
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
public function toPdf() {
|
| 50 |
-
$this->setTemplate('mpay24/info/pdf/selectpayment.phtml');
|
| 51 |
-
return $this->toHtml();
|
| 52 |
}
|
|
|
|
|
|
|
|
|
|
| 53 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Info_Selectpayment extends Mage_Payment_Block_Info {
|
| 22 |
+
/**
|
| 23 |
+
* Init default template for block
|
| 24 |
+
*/
|
| 25 |
+
protected function _construct() {
|
| 26 |
+
parent::_construct();
|
| 27 |
+
$this->setTemplate('mpay24/info/selectpayment.phtml');
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
public function getInfo() {
|
| 31 |
+
$info = $this->getData('info');
|
| 32 |
+
|
| 33 |
+
if (!($info instanceof Mage_Payment_Model_Info))
|
| 34 |
+
Mage::throwException($this->__('Can not retrieve payment info model object.'));
|
| 35 |
+
|
| 36 |
+
return $info;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
public function getMethod() {
|
| 40 |
+
$payment = $this->getInfo()->getMethodInstance();
|
| 41 |
+
|
| 42 |
+
return $this->getInfo()->getMethodInstance();
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
public function getPMethId() {
|
| 46 |
+
$pTypeBrand = explode(" => ", $this->getInfo()->getCcType());
|
| 47 |
+
$payments = $this->getActiveMethods();
|
| 48 |
+
$p_meth_id = 0;
|
| 49 |
+
|
| 50 |
+
foreach($payments as $id => $payment)
|
| 51 |
+
if($payment['P_TYPE'] == $pTypeBrand[0] && $payment['BRAND'] == $pTypeBrand[1])
|
| 52 |
+
$p_meth_id = $id;
|
| 53 |
+
|
| 54 |
+
if(strlen($p_meth_id) == 1)
|
| 55 |
+
$p_meth_id = "00$p_meth_id";
|
| 56 |
+
elseif(strlen($p_meth_id) == 2)
|
| 57 |
+
$p_meth_id = "0$p_meth_id";
|
| 58 |
+
|
| 59 |
+
return $p_meth_id;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
public function getPType() {
|
| 63 |
+
$pTypeBrand = explode(" => ", $this->getInfo()->getCcType());
|
| 64 |
+
return $pTypeBrand[0];
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
public function getBrand() {
|
| 68 |
+
$pTypeBrand = explode(" => ", $this->getInfo()->getCcType());
|
| 69 |
+
|
| 70 |
+
if(isset($pTypeBrand[1]))
|
| 71 |
+
return $pTypeBrand[1];
|
| 72 |
+
else
|
| 73 |
+
return "";
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
public function toPdf() {
|
| 77 |
+
$this->setTemplate('mpay24/info/pdf/selectpayment.phtml');
|
| 78 |
+
|
| 79 |
+
return $this->toHtml();
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* Get the payment systems for the merchant from the core_config_data and explode it into an array
|
| 84 |
+
* @return array $method
|
| 85 |
+
*/
|
| 86 |
+
public function getActiveMethods() {
|
| 87 |
+
$methods = array();
|
| 88 |
+
$payments = Mage::getStoreConfig('mpay24/mpay24/active_payments');
|
| 89 |
+
$paymentsArray = unserialize($payments);
|
| 90 |
+
|
| 91 |
+
$firstPS = Mage::getStoreConfig('mpay24/mpay24/ps_1');
|
| 92 |
+
$allPS = true;
|
| 93 |
+
|
| 94 |
+
for($i=2; $i<=Mage::getStoreConfig('mpay24/mpay24/payments_count'); $i++) {
|
| 95 |
+
if($firstPS != Mage::getStoreConfig('mpay24/mpay24/ps_'.$i)) {
|
| 96 |
+
$allPS = false;
|
| 97 |
+
break;
|
| 98 |
+
}
|
| 99 |
}
|
| 100 |
+
|
| 101 |
+
if($allPS) {
|
| 102 |
+
if($firstPS == 0) {
|
| 103 |
+
Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 104 |
+
Mage::getConfig()->reinit();
|
| 105 |
+
Mage::app()->reinitStores();
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
return $paymentsArray;
|
| 109 |
+
} else {
|
| 110 |
+
$i=1;
|
| 111 |
+
$payments = array();
|
| 112 |
+
foreach($paymentsArray as $id => $payment) {
|
| 113 |
+
if(Mage::getStoreConfig('mpay24/mpay24/ps_'.$i) == 1) {
|
| 114 |
+
$payments[$id] = $payment;
|
| 115 |
}
|
| 116 |
+
|
| 117 |
+
$i++;
|
| 118 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
}
|
| 120 |
+
|
| 121 |
+
return $payments;
|
| 122 |
+
}
|
| 123 |
}
|
app/code/community/Mpay24/Mpay24/Block/Mpay24.php
CHANGED
|
@@ -12,21 +12,21 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Mpay24 extends Mage_Core_Block_Template {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_Mpay24 extends Mage_Core_Block_Template {
|
| 22 |
+
public function _prepareLayout() {
|
| 23 |
+
return parent::_prepareLayout();
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
public function getMpay24() {
|
| 27 |
+
if (!$this->hasData('mpay24'))
|
| 28 |
+
$this->setData('mpay24', Mage::registry('mpay24'));
|
| 29 |
+
|
| 30 |
+
return $this->getData('mpay24');
|
| 31 |
+
}
|
| 32 |
}
|
app/code/community/Mpay24/Mpay24/Block/ParentRedirect.php
CHANGED
|
@@ -12,18 +12,18 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_ParentRedirect extends Mage_Core_Block_Abstract {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Block_ParentRedirect extends Mage_Core_Block_Abstract {
|
| 22 |
+
protected function _toHtml() {
|
| 23 |
+
$html = '<html><body>';
|
| 24 |
+
$html.= '<script type="text/javascript">self.parent.location.href="'.(Mage::getUrl(Mage::getSingleton('mpay24/session')->getParentRedirectUrl(), array('_secure'=>true))).'";</script>';
|
| 25 |
+
$html.= '</body></html>';
|
| 26 |
|
| 27 |
+
return $html;
|
| 28 |
+
}
|
| 29 |
}
|
app/code/community/Mpay24/Mpay24/Helper/Data.php
CHANGED
|
@@ -12,12 +12,10 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
class Mpay24_Mpay24_Helper_Data extends Mage_Core_Helper_Abstract {
|
| 22 |
-
|
| 23 |
-
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
class Mpay24_Mpay24_Helper_Data extends Mage_Core_Helper_Abstract {}
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Api/MDXI.xsd
CHANGED
|
@@ -93,6 +93,7 @@
|
|
| 93 |
<xs:simpleType>
|
| 94 |
<xs:restriction base="xs:string">
|
| 95 |
<xs:maxLength value="32"/>
|
|
|
|
| 96 |
</xs:restriction>
|
| 97 |
</xs:simpleType>
|
| 98 |
</xs:element>
|
| 93 |
<xs:simpleType>
|
| 94 |
<xs:restriction base="xs:string">
|
| 95 |
<xs:maxLength value="32"/>
|
| 96 |
+
<xs:minLength value="1"/>
|
| 97 |
</xs:restriction>
|
| 98 |
</xs:simpleType>
|
| 99 |
</xs:element>
|
app/code/community/Mpay24/Mpay24/Model/Api/MPay24Api.php
CHANGED
|
@@ -1,954 +1,1229 @@
|
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
/**
|
| 3 |
-
*
|
| 4 |
-
* @
|
| 5 |
-
* @filesource MPay24Api.php
|
| 6 |
-
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 7 |
*/
|
| 8 |
-
|
| 9 |
-
class MPay24Api {
|
| 10 |
-
|
| 11 |
-
/**
|
| 12 |
-
* @var BOOLEAN TRUE, when you want to use the test system, and FALSE otherwise
|
| 13 |
-
*/
|
| 14 |
-
private $test = false;
|
| 15 |
-
/**
|
| 16 |
-
* @var STRING The link where the requests should be sent to
|
| 17 |
-
*
|
| 18 |
-
* DEFAULT : https://test.mpay24.com/app/bin/etpproxy_v14 (TEST SYSTEM)
|
| 19 |
-
*/
|
| 20 |
-
private $etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";
|
| 21 |
-
/**
|
| 22 |
-
* @var INTEGER The merchant ID (supported from mPAY24). 5-digit number. Begin with 9
|
| 23 |
-
* for test system, begin with 7 for the live system.
|
| 24 |
-
*/
|
| 25 |
-
private $merchantid = "9xxxx";
|
| 26 |
-
/**
|
| 27 |
-
* @var STRING The SOAP password (supproted from mPAY24)
|
| 28 |
-
*/
|
| 29 |
-
private $soappass = "";
|
| 30 |
-
/**
|
| 31 |
-
* @var STRING The fix (envelope) part of the soap xml, which is to be sent to mPAY24
|
| 32 |
-
*/
|
| 33 |
-
private $soap_xml = "";
|
| 34 |
-
/**
|
| 35 |
-
* @var STRING The host name, in case you are using proxy
|
| 36 |
-
*/
|
| 37 |
-
private $proxy_host = "";
|
| 38 |
-
/**
|
| 39 |
-
* @var INTEGER 4-digit port number, in case you are using proxy
|
| 40 |
-
*/
|
| 41 |
-
private $proxy_port = "";
|
| 42 |
-
/**
|
| 43 |
-
* @var STRING The whole soap-xml (envelope and body), which is to be sent to mPAY24 as request
|
| 44 |
-
*/
|
| 45 |
-
private $request = "";
|
| 46 |
-
/**
|
| 47 |
-
* @var STRING The response from mPAY24
|
| 48 |
-
*/
|
| 49 |
-
private $response = "";
|
| 50 |
-
/**
|
| 51 |
-
* @var BOOLEAN TRUE if log files are to be written, by default - FALSE
|
| 52 |
-
*/
|
| 53 |
-
private $debug = true;
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
/**
|
| 57 |
-
* @abstract Set the basic (mandatory) settings for the requests
|
| 58 |
-
* @param INTEGER 5-digit account number, supported by mPAY24
|
| 59 |
-
*
|
| 60 |
-
* TEST accounts - starting with 9
|
| 61 |
-
*
|
| 62 |
-
* LIVE account - starting with 7
|
| 63 |
-
* @param STRING The webservice's password, supported by mPAY24
|
| 64 |
-
* @param BOOLEAN TRUE - when you want to use the TEST system
|
| 65 |
-
*
|
| 66 |
-
* FALSE - when you want to use the LIVE system
|
| 67 |
-
* @param STRING The host name in case you are behind a proxy server ("" when not)
|
| 68 |
-
* @param INTEGER 4-digit port number in case you are behind a proxy server ("" when not)
|
| 69 |
-
*/
|
| 70 |
-
public function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort) {
|
| 71 |
-
if(!defined('LIVE_ERROR_MSG')) define('LIVE_ERROR_MSG', "We are sorry, an error occured - please contact the merchant!");
|
| 72 |
-
|
| 73 |
-
if ( !defined('__DIR__') ) define('__DIR__', dirname(__FILE__));
|
| 74 |
-
|
| 75 |
-
$this->setMerchantID($merchantID);
|
| 76 |
-
$this->setSoapPassword($soapPassword);
|
| 77 |
-
$this->setSystem($test);
|
| 78 |
-
|
| 79 |
-
if($proxyHost != "" && $proxyPort != "")
|
| 80 |
-
$this->setProxySettings($proxyHost, $proxyPort);
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
/**
|
| 84 |
-
* @return STRING 5-digit merchant ID
|
| 85 |
-
*/
|
| 86 |
-
public function getMerchantID() {
|
| 87 |
-
return substr($this->merchantid, 1);
|
| 88 |
-
}
|
| 89 |
-
|
| 90 |
-
/**
|
| 91 |
-
* @return STRING The URL where the requests are sending to
|
| 92 |
-
*/
|
| 93 |
-
public function getEtpURL() {
|
| 94 |
-
return $this->etp_url;
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
-
/**
|
| 98 |
-
* @return STRING The request, which was sent to mPAY24 (in XML form)
|
| 99 |
-
*/
|
| 100 |
-
public function getRequest() {
|
| 101 |
-
return $this->request;
|
| 102 |
-
}
|
| 103 |
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
public function CallbackPaypal($requestString) {
|
| 302 |
-
$xml = $this->buildEnvelope();
|
| 303 |
-
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 304 |
-
|
| 305 |
-
$operation = $xml->createElement('etp:ManualCallback');
|
| 306 |
-
$operation = $body->appendChild($operation);
|
| 307 |
-
|
| 308 |
-
$requestXML = new DOMDocument("1.0", "UTF-8");
|
| 309 |
-
$requestXML->formatOutput = true;
|
| 310 |
-
$requestXML->loadXML($requestString);
|
| 311 |
-
|
| 312 |
-
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
| 313 |
-
|
| 314 |
-
foreach($requestNode->childNodes as $child) {
|
| 315 |
-
$child = $xml->importNode($child, true);
|
| 316 |
-
$operation->appendChild($child);
|
| 317 |
-
if($child->nodeName == 'paymentCallback') {
|
| 318 |
-
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance' ,'xsi:type', 'etp:CallbackPAYPAL');
|
| 319 |
-
}
|
| 320 |
-
}
|
| 321 |
-
|
| 322 |
-
$this->request = $xml->saveXML();
|
| 323 |
-
|
| 324 |
-
$this->send();
|
| 325 |
-
|
| 326 |
-
$result = new PaymentResponse($this->response);
|
| 327 |
-
|
| 328 |
-
return $result;
|
| 329 |
-
|
| 330 |
-
}
|
| 331 |
-
|
| 332 |
-
/**
|
| 333 |
-
* @abstract Clear a transaction with an amount
|
| 334 |
-
* @uses ManagePaymentResponse
|
| 335 |
-
* @param INTEGER The mPAY24 transaction ID
|
| 336 |
-
* @param INTEGER The amount to be cleared multiplay by 100
|
| 337 |
-
* @param STRING 3-digit ISO currency code: EUR, USD, etc
|
| 338 |
-
* @return ManagePaymentResponse
|
| 339 |
-
*/
|
| 340 |
-
public function ManualClear($mPAYTid, $amount, $currency) {
|
| 341 |
-
$xml = $this->buildEnvelope();
|
| 342 |
-
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 343 |
-
|
| 344 |
-
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualClear');
|
| 345 |
-
$operation = $body->appendChild($operation);
|
| 346 |
-
|
| 347 |
-
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 348 |
-
$merchantID = $operation->appendChild($merchantID);
|
| 349 |
-
|
| 350 |
-
$clearingDetails = $xml->createElement('clearingDetails');
|
| 351 |
-
$clearingDetails = $operation->appendChild($clearingDetails);
|
| 352 |
-
|
| 353 |
-
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 354 |
-
$xmlMPayTid = $clearingDetails->appendChild($xmlMPayTid);
|
| 355 |
-
|
| 356 |
-
$price = $xml->createElement('amount', $amount);
|
| 357 |
-
$price = $clearingDetails->appendChild($price);
|
| 358 |
-
|
| 359 |
-
$this->request = $xml->saveXML();
|
| 360 |
-
|
| 361 |
-
$this->send();
|
| 362 |
-
|
| 363 |
-
$result = new ManagePaymentResponse($this->response);
|
| 364 |
-
|
| 365 |
-
return $result;
|
| 366 |
-
}
|
| 367 |
-
|
| 368 |
-
/**
|
| 369 |
-
* @abstract Credit a transaction with an amount
|
| 370 |
-
* @uses ManagePaymentResponse
|
| 371 |
-
* @param INTEGER The mPAY24 transaction ID
|
| 372 |
-
* @param INTEGER The amount to be credited multiplay by 100
|
| 373 |
-
* @param STRING 3-digit ISO currency code: EUR, USD, etc
|
| 374 |
-
* @param STRING The name of the customer, who has paid
|
| 375 |
-
* @return ManagePaymentResponse
|
| 376 |
-
*/
|
| 377 |
-
public function ManualCredit($mPAYTid, $amount, $currency, $customer) {
|
| 378 |
-
$xml = $this->buildEnvelope();
|
| 379 |
-
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 380 |
-
|
| 381 |
-
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualCredit');
|
| 382 |
-
$operation = $body->appendChild($operation);
|
| 383 |
-
|
| 384 |
-
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 385 |
-
$merchantID = $operation->appendChild($merchantID);
|
| 386 |
-
|
| 387 |
-
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 388 |
-
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
| 389 |
-
|
| 390 |
-
$price = $xml->createElement('amount', $amount);
|
| 391 |
-
$price = $operation->appendChild($price);
|
| 392 |
-
|
| 393 |
-
$this->request = $xml->saveXML();
|
| 394 |
-
|
| 395 |
-
$this->send();
|
| 396 |
-
|
| 397 |
-
$result = new ManagePaymentResponse($this->response);
|
| 398 |
-
|
| 399 |
-
return $result;
|
| 400 |
-
}
|
| 401 |
-
|
| 402 |
-
/**
|
| 403 |
-
* @abstract Cancel a transaction
|
| 404 |
-
* @uses ManagePaymentResponse
|
| 405 |
-
* @param INTEGER The mPAY24 transaction ID for the transaction you want to cancel
|
| 406 |
-
* @return ManagePaymentResponse
|
| 407 |
-
*/
|
| 408 |
-
public function ManualReverse($mPAYTid) {
|
| 409 |
-
$xml = $this->buildEnvelope();
|
| 410 |
-
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 411 |
-
|
| 412 |
-
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualReverse');
|
| 413 |
-
$operation = $body->appendChild($operation);
|
| 414 |
-
|
| 415 |
-
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 416 |
-
$merchantID = $operation->appendChild($merchantID);
|
| 417 |
-
|
| 418 |
-
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 419 |
-
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
| 420 |
-
|
| 421 |
-
$this->request = $xml->saveXML();
|
| 422 |
-
|
| 423 |
-
$this->send();
|
| 424 |
-
|
| 425 |
-
$result = new ManagePaymentResponse($this->response);
|
| 426 |
-
|
| 427 |
-
return $result;
|
| 428 |
-
}
|
| 429 |
-
|
| 430 |
-
/**
|
| 431 |
-
* @abstract Get all the information for a transaction, supported by mPAY24
|
| 432 |
-
* @uses TransactionStatusResponse
|
| 433 |
-
* @param INTEGER The mPAY24 transaction ID
|
| 434 |
-
* @param STRING The transaction ID from your shop
|
| 435 |
-
* @return TransactionStatusResponse
|
| 436 |
-
*/
|
| 437 |
-
public function TransactionStatus($mPAYTid=null, $tid=null) {
|
| 438 |
-
$xml = $this->buildEnvelope();
|
| 439 |
-
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 440 |
-
|
| 441 |
-
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:TransactionStatus');
|
| 442 |
-
$operation = $body->appendChild($operation);
|
| 443 |
-
|
| 444 |
-
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 445 |
-
$merchantID = $operation->appendChild($merchantID);
|
| 446 |
-
|
| 447 |
-
if($mPAYTid) {
|
| 448 |
-
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 449 |
-
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
| 450 |
-
} else {
|
| 451 |
-
$xmlTid = $xml->createElement('tid', $tid);
|
| 452 |
-
$xmlTid = $operation->appendChild($xmlTid);
|
| 453 |
-
}
|
| 454 |
-
|
| 455 |
-
$this->request = $xml->saveXML();
|
| 456 |
-
|
| 457 |
-
$this->send();
|
| 458 |
-
|
| 459 |
-
$result = new TransactionStatusResponse($this->response);
|
| 460 |
-
|
| 461 |
-
return $result;
|
| 462 |
-
}
|
| 463 |
-
|
| 464 |
-
/**
|
| 465 |
-
* @param STRING: (without 'u')
|
| 466 |
-
*/
|
| 467 |
-
private function setMerchantID($merchantID=null) {
|
| 468 |
-
if($merchantID==null)
|
| 469 |
-
$this->merchantid = 'u' . MERCHANT_ID;
|
| 470 |
-
else
|
| 471 |
-
$this->merchantid = 'u' . $merchantID;
|
| 472 |
-
}
|
| 473 |
-
|
| 474 |
-
/**
|
| 475 |
-
* @param STRING
|
| 476 |
-
*/
|
| 477 |
-
private function setSoapPassword($pass=null) {
|
| 478 |
-
if(defined("SOAP_PASSWORD"))
|
| 479 |
-
$this->soappass = SOAP_PASSWORD;
|
| 480 |
-
else
|
| 481 |
-
$this->soappass = $pass;
|
| 482 |
-
}
|
| 483 |
-
|
| 484 |
-
/**
|
| 485 |
-
* @abstract Set if the system is test (true) or not (false)
|
| 486 |
-
*
|
| 487 |
-
* Set the POST url
|
| 488 |
-
* ("https://test.mpay24.com/app/bin/etpproxy_v14" or
|
| 489 |
-
* "https://www.mpay24.com/app/bin/etpproxy_v14")
|
| 490 |
-
* @param BOOLEAN
|
| 491 |
-
*
|
| 492 |
-
*/
|
| 493 |
-
private function setSystem($test=null) {
|
| 494 |
-
if($test) {
|
| 495 |
-
$this->test = true;
|
| 496 |
-
$this->etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";
|
| 497 |
-
} else {
|
| 498 |
-
$this->test = false;
|
| 499 |
-
$this->etp_url = "https://www.mpay24.com/app/bin/etpproxy_v15";
|
| 500 |
-
}
|
| 501 |
-
}
|
| 502 |
-
|
| 503 |
-
/**
|
| 504 |
-
* @abstract Set the used proxy host and proxy port in case proxy is used
|
| 505 |
-
* @param STRING
|
| 506 |
-
* @param STRING
|
| 507 |
-
*/
|
| 508 |
-
private function setProxySettings($proxy_host="", $proxy_port="") {
|
| 509 |
-
if($proxy_host != "" && $proxy_port != "") {
|
| 510 |
-
$this->proxy_host = $proxy_host;
|
| 511 |
-
$this->proxy_port = $proxy_port;
|
| 512 |
-
}
|
| 513 |
-
}
|
| 514 |
-
|
| 515 |
-
/**
|
| 516 |
-
* @abstract Create a DOMDocument and prepare it for SOAP request:
|
| 517 |
-
*
|
| 518 |
-
* set Envelope, NameSpaces, create empty Body
|
| 519 |
-
* @return DOMDocument
|
| 520 |
-
*/
|
| 521 |
-
private function buildEnvelope() {
|
| 522 |
-
$this->soap_xml = new DOMDocument("1.0", "UTF-8");
|
| 523 |
-
$this->soap_xml->formatOutput = true;
|
| 524 |
-
|
| 525 |
-
$envelope = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Envelope');
|
| 526 |
-
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
| 527 |
-
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:etp', 'https://www.mpay24.com/soap/etp/1.5/ETP.wsdl');
|
| 528 |
-
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
| 529 |
-
$envelope = $this->soap_xml->appendChild($envelope);
|
| 530 |
-
|
| 531 |
-
$body = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Body');
|
| 532 |
-
$body = $envelope->appendChild($body);
|
| 533 |
-
|
| 534 |
-
return $this->soap_xml;
|
| 535 |
-
}
|
| 536 |
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
fclose($fh);
|
| 569 |
-
} catch (Exception $e) {
|
| 570 |
-
if($this->test)
|
| 571 |
-
$dieMSG = "Your request couldn't be sent because of the following error:" . "\n" .
|
| 572 |
-
curl_error($ch) . "\n" .
|
| 573 |
-
$e->getMessage() .
|
| 574 |
-
' in '.$e->getFile().', line: '.
|
| 575 |
-
$e->getLine().'.';
|
| 576 |
-
else
|
| 577 |
-
$dieMSG = LIVE_ERROR_MSG;
|
| 578 |
-
|
| 579 |
-
echo $dieMSG;
|
| 580 |
-
}
|
| 581 |
-
}
|
| 582 |
}
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
class GeneralResponse {
|
| 587 |
-
|
| 588 |
-
/**
|
| 589 |
-
* @var STRING The status of the request, which was sent to mPAY24
|
| 590 |
-
*/
|
| 591 |
-
var $status;
|
| 592 |
-
/**
|
| 593 |
-
*
|
| 594 |
-
* @var STRING The return code from the request, which was sent to mPAY24
|
| 595 |
-
*/
|
| 596 |
-
var $returnCode;
|
| 597 |
-
|
| 598 |
-
/**
|
| 599 |
-
* @abstract Sets the basic values from the response from mPAY24: status and return code
|
| 600 |
-
* @param STRING The SOAP response from mPAY24 (in XML form)
|
| 601 |
-
*/
|
| 602 |
-
function GeneralResponse($response) {
|
| 603 |
-
if($response != '') {
|
| 604 |
-
$responseAsDOM = new DOMDocument();
|
| 605 |
-
$responseAsDOM->loadXML($response);
|
| 606 |
-
|
| 607 |
-
if(!empty($responseAsDOM) && is_object($responseAsDOM))
|
| 608 |
-
if(!$responseAsDOM || $responseAsDOM->getElementsByTagName('status')->length == 0){
|
| 609 |
-
$this->status = "ERROR";
|
| 610 |
-
$this->returnCode = urldecode($response);
|
| 611 |
-
} else {
|
| 612 |
-
$this->status = $responseAsDOM->getElementsByTagName('status')->item(0)->nodeValue;
|
| 613 |
-
$this->returnCode = $responseAsDOM->getElementsByTagName('returnCode')->item(0)->nodeValue;
|
| 614 |
-
}
|
| 615 |
-
} else {
|
| 616 |
-
$this->status = "ERROR";
|
| 617 |
-
$this->returnCode = "The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!";
|
| 618 |
-
}
|
| 619 |
-
}
|
| 620 |
-
|
| 621 |
-
/**
|
| 622 |
-
* @return STRING The status of the request, which was sent to mPAY24
|
| 623 |
-
*/
|
| 624 |
-
public function getStatus() {
|
| 625 |
-
return $this->status;
|
| 626 |
-
}
|
| 627 |
-
|
| 628 |
-
/**
|
| 629 |
-
* @return STRING The return code from the request, which was sent to mPAY24
|
| 630 |
-
*/
|
| 631 |
-
public function getReturnCode() {
|
| 632 |
-
return $this->returnCode;
|
| 633 |
-
}
|
| 634 |
|
| 635 |
-
|
| 636 |
-
$this->status = $status;
|
| 637 |
-
}
|
| 638 |
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 643 |
}
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
/**
|
| 680 |
-
* @return STRING The location (URL), returned from mPAY24
|
| 681 |
-
*/
|
| 682 |
-
public function getLocation(){
|
| 683 |
-
return $this->location;
|
| 684 |
-
}
|
| 685 |
-
|
| 686 |
-
/**
|
| 687 |
-
* @return GeneralResponse The object, that contains the basic values from the response from mPAY24:
|
| 688 |
-
* status and return code
|
| 689 |
-
*/
|
| 690 |
-
public function getGeneralResponse(){
|
| 691 |
-
return $this->generalResponse;
|
| 692 |
-
}
|
| 693 |
}
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
| 752 |
-
|
| 753 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 754 |
}
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
|
| 774 |
-
|
| 775 |
-
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 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 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
/**
|
| 860 |
-
* @return GeneralResponse The object, that contains the basic values from the response from mPAY24:
|
| 861 |
-
* status and return code
|
| 862 |
-
*/
|
| 863 |
-
public function getGeneralResponse() {
|
| 864 |
-
return $this->generalResponse;
|
| 865 |
-
}
|
| 866 |
}
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
|
| 935 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 936 |
}
|
| 937 |
-
|
| 938 |
-
|
| 939 |
-
|
| 940 |
-
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 944 |
}
|
| 945 |
-
|
| 946 |
-
|
| 947 |
-
|
| 948 |
-
|
| 949 |
-
|
| 950 |
-
|
| 951 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 952 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 953 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 954 |
?>
|
| 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 5522 2013-06-24 13:08:35Z anna $
|
| 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 |
+
* @var bool
|
| 15 |
+
*/
|
| 16 |
+
private $test = false;
|
| 17 |
+
/**
|
| 18 |
+
* 'test', when you want to use the test system, and 'www' otherwise
|
| 19 |
+
* @var string
|
| 20 |
+
*/
|
| 21 |
+
private $flexLINKSystem = "test";
|
| 22 |
+
/**
|
| 23 |
+
* The link where the requests should be sent to
|
| 24 |
+
*
|
| 25 |
+
* DEFAULT : https://test.mpay24.com/app/bin/etpproxy_v14 (TEST SYSTEM)
|
| 26 |
+
* @var string
|
| 27 |
+
*/
|
| 28 |
+
private $etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";
|
| 29 |
+
/**
|
| 30 |
+
* The merchant ID (supported from mPAY24). 5-digit number. Begin with 9
|
| 31 |
+
* for test system, begin with 7 for the live system.
|
| 32 |
+
* @var int
|
| 33 |
+
*/
|
| 34 |
+
private $merchantid = "9xxxx";
|
| 35 |
+
/**
|
| 36 |
+
* SPID (supported from mPAY24).
|
| 37 |
+
* @var string
|
| 38 |
+
*/
|
| 39 |
+
private $spid = "";
|
| 40 |
+
/**
|
| 41 |
+
* The SOAP password (supproted from mPAY24)
|
| 42 |
+
* @var string
|
| 43 |
+
*/
|
| 44 |
+
private $soappass = "";
|
| 45 |
+
/**
|
| 46 |
+
* The flexLINK password (supproted from mPAY24)
|
| 47 |
+
* @var string
|
| 48 |
+
*/
|
| 49 |
+
private $pass = "";
|
| 50 |
+
/**
|
| 51 |
+
* The fix (envelope) part of the soap xml, which is to be sent to mPAY24
|
| 52 |
+
* @var string
|
| 53 |
+
*/
|
| 54 |
+
private $soap_xml = "";
|
| 55 |
+
/**
|
| 56 |
+
* The host name, in case you are using proxy
|
| 57 |
+
* @var string
|
| 58 |
+
*/
|
| 59 |
+
private $proxy_host = "";
|
| 60 |
+
/**
|
| 61 |
+
* 4-digit port number, in case you are using proxy
|
| 62 |
+
* @var int
|
| 63 |
+
*/
|
| 64 |
+
private $proxy_port = "";
|
| 65 |
+
/**
|
| 66 |
+
* The whole soap-xml (envelope and body), which is to be sent to mPAY24 as request
|
| 67 |
+
* @var string
|
| 68 |
+
*/
|
| 69 |
+
private $request = "";
|
| 70 |
+
/**
|
| 71 |
+
* The response from mPAY24
|
| 72 |
+
* @var string
|
| 73 |
+
*/
|
| 74 |
+
private $response = "";
|
| 75 |
+
/**
|
| 76 |
+
* TRUE if log files are to be written, by default - FALSE
|
| 77 |
+
* @var bool
|
| 78 |
+
*/
|
| 79 |
+
private $debug = true;
|
| 80 |
+
/**
|
| 81 |
+
* The name of the shopsoftware
|
| 82 |
+
* @var string
|
| 83 |
+
*/
|
| 84 |
+
public $shop = "";
|
| 85 |
+
/**
|
| 86 |
+
* The veriosn of the shopsoftware
|
| 87 |
+
* @var string
|
| 88 |
+
*/
|
| 89 |
+
public $shopVersion = "";
|
| 90 |
+
/**
|
| 91 |
+
* The version of the shop module
|
| 92 |
+
* @var string
|
| 93 |
+
*/
|
| 94 |
+
public $moduleVersion = "";
|
| 95 |
+
|
| 96 |
+
/**
|
| 97 |
+
* Set the basic (mandatory) settings for the requests
|
| 98 |
+
* @param int $merchantID 5-digit account number, supported by mPAY24
|
| 99 |
+
*
|
| 100 |
+
* TEST accounts - starting with 9
|
| 101 |
+
*
|
| 102 |
+
* LIVE account - starting with 7
|
| 103 |
+
* @param string $soapPassword The webservice's password, supported by mPAY24
|
| 104 |
+
* @param bool $test TRUE - when you want to use the TEST system
|
| 105 |
+
*
|
| 106 |
+
* FALSE - when you want to use the LIVE system
|
| 107 |
+
* @param string $proxyHost The host name in case you are behind a proxy server ("" when not)
|
| 108 |
+
* @param int $proxyPort 4-digit port number in case you are behind a proxy server ("" when not)
|
| 109 |
+
*/
|
| 110 |
+
public function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort) {
|
| 111 |
/**
|
| 112 |
+
* An error message, that will be displayed to the user in case you are using the LIVE system
|
| 113 |
+
* @const LIVE_ERROR_MSG
|
|
|
|
|
|
|
| 114 |
*/
|
| 115 |
+
define('LIVE_ERROR_MSG', "We are sorry, an error occured - please contact the merchant!");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
+
/**
|
| 118 |
+
* The current directory, where the script is runnig from
|
| 119 |
+
* @const __DIR__
|
| 120 |
+
*/
|
| 121 |
+
if ( !defined('__DIR__') ) define('__DIR__', dirname(__FILE__));
|
| 122 |
+
|
| 123 |
+
$this->setMerchantID($merchantID);
|
| 124 |
+
$this->setSoapPassword($soapPassword);
|
| 125 |
+
$this->setSystem($test);
|
| 126 |
+
|
| 127 |
+
if($proxyHost != "" && $proxyPort != "")
|
| 128 |
+
$this->setProxySettings($proxyHost, $proxyPort);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/**
|
| 132 |
+
* Set the basic (mandatory) settings for the requests
|
| 133 |
+
* @param string $spid The SPID of your account, supported by mPAY24
|
| 134 |
+
* @param string $password The flexLINK password, supported by mPAY24
|
| 135 |
+
* @param bool $test TRUE - when you want to use the TEST system
|
| 136 |
+
*
|
| 137 |
+
* FALSE - when you want to use the LIVE system
|
| 138 |
+
*/
|
| 139 |
+
public function configureFlexLINK($spid, $password, $test) {
|
| 140 |
+
/**
|
| 141 |
+
* An error message, that will be displayed to the user in case you are using the LIVE system
|
| 142 |
+
* @const LIVE_ERROR_MSG
|
| 143 |
+
*/
|
| 144 |
+
define('LIVE_ERROR_MSG', "We are sorry, an error occured - please contact the merchant!");
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* The current directory, where the script is runnig from
|
| 148 |
+
* @const __DIR__
|
| 149 |
+
*/
|
| 150 |
+
if ( !defined('__DIR__') ) define('__DIR__', dirname(__FILE__));
|
| 151 |
+
|
| 152 |
+
$this->setSPID($spid);
|
| 153 |
+
$this->setPassword($password);
|
| 154 |
+
$this->setFlexLINKSystem($test);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
/**
|
| 158 |
+
* Get the merchant ID, which was set by the function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort)
|
| 159 |
+
* @return string
|
| 160 |
+
*/
|
| 161 |
+
public function getMerchantID() {
|
| 162 |
+
return substr($this->merchantid, 1);
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
/**
|
| 166 |
+
* Get the SPID, which was set by the function configureFlexLINK($spid, $password, $test)
|
| 167 |
+
* @return string
|
| 168 |
+
*/
|
| 169 |
+
public function getSPID() {
|
| 170 |
+
return $this->spid;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
/**
|
| 174 |
+
* Get the system, which should be used for flexLINK (test -> 'test' or live -> 'www')
|
| 175 |
+
* @return string
|
| 176 |
+
*/
|
| 177 |
+
public function getFlexLINKSystem() {
|
| 178 |
+
return $this->flexLINKSystem;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
/**
|
| 182 |
+
* Get the url, where requests are going to be posted
|
| 183 |
+
* @return string
|
| 184 |
+
*/
|
| 185 |
+
public function getEtpURL() {
|
| 186 |
+
return $this->etp_url;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
/**
|
| 190 |
+
* Get the request, which was sent to mPAY24 (in XML form)
|
| 191 |
+
* @return string
|
| 192 |
+
*/
|
| 193 |
+
public function getRequest() {
|
| 194 |
+
return $this->request;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
/**
|
| 198 |
+
* Get the response from mPAY24 (in XML form)
|
| 199 |
+
* @return string
|
| 200 |
+
*/
|
| 201 |
+
public function getResponse() {
|
| 202 |
+
return $this->response;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
/**
|
| 206 |
+
* Check whether a proxy is used
|
| 207 |
+
* @return bool
|
| 208 |
+
*/
|
| 209 |
+
public function proxyUsed() {
|
| 210 |
+
if($this->proxy_host != '' && $this->proxy_port != '')
|
| 211 |
+
return true;
|
| 212 |
+
else
|
| 213 |
+
return false;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
/**
|
| 217 |
+
* Set debug modus (FALSE by default)
|
| 218 |
+
* @param bool $debug TRUE if is turned on, otherwise FALSE
|
| 219 |
+
*/
|
| 220 |
+
public function setDebug($debug) {
|
| 221 |
+
$this->debug = $debug;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
/**
|
| 225 |
+
* Check whether the debug modus is turned on or off
|
| 226 |
+
* @return bool
|
| 227 |
+
*/
|
| 228 |
+
public function getDebug() {
|
| 229 |
+
return $this->debug;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
/**
|
| 233 |
+
* In case the test system is used, show die with the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG
|
| 234 |
+
* @param string $msg The message, which is shown to the user
|
| 235 |
+
*/
|
| 236 |
+
public function dieWithMsg($msg) {
|
| 237 |
+
if($this->test)
|
| 238 |
+
die($msg);
|
| 239 |
+
else
|
| 240 |
+
die(LIVE_ERROR_MSG);
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
/**
|
| 244 |
+
* In case the test system is used, show print the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG
|
| 245 |
+
* @param string $msg The message, which is shown to the user
|
| 246 |
+
*/
|
| 247 |
+
public function printMsg($msg) {
|
| 248 |
+
if($this->test)
|
| 249 |
+
print($msg);
|
| 250 |
+
else
|
| 251 |
+
print(LIVE_ERROR_MSG);
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
/**
|
| 255 |
+
* Die with an error message, which show the path in case of read/write permission errors
|
| 256 |
+
*/
|
| 257 |
+
public function permissionError() {
|
| 258 |
+
$errors = error_get_last();
|
| 259 |
+
$message = $errors['message'];
|
| 260 |
+
$path = substr($message, strpos($message, 'fopen(')+6, strpos($message, ')')-(strpos($message, 'fopen(')+6));
|
| 261 |
+
$this->dieWithMsg("Can't open file '$path'! Please set the needed read/write rights!");
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
/**
|
| 265 |
+
* Get all the payment methods, that are available for the merchant by mPAY24
|
| 266 |
+
* @return ListPaymentMethodsResponse
|
| 267 |
+
*/
|
| 268 |
+
public function ListPaymentMethods() {
|
| 269 |
+
$xml = $this->buildEnvelope();
|
| 270 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 271 |
+
|
| 272 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ListPaymentMethods');
|
| 273 |
+
$operation = $body->appendChild($operation);
|
| 274 |
+
|
| 275 |
+
$xmlMerchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 276 |
+
$xmlMerchantID = $operation->appendChild($xmlMerchantID);
|
| 277 |
+
|
| 278 |
+
$this->request = $xml->saveXML();
|
| 279 |
+
|
| 280 |
+
$this->send();
|
| 281 |
+
|
| 282 |
+
$result = new ListPaymentMethodsResponse($this->response);
|
| 283 |
+
|
| 284 |
+
return $result;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
/**
|
| 288 |
+
* Start a secure payment through the mPAY24 payment window -
|
| 289 |
+
* the sensible data (credit card numbers, bank account numbers etc)
|
| 290 |
+
* is (will be) not saved in the shop
|
| 291 |
+
* @param ORDER $mdxi The mdxi xml, which contains the shopping cart
|
| 292 |
+
* @return PaymentResponse
|
| 293 |
+
*/
|
| 294 |
+
public function SelectPayment($mdxi) {
|
| 295 |
+
$xml = $this->buildEnvelope();
|
| 296 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 297 |
+
|
| 298 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:SelectPayment');
|
| 299 |
+
$operation = $body->appendChild($operation);
|
| 300 |
+
|
| 301 |
+
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 302 |
+
$merchantID = $operation->appendChild($merchantID);
|
| 303 |
+
|
| 304 |
+
$xmlMDXI = $xml->createElement('mdxi', htmlspecialchars($mdxi));
|
| 305 |
+
$xmlMDXI = $operation->appendChild($xmlMDXI);
|
| 306 |
+
|
| 307 |
+
$getDataURL = $xml->createElement('getDataURL', "dummy_getDataURL");
|
| 308 |
+
$getDataURL = $operation->appendChild($getDataURL);
|
| 309 |
+
|
| 310 |
+
$tid = $xml->createElement('tid', 'tid');
|
| 311 |
+
$tid = $operation->appendChild($tid);
|
| 312 |
+
|
| 313 |
+
$this->request = $xml->saveXML();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
|
| 315 |
+
$this->send();
|
| 316 |
+
|
| 317 |
+
$result = new PaymentResponse($this->response);
|
| 318 |
+
|
| 319 |
+
return $result;
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
/**
|
| 323 |
+
* Start a secure payment using a PROFILE (mPAY24 proSAFE), supported by mPAY24 -
|
| 324 |
+
* a customer profile (you have already created) will be used for the payment.
|
| 325 |
+
* The payment window will not be called, the payment source (for example credit card),
|
| 326 |
+
* which was used from the customer by the last payment will be used for the transaction.
|
| 327 |
+
* @param ORDER $requestString The order xml, which contains the shopping cart
|
| 328 |
+
* @return SelectPaymentResponse
|
| 329 |
+
*/
|
| 330 |
+
public function ProfilePayment($requestString) {
|
| 331 |
+
$xml = $this->buildEnvelope();
|
| 332 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 333 |
+
|
| 334 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:AcceptPayment');
|
| 335 |
+
$operation = $body->appendChild($operation);
|
| 336 |
+
|
| 337 |
+
$requestXML = new DOMDocument("1.0", "UTF-8");
|
| 338 |
+
$requestXML->formatOutput = true;
|
| 339 |
+
$requestXML->loadXML($requestString);
|
| 340 |
+
|
| 341 |
+
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
| 342 |
+
|
| 343 |
+
foreach($requestNode->childNodes as $child) {
|
| 344 |
+
$child = $xml->importNode($child, true);
|
| 345 |
+
$operation->appendChild($child);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 346 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
|
| 348 |
+
$this->request = $xml->saveXML();
|
|
|
|
|
|
|
| 349 |
|
| 350 |
+
$this->send();
|
| 351 |
+
|
| 352 |
+
$result = new PaymentResponse($this->response);
|
| 353 |
+
|
| 354 |
+
return $result;
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
/**
|
| 358 |
+
* Start a secure payment using a PayPal Express Checkout, supported by mPAY24 -
|
| 359 |
+
* the customer doesn't need to be logged in in the shop or to give any data
|
| 360 |
+
* (addresses or payment information), but will be redirected to the PayPal site,
|
| 361 |
+
* and all the information from PayPal will be taken for the payment.
|
| 362 |
+
* @param ORDER $requestString The order xml, which contains the shopping cart
|
| 363 |
+
* @return PaymentResponse
|
| 364 |
+
*/
|
| 365 |
+
public function ExpressCheckoutPayment($requestString) {
|
| 366 |
+
$xml = $this->buildEnvelope();
|
| 367 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 368 |
+
|
| 369 |
+
$operation = $xml->createElement('etp:AcceptPayment');
|
| 370 |
+
$operation = $body->appendChild($operation);
|
| 371 |
+
|
| 372 |
+
$requestXML = new DOMDocument("1.0", "UTF-8");
|
| 373 |
+
$requestXML->formatOutput = true;
|
| 374 |
+
$requestXML->loadXML($requestString);
|
| 375 |
+
|
| 376 |
+
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
| 377 |
+
|
| 378 |
+
foreach($requestNode->childNodes as $child) {
|
| 379 |
+
$child = $xml->importNode($child, true);
|
| 380 |
+
$operation->appendChild($child);
|
| 381 |
+
|
| 382 |
+
if($child->nodeName == 'payment')
|
| 383 |
+
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance' ,'xsi:type', 'etp:PaymentPAYPAL');
|
| 384 |
}
|
| 385 |
+
|
| 386 |
+
$this->request = $xml->saveXML();
|
| 387 |
+
|
| 388 |
+
$this->send();
|
| 389 |
+
|
| 390 |
+
$result = new PaymentResponse($this->response);
|
| 391 |
+
|
| 392 |
+
return $result;
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
/**
|
| 396 |
+
* Initialize a manual callback to mPAY24 in order to check the information provided by PayPal
|
| 397 |
+
* @param string $requestString The callback request to mPAY24
|
| 398 |
+
* @return PaymentResponse
|
| 399 |
+
*/
|
| 400 |
+
public function CallbackPaypal($requestString) {
|
| 401 |
+
$xml = $this->buildEnvelope();
|
| 402 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 403 |
+
|
| 404 |
+
$operation = $xml->createElement('etp:ManualCallback');
|
| 405 |
+
$operation = $body->appendChild($operation);
|
| 406 |
+
|
| 407 |
+
$requestXML = new DOMDocument("1.0", "UTF-8");
|
| 408 |
+
$requestXML->formatOutput = true;
|
| 409 |
+
$requestXML->loadXML($requestString);
|
| 410 |
+
|
| 411 |
+
$requestNode = $requestXML->getElementsByTagName("AcceptPayment")->item(0);
|
| 412 |
+
|
| 413 |
+
foreach($requestNode->childNodes as $child) {
|
| 414 |
+
$child = $xml->importNode($child, true);
|
| 415 |
+
$operation->appendChild($child);
|
| 416 |
+
|
| 417 |
+
if($child->nodeName == 'paymentCallback')
|
| 418 |
+
$child->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance' ,'xsi:type', 'etp:CallbackPAYPAL');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 419 |
}
|
| 420 |
+
|
| 421 |
+
$this->request = $xml->saveXML();
|
| 422 |
+
|
| 423 |
+
$this->send();
|
| 424 |
+
|
| 425 |
+
$result = new PaymentResponse($this->response);
|
| 426 |
+
|
| 427 |
+
return $result;
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
/**
|
| 431 |
+
* Clear a transaction with an amount
|
| 432 |
+
* @param int $mPAYTid The mPAY24 transaction ID
|
| 433 |
+
* @param int $amount The amount to be cleared multiplay by 100
|
| 434 |
+
* @param string $currency 3-digit ISO currency code: EUR, USD, etc
|
| 435 |
+
* @return ManagePaymentResponse
|
| 436 |
+
*/
|
| 437 |
+
public function ManualClear($mPAYTid, $amount, $currency) {
|
| 438 |
+
$xml = $this->buildEnvelope();
|
| 439 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 440 |
+
|
| 441 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualClear');
|
| 442 |
+
$operation = $body->appendChild($operation);
|
| 443 |
+
|
| 444 |
+
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 445 |
+
$merchantID = $operation->appendChild($merchantID);
|
| 446 |
+
|
| 447 |
+
$clearingDetails = $xml->createElement('clearingDetails');
|
| 448 |
+
$clearingDetails = $operation->appendChild($clearingDetails);
|
| 449 |
+
|
| 450 |
+
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 451 |
+
$xmlMPayTid = $clearingDetails->appendChild($xmlMPayTid);
|
| 452 |
+
|
| 453 |
+
$price = $xml->createElement('amount', $amount);
|
| 454 |
+
$price = $clearingDetails->appendChild($price);
|
| 455 |
+
|
| 456 |
+
$this->request = $xml->saveXML();
|
| 457 |
+
|
| 458 |
+
$this->send();
|
| 459 |
+
|
| 460 |
+
$result = new ManagePaymentResponse($this->response);
|
| 461 |
+
|
| 462 |
+
return $result;
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
/**
|
| 466 |
+
* Credit a transaction with an amount
|
| 467 |
+
* @param int $mPAYTid The mPAY24 transaction ID
|
| 468 |
+
* @param int $amount The amount to be credited multiplay by 100
|
| 469 |
+
* @param string $currency 3-digit ISO currency code: EUR, USD, etc
|
| 470 |
+
* @param string $customer The name of the customer, who has paid
|
| 471 |
+
* @return ManagePaymentResponse
|
| 472 |
+
*/
|
| 473 |
+
public function ManualCredit($mPAYTid, $amount, $currency, $customer) {
|
| 474 |
+
$xml = $this->buildEnvelope();
|
| 475 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 476 |
+
|
| 477 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualCredit');
|
| 478 |
+
$operation = $body->appendChild($operation);
|
| 479 |
+
|
| 480 |
+
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 481 |
+
$merchantID = $operation->appendChild($merchantID);
|
| 482 |
+
|
| 483 |
+
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 484 |
+
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
| 485 |
+
|
| 486 |
+
$price = $xml->createElement('amount', $amount);
|
| 487 |
+
$price = $operation->appendChild($price);
|
| 488 |
+
|
| 489 |
+
$this->request = $xml->saveXML();
|
| 490 |
+
|
| 491 |
+
$this->send();
|
| 492 |
+
|
| 493 |
+
$result = new ManagePaymentResponse($this->response);
|
| 494 |
+
|
| 495 |
+
return $result;
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
/**
|
| 499 |
+
* Cancel a transaction
|
| 500 |
+
* @param int $mPAYTid The mPAY24 transaction ID for the transaction you want to cancel
|
| 501 |
+
* @return ManagePaymentResponse
|
| 502 |
+
*/
|
| 503 |
+
public function ManualReverse($mPAYTid) {
|
| 504 |
+
$xml = $this->buildEnvelope();
|
| 505 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 506 |
+
|
| 507 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:ManualReverse');
|
| 508 |
+
$operation = $body->appendChild($operation);
|
| 509 |
+
|
| 510 |
+
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 511 |
+
$merchantID = $operation->appendChild($merchantID);
|
| 512 |
+
|
| 513 |
+
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 514 |
+
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
| 515 |
+
|
| 516 |
+
$this->request = $xml->saveXML();
|
| 517 |
+
|
| 518 |
+
$this->send();
|
| 519 |
+
|
| 520 |
+
$result = new ManagePaymentResponse($this->response);
|
| 521 |
+
|
| 522 |
+
return $result;
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
/**
|
| 526 |
+
* Get all the information for a transaction, supported by mPAY24
|
| 527 |
+
* @param int $mPAYTid The mPAY24 transaction ID
|
| 528 |
+
* @param string $tid The transaction ID from your shop
|
| 529 |
+
* @return TransactionStatusResponse
|
| 530 |
+
*/
|
| 531 |
+
public function TransactionStatus($mPAYTid=null, $tid=null) {
|
| 532 |
+
$xml = $this->buildEnvelope();
|
| 533 |
+
$body = $xml->getElementsByTagNameNS('http://schemas.xmlsoap.org/soap/envelope/', 'Body')->item(0);
|
| 534 |
+
|
| 535 |
+
$operation = $xml->createElementNS('https://www.mpay24.com/soap/etp/1.5/ETP.wsdl', 'etp:TransactionStatus');
|
| 536 |
+
$operation = $body->appendChild($operation);
|
| 537 |
+
|
| 538 |
+
$merchantID = $xml->createElement('merchantID', substr($this->merchantid, 1));
|
| 539 |
+
$merchantID = $operation->appendChild($merchantID);
|
| 540 |
+
|
| 541 |
+
if($mPAYTid) {
|
| 542 |
+
$xmlMPayTid = $xml->createElement('mpayTID', $mPAYTid);
|
| 543 |
+
$xmlMPayTid = $operation->appendChild($xmlMPayTid);
|
| 544 |
+
} else {
|
| 545 |
+
$xmlTid = $xml->createElement('tid', $tid);
|
| 546 |
+
$xmlTid = $operation->appendChild($xmlTid);
|
| 547 |
}
|
| 548 |
+
|
| 549 |
+
$this->request = $xml->saveXML();
|
| 550 |
+
|
| 551 |
+
$this->send();
|
| 552 |
+
|
| 553 |
+
$result = new TransactionStatusResponse($this->response);
|
| 554 |
+
|
| 555 |
+
return $result;
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
/**
|
| 559 |
+
* Encoded the parameters (AES256-CBC) for the pay link and retunr them
|
| 560 |
+
* @param array $params The parameters, which are going to be posted to mPAY24
|
| 561 |
+
* @return string
|
| 562 |
+
*/
|
| 563 |
+
public function flexLINK($params) {
|
| 564 |
+
$paramsString = "";
|
| 565 |
+
|
| 566 |
+
foreach($params as $key => $value)
|
| 567 |
+
$paramsString .= "$key=$value&";
|
| 568 |
+
|
| 569 |
+
$encryptedParams = $this->ssl_encrypt($this->pass, $paramsString);
|
| 570 |
+
|
| 571 |
+
return $encryptedParams;
|
| 572 |
+
}
|
| 573 |
+
|
| 574 |
+
/**
|
| 575 |
+
* Set the merchant ID (without 'u')
|
| 576 |
+
* @param string $merchantID The merchant ID
|
| 577 |
+
*/
|
| 578 |
+
private function setMerchantID($merchantID=null) {
|
| 579 |
+
if($merchantID==null)
|
| 580 |
+
$this->merchantid = 'u' . MERCHANT_ID;
|
| 581 |
+
else
|
| 582 |
+
$this->merchantid = 'u' . $merchantID;
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
/**
|
| 586 |
+
* Set the SPID, in order to make flexLINK transactions
|
| 587 |
+
* @param string $spid The SPID of your account, supported by mPAY24
|
| 588 |
+
*/
|
| 589 |
+
private function setSPID($spid) {
|
| 590 |
+
$this->spid = $spid;
|
| 591 |
+
}
|
| 592 |
+
|
| 593 |
+
/**
|
| 594 |
+
* Set the Web-Services/SOAP password
|
| 595 |
+
* @param string $pass The SOAP password, provided by mPAY24
|
| 596 |
+
*/
|
| 597 |
+
private function setSoapPassword($pass=null) {
|
| 598 |
+
if(defined("SOAP_PASSWORD"))
|
| 599 |
+
$this->soappass = SOAP_PASSWORD;
|
| 600 |
+
else
|
| 601 |
+
$this->soappass = $pass;
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
/**
|
| 605 |
+
* Set the flexLINK password
|
| 606 |
+
* @param string $pass The flexLINK password, provided by mPAY24
|
| 607 |
+
*/
|
| 608 |
+
private function setPassword($pass) {
|
| 609 |
+
$this->pass = $pass;
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
/**
|
| 613 |
+
* Set whether the tets system (true) or the live system (false) will be used for the SOAP requests
|
| 614 |
+
* Set the POST url
|
| 615 |
+
*
|
| 616 |
+
* ("https://test.mpay24.com/app/bin/etpproxy_v14" or
|
| 617 |
+
*
|
| 618 |
+
* "https://www.mpay24.com/app/bin/etpproxy_v14")
|
| 619 |
+
* @param bool $test TRUE for TEST system and FALSE for LIVE system.
|
| 620 |
+
*
|
| 621 |
+
*/
|
| 622 |
+
private function setSystem($test=null) {
|
| 623 |
+
if($test) {
|
| 624 |
+
$this->test = true;
|
| 625 |
+
$this->etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";
|
| 626 |
+
} else {
|
| 627 |
+
$this->test = false;
|
| 628 |
+
$this->etp_url = "https://www.mpay24.com/app/bin/etpproxy_v15";
|
| 629 |
+
}
|
| 630 |
+
}
|
| 631 |
+
|
| 632 |
+
/**
|
| 633 |
+
* Set whether the tets system (true) or the live system (false) will be used for the flexLINK requests
|
| 634 |
+
* @param bool $test TRUE for TEST system and FALSE for LIVE system.
|
| 635 |
+
*/
|
| 636 |
+
private function setFlexLINKSystem($test=null) {
|
| 637 |
+
if($test)
|
| 638 |
+
$this->flexLINKSystem = "test";
|
| 639 |
+
else
|
| 640 |
+
$this->flexLINKSystem = "www";
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
/**
|
| 644 |
+
* Set the used proxy host and proxy port in case proxy is used
|
| 645 |
+
* @param string $proxy_host Proxy host
|
| 646 |
+
* @param string $proxy_port Proxy port
|
| 647 |
+
*/
|
| 648 |
+
private function setProxySettings($proxy_host="", $proxy_port="") {
|
| 649 |
+
if($proxy_host != "" && $proxy_port != "") {
|
| 650 |
+
$this->proxy_host = $proxy_host;
|
| 651 |
+
$this->proxy_port = $proxy_port;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 652 |
}
|
| 653 |
+
}
|
| 654 |
+
|
| 655 |
+
/**
|
| 656 |
+
* Create a DOMDocument and prepare it for SOAP request:
|
| 657 |
+
* set Envelope, NameSpaces, create empty Body
|
| 658 |
+
* @return DOMDocument
|
| 659 |
+
*/
|
| 660 |
+
private function buildEnvelope() {
|
| 661 |
+
$this->soap_xml = new DOMDocument("1.0", "UTF-8");
|
| 662 |
+
$this->soap_xml->formatOutput = true;
|
| 663 |
+
|
| 664 |
+
$envelope = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Envelope');
|
| 665 |
+
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
| 666 |
+
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:etp', 'https://www.mpay24.com/soap/etp/1.5/ETP.wsdl');
|
| 667 |
+
$envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
| 668 |
+
$envelope = $this->soap_xml->appendChild($envelope);
|
| 669 |
+
|
| 670 |
+
$body = $this->soap_xml->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Body');
|
| 671 |
+
$body = $envelope->appendChild($body);
|
| 672 |
+
|
| 673 |
+
return $this->soap_xml;
|
| 674 |
+
}
|
| 675 |
+
|
| 676 |
+
/**
|
| 677 |
+
* Create a curl request and send the cretaed SOAP XML
|
| 678 |
+
*/
|
| 679 |
+
private function send() {
|
| 680 |
+
$userAgent = 'mPAY24 PHP API $Rev: 5522 $ ($Date:: 2013-06-24 #$)';
|
| 681 |
+
|
| 682 |
+
if($this->shop != '') {
|
| 683 |
+
$userAgent = $this->shop;
|
| 684 |
+
|
| 685 |
+
if($this->shopVersion != '')
|
| 686 |
+
$userAgent .= " v. " . $this->shopVersion;
|
| 687 |
+
if($this->shopVersion != '')
|
| 688 |
+
$userAgent .= " - Module v. " . $this->moduleVersion;
|
| 689 |
+
}
|
| 690 |
+
|
| 691 |
+
$ch = curl_init($this->etp_url);
|
| 692 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
| 693 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
| 694 |
+
curl_setopt($ch,CURLOPT_USERPWD,"$this->merchantid:$this->soappass");
|
| 695 |
+
curl_setopt($ch,CURLOPT_USERAGENT,$userAgent);
|
| 696 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->request);
|
| 697 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
| 698 |
+
|
| 699 |
+
if($this->debug) {
|
| 700 |
+
$fh = fopen(__DIR__."/curllog.log", 'a+') or $this->permissionError();
|
| 701 |
+
|
| 702 |
+
curl_setopt($ch, CURLOPT_VERBOSE, 1);
|
| 703 |
+
curl_setopt($ch, CURLOPT_STDERR, $fh);
|
| 704 |
+
}
|
| 705 |
+
|
| 706 |
+
try {
|
| 707 |
+
curl_setopt($ch, CURLOPT_CAINFO, __DIR__.'/cacert.pem');
|
| 708 |
+
|
| 709 |
+
if($this->proxy_host !== '' && $this->proxy_port !== '')
|
| 710 |
+
curl_setopt($ch, CURLOPT_PROXY, $this->proxy_host.':'.$this->proxy_port);
|
| 711 |
+
|
| 712 |
+
$this->response = curl_exec($ch);
|
| 713 |
+
curl_close($ch);
|
| 714 |
+
|
| 715 |
+
if($this->debug)
|
| 716 |
+
fclose($fh);
|
| 717 |
+
} catch (Exception $e) {
|
| 718 |
+
if($this->test)
|
| 719 |
+
$dieMSG = "Your request couldn't be sent because of the following error:" . "\n" .
|
| 720 |
+
curl_error($ch) . "\n" .
|
| 721 |
+
$e->getMessage() .
|
| 722 |
+
' in '.$e->getFile().', line: '.
|
| 723 |
+
$e->getLine().'.';
|
| 724 |
+
else
|
| 725 |
+
$dieMSG = LIVE_ERROR_MSG;
|
| 726 |
+
|
| 727 |
+
echo $dieMSG;
|
| 728 |
+
}
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
+
/**
|
| 732 |
+
* Encode data (AES256-CBC) using a password
|
| 733 |
+
* @param string $pass The password, used for the encoding
|
| 734 |
+
* @param string $data The data, that should be encoded
|
| 735 |
+
* @return string
|
| 736 |
+
*/
|
| 737 |
+
private function ssl_encrypt($pass, $data) {
|
| 738 |
+
// Set a random salt
|
| 739 |
+
$salt = substr(md5(mt_rand(), true), 8);
|
| 740 |
+
|
| 741 |
+
$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
|
| 742 |
+
$pad = $block - (strlen($data) % $block);
|
| 743 |
+
|
| 744 |
+
$data = $data . str_repeat(chr($pad), $pad);
|
| 745 |
+
|
| 746 |
+
// Setup encryption parameters
|
| 747 |
+
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, "", MCRYPT_MODE_CBC, "");
|
| 748 |
+
|
| 749 |
+
$key_len = mcrypt_enc_get_key_size($td);
|
| 750 |
+
$iv_len = mcrypt_enc_get_iv_size($td);
|
| 751 |
+
|
| 752 |
+
$total_len = $key_len + $iv_len;
|
| 753 |
+
$salted = '';
|
| 754 |
+
$dx = '';
|
| 755 |
+
|
| 756 |
+
// Salt the key and iv
|
| 757 |
+
while (strlen($salted) < $total_len) {
|
| 758 |
+
$dx = md5($dx.$pass.$salt, true);
|
| 759 |
+
$salted .= $dx;
|
| 760 |
+
}
|
| 761 |
+
|
| 762 |
+
$key = substr($salted,0,$key_len);
|
| 763 |
+
$iv = substr($salted,$key_len,$iv_len);
|
| 764 |
+
|
| 765 |
+
mcrypt_generic_init($td, $key, $iv);
|
| 766 |
+
$encrypted_data = mcrypt_generic($td, $data);
|
| 767 |
+
mcrypt_generic_deinit($td);
|
| 768 |
+
mcrypt_module_close($td);
|
| 769 |
+
|
| 770 |
+
return chunk_split(base64_encode('Salted__' . $salt . $encrypted_data),32,"\r\n");
|
| 771 |
+
}
|
| 772 |
+
}
|
| 773 |
+
|
| 774 |
+
/**
|
| 775 |
+
* The GeneralResponse class contains the status of a response and return code, which was delivered by mPAY24 as an answer of your request
|
| 776 |
+
*
|
| 777 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
| 778 |
+
* @version $Id: MPay24Api.php 5522 2013-06-24 13:08:35Z anna $
|
| 779 |
+
* @filesource MPay24Api.php
|
| 780 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 781 |
+
*/
|
| 782 |
+
class GeneralResponse {
|
| 783 |
+
/**
|
| 784 |
+
* The status of the request, which was sent to mPAY24
|
| 785 |
+
* @var string
|
| 786 |
+
*/
|
| 787 |
+
var $status;
|
| 788 |
+
/**
|
| 789 |
+
* The return code from the request, which was sent to mPAY24
|
| 790 |
+
* @var string
|
| 791 |
+
*/
|
| 792 |
+
var $returnCode;
|
| 793 |
+
|
| 794 |
+
/**
|
| 795 |
+
* Sets the basic values from the response from mPAY24: status and return code
|
| 796 |
+
* @param string $response The SOAP response from mPAY24 (in XML form)
|
| 797 |
+
*/
|
| 798 |
+
function GeneralResponse($response) {
|
| 799 |
+
if($response != '') {
|
| 800 |
+
$responseAsDOM = new DOMDocument();
|
| 801 |
+
$responseAsDOM->loadXML($response);
|
| 802 |
+
|
| 803 |
+
if(!empty($responseAsDOM) && is_object($responseAsDOM))
|
| 804 |
+
if(!$responseAsDOM || $responseAsDOM->getElementsByTagName('status')->length == 0 || $responseAsDOM->getElementsByTagName('returnCode')->length == 0){
|
| 805 |
+
$this->status = "ERROR";
|
| 806 |
+
$this->returnCode = urldecode($response);
|
| 807 |
+
} else {
|
| 808 |
+
$this->status = $responseAsDOM->getElementsByTagName('status')->item(0)->nodeValue;
|
| 809 |
+
$this->returnCode = $responseAsDOM->getElementsByTagName('returnCode')->item(0)->nodeValue;
|
| 810 |
}
|
| 811 |
+
} else {
|
| 812 |
+
$this->status = "ERROR";
|
| 813 |
+
$this->returnCode = "The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!";
|
| 814 |
+
}
|
| 815 |
+
}
|
| 816 |
+
|
| 817 |
+
/**
|
| 818 |
+
* Get the status of the request, which was sent to mPAY24
|
| 819 |
+
* @return string
|
| 820 |
+
*/
|
| 821 |
+
public function getStatus() {
|
| 822 |
+
return $this->status;
|
| 823 |
+
}
|
| 824 |
+
|
| 825 |
+
/**
|
| 826 |
+
* Get the return code from the request, which was sent to mPAY24
|
| 827 |
+
* @return string
|
| 828 |
+
*/
|
| 829 |
+
public function getReturnCode() {
|
| 830 |
+
return $this->returnCode;
|
| 831 |
+
}
|
| 832 |
+
|
| 833 |
+
/**
|
| 834 |
+
* Set the status in the response, which was delivered by mPAY24
|
| 835 |
+
* @param string $status Status
|
| 836 |
+
*/
|
| 837 |
+
public function setStatus($status) {
|
| 838 |
+
$this->status = $status;
|
| 839 |
+
}
|
| 840 |
+
|
| 841 |
+
/**
|
| 842 |
+
* Set the return code in the response, which was delivered by mPAY24
|
| 843 |
+
* @param string $returnCode Return code
|
| 844 |
+
*/
|
| 845 |
+
public function setReturnCode($returnCode) {
|
| 846 |
+
return $this->returnCode = $returnCode;
|
| 847 |
+
}
|
| 848 |
+
}
|
| 849 |
+
|
| 850 |
+
/**
|
| 851 |
+
* The PaymentResponse class contains a generalResponse object and the location(URL), which will be used for the payment session
|
| 852 |
+
*
|
| 853 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
| 854 |
+
* @version $Id: MPay24Api.php 5522 2013-06-24 13:08:35Z anna $
|
| 855 |
+
* @filesource MPay24Api.php
|
| 856 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 857 |
+
*/
|
| 858 |
+
class PaymentResponse extends GeneralResponse {
|
| 859 |
+
/**
|
| 860 |
+
* An object, that represents the basic values from the response from mPAY24: status and return code
|
| 861 |
+
* @var string
|
| 862 |
+
*/
|
| 863 |
+
var $generalResponse;
|
| 864 |
+
/**
|
| 865 |
+
* An URL (of the mPAY24 payment fenster), where the customer would be redirected to, in case of successfull request
|
| 866 |
+
* @var string
|
| 867 |
+
*/
|
| 868 |
+
var $location;
|
| 869 |
+
|
| 870 |
+
/**
|
| 871 |
+
* Sets the values for a payment from the response from mPAY24: mPAY transaction ID, error number and location (URL)
|
| 872 |
+
* @param string $response The SOAP response from mPAY24 (in XML form)
|
| 873 |
+
*/
|
| 874 |
+
function PaymentResponse($response) {
|
| 875 |
+
$this->generalResponse = new GeneralResponse($response);
|
| 876 |
+
|
| 877 |
+
if($response != '') {
|
| 878 |
+
$responseAsDOM = new DOMDocument();
|
| 879 |
+
$responseAsDOM->loadXML($response);
|
| 880 |
+
|
| 881 |
+
if(!empty($responseAsDOM) && is_object($responseAsDOM) && $responseAsDOM->getElementsByTagName('location')->length != 0)
|
| 882 |
+
$this->location = $responseAsDOM->getElementsByTagName('location')->item(0)->nodeValue;
|
| 883 |
+
} else {
|
| 884 |
+
$this->generalResponse->setStatus("ERROR");
|
| 885 |
+
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
| 886 |
+
}
|
| 887 |
+
}
|
| 888 |
+
|
| 889 |
+
/**
|
| 890 |
+
* Get the location (URL), returned from mPAY24
|
| 891 |
+
* @return string
|
| 892 |
+
*/
|
| 893 |
+
public function getLocation(){
|
| 894 |
+
return $this->location;
|
| 895 |
+
}
|
| 896 |
+
|
| 897 |
+
/**
|
| 898 |
+
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
| 899 |
+
* @return string
|
| 900 |
+
*/
|
| 901 |
+
public function getGeneralResponse(){
|
| 902 |
+
return $this->generalResponse;
|
| 903 |
+
}
|
| 904 |
+
}
|
| 905 |
+
|
| 906 |
+
/**
|
| 907 |
+
* The ManagePaymentResponse class contains a generalResponse object and the mPAYTID and/or tid of the transaction which was managed
|
| 908 |
+
*
|
| 909 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
| 910 |
+
* @version $Id: MPay24Api.php 5522 2013-06-24 13:08:35Z anna $
|
| 911 |
+
* @filesource MPay24Api.php
|
| 912 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 913 |
+
*/
|
| 914 |
+
class ManagePaymentResponse extends GeneralResponse {
|
| 915 |
+
/**
|
| 916 |
+
* An object, that represents the basic values from the response from mPAY24: status and return code
|
| 917 |
+
* @var string
|
| 918 |
+
*/
|
| 919 |
+
var $generalResponse;
|
| 920 |
+
/**
|
| 921 |
+
* The mPAY transaction ID
|
| 922 |
+
* @var string
|
| 923 |
+
*/
|
| 924 |
+
var $mpayTID;
|
| 925 |
+
/**
|
| 926 |
+
* The transaction ID of the shop
|
| 927 |
+
* @var string
|
| 928 |
+
*/
|
| 929 |
+
var $tid;
|
| 930 |
+
|
| 931 |
+
/**
|
| 932 |
+
* Sets the values for a payment from the response from mPAY24: mPAY transaction IDand transaction ID from the shop
|
| 933 |
+
* @param string $response The SOAP response from mPAY24 (in XML form)
|
| 934 |
+
*/
|
| 935 |
+
function ManagePaymentResponse($response) {
|
| 936 |
+
$this->generalResponse = new GeneralResponse($response);
|
| 937 |
+
|
| 938 |
+
if($response != '') {
|
| 939 |
+
$responseAsDOM = new DOMDocument();
|
| 940 |
+
$responseAsDOM->loadXML($response);
|
| 941 |
+
|
| 942 |
+
if($responseAsDOM && $responseAsDOM->getElementsByTagName('mpayTID')->length != 0 && $responseAsDOM->getElementsByTagName('tid')->length != 0) {
|
| 943 |
+
$this->mpayTID = $responseAsDOM->getElementsByTagName('mpayTID')->item(0)->nodeValue;
|
| 944 |
+
$this->tid = $responseAsDOM->getElementsByTagName('tid')->item(0)->nodeValue;
|
| 945 |
+
}
|
| 946 |
+
} else {
|
| 947 |
+
$this->generalResponse->setStatus("ERROR");
|
| 948 |
+
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
| 949 |
+
}
|
| 950 |
+
}
|
| 951 |
+
|
| 952 |
+
/**
|
| 953 |
+
* Get the mPAY transaction ID, returned from mPAY24
|
| 954 |
+
* @return string
|
| 955 |
+
*/
|
| 956 |
+
public function getMpayTID() {
|
| 957 |
+
return $this->mpayTID;
|
| 958 |
+
}
|
| 959 |
+
|
| 960 |
+
/**
|
| 961 |
+
* Get the transaction ID of the shop, returned from mPAY24
|
| 962 |
+
* @return string
|
| 963 |
+
*/
|
| 964 |
+
public function getTid() {
|
| 965 |
+
return $this->tid;
|
| 966 |
+
}
|
| 967 |
+
|
| 968 |
+
/**
|
| 969 |
+
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
| 970 |
+
* @return string
|
| 971 |
+
*/
|
| 972 |
+
public function getGeneralResponse() {
|
| 973 |
+
return $this->generalResponse;
|
| 974 |
+
}
|
| 975 |
+
}
|
| 976 |
+
|
| 977 |
+
/**
|
| 978 |
+
* 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)
|
| 979 |
+
*
|
| 980 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
| 981 |
+
* @version $Id: MPay24Api.php 5522 2013-06-24 13:08:35Z anna $
|
| 982 |
+
* @filesource MPay24Api.php
|
| 983 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 984 |
+
*/
|
| 985 |
+
class ListPaymentMethodsResponse extends GeneralResponse {
|
| 986 |
+
/**
|
| 987 |
+
* An object, that represents the basic values from the response from mPAY24: status and return code
|
| 988 |
+
* @var string
|
| 989 |
+
*/
|
| 990 |
+
var $generalResponse;
|
| 991 |
+
/**
|
| 992 |
+
* The count of the payment methods, which are activated by mPAY24
|
| 993 |
+
* @var int
|
| 994 |
+
*/
|
| 995 |
+
var $all = 0;
|
| 996 |
+
/**
|
| 997 |
+
* A list with the payment types, activated by mPAY24
|
| 998 |
+
* @var array
|
| 999 |
+
*/
|
| 1000 |
+
var $pTypes = array();
|
| 1001 |
+
/**
|
| 1002 |
+
* A list with the brands, activated by mPAY24
|
| 1003 |
+
* @var array
|
| 1004 |
+
*/
|
| 1005 |
+
var $brands = array();
|
| 1006 |
+
/**
|
| 1007 |
+
* A list with the descriptions of the payment methods, activated by mPAY24
|
| 1008 |
+
* @var array
|
| 1009 |
+
*/
|
| 1010 |
+
var $descriptions = array();
|
| 1011 |
+
|
| 1012 |
+
/**
|
| 1013 |
+
* A list with the IDs of the payment methods, activated by mPAY24
|
| 1014 |
+
* @var array
|
| 1015 |
+
*/
|
| 1016 |
+
var $pMethIds = array();
|
| 1017 |
+
|
| 1018 |
+
/**
|
| 1019 |
+
* Sets the values for a payment from the response from mPAY24: count, payment types, brands and descriptions
|
| 1020 |
+
* @param string $response The SOAP response from mPAY24 (in XML form)
|
| 1021 |
+
*/
|
| 1022 |
+
function ListPaymentMethodsResponse($response) {
|
| 1023 |
+
$this->generalResponse = new GeneralResponse($response);
|
| 1024 |
+
|
| 1025 |
+
if($response != '') {
|
| 1026 |
+
$responseAsDOM = new DOMDocument();
|
| 1027 |
+
$responseAsDOM->loadXML($response);
|
| 1028 |
+
|
| 1029 |
+
if($responseAsDOM && $responseAsDOM->getElementsByTagName('all')->length != 0) {
|
| 1030 |
+
$this->all = $responseAsDOM->getElementsByTagName('all')->item(0)->nodeValue;
|
| 1031 |
+
|
| 1032 |
+
for($i = 0; $i < $this->all; $i++) {
|
| 1033 |
+
$this->pTypes[$i] = $responseAsDOM->getElementsByTagName('pType')->item($i)->nodeValue;
|
| 1034 |
+
$this->brands[$i] = $responseAsDOM->getElementsByTagName('brand')->item($i)->nodeValue;
|
| 1035 |
+
$this->descriptions[$i] = $responseAsDOM->getElementsByTagName('description')->item($i)->nodeValue;
|
| 1036 |
+
$this->pMethIds[$i] = $responseAsDOM->getElementsByTagName('paymentMethod')->item($i)->getAttribute("id");
|
| 1037 |
}
|
| 1038 |
+
}
|
| 1039 |
+
} else {
|
| 1040 |
+
$this->generalResponse->setStatus("ERROR");
|
| 1041 |
+
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
| 1042 |
+
}
|
| 1043 |
+
}
|
| 1044 |
+
|
| 1045 |
+
/**
|
| 1046 |
+
* Get the count of the payment methods, returned from mPAY24
|
| 1047 |
+
* @return int
|
| 1048 |
+
*/
|
| 1049 |
+
public function getAll() {
|
| 1050 |
+
return $this->all;
|
| 1051 |
+
}
|
| 1052 |
+
|
| 1053 |
+
/**
|
| 1054 |
+
* Get the payment types, returned from mPAY24
|
| 1055 |
+
* @return array
|
| 1056 |
+
*/
|
| 1057 |
+
public function getPTypes() {
|
| 1058 |
+
return $this->pTypes;
|
| 1059 |
+
}
|
| 1060 |
+
|
| 1061 |
+
/**
|
| 1062 |
+
* Get the brands, returned from mPAY24
|
| 1063 |
+
* @return array
|
| 1064 |
+
*/
|
| 1065 |
+
public function getBrands() {
|
| 1066 |
+
return $this->brands;
|
| 1067 |
+
}
|
| 1068 |
+
|
| 1069 |
+
/**
|
| 1070 |
+
* Get the descriptions, returned from mPAY24
|
| 1071 |
+
* @return array
|
| 1072 |
+
*/
|
| 1073 |
+
public function getDescriptions() {
|
| 1074 |
+
return $this->descriptions;
|
| 1075 |
+
}
|
| 1076 |
+
|
| 1077 |
+
/**
|
| 1078 |
+
* Get the payment method IDs, returned from mPAY24
|
| 1079 |
+
* @return array
|
| 1080 |
+
*/
|
| 1081 |
+
public function getPMethIDs() {
|
| 1082 |
+
return $this->pMethIds;
|
| 1083 |
+
}
|
| 1084 |
+
|
| 1085 |
+
/**
|
| 1086 |
+
* Get payment type, returned from mPAY24
|
| 1087 |
+
* @param int $i The index of a payment type
|
| 1088 |
+
* @return string
|
| 1089 |
+
*/
|
| 1090 |
+
public function getPType($i) {
|
| 1091 |
+
return $this->pTypes[$i];
|
| 1092 |
+
}
|
| 1093 |
+
|
| 1094 |
+
/**
|
| 1095 |
+
* Get brand, returned from mPAY24
|
| 1096 |
+
* @param int $i The index of a brand
|
| 1097 |
+
* @return string
|
| 1098 |
+
*/
|
| 1099 |
+
public function getBrand($i) {
|
| 1100 |
+
return $this->brands[$i];
|
| 1101 |
+
}
|
| 1102 |
+
|
| 1103 |
+
/**
|
| 1104 |
+
* Get description, returned from mPAY24
|
| 1105 |
+
* @param int $i The index of a description
|
| 1106 |
+
* @return string
|
| 1107 |
+
*/
|
| 1108 |
+
public function getDescription($i) {
|
| 1109 |
+
return $this->descriptions[$i];
|
| 1110 |
+
}
|
| 1111 |
+
|
| 1112 |
+
/**
|
| 1113 |
+
* Get payment method ID, returned from mPAY24
|
| 1114 |
+
* @param int $i The index of an payment method ID
|
| 1115 |
+
* @return int
|
| 1116 |
+
*/
|
| 1117 |
+
public function getPMethID($i) {
|
| 1118 |
+
return $this->pMethIds[$i];
|
| 1119 |
+
}
|
| 1120 |
+
|
| 1121 |
+
/**
|
| 1122 |
+
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
| 1123 |
+
* @return string
|
| 1124 |
+
*/
|
| 1125 |
+
public function getGeneralResponse() {
|
| 1126 |
+
return $this->generalResponse;
|
| 1127 |
+
}
|
| 1128 |
+
}
|
| 1129 |
+
|
| 1130 |
+
/**
|
| 1131 |
+
* The TransactionStatusResponse class contains a generalResponse object and all the parameters, returned with the confirmation from mPAY24
|
| 1132 |
+
*
|
| 1133 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
| 1134 |
+
* @version $Id: MPay24Api.php 5522 2013-06-24 13:08:35Z anna $
|
| 1135 |
+
* @filesource MPay24Api.php
|
| 1136 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 1137 |
+
*/
|
| 1138 |
+
class TransactionStatusResponse extends GeneralResponse {
|
| 1139 |
+
/**
|
| 1140 |
+
* An object, that represents the basic values from the response from mPAY24: status and return code
|
| 1141 |
+
* @var string
|
| 1142 |
+
*/
|
| 1143 |
+
var $generalResponse;
|
| 1144 |
+
/**
|
| 1145 |
+
* A list with all the parameters for a transaction
|
| 1146 |
+
* @var array
|
| 1147 |
+
*/
|
| 1148 |
+
var $params = array();
|
| 1149 |
+
/**
|
| 1150 |
+
* The count of all the paramerters for a transaction
|
| 1151 |
+
* @var int
|
| 1152 |
+
*/
|
| 1153 |
+
var $paramCount = 0;
|
| 1154 |
+
|
| 1155 |
+
/**
|
| 1156 |
+
* Sets the values for a transaction from the response from mPAY24: STATUS, PRICE, CURRENCY, LANGUAGE, etc
|
| 1157 |
+
* @param string $response The SOAP response from mPAY24 (in XML form)
|
| 1158 |
+
*/
|
| 1159 |
+
function TransactionStatusResponse($response) {
|
| 1160 |
+
$this->generalResponse = new GeneralResponse($response);
|
| 1161 |
+
|
| 1162 |
+
if($response != '') {
|
| 1163 |
+
$responseAsDOM = new DOMDocument();
|
| 1164 |
+
$responseAsDOM->loadXML($response);
|
| 1165 |
+
|
| 1166 |
+
if($responseAsDOM && $responseAsDOM->getElementsByTagName('name')->length != 0) {
|
| 1167 |
+
$this->paramCount = $responseAsDOM->getElementsByTagName('name')->length;
|
| 1168 |
+
$this->params['STATUS'] = $this->generalResponse->getStatus();
|
| 1169 |
+
|
| 1170 |
+
for($i = 0; $i < $this->paramCount; $i++){
|
| 1171 |
+
if($responseAsDOM->getElementsByTagName("name")->item($i)->nodeValue == "STATUS")
|
| 1172 |
+
$this->params["TSTATUS"] = $responseAsDOM->getElementsByTagName("value")->item($i)->nodeValue;
|
| 1173 |
+
else
|
| 1174 |
+
$this->params[$responseAsDOM->getElementsByTagName('name')->item($i)->nodeValue]
|
| 1175 |
+
= $responseAsDOM->getElementsByTagName('value')->item($i)->nodeValue;
|
| 1176 |
}
|
| 1177 |
+
}
|
| 1178 |
+
} else {
|
| 1179 |
+
$this->generalResponse->setStatus("ERROR");
|
| 1180 |
+
$this->generalResponse->setReturnCode("The response is empty! Probably your request to mPAY24 was not sent! Please see your server log for more information!");
|
| 1181 |
}
|
| 1182 |
+
}
|
| 1183 |
+
|
| 1184 |
+
/**
|
| 1185 |
+
* Get the count of all the paramerters for a transaction
|
| 1186 |
+
* @return int
|
| 1187 |
+
*/
|
| 1188 |
+
public function getParamCount() {
|
| 1189 |
+
return $this->paramCount;
|
| 1190 |
+
}
|
| 1191 |
+
|
| 1192 |
+
/**
|
| 1193 |
+
* Get the parameters for a transaction, returned from mPAY24
|
| 1194 |
+
* @return array
|
| 1195 |
+
*/
|
| 1196 |
+
public function getParams() {
|
| 1197 |
+
return $this->params;
|
| 1198 |
+
}
|
| 1199 |
+
|
| 1200 |
+
/**
|
| 1201 |
+
* Get the parameter's value, returned from mPAY24
|
| 1202 |
+
* @param string $i The name of a parameter (for example: STATUS, PRICE, CURRENCY, etc)
|
| 1203 |
+
* @return array
|
| 1204 |
+
*/
|
| 1205 |
+
public function getParam($i) {
|
| 1206 |
+
if(isset($this->params[$i]))
|
| 1207 |
+
return $this->params[$i];
|
| 1208 |
+
else
|
| 1209 |
+
return false;
|
| 1210 |
+
}
|
| 1211 |
+
|
| 1212 |
+
/**
|
| 1213 |
+
* Set a value for a parameter
|
| 1214 |
+
* @param string $name The name of a parameter (for example: STATUS, PRICE, CURRENCY, etc)
|
| 1215 |
+
* @param string $value The value of the parameter
|
| 1216 |
+
*/
|
| 1217 |
+
public function setParam($name, $value) {
|
| 1218 |
+
$this->params[$name] = $value;
|
| 1219 |
+
}
|
| 1220 |
+
|
| 1221 |
+
/**
|
| 1222 |
+
* Get the object, that contains the basic values from the response from mPAY24: status and return code
|
| 1223 |
+
* @return string
|
| 1224 |
+
*/
|
| 1225 |
+
public function getGeneralResponse() {
|
| 1226 |
+
return $this->generalResponse;
|
| 1227 |
+
}
|
| 1228 |
+
}
|
| 1229 |
?>
|
app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php
CHANGED
|
@@ -8,719 +8,744 @@
|
|
| 8 |
|
| 9 |
include_once("MPay24Shop.php");
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
default:
|
| 225 |
-
$status = 'SUSPENDED';
|
| 226 |
-
break;
|
| 227 |
-
}
|
| 228 |
-
}
|
| 229 |
-
return $status;
|
| 230 |
-
}
|
| 231 |
-
|
| 232 |
-
function getTransaction($tid) {
|
| 233 |
-
$transaction = new Transaction($tid);
|
| 234 |
-
$order = Mage::getSingleton('sales/order');
|
| 235 |
-
$order->loadByIncrementId($tid);
|
| 236 |
-
$transaction->PRICE = number_format(floatval($order->getPayment()->getAmountAuthorized()), 2, '.', '');
|
| 237 |
-
$transaction->CURRENCY = $order->getBaseCurrencyCode();
|
| 238 |
-
$transaction->MPAYTID = $order->getPayment()->getAdditionalInformation('mpay_tid');
|
| 239 |
-
return $transaction;
|
| 240 |
-
}
|
| 241 |
-
|
| 242 |
-
function createProfileOrder($tid) {}
|
| 243 |
-
function createExpressCheckoutOrder($tid) {}
|
| 244 |
-
function createFinishExpressCheckoutOrder($tid, $s, $a, $c) {}
|
| 245 |
-
|
| 246 |
-
function write_log($operation, $info_to_log) {
|
| 247 |
-
$fh = fopen("app/code/community/Mpay24/Mpay24/Model/Api/logs/mPAY24log.log", 'a+') or die("can't open file");
|
| 248 |
-
$MessageDate = date("Y-m-d H:i:s");
|
| 249 |
-
$Message= $MessageDate." ".$_SERVER['SERVER_NAME']." mPAY24 : ";
|
| 250 |
-
$result = $Message."$operation : $info_to_log\n";
|
| 251 |
-
fwrite($fh, $result);
|
| 252 |
-
fclose($fh);
|
| 253 |
-
}
|
| 254 |
-
|
| 255 |
-
function createSecret($tid, $amount, $currency, $timeStamp) {}
|
| 256 |
-
function getSecret($tid) {}
|
| 257 |
-
|
| 258 |
-
function createTransaction() {
|
| 259 |
-
$transaction = new Transaction($this->tid);
|
| 260 |
-
$transaction->PRICE = $this->price;
|
| 261 |
-
return $transaction;
|
| 262 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
|
| 264 |
-
|
| 265 |
-
$mdxi = new ORDER();
|
| 266 |
-
|
| 267 |
-
$mdxi->Order->setStyle(Mage::getStoreConfig('mpay24/mpay24sporder/style'));
|
| 268 |
-
$mdxi->Order->setLogoStyle(Mage::getStoreConfig('mpay24/mpay24sporder/logostyle'));
|
| 269 |
-
$mdxi->Order->setPageHeaderStyle(Mage::getStoreConfig('mpay24/mpay24sporder/pageheaderstyle'));
|
| 270 |
-
$mdxi->Order->setPageCaptionStyle(Mage::getStoreConfig('mpay24/mpay24sporder/pagecaptionstyle'));
|
| 271 |
-
$mdxi->Order->setPageStyle(Mage::getStoreConfig('mpay24/mpay24sporder/pagestyle'));
|
| 272 |
-
$mdxi->Order->setInputFieldsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/inputfieldsstyle'));
|
| 273 |
-
$mdxi->Order->setDropDownListsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/dropdownlistsstyle'));
|
| 274 |
-
$mdxi->Order->setButtonsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/buttonsstyle'));
|
| 275 |
-
$mdxi->Order->setErrorsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/errorsstyle'));
|
| 276 |
-
$mdxi->Order->setSuccessTitleStyle(Mage::getStoreConfig('mpay24/mpay24sporder/successtitlestyle'));
|
| 277 |
-
$mdxi->Order->setErrorTitleStyle(Mage::getStoreConfig('mpay24/mpay24sporder/errortitlestyle'));
|
| 278 |
-
$mdxi->Order->setFooterStyle(Mage::getStoreConfig('mpay24/mpay24sporder/footerstyle'));
|
| 279 |
-
|
| 280 |
-
$this->order->getPayment()->setAdditionalInformation('user_field', MPay24MagentoShop::MAGENTO_VERSION.$transaction->TID.'_'.date('Y-m-d'))->save();
|
| 281 |
-
$mdxi->Order->UserField = MPay24MagentoShop::MAGENTO_VERSION.$transaction->TID.'_'.date('Y-m-d');
|
| 282 |
-
$mdxi->Order->Tid = $transaction->TID;
|
| 283 |
-
|
| 284 |
-
$lang = explode('_', Mage::getStoreConfig('general/locale/code'));
|
| 285 |
$mdxi->Order->TemplateSet->setLanguage(strtoupper($lang[0]));
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
$mdxi->Order->PaymentTypes->setEnable('true');
|
| 289 |
|
| 290 |
-
$mdxi->Order->PaymentTypes->Payment(1)->setType($this->type);
|
| 291 |
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
}
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 345 |
}
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
}
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
}
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
}
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
}
|
| 362 |
-
|
| 363 |
-
$mdxi->Order->
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
$
|
| 367 |
-
$
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 410 |
}
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
$mdxi->Order->BillingAddr->Name = substr($billingName,0,50);
|
| 504 |
-
|
| 505 |
-
$billingAdress = $this->xmlentities($this->order->getBillingAddress()->getStreetFull());
|
| 506 |
-
|
| 507 |
-
$billingStreet = $this->splitAdress($billingAdress);
|
| 508 |
-
|
| 509 |
-
if(isset($billingStreet[0]) && is_array($billingStreet[0])) {
|
| 510 |
-
$mdxi->Order->BillingAddr->Street = $billingStreet[0]['Street'];
|
| 511 |
-
$mdxi->Order->BillingAddr->Street2 = $billingStreet[1]['Street2'];
|
| 512 |
-
} else {
|
| 513 |
-
$mdxi->Order->BillingAddr->Street = $billingStreet['Street'];
|
| 514 |
-
|
| 515 |
-
if(isset($billingStreet['Street2']))
|
| 516 |
-
$mdxi->Order->BillingAddr->Street2 = $billingStreet['Street2'];
|
| 517 |
-
}
|
| 518 |
-
|
| 519 |
-
$mdxi->Order->BillingAddr->Zip = substr($this->xmlentities($this->order->getBillingAddress()->getPostcode()),0,50);
|
| 520 |
-
$mdxi->Order->BillingAddr->City = substr($this->xmlentities($this->order->getBillingAddress()->getCity()),0,50);
|
| 521 |
-
$mdxi->Order->BillingAddr->Country->setCode($this->xmlentities($billingCountryCode));
|
| 522 |
-
$mdxi->Order->BillingAddr->Email = substr($this->xmlentities($this->order->getBillingAddress()->getEmail()),0,50);
|
| 523 |
-
|
| 524 |
-
if($this->order->getShippingAddress()) {
|
| 525 |
-
$mdxi->Order->ShippingAddr->setMode("ReadOnly");
|
| 526 |
-
|
| 527 |
-
if($this->xmlentities($this->order->getShippingAddress()->getFirstname()) === '')
|
| 528 |
-
$shippingName = $this->xmlentities($this->order->getShippingAddress()->getLastname());
|
| 529 |
-
elseif($this->xmlentities($this->order->getShippingAddress()->getLastname()) === '')
|
| 530 |
-
$shippingName = $this->xmlentities($this->order->getShippingAddress()->getFirstname());
|
| 531 |
-
else
|
| 532 |
-
$shippingName = $this->xmlentities($this->order->getShippingAddress()->getFirstname()).' '.$this->xmlentities($this->order->getShippingAddress()->getLastname());
|
| 533 |
-
|
| 534 |
-
$mdxi->Order->ShippingAddr->Name = substr($shippingName,0,50);
|
| 535 |
-
|
| 536 |
-
$shippingAdress = $this->xmlentities($this->order->getShippingAddress()->getStreetFull());
|
| 537 |
-
|
| 538 |
-
$shippingStreet = $this->splitAdress($shippingAdress);
|
| 539 |
-
|
| 540 |
-
if(isset($shippingStreet[0]) && is_array($shippingStreet[0])) {
|
| 541 |
-
$mdxi->Order->ShippingAddr->Street = $shippingStreet[0]['Street'];
|
| 542 |
-
$mdxi->Order->ShippingAddr->Street2 = $shippingStreet[1]['Street2'];
|
| 543 |
-
} else {
|
| 544 |
-
$mdxi->Order->ShippingAddr->Street = $shippingStreet['Street'];
|
| 545 |
-
|
| 546 |
-
if(isset($shippingStreet['Street2']))
|
| 547 |
-
$mdxi->Order->ShippingAddr->Street2 = $shippingStreet['Street2'];
|
| 548 |
-
}
|
| 549 |
-
|
| 550 |
-
$mdxi->Order->ShippingAddr->Zip = substr($this->xmlentities($this->order->getShippingAddress()->getPostcode()),0,50);
|
| 551 |
-
$mdxi->Order->ShippingAddr->City = substr($this->xmlentities($this->order->getShippingAddress()->getCity()),0,50);
|
| 552 |
-
$mdxi->Order->ShippingAddr->Country->setCode($this->xmlentities($shippingCountryCode));
|
| 553 |
-
$mdxi->Order->ShippingAddr->Email = substr($this->xmlentities($this->order->getShippingAddress()->getEmail()),0,50);
|
| 554 |
-
}
|
| 555 |
-
|
| 556 |
-
if(Mage::helper('customer')->isLoggedIn())
|
| 557 |
-
$mdxi->Order->URL->Success = Mage::getUrl(MPay24MagentoShop::SUCCESS_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
| 558 |
-
else
|
| 559 |
-
$mdxi->Order->URL->Success = Mage::getUrl(MPay24MagentoShop::GUEST_SUCCESS_URL,array('_secure' => true, '_query' => "tid=" . substr($this->order->getIncrementId(),0,32) ));
|
| 560 |
-
|
| 561 |
-
$mdxi->Order->URL->Error = Mage::getUrl(MPay24MagentoShop::ERROR_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
| 562 |
-
$mdxi->Order->URL->Confirmation = Mage::getUrl(MPay24MagentoShop::CONFIRMATION_URL,array('_secure' => true));
|
| 563 |
-
$mdxi->Order->URL->Cancel = Mage::getUrl(MPay24MagentoShop::CANCEL_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
| 564 |
-
|
| 565 |
-
if(Mage::getStoreConfig('mpay24/mpay24as/debug') == 1) {
|
| 566 |
-
$myFile = "app/code/community/Mpay24/Mpay24/Model/Api/xmls/".$transaction->TID.".xml";
|
| 567 |
-
$fh = fopen($myFile, 'w') or die("can't open file");
|
| 568 |
-
fwrite($fh, $mdxi->toXML());
|
| 569 |
-
fclose($fh);
|
| 570 |
-
}
|
| 571 |
-
|
| 572 |
-
return $mdxi;
|
| 573 |
-
}
|
| 574 |
-
|
| 575 |
-
function setVariables($order, $ps, $type, $brand) {
|
| 576 |
-
$this->tid = $order->getIncrementId();
|
| 577 |
-
$this->order = $order;
|
| 578 |
-
$this->price = number_format($order->getData('grand_total'),2,'.','');
|
| 579 |
-
$this->ps = $ps;
|
| 580 |
-
$this->type = $type;
|
| 581 |
-
$this->brand = $brand;
|
| 582 |
-
}
|
| 583 |
-
|
| 584 |
-
private function xmlentities($string) {
|
| 585 |
-
static $trans;
|
| 586 |
-
|
| 587 |
-
if (!isset($trans)) {
|
| 588 |
-
$trans = get_html_translation_table(HTML_SPECIALCHARS);
|
| 589 |
-
|
| 590 |
-
foreach ($trans as $key => $value)
|
| 591 |
-
$trans[$key] = '&#'.ord($key).';';
|
| 592 |
-
|
| 593 |
-
// dont translate the '&' in case it is part of &xxx;
|
| 594 |
-
$trans[chr(38)] = '&';
|
| 595 |
-
}
|
| 596 |
-
|
| 597 |
-
//after the initial translation, _do_ map standalone '&' into '&'
|
| 598 |
-
return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($string, $trans));
|
| 599 |
-
}
|
| 600 |
-
|
| 601 |
-
private function splitAdress($adress, $str2=null) {
|
| 602 |
-
$posNewLine = strpos($adress, "\n");
|
| 603 |
-
$strArray = array();
|
| 604 |
-
|
| 605 |
-
if($posNewLine === false) {
|
| 606 |
-
if(strlen($adress) <= 50)
|
| 607 |
-
if($str2 !== true)
|
| 608 |
-
$strArray['Street'] = $adress;
|
| 609 |
-
else
|
| 610 |
-
$strArray['Street2'] = $adress;
|
| 611 |
-
else {
|
| 612 |
-
$street1before = substr($adress, 0, 50);
|
| 613 |
-
$posLastInterval1 = strrpos($street1before, " ");
|
| 614 |
-
|
| 615 |
-
$street1 = substr($street1before, 0, $posLastInterval1);
|
| 616 |
-
|
| 617 |
-
$street2before = substr(substr($street1before, $posLastInterval1).substr($adress, 50), 1, 50);
|
| 618 |
-
$posLastInterval2 = strrpos($street2before, " ");
|
| 619 |
-
$street2 = substr($street2before, 0, $posLastInterval2);
|
| 620 |
-
|
| 621 |
-
if($str2 === null) {
|
| 622 |
-
$strArray['Street'] = $street1;
|
| 623 |
-
$strArray['Street2'] = $street2;
|
| 624 |
-
} elseif($str2 === false)
|
| 625 |
-
if($posLastInterval1)
|
| 626 |
-
$strArray['Street'] = $street1;
|
| 627 |
-
else
|
| 628 |
-
$strArray['Street'] = $street1before;
|
| 629 |
-
else
|
| 630 |
-
if($posLastInterval1)
|
| 631 |
-
$strArray['Street2'] = $street1;
|
| 632 |
-
else
|
| 633 |
-
$strArray['Street2'] = $street1before;
|
| 634 |
-
}
|
| 635 |
-
} else {
|
| 636 |
-
$array = explode("\n", $adress);
|
| 637 |
-
$adress1 = $array[0];
|
| 638 |
-
array_push($strArray, $this->splitAdress($adress1, false));
|
| 639 |
-
|
| 640 |
-
$adress2 = $array[1];
|
| 641 |
-
array_push($strArray, $this->splitAdress($adress2, true));
|
| 642 |
-
}
|
| 643 |
-
return $strArray;
|
| 644 |
-
}
|
| 645 |
-
|
| 646 |
-
public static function getMPay24Api() {
|
| 647 |
-
if(Mage::getStoreConfig('mpay24/mpay24as/system') == 1)
|
| 648 |
-
$test = TRUE;
|
| 649 |
-
else
|
| 650 |
-
$test = FALSE;
|
| 651 |
-
|
| 652 |
-
if(Mage::getStoreConfig('mpay24/mpay24as/debug') == 1)
|
| 653 |
-
$debug = TRUE;
|
| 654 |
-
else
|
| 655 |
-
$debug = FALSE;
|
| 656 |
-
|
| 657 |
-
if(Mage::getStoreConfig('mpay24/mpay24as/use_proxy') == 1) {
|
| 658 |
-
$proxy_host = Mage::getStoreConfig('mpay24/mpay24as/proxy_host');
|
| 659 |
-
$proxy_port = Mage::getStoreConfig('mpay24/mpay24as/proxy_port');
|
| 660 |
-
} else {
|
| 661 |
-
$proxy_host = null;
|
| 662 |
-
$proxy_port = null;
|
| 663 |
-
}
|
| 664 |
-
|
| 665 |
-
$mPay24MagentoShop = new MPay24MagentoShop(Mage::getStoreConfig('mpay24/mpay24as/merchantid'), Mage::getStoreConfig('mpay24/mpay24as/soap_pass'), $test, $proxy_host, $proxy_port, $debug);
|
| 666 |
-
return $mPay24MagentoShop;
|
| 667 |
-
}
|
| 668 |
-
|
| 669 |
-
/**
|
| 670 |
-
* @abstract Get the payment systems for the merchant from the core_config_data and explode it into an array
|
| 671 |
-
* @return Array $method
|
| 672 |
-
*/
|
| 673 |
-
public function getActiveMethods() {
|
| 674 |
-
$methods = array();
|
| 675 |
-
$brandsAndDescriptions = explode(", ", Mage::getStoreConfig('mpay24/mpay24/active_payment_types'));
|
| 676 |
-
|
| 677 |
-
$firstPS = Mage::getStoreConfig('mpay24/mpay24/ps_1');
|
| 678 |
-
$allPS = true;
|
| 679 |
-
|
| 680 |
-
for($i=2; $i<=Mage::getStoreConfig('mpay24/mpay24/payments_count'); $i++)
|
| 681 |
-
if($firstPS != Mage::getStoreConfig('mpay24/mpay24/ps_'.$i)) {
|
| 682 |
-
$allPS = false;
|
| 683 |
-
break;
|
| 684 |
-
}
|
| 685 |
-
|
| 686 |
-
if($allPS) {
|
| 687 |
-
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false')
|
| 688 |
-
if($firstPS == 1) {
|
| 689 |
-
Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 690 |
-
Mage::getConfig()->reinit();
|
| 691 |
-
Mage::app()->reinitStores();
|
| 692 |
-
}
|
| 693 |
-
else
|
| 694 |
-
if($firstPS == 0) {
|
| 695 |
-
Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 696 |
-
Mage::getConfig()->reinit();
|
| 697 |
-
Mage::app()->reinitStores();
|
| 698 |
-
}
|
| 699 |
-
|
| 700 |
-
foreach($brandsAndDescriptions as $brandAndDescr) {
|
| 701 |
-
$brand = substr($brandAndDescr, 0, strpos($brandAndDescr, "=>"));
|
| 702 |
-
$description = substr($brandAndDescr, strpos($brandAndDescr, "=>")+2);
|
| 703 |
-
$methods[$brand] = $description;
|
| 704 |
-
}
|
| 705 |
-
} else {
|
| 706 |
-
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false')
|
| 707 |
-
$check = 0;
|
| 708 |
-
else
|
| 709 |
-
$check = 1;
|
| 710 |
-
|
| 711 |
-
$i=1;
|
| 712 |
-
|
| 713 |
-
foreach($brandsAndDescriptions as $brandAndDescr) {
|
| 714 |
-
if(Mage::getStoreConfig('mpay24/mpay24/ps_'.$i) == $check) {
|
| 715 |
-
$brand = substr($brandAndDescr, 0, strpos($brandAndDescr, "=>"));
|
| 716 |
-
$description = substr($brandAndDescr, strpos($brandAndDescr, "=>")+2);
|
| 717 |
-
$methods[$brand] = $description;
|
| 718 |
-
}
|
| 719 |
-
$i++;
|
| 720 |
-
}
|
| 721 |
-
}
|
| 722 |
-
|
| 723 |
-
return $methods;
|
| 724 |
-
}
|
| 725 |
-
}
|
| 726 |
-
?>
|
| 8 |
|
| 9 |
include_once("MPay24Shop.php");
|
| 10 |
|
| 11 |
+
class MPay24MagentoShop extends MPay24Shop {
|
| 12 |
+
|
| 13 |
+
const PAYMENT_TYPE_AUTH = 'authorize';
|
| 14 |
+
const PAYMENT_TYPE_SALE = 'authorize_capture';
|
| 15 |
+
|
| 16 |
+
const SUCCESS_URL = 'mpay24/payment/success';
|
| 17 |
+
const GUEST_SUCCESS_URL = 'mpay24/payment/guestsuccess';
|
| 18 |
+
const ERROR_URL = 'mpay24/payment/error';
|
| 19 |
+
const CONFIRMATION_URL = 'mpay24/payment/confirmation';
|
| 20 |
+
|
| 21 |
+
const CANCEL_URL = 'mpay24/payment/cancel';
|
| 22 |
+
|
| 23 |
+
const MAGENTO_VERSION = "Magento 1.4.5 ";
|
| 24 |
+
|
| 25 |
+
var $tid;
|
| 26 |
+
var $price;
|
| 27 |
+
var $order;
|
| 28 |
+
var $ps;
|
| 29 |
+
var $type;
|
| 30 |
+
var $brand;
|
| 31 |
+
|
| 32 |
+
public static function getAllowedAuth() {
|
| 33 |
+
return array("CB", "MAESTRO", "PAYPAL", "ELV", "PB", "MPASS", "INVOICE", "HP", "SAFETYPAY");
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
private function getOrder($tid=null) {
|
| 37 |
+
$order = Mage::getSingleton('sales/order');
|
| 38 |
+
|
| 39 |
+
if($tid == null)
|
| 40 |
+
return $order->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
|
| 41 |
+
else
|
| 42 |
+
return $order->loadByIncrementId($tid);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
function updateTransaction($tid, $args, $shippingConfirmed) {}
|
| 46 |
+
|
| 47 |
+
function updateStatusToCancel($tid) {
|
| 48 |
+
$order = $this->getOrder($tid);
|
| 49 |
+
Mage::log('updateStatusToCancel called for order '.$order->getData('increment_id'));
|
| 50 |
+
$confirmationCalled = "Payment ";
|
| 51 |
+
|
| 52 |
+
$status = "";
|
| 53 |
+
|
| 54 |
+
$incrementId = $order->getData('increment_id');
|
| 55 |
+
$tid = $order->getId();
|
| 56 |
+
|
| 57 |
+
if($order->getPayment()) {
|
| 58 |
+
$mPay24MagentoShop = $this->getMPay24Api();
|
| 59 |
+
$mPAY24Result = $mPay24MagentoShop->updateTransactionStatus($incrementId);
|
| 60 |
+
|
| 61 |
+
if($mPAY24Result->getGeneralResponse()->getStatus() != 'OK' || $mPAY24Result->getParam('APPR_CODE') == '')
|
| 62 |
+
$apprCode = 'N/A';
|
| 63 |
+
else
|
| 64 |
+
$apprCode = $mPAY24Result->getParam('APPR_CODE');
|
| 65 |
+
|
| 66 |
+
switch ($mPAY24Result->getGeneralResponse()->getStatus()) {
|
| 67 |
+
case "OK":
|
| 68 |
+
if($order->getPayment()->getAdditionalInformation('user_field') == $mPAY24Result->getParam('USER_FIELD')) {
|
| 69 |
+
$updateResult = "The transaction status was succesfully updated!";
|
| 70 |
+
|
| 71 |
+
$order->getPayment()->setAdditionalData($mPAY24Result->getParam("P_TYPE"))->save();
|
| 72 |
+
$order->getPayment()->setCcType($mPAY24Result->getParam("P_TYPE") . " => " . $mPAY24Result->getParam('BRAND'))->save();
|
| 73 |
+
$order->getPayment()->setAdditionalInformation('status', true)->save();
|
| 74 |
+
$updateResult .= "\n\nActual status: " . $mPAY24Result->getParam('STATUS ');
|
| 75 |
+
$updateResult .= "\nAmount: " . number_format($mPAY24Result->getParam('PRICE')/100, 2, '.', '') . " " . $mPAY24Result->getParam('CURRENCY');
|
| 76 |
+
$updateResult .= "\nMPAYTID: " . $mPAY24Result->getParam('MPAYTID');
|
| 77 |
+
$updateResult .= "\nAppr_code: " . $apprCode;
|
| 78 |
+
|
| 79 |
+
$status = $mPAY24Result->getParam('TSTATUS');
|
| 80 |
+
|
| 81 |
+
switch($status) {
|
| 82 |
+
case 'RESERVED':
|
| 83 |
+
if($order->getId()) {
|
| 84 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 85 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 86 |
+
$order->getPayment()->setAmountAuthorized($mPAY24Result->getParam('PRICE')/100)->save();
|
| 87 |
+
$order->getPayment()->setAdditionalInformation('error', false)->save();
|
| 88 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("RESERVED") . ' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]');
|
| 89 |
+
$order->sendNewOrderEmail();
|
| 90 |
+
|
| 91 |
+
if($order->getInvoiceCollection()->count() == 0)
|
| 92 |
+
if(Mage::getStoreConfig('payment/mpay24/paid_payment_action') == MPay24MagentoShop::PAYMENT_TYPE_SALE) {
|
| 93 |
+
$order->getPayment()->setAdditionalInformation('mpay24AutoClearing', true)->save();
|
| 94 |
+
$this->_createInvoice($order, true);
|
| 95 |
+
} else
|
| 96 |
+
$this->_createInvoice($order);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
$order->save();
|
| 100 |
+
break;
|
| 101 |
+
case 'BILLED':
|
| 102 |
+
if($order->getInvoiceCollection()->count() == 0) {
|
| 103 |
+
if(in_array($mPAY24Result->getParam('P_TYPE'), MPay24MagentoShop::getAllowedAuth())) {
|
| 104 |
+
$onlineCapture = false;
|
| 105 |
+
$mif = true;
|
| 106 |
+
} else {
|
| 107 |
+
$onlineCapture = true;
|
| 108 |
+
$mif = false;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
$order->getPayment()->setAmountCharged($mPAY24Result->getParam('PRICE')/100)->save();
|
| 112 |
+
$order->getPayment()->setAdditionalInformation('error', false)->save();
|
| 113 |
+
$order->sendOrderUpdateEmail();
|
| 114 |
+
|
| 115 |
+
if($confirmation) {
|
| 116 |
+
$order->getPayment()->setAdditionalInformation('mpay24AutoClearing', false)->save();
|
| 117 |
+
$this->_createInvoice($order, true, true, $onlineCapture);
|
| 118 |
+
} else
|
| 119 |
+
$this->_createInvoice($order, true, $mif, $onlineCapture);
|
| 120 |
+
|
| 121 |
+
$order->save();
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 125 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 126 |
+
|
| 127 |
+
if($order->getIsNotVirtual())
|
| 128 |
+
$s = Mage::getStoreConfig('payment/mpay24/paid_order_status');
|
| 129 |
+
else
|
| 130 |
+
$s = Mage_Sales_Model_Order::STATE_COMPLETE;
|
| 131 |
+
|
| 132 |
+
$order->addStatusToHistory($s, Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("BILLED") .' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]', true)->save();
|
| 133 |
+
$order->save();
|
| 134 |
+
break;
|
| 135 |
+
case 'CREDITED':
|
| 136 |
+
if ($order->getTotalOnlineRefunded() == 0.00) {
|
| 137 |
+
$creditmemo = Mage::getModel('sales/service_order', $order)
|
| 138 |
+
->prepareCreditmemo()
|
| 139 |
+
->setPaymentRefundDisallowed(true)
|
| 140 |
+
->setAutomaticallyCreated(true)
|
| 141 |
+
->register();
|
| 142 |
+
|
| 143 |
+
$creditmemo->addComment(Mage::helper('mpay24')->__("Credit memo has been created automatically through of MI/F crediting!"));
|
| 144 |
+
$creditmemo->save();
|
| 145 |
+
|
| 146 |
+
$order->getPayment()->refund($creditmemo)->save();
|
| 147 |
+
|
| 148 |
+
$order->sendOrderUpdateEmail();
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 152 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 153 |
+
|
| 154 |
+
$this->_addChildTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND,
|
| 155 |
+
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
| 156 |
+
|
| 157 |
+
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE, Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("CREDITED") . ' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]')->save();
|
| 158 |
+
$order->save();
|
| 159 |
+
|
| 160 |
+
break;
|
| 161 |
+
case 'SUSPENDED':
|
| 162 |
+
if($order->getId()) {
|
| 163 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 164 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 165 |
+
$order->getPayment()->setAdditionalInformation('error', false)->save();
|
| 166 |
+
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("SUSPENDED") . ' [ '.$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]');
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
$order->save();
|
| 170 |
+
break;
|
| 171 |
+
case 'REVERSED':
|
| 172 |
+
if($order->getState() != Mage_Sales_Model_Order::STATE_CANCELED)
|
| 173 |
+
foreach ($order->getInvoiceCollection() as $orderInvoice) {
|
| 174 |
+
$order->getPayment()->setAdditionalInformation('MIFReverse', true)->save();
|
| 175 |
+
$order->getPayment()->void($orderInvoice)->save();
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 179 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 180 |
+
|
| 181 |
+
$order->sendOrderUpdateEmail();
|
| 182 |
+
$order->addStatusToHistory($order->getState(), Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("REVERSED") .' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]', true)->save();
|
| 183 |
+
$order->save();
|
| 184 |
+
break;
|
| 185 |
+
case 'ERROR':
|
| 186 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 187 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 188 |
+
$order->getPayment()->setAdditionalInformation('error', true)->save();
|
| 189 |
+
|
| 190 |
+
if($order->canCancel() && $order->getState() != Mage_Sales_Model_Order::STATE_CANCELED &&
|
| 191 |
+
$order->getData('status') != Mage_Sales_Model_Order::STATE_CANCELED)
|
| 192 |
+
$order->cancel($order->getPayment())->save();
|
| 193 |
+
|
| 194 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("ERROR") . " " . $order->getPayment()->getAdditionalInformation('error_text'));
|
| 195 |
+
$order->save();
|
| 196 |
+
break;
|
| 197 |
+
default:
|
| 198 |
+
break;
|
| 199 |
+
}
|
| 200 |
+
} else
|
| 201 |
+
$status = "SUSPENDED";
|
| 202 |
+
break;
|
| 203 |
+
case "ERROR":
|
| 204 |
+
if($mPAY24Result->getReturnCode() == 'NOT_FOUND' && $order->getPayment()->getAdditionalInformation('cancelButton'))
|
| 205 |
+
$updateResult = 'The order was canceled by the customer';
|
| 206 |
+
else {
|
| 207 |
+
$status = 'SUSPENDED';
|
| 208 |
+
$updateResult = Mage::helper('mpay24')->__("The transaction was not found!");
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
if($order->canCancel() && $order->getState() != Mage_Sales_Model_Order::STATE_CANCELED &&
|
| 212 |
+
$order->getData('status') != Mage_Sales_Model_Order::STATE_CANCELED && $status != 'SUSPENDED')
|
| 213 |
+
$order->cancel($order->getPayment())->save();
|
| 214 |
+
|
| 215 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('mpay24')->__($updateResult), true)->save();
|
| 216 |
+
$order->getPayment()->setAdditionalInformation('status', true)->save();
|
| 217 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', 'N/A')->save();
|
| 218 |
+
$order->getPayment()->setAdditionalInformation('appr_code', 'N/A')->save();
|
| 219 |
+
break;
|
| 220 |
+
default:
|
| 221 |
+
$status = 'SUSPENDED';
|
| 222 |
+
break;
|
| 223 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
}
|
| 225 |
+
return $status;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
function getTransaction($tid) {
|
| 229 |
+
$transaction = new Transaction($tid);
|
| 230 |
+
$order = Mage::getSingleton('sales/order');
|
| 231 |
+
$order->loadByIncrementId($tid);
|
| 232 |
+
$transaction->PRICE = number_format(floatval($order->getPayment()->getAmountAuthorized()), 2, '.', '');
|
| 233 |
+
$transaction->CURRENCY = $order->getBaseCurrencyCode();
|
| 234 |
+
$transaction->MPAYTID = $order->getPayment()->getAdditionalInformation('mpay_tid');
|
| 235 |
+
return $transaction;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
function createProfileOrder($tid) {}
|
| 239 |
+
function createExpressCheckoutOrder($tid) {}
|
| 240 |
+
function createFinishExpressCheckoutOrder($tid, $s, $a, $c) {}
|
| 241 |
+
|
| 242 |
+
function write_log($operation, $info_to_log) {
|
| 243 |
+
Mage::log("$operation : $info_to_log", null, "mPAY24log.log");
|
| 244 |
+
// $fh = fopen("app/code/community/Mpay24/Mpay24/Model/Api/logs/mPAY24log.log", 'a+') or die("can't open file");
|
| 245 |
+
// $MessageDate = date("Y-m-d H:i:s");
|
| 246 |
+
// $Message= $MessageDate." ".$_SERVER['SERVER_NAME']." mPAY24 : ";
|
| 247 |
+
// $result = $Message."$operation : $info_to_log\n";
|
| 248 |
+
// fwrite($fh, $result);
|
| 249 |
+
// fclose($fh);
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
function createSecret($tid, $amount, $currency, $timeStamp) {}
|
| 253 |
+
function getSecret($tid) {}
|
| 254 |
+
|
| 255 |
+
function createTransaction() {
|
| 256 |
+
$transaction = new Transaction($this->tid);
|
| 257 |
+
$transaction->PRICE = $this->price;
|
| 258 |
+
return $transaction;
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
function createMDXI($transaction) {
|
| 262 |
+
$mdxi = new ORDER();
|
| 263 |
+
|
| 264 |
+
$mdxi->Order->setStyle(Mage::getStoreConfig('mpay24/mpay24sporder/style'));
|
| 265 |
+
$mdxi->Order->setLogoStyle(Mage::getStoreConfig('mpay24/mpay24sporder/logostyle'));
|
| 266 |
+
$mdxi->Order->setPageHeaderStyle(Mage::getStoreConfig('mpay24/mpay24sporder/pageheaderstyle'));
|
| 267 |
+
$mdxi->Order->setPageCaptionStyle(Mage::getStoreConfig('mpay24/mpay24sporder/pagecaptionstyle'));
|
| 268 |
+
$mdxi->Order->setPageStyle(Mage::getStoreConfig('mpay24/mpay24sporder/pagestyle'));
|
| 269 |
+
$mdxi->Order->setInputFieldsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/inputfieldsstyle'));
|
| 270 |
+
$mdxi->Order->setDropDownListsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/dropdownlistsstyle'));
|
| 271 |
+
$mdxi->Order->setButtonsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/buttonsstyle'));
|
| 272 |
+
$mdxi->Order->setErrorsStyle(Mage::getStoreConfig('mpay24/mpay24sporder/errorsstyle'));
|
| 273 |
+
$mdxi->Order->setSuccessTitleStyle(Mage::getStoreConfig('mpay24/mpay24sporder/successtitlestyle'));
|
| 274 |
+
$mdxi->Order->setErrorTitleStyle(Mage::getStoreConfig('mpay24/mpay24sporder/errortitlestyle'));
|
| 275 |
+
$mdxi->Order->setFooterStyle(Mage::getStoreConfig('mpay24/mpay24sporder/footerstyle'));
|
| 276 |
+
|
| 277 |
+
$this->order->getPayment()->setAdditionalInformation('user_field', MPay24MagentoShop::MAGENTO_VERSION.$transaction->TID.'_'.date('Y-m-d'))->save();
|
| 278 |
+
$mdxi->Order->ClientIP = $this->order->getRemoteIp();
|
| 279 |
+
$mdxi->Order->UserField = MPay24MagentoShop::MAGENTO_VERSION.$transaction->TID.'_'.date('Y-m-d');
|
| 280 |
+
$mdxi->Order->Tid = $transaction->TID;
|
| 281 |
+
|
| 282 |
+
$lang = explode('_', Mage::getStoreConfig('general/locale/code'));
|
| 283 |
|
| 284 |
+
if(in_array(strtoupper($lang[0]), array("BG", "CS", "DE", "EN", "FR", "HR", "IT")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
$mdxi->Order->TemplateSet->setLanguage(strtoupper($lang[0]));
|
| 286 |
+
else
|
| 287 |
+
$mdxi->Order->TemplateSet->setLanguage("EN");
|
|
|
|
| 288 |
|
|
|
|
| 289 |
|
| 290 |
+
if($this->ps) {
|
| 291 |
+
$mdxi->Order->PaymentTypes->setEnable('true');
|
| 292 |
+
|
| 293 |
+
$mdxi->Order->PaymentTypes->Payment(1)->setType($this->type);
|
| 294 |
+
|
| 295 |
+
if($this->type != $this->brand)
|
| 296 |
+
$mdxi->Order->PaymentTypes->Payment(1)->setBrand($this->brand);
|
| 297 |
+
} else {
|
| 298 |
+
// $brandsAndTypes = explode(", ", Mage::getStoreConfig('mpay24/mpay24/active_payment_types'));
|
| 299 |
+
// $brands = array();
|
| 300 |
+
|
| 301 |
+
// foreach($brandsAndTypes as $brandAndType)
|
| 302 |
+
// $brands[substr($brandAndType, 0, strpos($brandAndType, "=>"))] = substr($brandAndType, strpos($brandAndType, "=>")+2);
|
| 303 |
+
|
| 304 |
+
$firstPS = Mage::getStoreConfig('mpay24/mpay24/ps_1');
|
| 305 |
+
$allPS = true;
|
| 306 |
+
|
| 307 |
+
for($i=2; $i<=Mage::getStoreConfig('mpay24/mpay24/payments_count'); $i++)
|
| 308 |
+
if($firstPS != Mage::getStoreConfig('mpay24/mpay24/ps_'.$i)) {
|
| 309 |
+
$allPS = false;
|
| 310 |
+
break;
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
if(!$allPS && Mage::getStoreConfig('mpay24/mpay24/payments_active') != 'false') {
|
| 314 |
+
$mdxi->Order->PaymentTypes->setEnable('true');
|
| 315 |
+
|
| 316 |
+
$allPaymentsArray = unserialize(Mage::getStoreConfig('mpay24/mpay24/active_payments'));
|
| 317 |
+
$c = 1;
|
| 318 |
+
$k = 1;
|
| 319 |
+
foreach($allPaymentsArray as $id => $payment) {
|
| 320 |
+
if(Mage::getStoreConfig("mpay24/mpay24/ps_$k") == '1') {
|
| 321 |
+
$mdxi->Order->PaymentTypes->Payment($c)->setType($payment['P_TYPE']);
|
| 322 |
+
|
| 323 |
+
if($payment['P_TYPE'] != $payment['BRAND'])
|
| 324 |
+
$mdxi->Order->PaymentTypes->Payment($c)->setBrand($payment['BRAND']);
|
| 325 |
+
|
| 326 |
+
$c++;
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
$k++;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
// $brands = $this->getActiveMethods();
|
| 333 |
+
|
| 334 |
+
|
| 335 |
+
// foreach($brands as $brand => $type) {
|
| 336 |
+
// $mdxi->Order->PaymentTypes->Payment($c)->setType($type);
|
| 337 |
+
|
| 338 |
+
// if($type != $brand)
|
| 339 |
+
// $mdxi->Order->PaymentTypes->Payment($c)->setBrand($brand);
|
| 340 |
+
|
| 341 |
+
// $c++;
|
| 342 |
+
// }
|
| 343 |
}
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
$conf = explode(',',Mage::getStoreConfig('mpay24/mpay24spsc/sc_row'));
|
| 347 |
+
|
| 348 |
+
$mdxi->Order->ShoppingCart->setStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_style'));
|
| 349 |
+
$mdxi->Order->ShoppingCart->setHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_header'));
|
| 350 |
+
$mdxi->Order->ShoppingCart->setHeaderStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_headerstyle'));
|
| 351 |
+
$mdxi->Order->ShoppingCart->setCaptionStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_captionstyle'));
|
| 352 |
+
|
| 353 |
+
if(in_array('Number',$conf)) {
|
| 354 |
+
$mdxi->Order->ShoppingCart->setNumberHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_numberheader'));
|
| 355 |
+
$mdxi->Order->ShoppingCart->setNumberStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_numberstyle'));
|
| 356 |
+
}
|
| 357 |
+
if(in_array('ProductNr',$conf)) {
|
| 358 |
+
$mdxi->Order->ShoppingCart->setProductNrHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_productnrheader'));
|
| 359 |
+
$mdxi->Order->ShoppingCart->setProductNrStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_productnrstyle'));
|
| 360 |
+
}
|
| 361 |
+
if(in_array('Description',$conf)) {
|
| 362 |
+
$mdxi->Order->ShoppingCart->setDescriptionHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_descriptionheader'));
|
| 363 |
+
$mdxi->Order->ShoppingCart->setDescriptionStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_descriptionstyle'));
|
| 364 |
+
}
|
| 365 |
+
if(in_array('Package',$conf)) {
|
| 366 |
+
$mdxi->Order->ShoppingCart->setPackageHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_packageheader'));
|
| 367 |
+
$mdxi->Order->ShoppingCart->setPackageStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_packagestyle'));
|
| 368 |
+
}
|
| 369 |
+
if(in_array('Quantity',$conf)) {
|
| 370 |
+
$mdxi->Order->ShoppingCart->setQuantityHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_quantityheader'));
|
| 371 |
+
$mdxi->Order->ShoppingCart->setQuantityStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_quantitystyle'));
|
| 372 |
+
}
|
| 373 |
+
if(in_array('ItemPrice',$conf)) {
|
| 374 |
+
$mdxi->Order->ShoppingCart->setItemPriceHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_itempriceheader'));
|
| 375 |
+
$mdxi->Order->ShoppingCart->setItemPriceStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_itempricestyle'));
|
| 376 |
+
}
|
| 377 |
+
if(in_array('Price',$conf)) {
|
| 378 |
+
$mdxi->Order->ShoppingCart->setPriceHeader(Mage::getStoreConfig('mpay24/mpay24spsc/sc_priceheader'));
|
| 379 |
+
$mdxi->Order->ShoppingCart->setPriceStyle(Mage::getStoreConfig('mpay24/mpay24spsc/sc_pricestyle'));
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
$mdxi->Order->ShoppingCart->Description(Mage::getStoreConfig('mpay24/mpay24spsc/description'));
|
| 383 |
+
|
| 384 |
+
$style1 = Mage::getStoreConfig('mpay24/mpay24spsc/item_style1');
|
| 385 |
+
$style2 = Mage::getStoreConfig('mpay24/mpay24spsc/item_style2');
|
| 386 |
+
$ret = "";
|
| 387 |
+
$linecount = 0;
|
| 388 |
+
|
| 389 |
+
foreach($this->order->getAllItems() as $_item) {
|
| 390 |
+
if(Mage::getStoreConfig('mpay24/mpay24/show_free_products') == 1 ||
|
| 391 |
+
(Mage::getStoreConfig('mpay24/mpay24/show_free_products') == 0 && number_format(($_item->getData('price')*1),2,'.','') != '0.00')) {
|
| 392 |
+
|
| 393 |
+
$linecount++;
|
| 394 |
+
$style = ($linecount % 2== 1) ? $style1 : $style2;
|
| 395 |
+
|
| 396 |
+
if(in_array('Number',$conf)) {
|
| 397 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Number = $linecount;
|
| 398 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Number->setStyle($style);
|
| 399 |
+
}
|
| 400 |
+
if(in_array('ProductNr',$conf)) {
|
| 401 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->ProductNr = $this->xmlentities($_item->getData('sku'));
|
| 402 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->ProductNr->setStyle($style);
|
| 403 |
+
}
|
| 404 |
+
if(in_array('Description',$conf)) {
|
| 405 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Description = $this->xmlentities($_item->getData('name'));
|
| 406 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Description->setStyle($style);
|
| 407 |
+
}
|
| 408 |
+
if(in_array('Package',$conf)) {
|
| 409 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Package = "";
|
| 410 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Package->setStyle($style);
|
| 411 |
+
}
|
| 412 |
+
if(in_array('Quantity',$conf)) {
|
| 413 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Quantity = (int)$_item->getQtyOrdered();
|
| 414 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->Quantity->setStyle($style);
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
if(Mage::getStoreConfig('tax/cart_display/price') == 2 || Mage::getStoreConfig('tax/cart_display/price') == 3) {
|
| 418 |
+
if(in_array('ItemPrice',$conf)) {
|
| 419 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->ItemPrice = number_format($_item->getPriceInclTax()*1,2,'.','');
|
| 420 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->ItemPrice->setStyle($style);
|
| 421 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->ItemPrice->setTax(number_format($_item->getTaxAmount(),2,'.',''));
|
| 422 |
+
}
|
| 423 |
+
} else {
|
| 424 |
+
if(in_array('ItemPrice',$conf)) {
|
| 425 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->ItemPrice = number_format(($_item->getData('price')*1),2,'.','');
|
| 426 |
+
$mdxi->Order->ShoppingCart->Item($linecount)->ItemPrice->setStyle($style);
|
| 427 |
+
}
|
| 428 |
+
}
|
| 429 |
}
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
$mdxi->Order->ShoppingCart->SubTotal->setHeader(Mage::getStoreConfig('mpay24/mpay24spsc/subtotal_header'));
|
| 433 |
+
$mdxi->Order->ShoppingCart->SubTotal->setHeaderStyle(Mage::getStoreConfig('mpay24/mpay24spsc/subtotal_headerstyle'));
|
| 434 |
+
$mdxi->Order->ShoppingCart->SubTotal->setStyle(Mage::getStoreConfig('mpay24/mpay24spsc/subtotal_style'));
|
| 435 |
+
|
| 436 |
+
if(Mage::getStoreConfig('tax/cart_display/subtotal') == 2 || Mage::getStoreConfig('tax/cart_display/subtotal') == 3)
|
| 437 |
+
$mdxi->Order->ShoppingCart->SubTotal = number_format($this->order->getSubtotalInclTax(),2,'.','');
|
| 438 |
+
else
|
| 439 |
+
$mdxi->Order->ShoppingCart->SubTotal = number_format($this->order->getData('subtotal'),2,'.','');
|
| 440 |
+
|
| 441 |
+
if(number_format($this->order->getData('discount_amount'),2,'.','') !== '0.00') {
|
| 442 |
+
$mdxi->Order->ShoppingCart->Discount->setHeader($this->order->getData('discount_description'));
|
| 443 |
+
$mdxi->Order->ShoppingCart->Discount->setHeaderStyle(Mage::getStoreConfig('mpay24/mpay24spsc/discount_headerstyle'));
|
| 444 |
+
$mdxi->Order->ShoppingCart->Discount->setStyle(Mage::getStoreConfig('mpay24/mpay24spsc/discount_style'));
|
| 445 |
+
$mdxi->Order->ShoppingCart->Discount = number_format($this->order->getData('discount_amount'), 2, '.', '');
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
if(number_format($this->order->getData('shipping_amount'),2,'.','') !== '0.00') {
|
| 449 |
+
$mdxi->Order->ShoppingCart->ShippingCosts->setHeader($this->order->getData('shipping_description'));
|
| 450 |
+
$mdxi->Order->ShoppingCart->ShippingCosts->setHeaderStyle(Mage::getStoreConfig('mpay24/mpay24spsc/shipping_costs_headerstyle'));
|
| 451 |
+
$mdxi->Order->ShoppingCart->ShippingCosts->setStyle(Mage::getStoreConfig('mpay24/mpay24spsc/shipping_costs_style'));
|
| 452 |
+
|
| 453 |
+
if(Mage::getStoreConfig('tax/cart_display/shipping') == 2 || Mage::getStoreConfig('tax/cart_display/shipping') == 3)
|
| 454 |
+
$mdxi->Order->ShoppingCart->ShippingCosts = number_format($this->order->getShippingInclTax(), 2, '.', '');
|
| 455 |
+
else
|
| 456 |
+
$mdxi->Order->ShoppingCart->ShippingCosts = number_format($this->order->getData('shipping_amount'), 2, '.', '');
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
if(number_format($this->order->getData('tax_amount'),2,'.','') !== '0.00') {
|
| 460 |
+
$array = $this->order->getFullTaxInfo();
|
| 461 |
+
$taxInfo = array();
|
| 462 |
+
|
| 463 |
+
foreach($array as $a){
|
| 464 |
+
$taxArray = $a;
|
| 465 |
+
|
| 466 |
+
foreach(array_keys($taxArray) as $taxKey)
|
| 467 |
+
$taxInfo[$taxKey] = $taxArray[$taxKey];
|
| 468 |
+
|
| 469 |
+
if(Mage::getStoreConfig('tax/cart_display/shipping') == 2 || Mage::getStoreConfig('tax/cart_display/shipping') == 3) {
|
| 470 |
+
if(substr(Mage::getStoreConfig('general/locale/code'), 0, 2) == 'de')
|
| 471 |
+
$inklText = "inkl. ";
|
| 472 |
+
else
|
| 473 |
+
$inklText = "incl. ";
|
| 474 |
+
} else
|
| 475 |
+
$inklText = "";
|
| 476 |
+
|
| 477 |
+
$mdxi->Order->ShoppingCart->Tax->setHeader($inklText . $taxArray['id']);
|
| 478 |
+
$mdxi->Order->ShoppingCart->Tax->setHeaderStyle(Mage::getStoreConfig('mpay24/mpay24spsc/tax_headerstyle'));
|
| 479 |
+
$mdxi->Order->ShoppingCart->Tax->setStyle(Mage::getStoreConfig('mpay24/mpay24spsc/tax_style'));
|
| 480 |
+
$mdxi->Order->ShoppingCart->Tax->setPercent(number_format($taxArray['rates'][0]['percent'],0,'.',''));
|
| 481 |
+
|
| 482 |
+
$mdxi->Order->ShoppingCart->Tax = number_format($taxArray['amount'],2,'.','');
|
| 483 |
}
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
$billingCountry = "";
|
| 487 |
+
$billingCountryCode = "";
|
| 488 |
+
$shippingCountry = "";
|
| 489 |
+
$shippingCountryCode = "";
|
| 490 |
+
|
| 491 |
+
foreach(Mage::app()->getLocale()->getOptionCountries() as $c)
|
| 492 |
+
if ($c['value'] == $this->order->getBillingAddress()->getCountry()) {
|
| 493 |
+
$billingCountry = $c['label'];
|
| 494 |
+
$billingCountryCode = $c['value'];
|
| 495 |
+
break;
|
| 496 |
}
|
| 497 |
+
|
| 498 |
+
if($this->order->getShippingAddress())
|
| 499 |
+
foreach(Mage::app()->getLocale()->getOptionCountries() as $c)
|
| 500 |
+
if ($c['value'] == $this->order->getShippingAddress()->getCountry()) {
|
| 501 |
+
$shippingCountry = $c['label'];
|
| 502 |
+
$shippingCountryCode = $c['value'];
|
| 503 |
+
break;
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
+
$mdxi->Order->Price = $transaction->PRICE;
|
| 507 |
+
$mdxi->Order->Price->setHeader(Mage::getStoreConfig('mpay24/mpay24spsc/price_header'));
|
| 508 |
+
$mdxi->Order->Price->setHeaderStyle(Mage::getStoreConfig('mpay24/mpay24spsc/price_headerstyle'));
|
| 509 |
+
$mdxi->Order->Price->setStyle(Mage::getStoreConfig('mpay24/mpay24spsc/price_style'));
|
| 510 |
+
|
| 511 |
+
$mdxi->Order->Currency = $this->xmlentities($this->order->getBaseCurrencyCode());
|
| 512 |
+
$mdxi->Order->Customer = $this->xmlentities(substr($this->order->getCustomerName(),0,50));
|
| 513 |
+
$mdxi->Order->Customer->setId($this->order->getCustomerId());
|
| 514 |
+
|
| 515 |
+
$mdxi->Order->BillingAddr->setMode(Mage::getStoreConfig('mpay24/mpay24/billingAddressMode'));
|
| 516 |
+
|
| 517 |
+
$mdxi->Order->BillingAddr->Name = $this->xmlentities(substr($this->order->getBillingAddress()->getName(),0,50));
|
| 518 |
+
|
| 519 |
+
if($this->xmlentities(substr($this->order->getBillingAddress()->getName(),0,50)) == $this->xmlentities(substr($this->order->getCustomerName(),0,50))) {
|
| 520 |
+
$mdxi->Order->BillingAddr->Name->setGender(substr(Mage::getResourceSingleton('customer/customer')->getAttribute('gender')->getSource()->getOptionText($this->order->getCustomer()->getGender()), 0, 1));
|
| 521 |
+
$mdxi->Order->BillingAddr->Name->setBirthday(date('Y-m-d', strtotime($this->order->getCustomerDob())));
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
$billingAdress = $this->xmlentities($this->order->getBillingAddress()->getStreetFull());
|
| 525 |
+
|
| 526 |
+
$billingStreet = $this->splitAdress($billingAdress);
|
| 527 |
+
|
| 528 |
+
if(isset($billingStreet[0]) && is_array($billingStreet[0])) {
|
| 529 |
+
$mdxi->Order->BillingAddr->Street = $billingStreet[0]['Street'];
|
| 530 |
+
$mdxi->Order->BillingAddr->Street2 = $billingStreet[1]['Street2'];
|
| 531 |
+
} else {
|
| 532 |
+
$mdxi->Order->BillingAddr->Street = $billingStreet['Street'];
|
| 533 |
+
|
| 534 |
+
if(isset($billingStreet['Street2']))
|
| 535 |
+
$mdxi->Order->BillingAddr->Street2 = $billingStreet['Street2'];
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
$mdxi->Order->BillingAddr->Zip = substr($this->xmlentities($this->order->getBillingAddress()->getPostcode()),0,50);
|
| 539 |
+
$mdxi->Order->BillingAddr->City = substr($this->xmlentities($this->order->getBillingAddress()->getCity()),0,50);
|
| 540 |
+
$mdxi->Order->BillingAddr->Country->setCode($this->xmlentities($billingCountryCode));
|
| 541 |
+
$mdxi->Order->BillingAddr->Email = substr($this->xmlentities($this->order->getBillingAddress()->getEmail()),0,50);
|
| 542 |
+
$mdxi->Order->BillingAddr->Phone = substr($this->xmlentities($this->order->getBillingAddress()->getTelephone()),0,20);
|
| 543 |
+
|
| 544 |
+
if($this->order->getShippingAddress()) {
|
| 545 |
+
$mdxi->Order->ShippingAddr->setMode("ReadOnly");
|
| 546 |
+
|
| 547 |
+
$mdxi->Order->ShippingAddr->Name = substr($this->order->getShippingAddress()->getName(),0,50);
|
| 548 |
+
|
| 549 |
+
if($this->xmlentities(substr($this->order->getShippingAddress()->getName(),0,50)) == $this->xmlentities(substr($this->order->getCustomerName(),0,50))) {
|
| 550 |
+
$mdxi->Order->ShippingAddr->Name->setGender(substr(Mage::getResourceSingleton('customer/customer')->getAttribute('gender')->getSource()->getOptionText($this->order->getCustomer()->getGender()), 0, 1));
|
| 551 |
+
$mdxi->Order->ShippingAddr->Name->setBirthday(date('Y-m-d', strtotime($this->order->getCustomerDob())));
|
| 552 |
}
|
| 553 |
+
|
| 554 |
+
$shippingAdress = $this->xmlentities($this->order->getShippingAddress()->getStreetFull());
|
| 555 |
+
|
| 556 |
+
$shippingStreet = $this->splitAdress($shippingAdress);
|
| 557 |
+
|
| 558 |
+
if(isset($shippingStreet[0]) && is_array($shippingStreet[0])) {
|
| 559 |
+
$mdxi->Order->ShippingAddr->Street = $shippingStreet[0]['Street'];
|
| 560 |
+
$mdxi->Order->ShippingAddr->Street2 = $shippingStreet[1]['Street2'];
|
| 561 |
+
} else {
|
| 562 |
+
$mdxi->Order->ShippingAddr->Street = $shippingStreet['Street'];
|
| 563 |
+
|
| 564 |
+
if(isset($shippingStreet['Street2']))
|
| 565 |
+
$mdxi->Order->ShippingAddr->Street2 = $shippingStreet['Street2'];
|
| 566 |
}
|
| 567 |
+
|
| 568 |
+
$mdxi->Order->ShippingAddr->Zip = substr($this->xmlentities($this->order->getShippingAddress()->getPostcode()),0,50);
|
| 569 |
+
$mdxi->Order->ShippingAddr->City = substr($this->xmlentities($this->order->getShippingAddress()->getCity()),0,50);
|
| 570 |
+
$mdxi->Order->ShippingAddr->Country->setCode($this->xmlentities($shippingCountryCode));
|
| 571 |
+
$mdxi->Order->ShippingAddr->Email = substr($this->xmlentities($this->order->getShippingAddress()->getEmail()),0,50);
|
| 572 |
+
$mdxi->Order->ShippingAddr->Phone = substr($this->xmlentities($this->order->getShippingAddress()->getTelephone()),0,20);
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
if(Mage::helper('customer')->isLoggedIn())
|
| 576 |
+
$mdxi->Order->URL->Success = Mage::getUrl(MPay24MagentoShop::SUCCESS_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
| 577 |
+
else
|
| 578 |
+
$mdxi->Order->URL->Success = Mage::getUrl(MPay24MagentoShop::GUEST_SUCCESS_URL,array('_secure' => true, '_query' => "tid=" . substr($this->order->getIncrementId(),0,32) ));
|
| 579 |
+
|
| 580 |
+
$mdxi->Order->URL->Error = Mage::getUrl(MPay24MagentoShop::ERROR_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
| 581 |
+
$mdxi->Order->URL->Confirmation = Mage::getUrl(MPay24MagentoShop::CONFIRMATION_URL,array('_secure' => true));
|
| 582 |
+
$mdxi->Order->URL->Cancel = Mage::getUrl(MPay24MagentoShop::CANCEL_URL,array('_secure' => true, '_query' => "TID=" . substr($this->order->getIncrementId(),0,32) ));
|
| 583 |
+
|
| 584 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/debug') == 1) {
|
| 585 |
+
$myFile = "app/code/community/Mpay24/Mpay24/Model/Api/xmls/".$transaction->TID.".xml";
|
| 586 |
+
$fh = fopen($myFile, 'w') or die("can't open file");
|
| 587 |
+
fwrite($fh, $mdxi->toXML());
|
| 588 |
+
fclose($fh);
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
return $mdxi;
|
| 592 |
+
}
|
| 593 |
+
|
| 594 |
+
function setVariables($order, $ps, $type, $brand) {
|
| 595 |
+
$this->tid = $order->getIncrementId();
|
| 596 |
+
$this->order = $order;
|
| 597 |
+
$this->price = number_format($order->getData('grand_total'),2,'.','');
|
| 598 |
+
$this->ps = $ps;
|
| 599 |
+
$this->type = $type;
|
| 600 |
+
$this->brand = $brand;
|
| 601 |
+
|
| 602 |
+
$m= new Mage;
|
| 603 |
+
$version=$m->getVersion();
|
| 604 |
+
$this->mPay24Api->shop = "Magento";
|
| 605 |
+
$this->mPay24Api->shopVersion = $version;
|
| 606 |
+
$this->mPay24Api->moduleVersion = MPay24MagentoShop::MAGENTO_VERSION;
|
| 607 |
+
}
|
| 608 |
+
|
| 609 |
+
private function xmlentities($string) {
|
| 610 |
+
static $trans;
|
| 611 |
+
|
| 612 |
+
if (!isset($trans)) {
|
| 613 |
+
$trans = get_html_translation_table(HTML_SPECIALCHARS);
|
| 614 |
+
|
| 615 |
+
foreach ($trans as $key => $value)
|
| 616 |
+
$trans[$key] = '&#'.ord($key).';';
|
| 617 |
+
|
| 618 |
+
// dont translate the '&' in case it is part of &xxx;
|
| 619 |
+
$trans[chr(38)] = '&';
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
//after the initial translation, _do_ map standalone '&' into '&'
|
| 623 |
+
return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($string, $trans));
|
| 624 |
+
}
|
| 625 |
+
|
| 626 |
+
private function splitAdress($adress, $str2=null) {
|
| 627 |
+
$posNewLine = strpos($adress, "\n");
|
| 628 |
+
$strArray = array();
|
| 629 |
+
|
| 630 |
+
if($posNewLine === false) {
|
| 631 |
+
if(strlen($adress) <= 50)
|
| 632 |
+
if($str2 !== true)
|
| 633 |
+
$strArray['Street'] = $adress;
|
| 634 |
+
else
|
| 635 |
+
$strArray['Street2'] = $adress;
|
| 636 |
+
else {
|
| 637 |
+
$street1before = substr($adress, 0, 50);
|
| 638 |
+
$posLastInterval1 = strrpos($street1before, " ");
|
| 639 |
+
|
| 640 |
+
$street1 = substr($street1before, 0, $posLastInterval1);
|
| 641 |
+
|
| 642 |
+
$street2before = substr(substr($street1before, $posLastInterval1).substr($adress, 50), 1, 50);
|
| 643 |
+
$posLastInterval2 = strrpos($street2before, " ");
|
| 644 |
+
$street2 = substr($street2before, 0, $posLastInterval2);
|
| 645 |
+
|
| 646 |
+
if($str2 === null) {
|
| 647 |
+
$strArray['Street'] = $street1;
|
| 648 |
+
$strArray['Street2'] = $street2;
|
| 649 |
+
} elseif($str2 === false)
|
| 650 |
+
if($posLastInterval1)
|
| 651 |
+
$strArray['Street'] = $street1;
|
| 652 |
+
else
|
| 653 |
+
$strArray['Street'] = $street1before;
|
| 654 |
+
else
|
| 655 |
+
if($posLastInterval1)
|
| 656 |
+
$strArray['Street2'] = $street1;
|
| 657 |
+
else
|
| 658 |
+
$strArray['Street2'] = $street1before;
|
| 659 |
}
|
| 660 |
+
} else {
|
| 661 |
+
$array = explode("\n", $adress);
|
| 662 |
+
$adress1 = $array[0];
|
| 663 |
+
array_push($strArray, $this->splitAdress($adress1, false));
|
| 664 |
+
|
| 665 |
+
$adress2 = $array[1];
|
| 666 |
+
array_push($strArray, $this->splitAdress($adress2, true));
|
| 667 |
+
}
|
| 668 |
+
return $strArray;
|
| 669 |
+
}
|
| 670 |
+
|
| 671 |
+
public static function getMPay24Api() {
|
| 672 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/system') == 1)
|
| 673 |
+
$test = TRUE;
|
| 674 |
+
else
|
| 675 |
+
$test = FALSE;
|
| 676 |
+
|
| 677 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/debug') == 1)
|
| 678 |
+
$debug = TRUE;
|
| 679 |
+
else
|
| 680 |
+
$debug = FALSE;
|
| 681 |
+
|
| 682 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/use_proxy') == 1) {
|
| 683 |
+
$proxy_host = Mage::getStoreConfig('mpay24/mpay24as/proxy_host');
|
| 684 |
+
$proxy_port = Mage::getStoreConfig('mpay24/mpay24as/proxy_port');
|
| 685 |
+
} else {
|
| 686 |
+
$proxy_host = null;
|
| 687 |
+
$proxy_port = null;
|
| 688 |
+
}
|
| 689 |
+
|
| 690 |
+
$mPay24MagentoShop = new MPay24MagentoShop(Mage::getStoreConfig('mpay24/mpay24as/merchantid'), Mage::getStoreConfig('mpay24/mpay24as/soap_pass'), $test, $proxy_host, $proxy_port, $debug);
|
| 691 |
+
return $mPay24MagentoShop;
|
| 692 |
+
}
|
| 693 |
+
|
| 694 |
+
// /**
|
| 695 |
+
// * Get the payment systems for the merchant from the core_config_data and explode it into an array
|
| 696 |
+
// * @return array $method
|
| 697 |
+
// */
|
| 698 |
+
// public function getActiveMethods() {
|
| 699 |
+
// $methods = array();
|
| 700 |
+
// $brandsAndDescriptions = explode(", ", Mage::getStoreConfig('mpay24/mpay24/active_payment_types'));
|
| 701 |
+
|
| 702 |
+
// $firstPS = Mage::getStoreConfig('mpay24/mpay24/ps_1');
|
| 703 |
+
// $allPS = true;
|
| 704 |
+
|
| 705 |
+
// for($i=2; $i<=Mage::getStoreConfig('mpay24/mpay24/payments_count'); $i++)
|
| 706 |
+
// if($firstPS != Mage::getStoreConfig('mpay24/mpay24/ps_'.$i)) {
|
| 707 |
+
// $allPS = false;
|
| 708 |
+
// break;
|
| 709 |
+
// }
|
| 710 |
+
|
| 711 |
+
// if($allPS) {
|
| 712 |
+
// if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false')
|
| 713 |
+
// if($firstPS == 1) {
|
| 714 |
+
// Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 715 |
+
// Mage::getConfig()->reinit();
|
| 716 |
+
// Mage::app()->reinitStores();
|
| 717 |
+
// }
|
| 718 |
+
// else
|
| 719 |
+
// if($firstPS == 0) {
|
| 720 |
+
// Mage::getConfig()->saveConfig("payment/mpay24/active", 0);
|
| 721 |
+
// Mage::getConfig()->reinit();
|
| 722 |
+
// Mage::app()->reinitStores();
|
| 723 |
+
// }
|
| 724 |
+
|
| 725 |
+
// foreach($brandsAndDescriptions as $brandAndDescr) {
|
| 726 |
+
// $brand = substr($brandAndDescr, 0, strpos($brandAndDescr, "=>"));
|
| 727 |
+
// $description = substr($brandAndDescr, strpos($brandAndDescr, "=>")+2);
|
| 728 |
+
// $methods[$brand] = $description;
|
| 729 |
+
// }
|
| 730 |
+
// } else {
|
| 731 |
+
// if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'false')
|
| 732 |
+
// $check = 0;
|
| 733 |
+
// else
|
| 734 |
+
// $check = 1;
|
| 735 |
+
|
| 736 |
+
// $i=1;
|
| 737 |
+
|
| 738 |
+
// foreach($brandsAndDescriptions as $brandAndDescr) {
|
| 739 |
+
// if(Mage::getStoreConfig('mpay24/mpay24/ps_'.$i) == $check) {
|
| 740 |
+
// $brand = substr($brandAndDescr, 0, strpos($brandAndDescr, "=>"));
|
| 741 |
+
// $description = substr($brandAndDescr, strpos($brandAndDescr, "=>")+2);
|
| 742 |
+
// $methods[$brand] = $description;
|
| 743 |
+
// }
|
| 744 |
+
// $i++;
|
| 745 |
+
// }
|
| 746 |
+
// }
|
| 747 |
+
|
| 748 |
+
// return $methods;
|
| 749 |
+
// }
|
| 750 |
+
}
|
| 751 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Api/MPay24Shop.php
CHANGED
|
@@ -1,721 +1,900 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
if(!$transaction->MPAYTID || !is_numeric($transaction->MPAYTID)) {
|
| 428 |
-
$tidTransactionStatusResult = $this->mPay24Api->TransactionStatus(null, $tid);
|
| 429 |
-
|
| 430 |
-
if($this->mPay24Api->getDebug()) {
|
| 431 |
-
$this->write_log("TidTransactionStatus",
|
| 432 |
-
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 433 |
-
$this->write_log("TidTransactionStatus",
|
| 434 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 435 |
-
}
|
| 436 |
-
|
| 437 |
-
if($tidTransactionStatusResult->getParam("SHIPPING_ADDR")) {
|
| 438 |
-
$order = new DOMDocument();
|
| 439 |
-
$order->loadXML($tidTransactionStatusResult->getParam("SHIPPING_ADDR"));
|
| 440 |
-
}
|
| 441 |
-
|
| 442 |
-
if(isset($order)) {
|
| 443 |
-
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
| 444 |
-
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
| 445 |
-
|
| 446 |
-
if($shippingConfirmed == "false") {
|
| 447 |
-
$tidTransactionStatusResult->setParam("shippingConfirmed", false);
|
| 448 |
-
$tidTransactionStatusResult->setParam("SHIPP_NAME", $order->getElementsByTagName("Shipping")->item(0)
|
| 449 |
->getElementsByTagName("Name")->item(0)->nodeValue);
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
->getElementsByTagName("Zip")->item(0)->nodeValue);
|
| 457 |
-
|
| 458 |
->getElementsByTagName("City")->item(0)->nodeValue);
|
| 459 |
-
|
| 460 |
->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
|
|
|
| 488 |
->getElementsByTagName("Name")->item(0)->nodeValue);
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
->getElementsByTagName("Zip")->item(0)->nodeValue);
|
| 495 |
-
|
| 496 |
->getElementsByTagName("City")->item(0)->nodeValue);
|
| 497 |
-
|
| 498 |
->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 608 |
-
}
|
| 609 |
-
|
| 610 |
-
return $cancelTransactionResult;
|
| 611 |
-
}
|
| 612 |
-
|
| 613 |
-
/**
|
| 614 |
-
* @abstract Check if the a transaction is created, whether the object is from type Transaction
|
| 615 |
-
* and whether the mandatory settings (TID and PRICE) of a transaction are setted
|
| 616 |
-
* @param Transaction The transaction, which is to be checked
|
| 617 |
-
*/
|
| 618 |
-
private function checkTransaction($transaction) {
|
| 619 |
-
if(!$transaction || !$transaction instanceof Transaction)
|
| 620 |
-
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create a Transaction object, which contains at least TID and PRICE!");
|
| 621 |
-
else if(!$transaction->TID)
|
| 622 |
-
$this->mPay24Api->dieWithMsg("The Transaction must contain TID!");
|
| 623 |
-
else if(!$transaction->PRICE)
|
| 624 |
-
$this->mPay24Api->dieWithMsg("The Transaction must contain PRICE!");
|
| 625 |
-
}
|
| 626 |
}
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 720 |
}
|
| 721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 5522 2013-06-24 13:08:35Z 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 |
+
* @var $mPay24Api
|
| 17 |
+
*/
|
| 18 |
+
var $mPay24Api = null;
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* The constructor, which sets all the initial values, in order to be able making transactions
|
| 22 |
+
* @param int $merchantID 5-digit account number, supported by mPAY24:
|
| 23 |
+
* TEST accounts - starting with 9
|
| 24 |
+
* LIVE account - starting with 7
|
| 25 |
+
* @param string $soapPassword The webservice's password, supported by mPAY24
|
| 26 |
+
* @param bool $test TRUE - when you want to use the TEST system,
|
| 27 |
+
* FALSE - when you want to use the LIVE system
|
| 28 |
+
* @param string $proxyHost The host name in case you are behind a proxy server ("" when not)
|
| 29 |
+
* @param int $proxyPort 4-digit port number in case you are behind a proxy server ("" when not)
|
| 30 |
+
* @param bool $debug TRUE - when you want to write log files,
|
| 31 |
+
* FALSE - when you don't want write log files
|
| 32 |
+
*/
|
| 33 |
+
function MPay24Shop($merchantID, $soapPassword, $test, $proxyHost=null, $proxyPort=null, $debug=false) {
|
| 34 |
+
if(!is_bool($test))
|
| 35 |
+
die("The test parameter '$test' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
| 36 |
+
|
| 37 |
+
if(!is_bool($debug))
|
| 38 |
+
die("The debug parameter '$debug' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
| 39 |
+
|
| 40 |
+
$this->mPay24Api = new MPay24Api();
|
| 41 |
+
|
| 42 |
+
if($proxyHost == null) {
|
| 43 |
+
$pHost = "";
|
| 44 |
+
$pPort = "";
|
| 45 |
+
} else {
|
| 46 |
+
$pHost = $proxyHost;
|
| 47 |
+
$pPort = $proxyPort;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
$this->mPay24Api->configure($merchantID, $soapPassword, $test, $pHost, $pPort);
|
| 51 |
+
$this->mPay24Api->setDebug($debug);
|
| 52 |
+
|
| 53 |
+
if (version_compare(phpversion(), '5.0.0', '<')===true || !in_array('curl', get_loaded_extensions()) || !in_array('dom', get_loaded_extensions())) {
|
| 54 |
+
$this->mPay24Api->printMsg("ERROR: You don't meet the needed requirements for this example shop.<br>");
|
| 55 |
+
|
| 56 |
+
if(version_compare(phpversion(), '5.0.0', '<')===true)
|
| 57 |
+
$this->mPay24Api->printMsg("You need PHP version 5.0.0 or newer!<br>");
|
| 58 |
+
if(!in_array('curl', get_loaded_extensions()))
|
| 59 |
+
$this->mPay24Api->printMsg("You need cURL extension!<br>");
|
| 60 |
+
if(!in_array('dom', get_loaded_extensions()))
|
| 61 |
+
$this->mPay24Api->printMsg("You need DOM extension!<br>");
|
| 62 |
+
|
| 63 |
+
$this->mPay24Api->dieWithMsg("Please load the required extensions!");
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
if(strlen($merchantID) != 5 || (substr($merchantID, 0, 1) != "7" && substr($merchantID, 0, 1) != "9"))
|
| 67 |
+
$this->mPay24Api->dieWithMsg("The merchant ID '$merchantID' you have given is wrong, it must be 5-digit number and starts with 7 or 9!");
|
| 68 |
+
|
| 69 |
+
if($proxyPort != null && (!is_numeric($proxyPort) || strlen($proxyPort) != 4))
|
| 70 |
+
$this->mPay24Api->dieWithMsg("The proxy port '$proxyPort' you have given must be numeric!");
|
| 71 |
+
|
| 72 |
+
if(($proxyHost == null && $proxyHost != $proxyPort) || ($proxyPort == null && $proxyHost != $proxyPort))
|
| 73 |
+
$this->mPay24Api->dieWithMsg("You must setup both variables 'proxyHost' and 'proxyPort'!");
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* Create a transaction and save/return this (in a data base or file system (for example XML))
|
| 78 |
+
* @return Transaction
|
| 79 |
+
*/
|
| 80 |
+
abstract function createTransaction();
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* Actualize the transaction, which has a transaction ID = $tid with the values from $args in your shop and return it
|
| 84 |
+
* @param string $tid The transaction ID you want to update with the confirmation
|
| 85 |
+
* @param array $args Arrguments with them the transaction is to be updated
|
| 86 |
+
* @param bool $shippingConfirmed TRUE if the shipping address is confirmed, FALSE - otherwise (in case of PayPal Express Checkout)
|
| 87 |
+
*/
|
| 88 |
+
abstract function updateTransaction($tid, $args, $shippingConfirmed);
|
| 89 |
+
|
| 90 |
+
/**
|
| 91 |
+
* Give the transaction object back, for a transaction which has a transaction ID = $tid
|
| 92 |
+
* @param string $tid The transaction ID of the transaction you want get
|
| 93 |
+
* @return Transaction
|
| 94 |
+
*/
|
| 95 |
+
abstract function getTransaction($tid);
|
| 96 |
+
|
| 97 |
+
/**
|
| 98 |
+
* Using the ORDER object from order.php, create a MDXI-XML, which is needed for a transaction to be started
|
| 99 |
+
* @param Transaction $transaction The transaction you want to make a MDXI XML file for
|
| 100 |
+
* @return ORDER
|
| 101 |
+
*/
|
| 102 |
+
abstract function createMDXI($transaction);
|
| 103 |
+
|
| 104 |
+
/**
|
| 105 |
+
* Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with profiles to be started
|
| 106 |
+
* @param string $tid The transaction ID of the transaction you want to make an order transaction XML file for
|
| 107 |
+
* @return XML
|
| 108 |
+
*/
|
| 109 |
+
abstract function createProfileOrder($tid);
|
| 110 |
+
|
| 111 |
+
/**
|
| 112 |
+
* Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with PayPal Express Checkout to be started
|
| 113 |
+
* @param string $tid The transaction ID of the transaction you want to make an order transaction XML file for
|
| 114 |
+
* @return XML
|
| 115 |
+
*/
|
| 116 |
+
abstract function createExpressCheckoutOrder($tid);
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with PayPal Express Checkout to be finished
|
| 120 |
+
* @param string $tid The transaction ID of the transaction you want to make an order transaction XML file for
|
| 121 |
+
* @param string $shippingCosts The shipping costs amount for the transaction, provided by PayPal, after changing the shipping address
|
| 122 |
+
* @param string $amount The new amount for the transaction, provided by PayPal, after changing the shipping address
|
| 123 |
+
* @param bool $cancel TRUE if the a cancelation is wanted after renewing the amounts and FALSE otherwise
|
| 124 |
+
* @return XML
|
| 125 |
+
*/
|
| 126 |
+
abstract function createFinishExpressCheckoutOrder($tid, $shippingCosts, $amount, $cancel);
|
| 127 |
+
|
| 128 |
+
/**
|
| 129 |
+
* Write a log into a file, file system, data base
|
| 130 |
+
* @param string $operation The operation, which is to log: GetPaymentMethods, Pay, PayWithProfile, Confirmation, UpdateTransactionStatus, ClearAmount, CreditAmount, CancelTransaction, etc.
|
| 131 |
+
* @param string $info_to_log The information, which is to log: request, response, etc.
|
| 132 |
+
*/
|
| 133 |
+
abstract function write_log($operation, $info_to_log);
|
| 134 |
+
|
| 135 |
+
/**
|
| 136 |
+
* This is an optional function, but it's strongly recomended that you implement it - see details.
|
| 137 |
+
* It should build a hash from the transaction ID of your shop, the amount of the transaction,
|
| 138 |
+
* the currency and the timeStamp of the transaction. The mPAY24 confirmation interface will be called
|
| 139 |
+
* with this hash (parameter name 'token'), so you would be able to check whether the confirmation is
|
| 140 |
+
* really coming from mPAY24 or not. The hash should be then saved in the transaction object, so that
|
| 141 |
+
* every transaction has an unique secret token.
|
| 142 |
+
* @param string $tid The transaction ID you want to make a secret key for
|
| 143 |
+
* @param string $amount The amount, reserved for this transaction
|
| 144 |
+
* @param string $currency The currency (3-digit ISO-Currency-Code) at the moment the transaction is created
|
| 145 |
+
* @param string $timeStamp The timeStamp at the moment the transaction is created
|
| 146 |
+
* @return string
|
| 147 |
+
*/
|
| 148 |
+
abstract function createSecret($tid, $amount, $currency, $timeStamp);
|
| 149 |
+
|
| 150 |
+
/**
|
| 151 |
+
* Get the secret (hashed) token for a transaction
|
| 152 |
+
* @param string $tid The transaction ID you want to get the secret key for
|
| 153 |
+
* @return string
|
| 154 |
+
*/
|
| 155 |
+
abstract function getSecret($tid);
|
| 156 |
+
|
| 157 |
+
/**
|
| 158 |
+
* Get a list which includes all the payment methods (activated by mPAY24) for your mechant ID
|
| 159 |
+
* @return ListPaymentMethodsResponse
|
| 160 |
+
*/
|
| 161 |
+
function getPaymentMethods() {
|
| 162 |
+
if(!$this->mPay24Api)
|
| 163 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 164 |
+
|
| 165 |
+
$paymentMethods = $this->mPay24Api->ListPaymentMethods();
|
| 166 |
+
|
| 167 |
+
if($this->mPay24Api->getDebug()) {
|
| 168 |
+
$this->write_log("GetPaymentMethods",
|
| 169 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 170 |
+
$this->write_log("GetPaymentMethods",
|
| 171 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
return $paymentMethods;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
/**
|
| 178 |
+
* Return a redirect URL to start a payment
|
| 179 |
+
* @return PaymentResponse
|
| 180 |
+
*/
|
| 181 |
+
function pay() {
|
| 182 |
+
if(!$this->mPay24Api)
|
| 183 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 184 |
+
|
| 185 |
+
$transaction = $this->createTransaction();
|
| 186 |
+
|
| 187 |
+
$this->checkTransaction($transaction);
|
| 188 |
+
|
| 189 |
+
libxml_use_internal_errors(true);
|
| 190 |
+
|
| 191 |
+
$mdxi = $this->createMDXI($transaction);
|
| 192 |
+
|
| 193 |
+
if(!$mdxi || !$mdxi instanceof ORDER)
|
| 194 |
+
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php) and fulfill it with a MDXI!");
|
| 195 |
+
|
| 196 |
+
$mdxiXML = $mdxi->toXML();
|
| 197 |
+
|
| 198 |
+
if(!$this->mPay24Api->proxyUsed())
|
| 199 |
+
if(!$mdxi->validate()) {
|
| 200 |
+
$errors = "";
|
| 201 |
+
|
| 202 |
+
foreach(libxml_get_errors() as $error)
|
| 203 |
+
$errors.= trim($error->message) . "<br>";
|
| 204 |
+
|
| 205 |
+
$this->mPay24Api->dieWithMsg("The schema you have created is not valid!". "<br><br>".$errors.
|
| 206 |
+
"<textarea cols='100' rows='30'>$mdxiXML</textarea>");
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
$mdxiXML = $mdxi->toXML();
|
| 210 |
+
|
| 211 |
+
$payResult = $this->mPay24Api->SelectPayment($mdxiXML);
|
| 212 |
+
|
| 213 |
+
if($this->mPay24Api->getDebug()) {
|
| 214 |
+
$this->write_log("Pay",
|
| 215 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 216 |
+
$this->write_log("Pay",
|
| 217 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
return $payResult;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
/**
|
| 224 |
+
* Start a payment with customer profile
|
| 225 |
+
* @return PaymentResponse
|
| 226 |
+
*/
|
| 227 |
+
function payWithProfile() {
|
| 228 |
+
if(!$this->mPay24Api)
|
| 229 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 230 |
+
|
| 231 |
+
$transaction = $this->createTransaction();
|
| 232 |
+
|
| 233 |
+
$this->checkTransaction($transaction);
|
| 234 |
+
|
| 235 |
+
$order = $this->createProfileOrder($transaction);
|
| 236 |
+
|
| 237 |
+
if(!$order || !$order instanceof ORDER)
|
| 238 |
+
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
| 239 |
+
|
| 240 |
+
$payWithProfileResult = $this->mPay24Api->ProfilePayment($order->toXML());
|
| 241 |
+
|
| 242 |
+
if($this->mPay24Api->getDebug()) {
|
| 243 |
+
$this->write_log("PayWithProfile",
|
| 244 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 245 |
+
$this->write_log("PayWithProfile",
|
| 246 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
return $payWithProfileResult;
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
/**
|
| 253 |
+
* Start a payment with PayPal Express Checkout
|
| 254 |
+
* @return PaymentResponse
|
| 255 |
+
*/
|
| 256 |
+
function payWithExpressCheckout() {
|
| 257 |
+
if(!$this->mPay24Api)
|
| 258 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 259 |
+
|
| 260 |
+
$transaction = $this->createTransaction();
|
| 261 |
+
|
| 262 |
+
$this->checkTransaction($transaction);
|
| 263 |
+
|
| 264 |
+
$order = $this->createExpressCheckoutOrder($transaction);
|
| 265 |
+
|
| 266 |
+
if(!$order || !$order instanceof ORDER)
|
| 267 |
+
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
| 268 |
+
|
| 269 |
+
$payWithExpressCheckoutResult = $this->mPay24Api->ExpressCheckoutPayment($order->toXML());
|
| 270 |
+
|
| 271 |
+
if($this->mPay24Api->getDebug()) {
|
| 272 |
+
$this->write_log("PayWithExpressCheckout",
|
| 273 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 274 |
+
$this->write_log("PayWithExpressCheckout",
|
| 275 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
return $payWithExpressCheckoutResult;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
/**
|
| 282 |
+
* 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. With the 'cancel' parameter you are able also to cancel the transaction
|
| 283 |
+
* @param string $tid The transaction ID in the shop
|
| 284 |
+
* @param int $shippingCosts The shippingcosts for the transaction multiply by 100
|
| 285 |
+
* @param int $amount The amount you want to reserve/bill multiply by 100
|
| 286 |
+
* @param string $cancel ALLOWED: "true" or "false" - in case of 'true' the transaction will be canceled, otherwise reserved/billed
|
| 287 |
+
* @return PaymentResponse
|
| 288 |
+
*/
|
| 289 |
+
function finishExpressCheckoutPayment($tid, $shippingCosts, $amount, $cancel) {
|
| 290 |
+
if(!$this->mPay24Api)
|
| 291 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 292 |
+
|
| 293 |
+
if($cancel !== "true" && $cancel !== "false")
|
| 294 |
+
$this->mPay24Api->dieWithMsg("The allowed values for the parameter 'cancel' by finishing a PayPal (Express Checkout) payment are 'true' or 'false'!");
|
| 295 |
+
|
| 296 |
+
$transaction = $this->getTransaction($tid);
|
| 297 |
+
|
| 298 |
+
$this->checkTransaction($transaction);
|
| 299 |
+
|
| 300 |
+
$mPAYTid = $transaction->MPAYTID;
|
| 301 |
+
|
| 302 |
+
if(!$mPAYTid)
|
| 303 |
+
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to finish with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
| 304 |
+
|
| 305 |
+
if(!$amount || !is_numeric($amount))
|
| 306 |
+
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to pay by PayPal is not valid!");
|
| 307 |
+
|
| 308 |
+
if(!$shippingCosts || !is_numeric($shippingCosts))
|
| 309 |
+
$this->mPay24Api->dieWithMsg("The shipping costs '$shippingCosts' you are trying to set are not valid!");
|
| 310 |
+
|
| 311 |
+
$order = $this->createFinishExpressCheckoutOrder($transaction, $shippingCosts, $amount, $cancel);
|
| 312 |
+
|
| 313 |
+
if(!$order || !$order instanceof ORDER)
|
| 314 |
+
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create an ORDER object (order.php)!");
|
| 315 |
+
|
| 316 |
+
$finishExpressCheckoutResult = $this->mPay24Api->CallbackPaypal($order->toXML());
|
| 317 |
+
|
| 318 |
+
if($this->mPay24Api->getDebug()) {
|
| 319 |
+
$this->write_log("FinishExpressCheckoutResult",
|
| 320 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 321 |
+
$this->write_log("FinishExpressCheckoutResult",
|
| 322 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
return $finishExpressCheckoutResult;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
/**
|
| 329 |
+
* Proceed the confirmation call
|
| 330 |
+
* @param string $tid The transaction ID in the shop
|
| 331 |
+
* @param array $args A list with the arguments, provided with the confirmation
|
| 332 |
+
*/
|
| 333 |
+
function confirm($tid, $args) {
|
| 334 |
+
$to_log = '';
|
| 335 |
+
$shippingConfirmed = "";
|
| 336 |
+
|
| 337 |
+
foreach($args as $name => $value)
|
| 338 |
+
$to_log.= $name . " = " . $value . "\n";
|
| 339 |
+
|
| 340 |
+
if($this->mPay24Api->getDebug())
|
| 341 |
+
$this->write_log("Confirmation for transaction '" . $tid . "'\n", utf8_encode($to_log)."\n");
|
| 342 |
+
|
| 343 |
+
$transactionStatus = $this->updateTransactionStatus($tid);
|
| 344 |
+
|
| 345 |
+
$newArgs = $transactionStatus->getParams();
|
| 346 |
+
|
| 347 |
+
foreach($newArgs as $name => $value)
|
| 348 |
+
$to_log.= $name . " = " . $value . "\n";
|
| 349 |
+
|
| 350 |
+
if($this->mPay24Api->getDebug())
|
| 351 |
+
$this->write_log("Status for transaction " . $tid . ":", utf8_encode($to_log)."\n");
|
| 352 |
+
|
| 353 |
+
if($transactionStatus->getParam("SHIPPING_ADDR")) {
|
| 354 |
+
$order = new DOMDocument();
|
| 355 |
+
$order->loadXML($transactionStatus->getParam("SHIPPING_ADDR"));
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
if(isset($order)) {
|
| 359 |
+
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
| 360 |
+
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
if($this->getSecret($tid) == $args['token']) {
|
| 364 |
+
if($shippingConfirmed == "false") {
|
| 365 |
+
$newArgs["SHIPP_NAME"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Name")->item(0)->nodeValue;
|
| 366 |
+
$newArgs["SHIPP_STREET"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street")->item(0)->nodeValue;
|
| 367 |
+
|
| 368 |
+
if($order->getElementsByTagName("Shipping")->item(0)->hasAttribute("Street2"))
|
| 369 |
+
$newArgs["SHIPP_STREET2"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Street2")->item(0)->nodeValue;
|
| 370 |
+
|
| 371 |
+
$newArgs["SHIPP_ZIP"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Zip")->item(0)->nodeValue;
|
| 372 |
+
$newArgs["SHIPP_CITY"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("City")->item(0)->nodeValue;
|
| 373 |
+
$newArgs["SHIPP_COUNTRY"] = $order->getElementsByTagName("Shipping")->item(0)->getElementsByTagName("Country")->item(0)->getAttribute("code");
|
| 374 |
+
return $this->updateTransaction($tid, $newArgs, false);
|
| 375 |
+
} else
|
| 376 |
+
return $this->updateTransaction($tid, $newArgs, true);
|
| 377 |
+
}
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
/**
|
| 381 |
+
* Get the transaction's current information - see details
|
| 382 |
+
*
|
| 383 |
+
* An array with all the data (by mPAY24) for this transaction (STATUS, CURRENCY, PRICE, APPR_CODE, etc) will be returned.
|
| 384 |
+
* Possible values for the STATUS attribute:
|
| 385 |
+
*
|
| 386 |
+
* * RESERVED - in case the authorization was successful but not cleared yet
|
| 387 |
+
* * BILLED - in case the authorization was successful and amount was cleared
|
| 388 |
+
* * CREDITED - in case amount was credited
|
| 389 |
+
* * REVERSED - in case the transaction was canceled
|
| 390 |
+
* * SUSPENDED - in case the transaction is not fully compleated yet
|
| 391 |
+
* * NOT FOUND - in case there is not such a transaction in the mPAY24 database
|
| 392 |
+
* * ERROR - in case the transaction was not successful
|
| 393 |
+
* @param string $tid The transaction ID (in your shop), for the transaction you are asking for
|
| 394 |
+
* @return array
|
| 395 |
+
*/
|
| 396 |
+
function updateTransactionStatus($tid) {
|
| 397 |
+
if(!$this->mPay24Api)
|
| 398 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 399 |
+
|
| 400 |
+
$transaction = $this->getTransaction($tid);
|
| 401 |
+
|
| 402 |
+
$this->checkTransaction($transaction);
|
| 403 |
+
|
| 404 |
+
if(!$transaction->MPAYTID || !is_numeric($transaction->MPAYTID)) {
|
| 405 |
+
$tidTransactionStatusResult = $this->mPay24Api->TransactionStatus(null, $tid);
|
| 406 |
+
|
| 407 |
+
if($this->mPay24Api->getDebug()) {
|
| 408 |
+
$this->write_log("TidTransactionStatus",
|
| 409 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 410 |
+
$this->write_log("TidTransactionStatus",
|
| 411 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 412 |
+
}
|
| 413 |
+
|
| 414 |
+
if($tidTransactionStatusResult->getParam("SHIPPING_ADDR")) {
|
| 415 |
+
$order = new DOMDocument();
|
| 416 |
+
$order->loadXML($tidTransactionStatusResult->getParam("SHIPPING_ADDR"));
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
if(isset($order)) {
|
| 420 |
+
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
| 421 |
+
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
| 422 |
+
|
| 423 |
+
if($shippingConfirmed == "false") {
|
| 424 |
+
$tidTransactionStatusResult->setParam("shippingConfirmed", false);
|
| 425 |
+
$tidTransactionStatusResult->setParam("SHIPP_NAME", $order->getElementsByTagName("Shipping")->item(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 426 |
->getElementsByTagName("Name")->item(0)->nodeValue);
|
| 427 |
+
$tidTransactionStatusResult->setParam("SHIPP_STREET", $order->getElementsByTagName("Shipping")->item(0)
|
| 428 |
+
->getElementsByTagName("Street")->item(0)->nodeValue);
|
| 429 |
+
if($tidTransactionStatusResult->getParam("SHIPP_STREET2"))
|
| 430 |
+
$tidTransactionStatusResult->setParam("SHIPP_STREET2", $order->getElementsByTagName("Shipping")->item(0)
|
| 431 |
+
->getElementsByTagName("Street2")->item(0)->nodeValue);
|
| 432 |
+
$tidTransactionStatusResult->setParam("SHIPP_ZIP", $order->getElementsByTagName("Shipping")->item(0)
|
| 433 |
->getElementsByTagName("Zip")->item(0)->nodeValue);
|
| 434 |
+
$tidTransactionStatusResult->setParam("SHIPP_CITY", $order->getElementsByTagName("Shipping")->item(0)
|
| 435 |
->getElementsByTagName("City")->item(0)->nodeValue);
|
| 436 |
+
$tidTransactionStatusResult->setParam("SHIPP_COUNTRY", $order->getElementsByTagName("Shipping")->item(0)
|
| 437 |
->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
| 438 |
+
} else
|
| 439 |
+
$tidTransactionStatusResult->setParam("shippingConfirmed", true);
|
| 440 |
+
} else
|
| 441 |
+
$tidTransactionStatusResult->setParam("shippingConfirmed", true);
|
| 442 |
+
|
| 443 |
+
return $tidTransactionStatusResult;
|
| 444 |
+
} else{
|
| 445 |
+
$mPAYTidTransactionStatusResult = $this->mPay24Api->TransactionStatus($transaction->MPAYTID, null);
|
| 446 |
+
|
| 447 |
+
if($this->mPay24Api->getDebug()) {
|
| 448 |
+
$this->write_log("mPAYTidTransactionStatus",
|
| 449 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 450 |
+
$this->write_log("mPAYTidTransactionStatus",
|
| 451 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
if($mPAYTidTransactionStatusResult->getParam("SHIPPING_ADDR")) {
|
| 455 |
+
$order = new DOMDocument();
|
| 456 |
+
$order->loadXML($mPAYTidTransactionStatusResult->getParam("SHIPPING_ADDR"));
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
if(isset($order)) {
|
| 460 |
+
$shipping = $order->getElementsByTagName("Shipping")->item(0);
|
| 461 |
+
$shippingConfirmed = $shipping->getAttribute("confirmed");
|
| 462 |
+
|
| 463 |
+
if($shippingConfirmed == "false") {
|
| 464 |
+
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", false);
|
| 465 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_NAME", $order->getElementsByTagName("Shipping")->item(0)
|
| 466 |
->getElementsByTagName("Name")->item(0)->nodeValue);
|
| 467 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_STREET", $order->getElementsByTagName("Shipping")->item(0)
|
| 468 |
+
->getElementsByTagName("Street")->item(0)->nodeValue);
|
| 469 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_STREET2", $order->getElementsByTagName("Shipping")->item(0)
|
| 470 |
+
->getElementsByTagName("Street2")->item(0)->nodeValue);
|
| 471 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_ZIP", $order->getElementsByTagName("Shipping")->item(0)
|
| 472 |
->getElementsByTagName("Zip")->item(0)->nodeValue);
|
| 473 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_CITY", $order->getElementsByTagName("Shipping")->item(0)
|
| 474 |
->getElementsByTagName("City")->item(0)->nodeValue);
|
| 475 |
+
$mPAYTidTransactionStatusResult->setParam("SHIPP_COUNTRY", $order->getElementsByTagName("Shipping")->item(0)
|
| 476 |
->getElementsByTagName("Country")->item(0)->getAttribute("code"));
|
| 477 |
+
} else
|
| 478 |
+
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", true);
|
| 479 |
+
} else
|
| 480 |
+
$mPAYTidTransactionStatusResult->setParam("shippingConfirmed", true);
|
| 481 |
+
|
| 482 |
+
return $mPAYTidTransactionStatusResult;
|
| 483 |
+
}
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
/**
|
| 487 |
+
* Clear an amount of an authorized transaction
|
| 488 |
+
* @param string $tid The transaction ID, for the transaction you want to clear
|
| 489 |
+
* @param int $amount The amount you want to clear multiply by 100
|
| 490 |
+
*/
|
| 491 |
+
function clearAmount($tid, $amount) {
|
| 492 |
+
if(!$this->mPay24Api)
|
| 493 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 494 |
+
|
| 495 |
+
$transaction = $this->getTransaction($tid);
|
| 496 |
+
|
| 497 |
+
$this->checkTransaction($transaction);
|
| 498 |
+
|
| 499 |
+
$mPAYTid = $transaction->MPAYTID;
|
| 500 |
+
$currency = $transaction->CURRENCY;
|
| 501 |
+
|
| 502 |
+
if(!$mPAYTid)
|
| 503 |
+
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to clear with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
| 504 |
+
|
| 505 |
+
if(!$amount || !is_numeric($amount))
|
| 506 |
+
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to clear is not valid!");
|
| 507 |
+
|
| 508 |
+
if(!$currency || strlen($currency) != 3)
|
| 509 |
+
$this->mPay24Api->dieWithMsg("The currency code '$currency' for the amount you are trying to clear is not valid (3-digit ISO-Currency-Code)!");
|
| 510 |
+
|
| 511 |
+
$clearAmountResult = $this->mPay24Api->ManualClear($mPAYTid, $amount, $currency);
|
| 512 |
+
|
| 513 |
+
if($this->mPay24Api->getDebug()) {
|
| 514 |
+
$this->write_log("ClearAmount",
|
| 515 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 516 |
+
$this->write_log("ClearAmount",
|
| 517 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
return $clearAmountResult;
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
/**
|
| 524 |
+
* Credit an amount of a billed transaction
|
| 525 |
+
* @param string $tid The transaction ID, for the transaction you want to credit
|
| 526 |
+
* @param int $amount The amount you want to credit multiply by 100
|
| 527 |
+
*/
|
| 528 |
+
function creditAmount($tid, $amount) {
|
| 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 |
+
$mPAYTid = $transaction->MPAYTID;
|
| 537 |
+
$currency = $transaction->CURRENCY;
|
| 538 |
+
$customer = $transaction->CUSTOMER;
|
| 539 |
+
|
| 540 |
+
if(!$mPAYTid)
|
| 541 |
+
$this->mPay24Api->dieWithMsg("The transaction '$tid' you want to credit with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
| 542 |
+
|
| 543 |
+
if(!$amount || !is_numeric($amount))
|
| 544 |
+
$this->mPay24Api->dieWithMsg("The amount '$amount' you are trying to credit is not valid!");
|
| 545 |
+
|
| 546 |
+
if(!$currency || strlen($currency) != 3)
|
| 547 |
+
$this->mPay24Api->dieWithMsg("The currency code '$currency' for the amount you are trying to credit is not valid (3-digit ISO-Currency-Code)!");
|
| 548 |
+
|
| 549 |
+
$creditAmountResult = $this->mPay24Api->ManualCredit($mPAYTid, $amount, $currency, $customer);
|
| 550 |
+
|
| 551 |
+
if($this->mPay24Api->getDebug()) {
|
| 552 |
+
$this->write_log("CreditAmount",
|
| 553 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 554 |
+
$this->write_log("CreditAmount",
|
| 555 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
return $creditAmountResult;
|
| 559 |
+
}
|
| 560 |
+
|
| 561 |
+
/**
|
| 562 |
+
* Cancel a authorized transaction
|
| 563 |
+
* @param string $tid The transaction ID, for the transaction you want to cancel
|
| 564 |
+
*/
|
| 565 |
+
function cancelTransaction($tid) {
|
| 566 |
+
if(!$this->mPay24Api)
|
| 567 |
+
die("You are not allowed to define a constructor in the child class of MPay24Shop!");
|
| 568 |
+
|
| 569 |
+
$transaction = $this->getTransaction($tid);
|
| 570 |
+
|
| 571 |
+
$this->checkTransaction($transaction);
|
| 572 |
+
|
| 573 |
+
$mPAYTid = $transaction->MPAYTID;
|
| 574 |
+
|
| 575 |
+
if(!$mPAYTid)
|
| 576 |
+
$this->mPay24Api->dieWithMsgie("The transaction '$tid' you want to cancel with the mPAYTid '$mPAYTid' does not exist in the mPAY24 data base!");
|
| 577 |
+
|
| 578 |
+
$cancelTransactionResult = $this->mPay24Api->ManualReverse($mPAYTid);
|
| 579 |
+
|
| 580 |
+
if($this->mPay24Api->getDebug()) {
|
| 581 |
+
$this->write_log("CancelTransaction",
|
| 582 |
+
"REQUEST to " . $this->mPay24Api->getEtpURL() . " - ".str_replace("><", ">\n<", $this->mPay24Api->getRequest())."\n");
|
| 583 |
+
$this->write_log("CancelTransaction",
|
| 584 |
+
"RESPONSE - ".str_replace("><", ">\n<", $this->mPay24Api->getResponse())."\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 585 |
}
|
| 586 |
+
|
| 587 |
+
return $cancelTransactionResult;
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
/**
|
| 591 |
+
* 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
|
| 592 |
+
* @param Transaction $tid The transaction, which should be checked
|
| 593 |
+
*/
|
| 594 |
+
private function checkTransaction($transaction) {
|
| 595 |
+
if(!$transaction || !$transaction instanceof Transaction)
|
| 596 |
+
$this->mPay24Api->dieWithMsg("To be able to use the MPay24Api you must create a Transaction object, which contains at least TID and PRICE!");
|
| 597 |
+
else if(!$transaction->TID)
|
| 598 |
+
$this->mPay24Api->dieWithMsg("The Transaction must contain TID!");
|
| 599 |
+
else if(!$transaction->PRICE)
|
| 600 |
+
$this->mPay24Api->dieWithMsg("The Transaction must contain PRICE!");
|
| 601 |
+
}
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
/**
|
| 605 |
+
* The properties, which are allowed for a transaction
|
| 606 |
+
* @const TRANSACTION_PROPERTIES
|
| 607 |
+
*/
|
| 608 |
+
define("TRANSACTION_PROPERTIES", "SECRET,TID,STATUS,MPAYTID,APPR_CODE,P_TYPE,
|
| 609 |
+
BRAND,PRICE,CURRENCY,OPERATION,LANGUAGE,
|
| 610 |
+
USER_FIELD,ORDERDESC,CUSTOMER,CUSTOMER_EMAIL,
|
| 611 |
+
CUSTOMER_ID,PROFILE_STATUS,FILTER_STATUS,TSTATUS");
|
| 612 |
+
|
| 613 |
+
/**
|
| 614 |
+
* The Transaction class allows you to set and get different trnasaction's properties - see details
|
| 615 |
+
*
|
| 616 |
+
* TYPE: PARAMETER - VALUE(s), description
|
| 617 |
+
*
|
| 618 |
+
* * STRING: STATUS - OK, ERROR
|
| 619 |
+
* * STRING: OPERATION - CONFIRMATION
|
| 620 |
+
* * STRING: TID - length <= 32
|
| 621 |
+
* * STRING: TRANSACTION_STATUS - RESERVED, BILLED, REVERSED, CREDITED, ERROR
|
| 622 |
+
* * INT: PRICE - length = 11 (e. g. "10" = "0,10")
|
| 623 |
+
* * STRING: CURRENCY - length = 3 (ISO currency code, e. g. "EUR")
|
| 624 |
+
* * STRING: P_TYPE - CC, ELV, EPS, GIROPAY, MAESTRO, PB, PSC, QUICK, etc
|
| 625 |
+
* * STRING: BRAND - AMEX, DINERS, JCB, MASTERCARD, VISA, ATOS, HOBEX-AT, HOBEX-DE, etc
|
| 626 |
+
* * INT: MPAYTID - length = 11
|
| 627 |
+
* * STRING: USER_FIELD
|
| 628 |
+
* * STRING: ORDERDESC
|
| 629 |
+
* * STRING: CUSTOMER
|
| 630 |
+
* * STRING: CUSTOMER_EMAIL
|
| 631 |
+
* * STRING: LANGUAGE - length = 2
|
| 632 |
+
* * STRING: CUSTOMER_ID - length = 11
|
| 633 |
+
* * STRING: PROFILE_STATUS - IGNORED, USED, ERROR, CREATED, UPDATED, DELETED
|
| 634 |
+
* * STRING: FILTER_STATUS
|
| 635 |
+
* * STRING: APPR_CODE
|
| 636 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
| 637 |
+
* @version $Id: MPay24Shop.php 5522 2013-06-24 13:08:35Z anna $
|
| 638 |
+
* @filesource MPay24Shop.php
|
| 639 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 640 |
+
*/
|
| 641 |
+
class Transaction {
|
| 642 |
+
/**
|
| 643 |
+
* An array, which contains the allowed properties for an transaction
|
| 644 |
+
* @var $allowedProperties
|
| 645 |
+
*/
|
| 646 |
+
var $allowedProperties = array();
|
| 647 |
+
/**
|
| 648 |
+
* An array, which contains the set properties for this transaction object
|
| 649 |
+
* @var $allowedProperties
|
| 650 |
+
*/
|
| 651 |
+
var $properties = array();
|
| 652 |
+
|
| 653 |
+
/**
|
| 654 |
+
* Create a transaction object and set the allowed properties from the TRANSACTION_PROPERTIES
|
| 655 |
+
* @param string $tid The ID of a transaction
|
| 656 |
+
*/
|
| 657 |
+
function Transaction($tid) {
|
| 658 |
+
$this->allowedProperties = explode(",", preg_replace('/\s*/m', '', TRANSACTION_PROPERTIES));
|
| 659 |
+
$this->TID = $tid;
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
/**
|
| 663 |
+
* Get the property of the Transaction object
|
| 664 |
+
* @param string $property The name of the property, which is searched
|
| 665 |
+
* @return string|bool
|
| 666 |
+
*/
|
| 667 |
+
public function __get($property) {
|
| 668 |
+
if(!in_array($property, $this->allowedProperties))
|
| 669 |
+
die("The transaction's property " . $property . ", you want to get is not defined!");
|
| 670 |
+
|
| 671 |
+
if(isset($this->properties[$property]))
|
| 672 |
+
return $this->properties[$property];
|
| 673 |
+
else
|
| 674 |
+
return false;
|
| 675 |
+
}
|
| 676 |
+
|
| 677 |
+
/**
|
| 678 |
+
* Set the property of the Transaction object
|
| 679 |
+
* @param string $property The name of the property you want to set, see TRANSACTION_PROPERTIES
|
| 680 |
+
* @param mixed $value The value of the property you want to set
|
| 681 |
+
*/
|
| 682 |
+
public function __set($property, $value) {
|
| 683 |
+
if(!in_array($property, $this->allowedProperties))
|
| 684 |
+
die("The transaction's property " . $property . ", you want to set is not defined!");
|
| 685 |
+
$this->properties[$property] = $value;
|
| 686 |
+
}
|
| 687 |
+
|
| 688 |
+
/**
|
| 689 |
+
* Set all the allowed properties for this transaction
|
| 690 |
+
* @param array $args An array with the allowed properties
|
| 691 |
+
*/
|
| 692 |
+
protected function setProperties($args) {
|
| 693 |
+
$this->properties = $args;
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
/**
|
| 697 |
+
* Get all the allowed properties for this transaction
|
| 698 |
+
* @return array
|
| 699 |
+
*/
|
| 700 |
+
protected function getProperties() {
|
| 701 |
+
return $this->properties;
|
| 702 |
+
}
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
/**
|
| 706 |
+
* The abstract MPay24flexLINK class provides abstract functions, which are used from the other functions in order to create a flexLINK
|
| 707 |
+
*
|
| 708 |
+
* @author mPAY24 GmbH <support@mpay24.com>
|
| 709 |
+
* @version $Id: MPay24Shop.php 5522 2013-06-24 13:08:35Z anna $
|
| 710 |
+
* @filesource MPay24Shop.php
|
| 711 |
+
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 712 |
+
*/
|
| 713 |
+
abstract class MPay24flexLINK {
|
| 714 |
+
/**
|
| 715 |
+
* The mPAY24API Object, you are going to work with
|
| 716 |
+
* @var $mPay24Api
|
| 717 |
+
*/
|
| 718 |
+
var $mPay24Api = null;
|
| 719 |
+
|
| 720 |
+
/**
|
| 721 |
+
* The constructor, which sets all the initial values to be able making flexLINK transactions. In order to be able use this functionality, you should contact mPAY24 first.
|
| 722 |
+
* @param string $spid SPID, supported by mPAY24
|
| 723 |
+
* @param string $password The flexLINK password, supported by mPAY24
|
| 724 |
+
* @param bool $test TRUE - when you want to use the TEST system
|
| 725 |
+
*
|
| 726 |
+
* FALSE - when you want to use the LIVE system
|
| 727 |
+
* @param bool $debug TRUE - when you want to write log files
|
| 728 |
+
*
|
| 729 |
+
*/
|
| 730 |
+
function MPay24flexLINK($spid, $password, $test, $debug=false) {
|
| 731 |
+
if(!is_bool($test))
|
| 732 |
+
die("The test parameter '$test' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
| 733 |
+
|
| 734 |
+
if(!is_bool($debug))
|
| 735 |
+
die("The debug parameter '$debug' you have given is wrong, it must be boolean value 'true' or 'false'!");
|
| 736 |
+
|
| 737 |
+
$this->mPay24Api = new MPay24Api();
|
| 738 |
+
|
| 739 |
+
$this->mPay24Api->configureFlexLINK($spid, $password, $test);
|
| 740 |
+
$this->mPay24Api->setDebug($debug);
|
| 741 |
+
|
| 742 |
+
if (version_compare(phpversion(), '5.0.0', '<')===true || !in_array('mcrypt', get_loaded_extensions())) {
|
| 743 |
+
$this->mPay24Api->printMsg("ERROR: You don't meet the needed requirements for this example shop.<br>");
|
| 744 |
+
|
| 745 |
+
if(version_compare(phpversion(), '5.0.0', '<')===true)
|
| 746 |
+
$this->mPay24Api->printMsg("You need PHP version 5.0.0 or newer!<br>");
|
| 747 |
+
if(!in_array('mcrypt', get_loaded_extensions()))
|
| 748 |
+
$this->mPay24Api->printMsg("You need mcrypt extension!<br>");
|
| 749 |
+
$this->mPay24Api->dieWithMsg("Please load the required extensions!");
|
| 750 |
}
|
| 751 |
+
}
|
| 752 |
+
|
| 753 |
+
/**
|
| 754 |
+
* Encrypt the parameters you want to post to mPAY24 - see details
|
| 755 |
+
* @param string $invoice_id The invoice ID of the transaction
|
| 756 |
+
* @param string $amount The amount which should be invoiced in 12.34
|
| 757 |
+
* @param string $currency length = 3 (ISO currency code, e. g. "EUR")
|
| 758 |
+
* @param string $language length = 2 (ISO currency code, e. g. "DE")
|
| 759 |
+
* @param string $user_field A place hollder for free chosen user information
|
| 760 |
+
* @param string $description Description of the product, the invoice is for
|
| 761 |
+
* @param string $mode BillingAddress Mode (ReadWrite or ReadOnly)
|
| 762 |
+
* @param string $name Name of the customer
|
| 763 |
+
* @param string $street Billing address street
|
| 764 |
+
* @param string $street2 Billing address street2
|
| 765 |
+
* @param string $zip Billing address zip
|
| 766 |
+
* @param string $city Billing address city
|
| 767 |
+
* @param string $country Billing address country, length = 2 (ISO country code, e. g. "AT")
|
| 768 |
+
* @param string $email Billing address e-mail
|
| 769 |
+
* @param string $success Success-URL
|
| 770 |
+
* @param string $error Error-URL
|
| 771 |
+
* @param string $confirmation Confirmation-URL
|
| 772 |
+
* @param string $invoice_idVar Default = IID
|
| 773 |
+
* @param string $amountVar Default = AMO
|
| 774 |
+
* @param string $currencyVar Default = CUR
|
| 775 |
+
* @param string $languageVar Default = LAN
|
| 776 |
+
* @param string $user_fieldVar Default = USR
|
| 777 |
+
* @param string $descriptionVar Default = DES
|
| 778 |
+
* @param string $modeVar Default = MOD
|
| 779 |
+
* @param string $nameVar Default = NAM
|
| 780 |
+
* @param string $streetVar Default = ST1
|
| 781 |
+
* @param string $street2Var Default = ST2
|
| 782 |
+
* @param string $zipVar Default = ZIP
|
| 783 |
+
* @param string $cityVar Default = CIT
|
| 784 |
+
* @param string $countryVar Default = COU
|
| 785 |
+
* @param string $emailVar Default = EML
|
| 786 |
+
* @param string $successVar Default = SUC
|
| 787 |
+
* @param string $errorVar Default = ERR
|
| 788 |
+
* @param string $confirmationVar Default = CON
|
| 789 |
+
* @return string
|
| 790 |
+
*/
|
| 791 |
+
function getEncryptedParams(//parameter values
|
| 792 |
+
$invoice_id,
|
| 793 |
+
$amount,
|
| 794 |
+
$currency=NULL,
|
| 795 |
+
$language=NULL,
|
| 796 |
+
$user_field=NULL,
|
| 797 |
+
$description=NULL,
|
| 798 |
+
$mode=NULL,
|
| 799 |
+
$name=NULL,
|
| 800 |
+
$street=NULL,
|
| 801 |
+
$street2=NULL,
|
| 802 |
+
$zip=NULL,
|
| 803 |
+
$city=NULL,
|
| 804 |
+
$country=NULL,
|
| 805 |
+
$email=NULL,
|
| 806 |
+
$success=NULL,
|
| 807 |
+
$error=NULL,
|
| 808 |
+
$confirmation=NULL,
|
| 809 |
+
//parameters names
|
| 810 |
+
$invoice_idVar="IID",
|
| 811 |
+
$amountVar="AMO",
|
| 812 |
+
$currencyVar="CUR",
|
| 813 |
+
$languageVar="LAN",
|
| 814 |
+
$user_fieldVar="USR",
|
| 815 |
+
$descriptionVar="DES",
|
| 816 |
+
$modeVar="MOD",
|
| 817 |
+
$nameVar="NAM",
|
| 818 |
+
$streetVar="ST1",
|
| 819 |
+
$street2Var="ST2",
|
| 820 |
+
$zipVar="ZIP",
|
| 821 |
+
$cityVar="CIT",
|
| 822 |
+
$countryVar="COU",
|
| 823 |
+
$emailVar="EML",
|
| 824 |
+
$successVar="SUC",
|
| 825 |
+
$errorVar="ERR",
|
| 826 |
+
$confirmationVar="CON") {
|
| 827 |
+
if(!$this->mPay24Api)
|
| 828 |
+
die("You are not allowed to define a constructor in the child class of MPay24flexLINK!");
|
| 829 |
+
|
| 830 |
+
$params[$invoice_idVar] = $invoice_id;
|
| 831 |
+
$params[$amountVar] = $amount;
|
| 832 |
+
|
| 833 |
+
if($currency == NULL)
|
| 834 |
+
$currency = "EUR";
|
| 835 |
+
|
| 836 |
+
$params[$currencyVar] = $currency;
|
| 837 |
+
|
| 838 |
+
if($language == NULL)
|
| 839 |
+
$language = "DE";
|
| 840 |
+
|
| 841 |
+
$params[$languageVar] = $language;
|
| 842 |
+
$params[$user_fieldVar] = $user_field;
|
| 843 |
+
|
| 844 |
+
if($description == NULL)
|
| 845 |
+
$description = "Rechnungsnummer:";
|
| 846 |
+
|
| 847 |
+
$params[$descriptionVar] = $description;
|
| 848 |
+
|
| 849 |
+
if($mode == NULL)
|
| 850 |
+
$mode = "ReadWrite";
|
| 851 |
+
|
| 852 |
+
$params[$modeVar] = $mode;
|
| 853 |
+
|
| 854 |
+
$params[$nameVar] = $name;
|
| 855 |
+
$params[$streetVar] = $street;
|
| 856 |
+
$params[$street2Var] = $street2;
|
| 857 |
+
$params[$zipVar] = $zip;
|
| 858 |
+
$params[$cityVar] = $city;
|
| 859 |
+
|
| 860 |
+
if($country == NULL)
|
| 861 |
+
$country = "AT";
|
| 862 |
+
|
| 863 |
+
$params[$countryVar] = $country;
|
| 864 |
+
|
| 865 |
+
$params[$emailVar] = $email;
|
| 866 |
+
$params[$successVar] = $success;
|
| 867 |
+
$params[$errorVar] = $error;
|
| 868 |
+
$params[$confirmationVar] = $confirmation;
|
| 869 |
+
|
| 870 |
+
foreach($params as $key => $value)
|
| 871 |
+
if($this->mPay24Api->getDebug())
|
| 872 |
+
$this->write_flexLINK_log("flexLINK:\t\t\tParameters: $key = $value\n");
|
| 873 |
+
|
| 874 |
+
$parameters = $this->mPay24Api->flexLINK($params);
|
| 875 |
+
|
| 876 |
+
if($this->mPay24Api->getDebug())
|
| 877 |
+
$this->write_flexLINK_log("flexLINK:\t\t\tEncrypted parameters: $parameters\n");
|
| 878 |
+
|
| 879 |
+
return $parameters;
|
| 880 |
+
}
|
| 881 |
+
|
| 882 |
+
/**
|
| 883 |
+
* Get the whole URL (flexLINK) to the mPAY24 pay page, used to pay an invoice
|
| 884 |
+
* @param string $encryptedParams The encrypted parameters, returned by the function getEncryptedParams
|
| 885 |
+
* @return stringAn URL to pay
|
| 886 |
+
*/
|
| 887 |
+
public function getPayLink($encryptedParams) {
|
| 888 |
+
if($this->mPay24Api->getDebug())
|
| 889 |
+
$this->write_flexLINK_log("flexLINK:\t\t\tURL: https://".$this->mPay24Api->getFlexLINKSystem().".mpay24.com/app/bin/checkout/".$this->mPay24Api->getSPID()."/$encryptedParams\n");
|
| 890 |
+
|
| 891 |
+
return "https://".$this->mPay24Api->getFlexLINKSystem().".mpay24.com/app/bin/checkout/".$this->mPay24Api->getSPID()."/$encryptedParams";
|
| 892 |
+
}
|
| 893 |
+
|
| 894 |
+
/**
|
| 895 |
+
* Write a flexLINK log into a file, file system, data base
|
| 896 |
+
* @param string $info_to_log The information, which is to log: request, response, etc.
|
| 897 |
+
*/
|
| 898 |
+
abstract function write_flexLINK_log($info_to_log);
|
| 899 |
+
}
|
| 900 |
+
?>
|
app/code/community/Mpay24/Mpay24/Model/Api/logs/curllog.log
DELETED
|
File without changes
|
app/code/community/Mpay24/Mpay24/Model/Api/logs/mPAY24log.log
DELETED
|
File without changes
|
app/code/community/Mpay24/Mpay24/Model/Api/orderXML.php
CHANGED
|
@@ -1,219 +1,234 @@
|
|
| 1 |
<?php
|
| 2 |
-
/**
|
| 3 |
-
* @author support@mpay24.com
|
| 4 |
-
* @version $Id: orderXML.php 5217 2012-10-16 05:27:43Z anna $
|
| 5 |
-
* @filesource orderXML.php
|
| 6 |
-
* @license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1
|
| 7 |
-
*/
|
| 8 |
-
|
| 9 |
/**
|
| 10 |
-
*
|
|
|
|
| 11 |
*/
|
| 12 |
define ("MDXI_SCHEMA","https://www.mpay24.com/schemas/MDXI/v3.0/MDXI.xsd");
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
class ORDER {
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
/**
|
| 38 |
-
* @abstract Generic call-Method instead of numerous setter methods
|
| 39 |
-
* @param STRING The name of the method, which is called for the Item-Object
|
| 40 |
-
* @param ARRAY The arguments with them the method is called - minOccurance = 0, maxOccurance = 2:
|
| 41 |
-
*
|
| 42 |
-
* The first argument must be a positive integer (will be used as a index)
|
| 43 |
-
*
|
| 44 |
-
* The second argument is optional and would be used as value for the DOMNode
|
| 45 |
-
*/
|
| 46 |
-
public function __call($method, $args) {
|
| 47 |
-
if(substr($method, 0, 3) == "set" && $args[0] != '') {
|
| 48 |
-
$attributeName = substr($method, 3);
|
| 49 |
-
|
| 50 |
-
$value = $args[0];
|
| 51 |
-
|
| 52 |
-
if(preg_match('/[0-9]+,[0-9]+/', $value, $match))
|
| 53 |
-
$value = str_replace(',', '.', $match[0]);
|
| 54 |
-
|
| 55 |
-
if(preg_match('/[0-9]+.[0-9]+/', $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'))))
|
| 56 |
-
$value = number_format(floatval($match[0]), 2, '.', '');
|
| 57 |
-
|
| 58 |
-
$this->node->setAttribute($attributeName, $value);
|
| 59 |
-
} elseif($args[0] != '') {
|
| 60 |
-
if(sizeof($args)>2)
|
| 61 |
-
die("It is not allowed to set more than 2 arguments for the node '$method'!");
|
| 62 |
-
if(!is_int($args[0]) || $args[0] < 1)
|
| 63 |
-
die("The first argument for the node '$method' must be whole number, bigger than 0!");
|
| 64 |
-
|
| 65 |
-
$name = $method . '[' . $args[0] . ']';
|
| 66 |
-
|
| 67 |
-
$xpath = new DOMXPath($this->doc);
|
| 68 |
-
$qry = $xpath->query($name,$this->node);
|
| 69 |
-
|
| 70 |
-
if ($qry->length > 0)
|
| 71 |
-
return new ORDER($this->doc,$qry->item(0));
|
| 72 |
-
else {
|
| 73 |
-
if(array_key_exists(1, $args)) {
|
| 74 |
-
$value = $args[1];
|
| 75 |
-
|
| 76 |
-
if(preg_match('/[0-9]+,[0-9]+/', $value, $match))
|
| 77 |
-
$value = str_replace(',', '.', $match[0]);
|
| 78 |
-
|
| 79 |
-
if(preg_match('/[0-9]+.[0-9]+/', $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'))))
|
| 80 |
-
$value = number_format(floatval($match[0]), 2, '.', '');
|
| 81 |
-
|
| 82 |
-
$node = $this->doc->createElement($method, $value);
|
| 83 |
-
}
|
| 84 |
-
else
|
| 85 |
-
$node = $this->doc->createElement($method);
|
| 86 |
-
|
| 87 |
-
$node = $this->node->appendChild($node);
|
| 88 |
-
return new ORDER($this->doc,$node);
|
| 89 |
-
}
|
| 90 |
-
}
|
| 91 |
}
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
* @param STRING The name of the Node you want to set
|
| 114 |
-
* @param ANY The value of the Node you want to set
|
| 115 |
-
*/
|
| 116 |
-
public function __set($name, $value) {
|
| 117 |
-
$xpath = new DOMXPath($this->doc);
|
| 118 |
-
$qry = $xpath->query($name,$this->node);
|
| 119 |
-
|
| 120 |
-
$value = str_replace('&', '&', $value);
|
| 121 |
-
|
| 122 |
-
if(preg_match('/[0-9]+,[0-9]+/', $value, $match))
|
| 123 |
-
$value = str_replace(',', '.', $match[0]);
|
| 124 |
-
|
| 125 |
-
if(preg_match('/[0-9]+.[0-9]+/', $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'))))
|
| 126 |
-
$value = number_format(floatval($match[0]), 2, '.', '');
|
| 127 |
-
|
| 128 |
-
if(strpos($value, "<") || strpos($value, ">"))
|
| 129 |
-
$value = "<![CDATA[" . $this->xmlencode($value) . "]]>";
|
| 130 |
-
|
| 131 |
-
if ($qry->length > 0)
|
| 132 |
-
$qry->item(0)->nodeValue = $value;
|
| 133 |
-
else {
|
| 134 |
-
$node = $this->doc->createElement($name,$value);
|
| 135 |
-
$this->node = $this->node->appendChild($node);
|
| 136 |
-
}
|
| 137 |
-
}
|
| 138 |
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
* @return XML The created XML from the ORDER
|
| 142 |
-
*/
|
| 143 |
-
public function toXML() {
|
| 144 |
-
return $this->doc->saveXML();
|
| 145 |
-
}
|
| 146 |
|
| 147 |
-
|
| 148 |
-
* @abstract Validate the ORDER with the schema, defined in the constant MDXI_SCHEMA
|
| 149 |
-
* @uses CONSTANT MDXI_SCHEMA
|
| 150 |
-
* @return BOOLEAN TRUE if the validation was successful or FALSE
|
| 151 |
-
*/
|
| 152 |
-
public function validate() {
|
| 153 |
-
$mdxi = "/MDXI.xsd";
|
| 154 |
-
|
| 155 |
-
if($this->olderThanOneWeek(__DIR__ . $mdxi)){
|
| 156 |
-
set_time_limit(0);
|
| 157 |
-
ini_set('display_errors',true);
|
| 158 |
-
|
| 159 |
-
$fp = fopen (__DIR__ . '/MDXInew.xsd', 'w');
|
| 160 |
-
$ch = curl_init(MDXI_SCHEMA);
|
| 161 |
-
curl_setopt($ch, CURLOPT_FILE, $fp);
|
| 162 |
-
curl_setopt($ch, CURLOPT_HEADER, 0);
|
| 163 |
-
curl_setopt($ch, CURLOPT_CAINFO, __DIR__.'/cacert.pem');
|
| 164 |
-
$result = curl_exec($ch);
|
| 165 |
-
|
| 166 |
-
if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200 && file_exists(__DIR__ . '/MDXInew.xsd')) {
|
| 167 |
-
unlink(__DIR__ . $mdxi);
|
| 168 |
-
fclose($fp);
|
| 169 |
-
rename(__DIR__ . "/MDXInew.xsd", __DIR__ . $mdxi);
|
| 170 |
} else
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
| 174 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
}
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
}
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
return false;
|
| 214 |
-
|
|
|
|
| 215 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
}
|
| 217 |
}
|
|
|
|
| 218 |
}
|
| 219 |
?>
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
/**
|
| 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 5477 2013-06-18 13:00:17Z 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 |
+
* @var DOMDocument
|
| 20 |
+
*/
|
| 21 |
+
private $doc;
|
| 22 |
+
/**
|
| 23 |
+
* A DOMNode from the MDXI XML, or the whole MDXI XML, represented as DOMDocument
|
| 24 |
+
* @var DOMDocument|DOMNode
|
| 25 |
+
*/
|
| 26 |
+
private $node;
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Create a DOMDocument or a ORDER-Object with root $doc
|
| 30 |
+
* @param DOMNode $doc The root DOMNode of an XML tree
|
| 31 |
+
* @param DOMNode $node The child DOMNode
|
| 32 |
+
*/
|
| 33 |
+
public function ORDER($doc=null,$node=null) {
|
| 34 |
+
if ($doc)
|
| 35 |
+
$this->doc = $doc;
|
| 36 |
+
else {
|
| 37 |
+
$this->doc = new DOMDocument("1.0", "UTF-8");
|
| 38 |
+
$this->doc->formatOutput = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
+
if ($node)
|
| 42 |
+
$this->node = $node;
|
| 43 |
+
else
|
| 44 |
+
$this->node = $this->doc;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* Generic call-Method instead of numerous setter methods
|
| 49 |
+
* @param string $method The name of the method, which is called for the Item-Object
|
| 50 |
+
* @param array $args The arguments with them the method is called - minOccurance = 0, maxOccurance = 2:
|
| 51 |
+
* The first argument must be a positive integer (will be used as a index)
|
| 52 |
+
* The second argument is optional and would be used as value for the DOMNode
|
| 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('/[0-9]+,[0-9]+/', $value, $match))
|
| 61 |
+
$value = str_replace(',', '.', $match[0]);
|
| 62 |
+
|
| 63 |
+
if(preg_match('/[0-9]+.[0-9]+/', $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 |
+
$this->node->setAttribute($attributeName, $value);
|
| 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,$this->node);
|
| 77 |
+
|
| 78 |
+
if ($qry->length > 0)
|
| 79 |
+
return new ORDER($this->doc,$qry->item(0));
|
| 80 |
+
else {
|
| 81 |
+
if(array_key_exists(1, $args)) {
|
| 82 |
+
$value = $args[1];
|
| 83 |
|
| 84 |
+
if(preg_match('/[0-9]+,[0-9]+/', $value, $match))
|
| 85 |
+
$value = str_replace(',', '.', $match[0]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
+
if(preg_match('/[0-9]+.[0-9]+/', $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,$node);
|
| 97 |
}
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* Get the value of a ORDER-Variable
|
| 103 |
+
* @param string $name The name of the method, which is called for the Item-Object
|
| 104 |
+
* @return ORDER
|
| 105 |
+
*/
|
| 106 |
+
public function __get($name) {
|
| 107 |
+
$xpath = new DOMXPath($this->doc);
|
| 108 |
+
$qry = $xpath->query($name,$this->node);
|
| 109 |
+
|
| 110 |
+
if ($qry->length > 0)
|
| 111 |
+
return new ORDER($this->doc,$qry->item(0));
|
| 112 |
+
else {
|
| 113 |
+
$node = $this->doc->createElement($name);
|
| 114 |
+
$node = $this->node->appendChild($node);
|
| 115 |
+
return new ORDER($this->doc,$node);
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
/**
|
| 120 |
+
* Set the value of a ORDER-Variable
|
| 121 |
+
* @param string $name The name of the Node you want to set
|
| 122 |
+
* @param mixed $value The value of the Node you want to set
|
| 123 |
+
*/
|
| 124 |
+
public function __set($name, $value) {
|
| 125 |
+
$xpath = new DOMXPath($this->doc);
|
| 126 |
+
$qry = $xpath->query($name,$this->node);
|
| 127 |
+
|
| 128 |
+
$value = str_replace('&', '&', $value);
|
| 129 |
+
|
| 130 |
+
if(preg_match('/[0-9]+,[0-9]+/', $value, $match))
|
| 131 |
+
$value = str_replace(',', '.', $match[0]);
|
| 132 |
+
|
| 133 |
+
if(preg_match('/[0-9]+.[0-9]+/', $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 ($qry->length > 0)
|
| 140 |
+
$qry->item(0)->nodeValue = $value;
|
| 141 |
+
else {
|
| 142 |
+
$node = $this->doc->createElement($name,$value);
|
| 143 |
+
$this->node = $this->node->appendChild($node);
|
| 144 |
}
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* Create a XML-Object from the ORDER-Object and return it
|
| 149 |
+
* @return XML
|
| 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 |
+
* @return bool
|
| 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 (__DIR__ . '/MDXInew.xsd', 'w');
|
| 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 |
+
* @param string $txt A string to be encoded
|
| 189 |
+
* @return string
|
| 190 |
+
*/
|
| 191 |
+
private function xmlencode($txt) {
|
| 192 |
+
$txt = str_replace('<', '<', $txt);
|
| 193 |
+
$txt = str_replace('>', '>', $txt);
|
| 194 |
+
$txt = str_replace('&apos;', "'", $txt);
|
| 195 |
+
$txt = str_replace('&quot;', '"', $txt);
|
| 196 |
+
return $txt;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
/**
|
| 200 |
+
* Check whether the MDXI.xsd is older than one week
|
| 201 |
+
* @param string $filename The path to the file (MDXI.xsd)
|
| 202 |
+
* @return bool
|
| 203 |
+
*/
|
| 204 |
+
private function olderThanOneWeek($filename){
|
| 205 |
+
$year = date ("Y", filemtime($filename));
|
| 206 |
+
$month = date ("m", filemtime($filename));
|
| 207 |
+
$day = date ("d", filemtime($filename));
|
| 208 |
+
|
| 209 |
+
$tyear = date ("Y");
|
| 210 |
+
$tmonth = date ("m");
|
| 211 |
+
$tday = date ("d");
|
| 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;
|
| 230 |
}
|
| 231 |
}
|
| 232 |
+
}
|
| 233 |
}
|
| 234 |
?>
|
app/code/community/Mpay24/Mpay24/Model/Api/xmls/Example_MDXI.xml
CHANGED
|
@@ -10,16 +10,16 @@
|
|
| 10 |
<Payment Type="EPS" Brand="ERSTE"/>
|
| 11 |
</PaymentTypes>
|
| 12 |
<ShoppingCart>
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
</ShoppingCart>
|
| 24 |
<Price>25.99</Price>
|
| 25 |
<Currency>EUR</Currency>
|
| 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>
|
app/code/community/Mpay24/Mpay24/Model/Config.php
CHANGED
|
@@ -12,43 +12,44 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Config extends Mage_Payment_Model_Config {
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
foreach ($config as $code => $methodConfig) {
|
| 33 |
-
if (Mage::getStoreConfigFlag('payment/'.$code.'/active', $store)) {
|
| 34 |
-
$methods[$code] = $this->_getMethod($code, $methodConfig);
|
| 35 |
-
}
|
| 36 |
-
}
|
| 37 |
-
return $methods;
|
| 38 |
-
}
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Config extends Mage_Payment_Model_Config {
|
| 22 |
|
| 23 |
+
/**
|
| 24 |
+
* Retrieve active system payments
|
| 25 |
+
*
|
| 26 |
+
* @param mixed $store
|
| 27 |
+
* @return array
|
| 28 |
+
*/
|
| 29 |
+
public function getActiveMethods($store=null) {
|
| 30 |
+
$methods = array();
|
| 31 |
+
$config = Mage::getStoreConfig('mpay24', $store);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
foreach ($config as $code => $methodConfig)
|
| 34 |
+
if (Mage::getStoreConfigFlag('payment/'.$code.'/active', $store))
|
| 35 |
+
$methods[$code] = $this->_getMethod($code, $methodConfig);
|
| 36 |
+
|
| 37 |
+
return $methods;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* Retrieve all system payments
|
| 42 |
+
*
|
| 43 |
+
* @param mixed $store
|
| 44 |
+
* @return array
|
| 45 |
+
*/
|
| 46 |
+
public function getAllMethods($store=null) {
|
| 47 |
+
$methods = array();
|
| 48 |
+
$config = Mage::getStoreConfig('payment', $store);
|
| 49 |
+
|
| 50 |
+
foreach ($config as $code => $methodConfig)
|
| 51 |
+
$methods[$code] = $this->_getMethod($code, $methodConfig);
|
| 52 |
+
|
| 53 |
+
return $methods;
|
| 54 |
+
}
|
| 55 |
}
|
app/code/community/Mpay24/Mpay24/Model/Entity/Setup.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
}
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
class Mpay24_Mpay24_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup {
|
| 22 |
+
public function getDefaultEntities() {
|
| 23 |
+
return array(
|
| 24 |
+
'order_payment' => array(
|
| 25 |
+
'entity_model' => 'sales/order_payment',
|
| 26 |
+
'table'=>'sales/order_entity',
|
| 27 |
+
'attributes' => array(
|
| 28 |
+
'parent_id' => array(
|
| 29 |
+
'type'=>'static',
|
| 30 |
+
'backend'=>'sales_entity/order_attribute_backend_child'
|
| 31 |
+
),
|
| 32 |
+
'mpay_tid' => array(),
|
| 33 |
+
)
|
| 34 |
+
)
|
| 35 |
+
);
|
| 36 |
+
}
|
| 37 |
}
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/Model/Method/Abstract.php
CHANGED
|
@@ -12,75 +12,75 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
abstract class Mpay24_Mpay24_Model_Method_Abstract extends Mage_Payment_Model_Method_Abstract {
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
public function clearSession(){
|
| 33 |
-
$this->getSession()->set3DSUrl('');
|
| 34 |
-
$this->getSession()->setAdditionalInformation('mpay_tid', '');
|
| 35 |
-
}
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
$this->_checkout = Mage::getSingleton('checkout/session');
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
->loadByIncrementId($paymentInfo->getOrder()->getRealOrderId());
|
| 83 |
-
}
|
| 84 |
-
return $this->_order;
|
| 85 |
}
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
abstract class Mpay24_Mpay24_Model_Method_Abstract extends Mage_Payment_Model_Method_Abstract {
|
| 22 |
|
| 23 |
+
/**
|
| 24 |
+
* Get mpay24 session namespace
|
| 25 |
+
*
|
| 26 |
+
* @return Mpay24_Mpay24_Model_Session
|
| 27 |
+
*/
|
| 28 |
+
public function getSession() {
|
| 29 |
+
return Mage::getSingleton('mpay24/session');
|
| 30 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
public function clearSession(){
|
| 33 |
+
$this->getSession()->set3DSUrl('');
|
| 34 |
+
$this->getSession()->setAdditionalInformation('mpay_tid', '');
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
/**
|
| 38 |
+
* Get payment
|
| 39 |
+
*
|
| 40 |
+
* @return Mage_Sales_Model_Order
|
| 41 |
+
*/
|
| 42 |
+
public function getPayment() {
|
| 43 |
+
if (empty($this->_payment))
|
| 44 |
+
$this->_payment = $this->getCheckout()->getQuote()->getPayment();
|
| 45 |
+
|
| 46 |
+
return $this->_payment;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* Get quote
|
| 51 |
+
*
|
| 52 |
+
* @return Mage_Sales_Model_Order
|
| 53 |
+
*/
|
| 54 |
+
public function getQuote() {
|
| 55 |
+
if (empty($this->_quote))
|
| 56 |
+
$this->_quote = $this->getCheckout()->getQuote();
|
| 57 |
+
|
| 58 |
+
return $this->_quote;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
/**
|
| 62 |
+
* Get checkout
|
| 63 |
+
*
|
| 64 |
+
* @return Mage_Sales_Model_Order
|
| 65 |
+
*/
|
| 66 |
+
public function getCheckout() {
|
| 67 |
+
if (empty($this->_checkout))
|
| 68 |
$this->_checkout = Mage::getSingleton('checkout/session');
|
| 69 |
+
|
| 70 |
+
return $this->_checkout;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* Get order model
|
| 75 |
+
*
|
| 76 |
+
* @return Mage_Sales_Model_Order
|
| 77 |
+
*/
|
| 78 |
+
public function getOrder() {
|
| 79 |
+
if (!$this->_order) {
|
| 80 |
+
$paymentInfo = $this->getInfoInstance();
|
| 81 |
+
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($paymentInfo->getOrder()->getRealOrderId());
|
|
|
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
+
|
| 84 |
+
return $this->_order;
|
| 85 |
+
}
|
| 86 |
}
|
app/code/community/Mpay24/Mpay24/Model/Method/Selectpayment.php
CHANGED
|
@@ -12,56 +12,68 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
abstract class Mpay24_Mpay24_Model_Method_Selectpayment extends Mpay24_Mpay24_Model_Method_Abstract{
|
| 24 |
-
|
| 25 |
-
public function authorize(Varien_Object $payment, $amount) {
|
| 26 |
-
$ps = false;
|
| 27 |
-
$type = "";
|
| 28 |
-
$brand = "";
|
| 29 |
-
|
| 30 |
-
if(isset($_REQUEST['mpay24_ps']) && $_REQUEST['mpay24_ps'] != 'false') {
|
| 31 |
-
$ps = true;
|
| 32 |
-
$brand = substr($_REQUEST['mpay24_ps'], 10, strpos($_REQUEST['mpay24_ps'], "_", 10)-10);
|
| 33 |
-
$type = substr($_REQUEST['mpay24_ps'], strpos($_REQUEST['mpay24_ps'], "_", 10+strlen($brand))+1);
|
| 34 |
-
}
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
$payment->setAmount($amount);
|
| 41 |
-
|
| 42 |
-
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 43 |
-
$mPay24MagentoShop->setVariables($payment->getOrder(), $ps, $type, $brand);
|
| 44 |
-
$soapResult = $mPay24MagentoShop->pay();
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
$error = Mage::helper('mpay24')->__('Invalid amount for authorization.');
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
abstract class Mpay24_Mpay24_Model_Method_Selectpayment extends Mpay24_Mpay24_Model_Method_Abstract{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
public function authorize(Varien_Object $payment, $amount) {
|
| 26 |
+
$ps = false;
|
| 27 |
+
$type = "";
|
| 28 |
+
$brand = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
$payments = array();
|
| 31 |
+
$paymentsArray = unserialize(Mage::getStoreConfig('mpay24/mpay24/active_payments'));
|
| 32 |
+
|
| 33 |
+
foreach($paymentsArray as $id => $paymentType) {
|
| 34 |
+
if(strlen($id) == 1)
|
| 35 |
+
$id = "00$id";
|
| 36 |
+
elseif(strlen($id) == 2)
|
| 37 |
+
$id = "0$id";
|
| 38 |
+
|
| 39 |
+
$payments[$id] = $paymentType;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
if(isset($_REQUEST['mpay24_ps']) && $_REQUEST['mpay24_ps'] != 'false') {
|
| 43 |
+
$ps = true;
|
| 44 |
+
$brand = $payments[$_REQUEST['mpay24_ps']]['BRAND'];
|
| 45 |
+
$type = $payments[$_REQUEST['mpay24_ps']]['P_TYPE'];
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
$this->clearSession();
|
| 49 |
+
$error = false;
|
| 50 |
+
|
| 51 |
+
if($amount>0) {
|
| 52 |
+
$payment->setAmount($amount);
|
| 53 |
+
|
| 54 |
+
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 55 |
+
$mPay24MagentoShop->setVariables($payment->getOrder(), $ps, $type, $brand);
|
| 56 |
+
$soapResult = $mPay24MagentoShop->pay();
|
| 57 |
+
|
| 58 |
+
$payment->setTransactionId($payment->getOrder()->getIncrementId())->setIsTransactionClosed(0);
|
| 59 |
+
|
| 60 |
+
if($soapResult->getGeneralResponse()->getStatus() == "OK") {
|
| 61 |
+
$this->getPayment()->setAuth(true);
|
| 62 |
+
$this->getSession()->setUrl($soapResult->getLocation());
|
| 63 |
+
$payment->setAdditionalInformation('user_field', MPay24MagentoShop::MAGENTO_VERSION.substr($payment->getOrder()->getIncrementId(),0,100).'_'.date('Y-m-d'));
|
| 64 |
+
} else
|
| 65 |
+
$error = $soapResult->getGeneralResponse()->getReturnCode();
|
| 66 |
+
} else {
|
| 67 |
$error = Mage::helper('mpay24')->__('Invalid amount for authorization.');
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
if ($error !== false) {
|
| 71 |
+
Mage::log($error, 10);
|
| 72 |
+
Mage::throwException(Mage::helper('mpay24')->__('Please contact the merchant,')."\n".Mage::helper('mpay24')->__('this payment is not possible at the moment!'));
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
public function getOrderPlaceRedirectUrl() {
|
| 77 |
+
return ($this->getPayment()->getAuth()) ? Mage::getUrl('mpay24/payment/redirect',array('_secure' => true)) : false;
|
| 78 |
+
}
|
| 79 |
}
|
app/code/community/Mpay24/Mpay24/Model/Mpay24/Debug.php
CHANGED
|
@@ -12,14 +12,14 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Mpay24_Debug extends Mage_Core_Model_Abstract {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Mpay24_Debug extends Mage_Core_Model_Abstract {
|
| 22 |
+
protected function _construct() {
|
| 23 |
+
$this->_init('mpay24/mpay24_debug');
|
| 24 |
+
}
|
| 25 |
}
|
app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug.php
CHANGED
|
@@ -12,14 +12,14 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Mysql4_Mpay24_Debug extends Mage_Core_Model_Mysql4_Abstract {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Mysql4_Mpay24_Debug extends Mage_Core_Model_Mysql4_Abstract {
|
| 22 |
+
protected function _construct() {
|
| 23 |
+
$this->_init('mpay24/mpay24_debug', 'debug_id');
|
| 24 |
+
}
|
| 25 |
}
|
app/code/community/Mpay24/Mpay24/Model/Mysql4/Mpay24/Debug/Collection.php
CHANGED
|
@@ -12,14 +12,14 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Mysql4_Mpay24_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Mysql4_Mpay24_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 22 |
+
protected function _construct() {
|
| 23 |
+
$this->_init('mpay24/mpay24_debug');
|
| 24 |
+
}
|
| 25 |
}
|
app/code/community/Mpay24/Mpay24/Model/Mysql4/Setup.php
CHANGED
|
@@ -12,12 +12,10 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
class Mpay24_Mpay24_Model_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {
|
| 22 |
-
|
| 23 |
-
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
class Mpay24_Mpay24_Model_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {}
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Observer.php
CHANGED
|
@@ -12,68 +12,76 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 21 |
|
| 22 |
class Mpay24_Mpay24_Model_Observer extends Mage_Core_Model_Config_Data {
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 21 |
|
| 22 |
class Mpay24_Mpay24_Model_Observer extends Mage_Core_Model_Config_Data {
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Retrieve active system payments
|
| 26 |
+
*/
|
| 27 |
+
public function afterSave() {
|
| 28 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/payments_count", 0);
|
| 29 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/payments_error", "");
|
| 30 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/active_payments", "");
|
| 31 |
+
// Mage::getConfig()->saveConfig("mpay24/mpay24/active_payment_types", "");
|
| 32 |
+
|
| 33 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/old_merchantid') == "")
|
| 34 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24as/old_merchantid", Mage::getStoreConfig('mpay24/mpay24as/merchantid'));
|
| 35 |
+
|
| 36 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/old_merchantid') != Mage::getStoreConfig('mpay24/mpay24as/merchantid')) {
|
| 37 |
+
// Mage::getConfig()->saveConfig("mpay24/mpay24/payments_active", "true");
|
| 38 |
+
|
| 39 |
+
for($i=1; $i<=50; $i++)
|
| 40 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/ps_".$i, 1);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
Mage::getConfig()->reinit();
|
| 44 |
+
Mage::app()->reinitStores();
|
| 45 |
+
|
| 46 |
+
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 47 |
+
$result = $mPay24MagentoShop->getPaymentMethods();
|
| 48 |
+
|
| 49 |
+
if($result->getGeneralResponse()->getStatus() == 'OK') {
|
| 50 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/payments_count", $result->getAll());
|
| 51 |
+
|
| 52 |
+
$payments = array();
|
| 53 |
+
// $brands = array();
|
| 54 |
+
// $pMethIds = array();
|
| 55 |
+
// $types = "";
|
| 56 |
+
$i=0;
|
| 57 |
+
|
| 58 |
+
foreach($result->getBrands() as $brand) {
|
| 59 |
+
$payments[$result->getPMethID($i)]['P_TYPE'] = $result->getPType($i);
|
| 60 |
+
$payments[$result->getPMethID($i)]['BRAND'] = $result->getBrand($i);
|
| 61 |
+
$payments[$result->getPMethID($i)]['DESCR'] = $result->getDescription($i);
|
| 62 |
+
|
| 63 |
+
// array_push($brands, $brand . "=>" . $result->getDescription($i));
|
| 64 |
+
// array_push($pMethIds, $brand . "=>" . $result->getPMethID($i));
|
| 65 |
+
// $types .= $brand . "=>" . $result->getPType($i) . ", ";
|
| 66 |
+
$i++;
|
| 67 |
+
|
| 68 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/old_merchantid') != Mage::getStoreConfig('mpay24/mpay24as/merchantid'))
|
| 69 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/ps_".$i, 1);
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/active_payments", serialize($payments));
|
| 73 |
+
// Mage::getConfig()->saveConfig("mpay24/mpay24/active_payments", implode(", ", $brands));
|
| 74 |
+
// Mage::getConfig()->saveConfig("mpay24/mpay24/active_payment_ids", implode(", ", $pMethIds));
|
| 75 |
+
// Mage::getConfig()->saveConfig("mpay24/mpay24/active_payment_types", substr($types, 0, -2));
|
| 76 |
+
Mage::getConfig()->reinit();
|
| 77 |
+
Mage::app()->reinitStores();
|
| 78 |
+
} else {
|
| 79 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24/payments_error", $result->getGeneralResponse()->getReturnCode());
|
| 80 |
+
Mage::getConfig()->reinit();
|
| 81 |
+
Mage::app()->reinitStores();
|
| 82 |
}
|
| 83 |
+
|
| 84 |
+
if(Mage::getStoreConfig('mpay24/mpay24as/old_merchantid') != Mage::getStoreConfig('mpay24/mpay24as/merchantid'))
|
| 85 |
+
Mage::getConfig()->saveConfig("mpay24/mpay24as/old_merchantid", Mage::getStoreConfig('mpay24/mpay24as/merchantid'));
|
| 86 |
+
}
|
| 87 |
}
|
app/code/community/Mpay24/Mpay24/Model/Selectpayment.php
CHANGED
|
@@ -12,151 +12,155 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
-
class Mpay24_Mpay24_Model_Selectpayment extends Mpay24_Mpay24_Model_Method_Selectpayment {
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
}
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
| 82 |
}
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
}
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
if($status != "SUSPENDED" && $status != "PENDING" && $mPAY24Result->getGeneralResponse()->getStatus() != 'OK') {
|
| 124 |
-
Mage::log('The order was not canceled: ' . $mPAY24Result->getGeneralResponse()->getReturnCode(), 10);
|
| 125 |
-
Mage::throwException(Mage::helper('mpay24')->__("The order could not be canceled! For mor information see the log files!"));
|
| 126 |
-
return false;
|
| 127 |
-
}
|
| 128 |
-
}
|
| 129 |
-
|
| 130 |
-
parent::void($payment);
|
| 131 |
-
|
| 132 |
-
return $this;
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
/**
|
| 136 |
-
* @abstract Cancel a payment
|
| 137 |
-
*
|
| 138 |
-
* @param Varien_Object $invoicePayment
|
| 139 |
-
* @return Mpay24_Mpay24_Model_PaymentMethod
|
| 140 |
-
*/
|
| 141 |
-
public function cancel(Varien_Object $payment) {
|
| 142 |
-
$this->clearSession();
|
| 143 |
if(!$payment->getAdditionalInformation('cancelButton') && !$payment->getAdditionalInformation('error')) {
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
parent::cancel($payment);
|
| 158 |
-
|
| 159 |
return $this;
|
| 160 |
-
|
| 161 |
}
|
| 162 |
-
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
+
class Mpay24_Mpay24_Model_Selectpayment extends Mpay24_Mpay24_Model_Method_Selectpayment {
|
| 24 |
+
protected $_code = 'mpay24';
|
| 25 |
+
protected $_formBlockType = 'mpay24/form_selectpayment';
|
| 26 |
+
protected $_infoBlockType = 'mpay24/info_selectpayment';
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Availability options
|
| 30 |
+
*/
|
| 31 |
+
protected $_isGateway = true;
|
| 32 |
+
protected $_canOrder = true;
|
| 33 |
+
protected $_canAuthorize = true;
|
| 34 |
+
protected $_canCapture = true;
|
| 35 |
+
protected $_canCapturePartial = true;
|
| 36 |
+
protected $_canRefund = true;
|
| 37 |
+
protected $_canRefundInvoicePartial = true;
|
| 38 |
+
protected $_canVoid = true;
|
| 39 |
+
protected $_canUseInternal = true;
|
| 40 |
+
protected $_canUseCheckout = true;
|
| 41 |
+
|
| 42 |
+
public function validate() {
|
| 43 |
+
parent::validate();
|
| 44 |
+
return $this;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
public function authorize(Varien_Object $payment, $amount) {
|
| 48 |
+
parent::authorize($payment, $amount);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Capture payment
|
| 53 |
+
*
|
| 54 |
+
* @param Varien_Object $orderPayment The payment object, used for the capturing
|
| 55 |
+
* @param int $amount The amount, multiplied 100 (€ 1.00 => 100)
|
| 56 |
+
* @return bool|Mpay24_Mpay24_Model_PaymentMethod
|
| 57 |
+
*/
|
| 58 |
+
public function capture(Varien_Object $payment, $amount) {
|
| 59 |
+
if(!$payment->getAdditionalInformation('MIFClear') && Mage::getStoreConfig('payment/mpay24/paid_payment_action') != MPay24MagentoShop::PAYMENT_TYPE_SALE && !$payment->getAdditionalInformation('error')) {
|
| 60 |
+
$this->clearSession();
|
| 61 |
+
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 62 |
+
$mPAY24Result = $mPay24MagentoShop->clearAmount($payment->getOrder()->getIncrementId(),$amount*100);
|
| 63 |
+
|
| 64 |
+
if($mPAY24Result->getGeneralResponse()->getStatus() != 'OK') {
|
| 65 |
+
Mage::log('The order was not captured: ' . $mPAY24Result->getGeneralResponse()->getReturnCode(), 10);
|
| 66 |
+
Mage::throwException(Mage::helper('mpay24')->__("The order could not be captured! For mor information see the log files!"));
|
| 67 |
+
return false;
|
| 68 |
+
}
|
| 69 |
}
|
| 70 |
+
|
| 71 |
+
parent::capture($payment, $amount);
|
| 72 |
+
|
| 73 |
+
if($payment->getOrder()->getIsNotVirtual())
|
| 74 |
+
$s = Mage::getStoreConfig('payment/mpay24/paid_order_status');
|
| 75 |
+
else
|
| 76 |
+
$s = Mage_Sales_Model_Order::STATE_COMPLETE;
|
| 77 |
+
|
| 78 |
+
if($payment->getOrder()->getState() != $s)
|
| 79 |
+
$payment->getOrder()->addStatusToHistory($s, Mage::helper('mpay24')->__("Payment ") . Mage::helper('mpay24')->__("BILLED") .' [ ' . $payment->getOrder()->getBaseCurrencyCode() . " " .$payment->getOrder()->formatPriceTxt($amount).' ]', true)->save();
|
| 80 |
+
|
| 81 |
+
return $this;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* Refund money
|
| 86 |
+
*
|
| 87 |
+
* @param Varien_Object $orderPayment The payment object, used for the refunding
|
| 88 |
+
* @param int $amount The amount, multiplied 100 (€ 1.00 => 100)
|
| 89 |
+
* @return bool|Mpay24_Mpay24_Model_PaymentMethod
|
| 90 |
+
*/
|
| 91 |
+
public function refund(Varien_Object $payment, $amount) {
|
| 92 |
+
$this->clearSession();
|
| 93 |
+
|
| 94 |
+
if(!$payment->getAdditionalInformation('MIFCredit') && !$payment->getAdditionalInformation('error')) {
|
| 95 |
+
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 96 |
+
$mPAY24Result = $mPay24MagentoShop->creditAmount($payment->getOrder()->getIncrementId(),$amount*100);
|
| 97 |
+
|
| 98 |
+
if($mPAY24Result->getGeneralResponse()->getStatus() != 'OK') {
|
| 99 |
+
Mage::log('The order was not refunded: ' . $mPAY24Result->getGeneralResponse()->getReturnCode(), 10);
|
| 100 |
+
Mage::throwException(Mage::helper('mpay24')->__("The order could not be refunded! For mor information see the log files!"));
|
| 101 |
+
return false;
|
| 102 |
+
}
|
| 103 |
}
|
| 104 |
+
|
| 105 |
+
parent::refund($payment, $amount);
|
| 106 |
+
|
| 107 |
+
return $this;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/**
|
| 111 |
+
* Void a payment
|
| 112 |
+
*
|
| 113 |
+
* @param Varien_Object $orderPayment The payment object, used for the voiding
|
| 114 |
+
* @return bool|Mpay24_Mpay24_Model_PaymentMethod
|
| 115 |
+
*/
|
| 116 |
+
public function void(Varien_Object $payment) {
|
| 117 |
+
$this->clearSession();
|
| 118 |
+
|
| 119 |
+
if(!$payment->getAdditionalInformation('MIFReverse') && !$payment->getAdditionalInformation('error')) {
|
| 120 |
+
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 121 |
+
$status = $mPay24MagentoShop->updateStatusToCancel($payment->getOrder()->getIncrementId());
|
| 122 |
+
|
| 123 |
+
if($status != "SUSPENDED" && $status != "PENDING")
|
| 124 |
+
$mPAY24Result = $mPay24MagentoShop->cancelTransaction($payment->getOrder()->getIncrementId());
|
| 125 |
+
|
| 126 |
+
if($status != "SUSPENDED" && $status != "PENDING" && $mPAY24Result->getGeneralResponse()->getStatus() != 'OK') {
|
| 127 |
+
Mage::log('The order was not canceled: ' . $mPAY24Result->getGeneralResponse()->getReturnCode(), 10);
|
| 128 |
+
Mage::throwException(Mage::helper('mpay24')->__("The order could not be canceled! For mor information see the log files!"));
|
| 129 |
+
return false;
|
| 130 |
+
}
|
| 131 |
}
|
| 132 |
+
|
| 133 |
+
parent::void($payment);
|
| 134 |
+
|
| 135 |
+
return $this;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* Cancel a payment
|
| 140 |
+
*
|
| 141 |
+
* @param Varien_Object $orderPayment The payment object, used for the cancelation
|
| 142 |
+
* @return bool|Mpay24_Mpay24_Model_PaymentMethod
|
| 143 |
+
*/
|
| 144 |
+
public function cancel(Varien_Object $payment) {
|
| 145 |
+
$this->clearSession();
|
| 146 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
if(!$payment->getAdditionalInformation('cancelButton') && !$payment->getAdditionalInformation('error')) {
|
| 148 |
+
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 149 |
+
$status = $mPay24MagentoShop->updateStatusToCancel($payment->getOrder()->getIncrementId());
|
| 150 |
+
|
| 151 |
+
if($status != "SUSPENDED" && $status != "PENDING")
|
| 152 |
+
$mPAY24Result = $mPay24MagentoShop->cancelTransaction($payment->getOrder()->getIncrementId());
|
| 153 |
+
|
| 154 |
+
if($status != "SUSPENDED" && $status != "PENDING" && $mPAY24Result->getGeneralResponse()->getStatus() != 'OK') {
|
| 155 |
+
Mage::log('The order was not canceled: ' . $mPAY24Result->getGeneralResponse()->getReturnCode(), 10);
|
| 156 |
+
Mage::throwException(Mage::helper('mpay24')->__("The order could not be canceled! For mor information see the log files!"));
|
| 157 |
+
return false;
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
parent::cancel($payment);
|
| 162 |
+
|
| 163 |
return $this;
|
| 164 |
+
}
|
| 165 |
}
|
| 166 |
+
?>
|
app/code/community/Mpay24/Mpay24/Model/Session.php
CHANGED
|
@@ -12,14 +12,14 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Session extends Mage_Core_Model_Session_Abstract {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Session extends Mage_Core_Model_Session_Abstract {
|
| 22 |
+
public function __construct() {
|
| 23 |
+
$this->init('mpay24');
|
| 24 |
+
}
|
| 25 |
}
|
app/code/community/Mpay24/Mpay24/Model/Source/AllowedIPs.php
CHANGED
|
@@ -12,18 +12,18 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_AllowedIPs {
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_AllowedIPs {
|
| 21 |
+
public function toOptionArray() {
|
| 22 |
+
return array(
|
| 23 |
+
array('value' => '213.164.23.169', 'label' => Mage::helper('mpay24')->__('213.164.23.169')),
|
| 24 |
+
array('value' => '213.164.25.245', 'label' => Mage::helper('mpay24')->__('213.164.25.245')),
|
| 25 |
+
array('value' => '80.110.33.70', 'label' => Mage::helper('mpay24')->__('80.110.33.70')),
|
| 26 |
+
array('value' => '127.0.0.1', 'label' => Mage::helper('mpay24')->__('127.0.0.1'))
|
| 27 |
+
);
|
| 28 |
+
}
|
| 29 |
+
}
|
app/code/community/Mpay24/Mpay24/Model/Source/BillAddr.php
CHANGED
|
@@ -12,23 +12,23 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Source_BillAddr {
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_Source_BillAddr {
|
| 22 |
|
| 23 |
+
/**
|
| 24 |
+
* Options getter
|
| 25 |
+
*
|
| 26 |
+
* @return array
|
| 27 |
+
*/
|
| 28 |
+
public function toOptionArray() {
|
| 29 |
+
return array(
|
| 30 |
+
array('value' => 'ReadWrite', 'label'=>Mage::helper('adminhtml')->__('ReadWrite')),
|
| 31 |
+
array('value' => 'ReadOnly', 'label'=>Mage::helper('adminhtml')->__('ReadOnly')),
|
| 32 |
+
);
|
| 33 |
+
}
|
| 34 |
}
|
app/code/community/Mpay24/Mpay24/Model/Source/ClearingAction.php
CHANGED
|
@@ -12,19 +12,19 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
class Mpay24_Mpay24_Model_Source_ClearingAction {
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 22 |
|
| 23 |
class Mpay24_Mpay24_Model_Source_ClearingAction {
|
| 24 |
+
public function toOptionArray() {
|
| 25 |
+
return array(
|
| 26 |
+
array('value' => MPay24MagentoShop::PAYMENT_TYPE_AUTH, 'label' => Mage::helper('mpay24')->__('Authorization')),
|
| 27 |
+
array('value' => MPay24MagentoShop::PAYMENT_TYPE_SALE, 'label' => Mage::helper('mpay24')->__('Billing')),
|
| 28 |
+
);
|
| 29 |
+
}
|
| 30 |
}
|
app/code/community/Mpay24/Mpay24/Model/Source/FormTemplate.php
CHANGED
|
@@ -12,22 +12,22 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_FormTemplate {
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_FormTemplate {
|
| 21 |
|
| 22 |
+
/**
|
| 23 |
+
* Options getter
|
| 24 |
+
*
|
| 25 |
+
* @return array
|
| 26 |
+
*/
|
| 27 |
+
public function toOptionArray() {
|
| 28 |
+
return array(
|
| 29 |
+
array('value' => 'dropDown.phtml', 'label'=>'Drop-Down'),
|
| 30 |
+
array('value' => 'area.phtml', 'label'=>'Icons'),
|
| 31 |
+
);
|
| 32 |
+
}
|
| 33 |
}
|
app/code/community/Mpay24/Mpay24/Model/Source/PaidOrder.php
CHANGED
|
@@ -12,22 +12,22 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_PaidOrder {
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
public function toOptionArray() {
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
}
|
| 33 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_PaidOrder {
|
| 21 |
|
| 22 |
+
/**
|
| 23 |
+
* Options getter
|
| 24 |
+
*
|
| 25 |
+
* @return array
|
| 26 |
+
*/
|
| 27 |
public function toOptionArray() {
|
| 28 |
+
return array(
|
| 29 |
+
array('value' => Mage_Sales_Model_Order::STATE_PROCESSING, 'label'=>'Processing'),
|
| 30 |
+
array('value' => Mage_Sales_Model_Order::STATE_COMPLETE, 'label'=>'Complete'),
|
| 31 |
+
);
|
| 32 |
}
|
| 33 |
}
|
app/code/community/Mpay24/Mpay24/Model/Source/PaymentsActive.php
CHANGED
|
@@ -12,22 +12,22 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_PaymentsActive {
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_PaymentsActive {
|
| 21 |
|
| 22 |
+
/**
|
| 23 |
+
* Options getter
|
| 24 |
+
*
|
| 25 |
+
* @return array
|
| 26 |
+
*/
|
| 27 |
+
public function toOptionArray() {
|
| 28 |
+
return array(
|
| 29 |
+
array('value' => 'false', 'label'=>Mage::helper('mpay24')->__("Default mPAY24 configuration")),
|
| 30 |
+
array('value' => 'true', 'label'=>Mage::helper('mpay24')->__("Custom configuration"))
|
| 31 |
+
);
|
| 32 |
+
}
|
| 33 |
}
|
app/code/community/Mpay24/Mpay24/Model/Source/Request.php
CHANGED
|
@@ -12,12 +12,10 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
class Mpay24_Mpay24_Model_Source_Request extends Varien_Object {
|
| 22 |
-
|
| 23 |
-
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
class Mpay24_Mpay24_Model_Source_Request extends Varien_Object {}
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Source/Result.php
CHANGED
|
@@ -12,12 +12,10 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
class Mpay24_Mpay24_Model_Source_Result extends Varien_Object {
|
| 22 |
-
|
| 23 |
-
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
class Mpay24_Mpay24_Model_Source_Result extends Varien_Object {}
|
|
|
|
|
|
app/code/community/Mpay24/Mpay24/Model/Source/ShoppingCartRowsAction.php
CHANGED
|
@@ -12,21 +12,21 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_ShoppingCartRowsAction {
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_ShoppingCartRowsAction {
|
| 21 |
+
public function toOptionArray() {
|
| 22 |
+
return array(
|
| 23 |
+
array('value' => 'Number', 'label' => Mage::helper('mpay24')->__('Number')),
|
| 24 |
+
array('value' => 'ProductNr', 'label' => Mage::helper('mpay24')->__('ProductNr')),
|
| 25 |
+
array('value' => 'Description', 'label' => Mage::helper('mpay24')->__('Description')),
|
| 26 |
+
array('value' => 'Package', 'label' => Mage::helper('mpay24')->__('Package')),
|
| 27 |
+
array('value' => 'Quantity', 'label' => Mage::helper('mpay24')->__('Quantity')),
|
| 28 |
+
array('value' => 'ItemPrice', 'label' => Mage::helper('mpay24')->__('ItemPrice')),
|
| 29 |
+
array('value' => 'Price', 'label' => Mage::helper('mpay24')->__('Price'))
|
| 30 |
+
);
|
| 31 |
+
}
|
| 32 |
}
|
app/code/community/Mpay24/Mpay24/Model/Source/System.php
CHANGED
|
@@ -12,22 +12,22 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_System {
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
class Mpay24_Mpay24_Model_Source_System {
|
| 21 |
|
| 22 |
+
/**
|
| 23 |
+
* Options getter
|
| 24 |
+
*
|
| 25 |
+
* @return array
|
| 26 |
+
*/
|
| 27 |
+
public function toOptionArray() {
|
| 28 |
+
return array(
|
| 29 |
+
array('value' => true, 'label'=>Mage::helper('adminhtml')->__('Test')),
|
| 30 |
+
array('value' => false, 'label'=>Mage::helper('adminhtml')->__('Live')),
|
| 31 |
+
);
|
| 32 |
+
}
|
| 33 |
}
|
app/code/community/Mpay24/Mpay24/Model/System/Config/Backend/Encrypted.php
CHANGED
|
@@ -12,43 +12,41 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_System_Config_Backend_Encrypted extends Mage_Core_Model_Config_Data {
|
| 22 |
-
|
| 23 |
-
/**
|
| 24 |
-
* @abstract Decrypt value after loading
|
| 25 |
-
*
|
| 26 |
-
*/
|
| 27 |
-
protected function _afterLoad() {
|
| 28 |
-
$value = (string)$this->getValue();
|
| 29 |
-
if (!empty($value) && ($decrypted = Mage::helper('core')->decrypt($value))) {
|
| 30 |
-
$this->setValue($decrypted);
|
| 31 |
-
}
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
protected function _beforeSave() {
|
| 35 |
-
$value = (string)$this->getValue();
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_Model_System_Config_Backend_Encrypted extends Mage_Core_Model_Config_Data {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
/**
|
| 24 |
+
* Decrypt value after loading
|
| 25 |
+
*/
|
| 26 |
+
protected function _afterLoad() {
|
| 27 |
+
$value = (string)$this->getValue();
|
| 28 |
+
|
| 29 |
+
if (!empty($value) && ($decrypted = Mage::helper('core')->decrypt($value)))
|
| 30 |
+
$this->setValue($decrypted);
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
protected function _beforeSave() {
|
| 34 |
+
$value = (string)$this->getValue();
|
| 35 |
+
|
| 36 |
+
// don't change value, if an obscured value came
|
| 37 |
+
if (preg_match('/^\*+$/', $this->getValue()))
|
| 38 |
+
$value = $this->getOldValue();
|
| 39 |
+
|
| 40 |
+
if (!empty($value) && ($encrypted = Mage::helper('core')->encrypt($value)))
|
| 41 |
+
$this->setValue($encrypted);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
/**
|
| 45 |
+
* Get & decrypt old value from configuration
|
| 46 |
+
*
|
| 47 |
+
* @return string
|
| 48 |
+
*/
|
| 49 |
+
public function getOldValue() {
|
| 50 |
+
return Mage::helper('core')->decrypt(parent::getOldValue());
|
| 51 |
+
}
|
| 52 |
}
|
app/code/community/Mpay24/Mpay24/controllers/IndexController.php
CHANGED
|
@@ -12,14 +12,14 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_IndexController extends Mage_Core_Controller_Front_Action {
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
class Mpay24_Mpay24_IndexController extends Mage_Core_Controller_Front_Action {
|
| 22 |
+
public function indexAction() {
|
| 23 |
+
$this->_redirect('/');
|
| 24 |
+
}
|
| 25 |
}
|
app/code/community/Mpay24/Mpay24/controllers/PaymentController.php
CHANGED
|
@@ -12,588 +12,593 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 21 |
|
| 22 |
class Mpay24_Mpay24_PaymentController extends Mage_Core_Controller_Front_Action {
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
}
|
| 30 |
-
|
| 31 |
-
|
| 32 |
/**
|
| 33 |
-
*
|
| 34 |
*/
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
|
| 53 |
$order = Mage::getModel('sales/order');
|
| 54 |
$order->loadByIncrementId($result['TID']);
|
| 55 |
-
|
| 56 |
Mage::log('mPAY24 Extension: RESULT from confirmation action:'."\n");
|
| 57 |
Mage::log($result);
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
break;
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
$this->loadLayout();
|
| 77 |
-
$this->renderLayout();
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
/**
|
| 81 |
-
* @abstract Is called from mPAY24 as Success-URL. Send TRANSACTION-STATUS request to mPAY24
|
| 82 |
*/
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
*
|
| 93 |
*/
|
| 94 |
public function guestsuccessAction() {
|
| 95 |
-
|
| 96 |
-
|
| 97 |
Mage::log('success guest action called for order '.$order->getData('increment_id'));
|
| 98 |
$order->getPayment()->setAdditionalInformation('success', true)->save();
|
| 99 |
$this->getTransactionStatus($_REQUEST['TID']);
|
| 100 |
$this->_redirect('checkout/onepage/success/');
|
| 101 |
-
|
| 102 |
|
| 103 |
-
|
| 104 |
-
*
|
| 105 |
*/
|
| 106 |
public function errorAction() {
|
| 107 |
-
|
| 108 |
-
|
| 109 |
Mage::log('error action called for order '.$order->getData('increment_id'));
|
| 110 |
$order->getPayment()->setAdditionalInformation('error_text', utf8_encode($_REQUEST['ERROR']))->save();
|
| 111 |
$order->getPayment()->setAdditionalInformation('error', true)->save();
|
| 112 |
$this->getTransactionStatus($_REQUEST['TID']);
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
*/
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
public function getCheckout() {
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
public function getOrder($tid=null) {
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
if($tid == null)
|
| 148 |
-
|
| 149 |
else
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
*
|
| 155 |
-
* @param
|
| 156 |
-
* @param
|
| 157 |
-
* @return
|
| 158 |
*/
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
if($confirmation)
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
if($order->getPayment()) {
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
$res = "OK";
|
| 188 |
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
$apprCode = $mPAY24Result->getParam('APPR_CODE');
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
|
|
|
| 511 |
return $updateResult;
|
| 512 |
-
|
| 513 |
-
|
| 514 |
protected function _initTemplate($idFieldName = 'template_id') {
|
| 515 |
-
|
| 516 |
$this->_title($this->__('System'))->_title($this->__('Transactional Emails'));
|
| 517 |
|
| 518 |
$id = (int)$this->getRequest()->getParam($idFieldName);
|
| 519 |
$model = Mage::getModel('adminhtml/email_template');
|
| 520 |
|
| 521 |
-
|
| 522 |
-
|
| 523 |
|
| 524 |
if (!Mage::registry('email_template'))
|
| 525 |
-
|
| 526 |
|
| 527 |
-
|
| 528 |
-
|
| 529 |
|
| 530 |
return $model;
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
/**
|
| 573 |
-
*
|
| 574 |
*
|
| 575 |
-
* @param
|
| 576 |
-
* @param
|
| 577 |
*/
|
| 578 |
protected function _addChildTransaction($typeTarget, $typeParent = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH) {
|
| 579 |
-
|
| 580 |
-
|
| 581 |
$parentTransactionId = $this->getOrder()->getIncrementId();
|
| 582 |
-
|
| 583 |
if ($typeParent != Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH)
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
if ($parentTransaction) {
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
}
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
include_once "app/code/community/Mpay24/Mpay24/Model/Api/MPay24MagentoShop.php";
|
| 21 |
|
| 22 |
class Mpay24_Mpay24_PaymentController extends Mage_Core_Controller_Front_Action {
|
| 23 |
+
|
| 24 |
+
protected function _expireAjax() {
|
| 25 |
+
Mage::log('mPAY24 Extension: expireAjax called');
|
| 26 |
+
if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
|
| 27 |
+
$this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
|
| 28 |
+
exit;
|
| 29 |
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
/**
|
| 33 |
+
* Redirect to mPAY24 pay page
|
| 34 |
*/
|
| 35 |
+
public function redirectAction() {
|
| 36 |
+
Mage::log('mPAY24 Extension: redirect action called');
|
| 37 |
+
$order = $this->getOrder();
|
| 38 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('mpay24')->__("Redirected to mPAY24 pay page"));
|
| 39 |
+
$order->save();
|
| 40 |
+
$this->_redirectUrl(urldecode(Mage::getSingleton('mpay24/session')->getUrl()));
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* Is called from mPAY24 as Confirmation-URL. Send TRANSACTION-STATUS request to mPAY24
|
| 45 |
+
*/
|
| 46 |
+
public function confirmationAction() {
|
| 47 |
+
Mage::log('mPAY24 Extension: confirmation action called for order '.$_REQUEST['TID']);
|
| 48 |
+
|
| 49 |
+
$this->getResponse()->setBody("OK: " . MPay24MagentoShop::MAGENTO_VERSION . " - confirmation received");
|
| 50 |
+
|
| 51 |
+
$result = $this->getRequest()->getParams();
|
| 52 |
|
| 53 |
$order = Mage::getModel('sales/order');
|
| 54 |
$order->loadByIncrementId($result['TID']);
|
| 55 |
+
|
| 56 |
Mage::log('mPAY24 Extension: RESULT from confirmation action:'."\n");
|
| 57 |
Mage::log($result);
|
| 58 |
+
|
| 59 |
+
switch($result['OPERATION']) {
|
| 60 |
+
case 'CONFIRMATION':
|
| 61 |
+
$this->getTransactionStatus($result['TID'], true);
|
| 62 |
break;
|
| 63 |
+
default:
|
| 64 |
+
break;
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
public function indexAction() {
|
| 69 |
+
Mage::log('mPAY24 Extension: index action called');
|
| 70 |
+
$this->loadLayout();
|
| 71 |
+
$this->renderLayout();
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
public function paymentAction() {
|
| 75 |
+
Mage::log('mPAY24 Extension: payment action called');
|
| 76 |
+
$this->loadLayout();
|
| 77 |
+
$this->renderLayout();
|
| 78 |
}
|
| 79 |
|
| 80 |
+
/**
|
| 81 |
+
* Is called from mPAY24 as Success-URL. Send TRANSACTION-STATUS request to mPAY24
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
*/
|
| 83 |
+
public function successAction() {
|
| 84 |
+
Mage::log('mPAY24 Extension: success action called for order '.$_REQUEST['TID']);
|
| 85 |
+
$order = $this->getOrder($_REQUEST['TID']);
|
| 86 |
+
$order->getPayment()->setAdditionalInformation('success', true)->save();
|
| 87 |
+
$this->getTransactionStatus($_REQUEST['TID']);
|
| 88 |
+
$this->_redirect('sales/order/view/order_id/'.$order->getId().'/');
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/**
|
| 92 |
+
* Is called from mPAY24 as Success-URL for not registered customers. Send TRANSACTION-STATUS request to mPAY24
|
| 93 |
*/
|
| 94 |
public function guestsuccessAction() {
|
| 95 |
+
Mage::log('mPAY24 Extension: guest success action called for order '.$_REQUEST['TID']);
|
| 96 |
+
$order = $this->getOrder($_REQUEST['TID']);
|
| 97 |
Mage::log('success guest action called for order '.$order->getData('increment_id'));
|
| 98 |
$order->getPayment()->setAdditionalInformation('success', true)->save();
|
| 99 |
$this->getTransactionStatus($_REQUEST['TID']);
|
| 100 |
$this->_redirect('checkout/onepage/success/');
|
| 101 |
+
}
|
| 102 |
|
| 103 |
+
/**
|
| 104 |
+
* Is called from mPAY24 as Error-URL. Send TRANSACTION-STATUS request to mPAY24
|
| 105 |
*/
|
| 106 |
public function errorAction() {
|
| 107 |
+
Mage::log('mPAY24 Extension: error action called for order '.$_REQUEST['TID']);
|
| 108 |
+
$order = $this->getOrder($_REQUEST['TID']);
|
| 109 |
Mage::log('error action called for order '.$order->getData('increment_id'));
|
| 110 |
$order->getPayment()->setAdditionalInformation('error_text', utf8_encode($_REQUEST['ERROR']))->save();
|
| 111 |
$order->getPayment()->setAdditionalInformation('error', true)->save();
|
| 112 |
$this->getTransactionStatus($_REQUEST['TID']);
|
| 113 |
|
| 114 |
+
//@todo cancel an order only if the customer is back to the shop
|
| 115 |
+
if($order->canCancel() && $order->getState() != Mage_Sales_Model_Order::STATE_CANCELED && $order->getData('status') != Mage_Sales_Model_Order::STATE_CANCELED)
|
| 116 |
+
$order->cancel($order->getPayment())->save();
|
| 117 |
+
|
| 118 |
+
Mage::getSingleton('mpay24/session')->setParentRedirectUrl('sales/order/view/order_id/'.$order->getId().'/');
|
| 119 |
+
$this->getResponse()->setBody($this->getLayout()->createBlock("mpay24/parentRedirect")->toHtml());
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
/**
|
| 123 |
+
* Is called from mPAY24 as Cancel-URL. Send TRANSACTION-STATUS request to mPAY24
|
| 124 |
*/
|
| 125 |
+
public function cancelAction() {
|
| 126 |
+
Mage::log('mPAY24 Extension: cancel action called for order '.$_REQUEST['TID']);
|
| 127 |
+
$order = $this->getOrder($_REQUEST['TID']);
|
| 128 |
+
Mage::log('cancel action called for order '.$order->getData('increment_id'));
|
| 129 |
+
$order->getPayment()->setAdditionalInformation('cancelButton', true)->save();
|
| 130 |
+
|
| 131 |
+
$this->getTransactionStatus($_REQUEST['TID']);
|
| 132 |
+
|
| 133 |
+
Mage::getSingleton('mpay24/session')->setParentRedirectUrl('sales/order/view/order_id/'.$order->getId().'/');
|
| 134 |
+
$this->getResponse()->setBody($this->getLayout()->createBlock("mpay24/parentRedirect")->toHtml());
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
public function getCheckout() {
|
| 138 |
+
Mage::log('mPAY24 Extension: get checkout called');
|
| 139 |
+
return Mage::getSingleton('checkout/session');
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
/**
|
| 143 |
+
* Get the order for a tid
|
| 144 |
+
* @param string $tid The Order ID in the shop
|
| 145 |
+
* @return Mage_Sales_Model_Order
|
| 146 |
+
*/
|
| 147 |
public function getOrder($tid=null) {
|
| 148 |
+
Mage::log('mPAY24 Extension: get order called');
|
| 149 |
+
$order = Mage::getSingleton('sales/order');
|
| 150 |
+
|
| 151 |
if($tid == null)
|
| 152 |
+
return $order->loadByIncrementId($this->getCheckout()->getLastRealOrderId());
|
| 153 |
else
|
| 154 |
+
return $order->loadByIncrementId($tid);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
/**
|
| 158 |
+
* Synchronize the transaction status with mPAY24
|
| 159 |
+
* @param string $tid The Order ID in the shop
|
| 160 |
+
* @param bool $confirmation TRUE if the function is called as a result of a mPAY24 confirmation call
|
| 161 |
+
* @return string
|
| 162 |
*/
|
| 163 |
+
public function getTransactionStatus($tid=null, $confirmation=false) {
|
| 164 |
+
Mage::log('mPAY24 Extension: getTransactionStatus called for order '.$tid);
|
| 165 |
+
$auth_refund = array("CC", "CB", "MAESTRO", "PAYPAL", "ELV", "PB", "MPASS", "INVOICE", "HP", "SAFETYPAY");
|
| 166 |
+
$updateResult = "";
|
| 167 |
+
$order = $this->getOrder($tid);
|
| 168 |
+
|
| 169 |
+
$confirmationCalled = "Payment ";
|
| 170 |
+
|
| 171 |
if($confirmation)
|
| 172 |
+
$confirmationCalled = "Confirmation URL called: Payment ";
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
$incrementId = $order->getData('increment_id');
|
| 176 |
+
$tid = $order->getId();
|
| 177 |
+
|
| 178 |
if($order->getPayment()) {
|
| 179 |
+
if(!$confirmation || !in_array($this->getRequest()->getClientIp(), explode(',', Mage::getStoreConfig('mpay24/mpay24as/allowed_ips')))) {
|
| 180 |
+
$mPay24MagentoShop = MPay24MagentoShop::getMPay24Api();
|
| 181 |
+
$mPAY24Result = $mPay24MagentoShop->updateTransactionStatus($incrementId);
|
| 182 |
+
$res = $mPAY24Result->getGeneralResponse()->getStatus();
|
| 183 |
+
$status = $mPAY24Result->getParam('TSTATUS');
|
| 184 |
+
|
| 185 |
+
if($mPAY24Result->getGeneralResponse()->getStatus() != 'OK' || $mPAY24Result->getParam('APPR_CODE') == '')
|
| 186 |
+
$apprCode = 'N/A';
|
| 187 |
+
else
|
| 188 |
+
$apprCode = $mPAY24Result->getParam('APPR_CODE');
|
| 189 |
+
} else {
|
| 190 |
+
$mPAY24Result = new TransactionStatusResponse("");
|
| 191 |
$res = "OK";
|
| 192 |
|
| 193 |
+
foreach($this->getRequest()->getParams() as $key => $value)
|
| 194 |
+
$mPAY24Result->setParam($key, $value);
|
| 195 |
+
|
| 196 |
+
$status = $mPAY24Result->getParam('STATUS');
|
| 197 |
$apprCode = $mPAY24Result->getParam('APPR_CODE');
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
switch ($res) {
|
| 201 |
+
case "OK":
|
| 202 |
+
if($order->getPayment()->getAdditionalInformation('user_field') == $mPAY24Result->getParam('USER_FIELD')) {
|
| 203 |
+
$updateResult = "The transaction status was succesfully updated!";
|
| 204 |
+
|
| 205 |
+
$order->getPayment()->setAdditionalData($mPAY24Result->getParam("P_TYPE"))->save();
|
| 206 |
+
$order->getPayment()->setCcType($mPAY24Result->getParam("P_TYPE") . " => " . $mPAY24Result->getParam('BRAND'))->save();
|
| 207 |
+
$order->getPayment()->setAdditionalInformation('status', true)->save();
|
| 208 |
+
$updateResult .= "\n\nActual status: " . $mPAY24Result->getParam('STATUS ');
|
| 209 |
+
$updateResult .= "\nAmount: " . number_format($mPAY24Result->getParam('PRICE')/100, 2, '.', '') . " " . $mPAY24Result->getParam('CURRENCY');
|
| 210 |
+
$updateResult .= "\nMPAYTID: " . $mPAY24Result->getParam('MPAYTID');
|
| 211 |
+
$updateResult .= "\nAppr_code: " . $apprCode;
|
| 212 |
+
|
| 213 |
+
if($order->getIsNotVirtual())
|
| 214 |
+
$s = Mage::getStoreConfig('payment/mpay24/paid_order_status');
|
| 215 |
+
else
|
| 216 |
+
$s = Mage_Sales_Model_Order::STATE_COMPLETE;
|
| 217 |
+
|
| 218 |
+
switch($status) {
|
| 219 |
+
case 'RESERVED':
|
| 220 |
+
if($order->getId()){
|
| 221 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 222 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 223 |
+
$order->getPayment()->setAmountAuthorized($mPAY24Result->getParam('PRICE')/100)->save();
|
| 224 |
+
$order->getPayment()->setAdditionalInformation('error', false)->save();
|
| 225 |
+
$order->addStatusToHistory($s, Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("RESERVED") . ' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]');
|
| 226 |
+
$order->sendNewOrderEmail();
|
| 227 |
+
|
| 228 |
+
if($order->getInvoiceCollection()->count() == 0)
|
| 229 |
+
if(Mage::getStoreConfig('payment/mpay24/paid_payment_action') == MPay24MagentoShop::PAYMENT_TYPE_SALE)
|
| 230 |
+
$this->_createInvoice($order, true);
|
| 231 |
+
else
|
| 232 |
+
$this->_createInvoice($order);
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
$order->save();
|
| 236 |
+
break;
|
| 237 |
+
case 'BILLED':
|
| 238 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 239 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 240 |
+
|
| 241 |
+
if($order->getInvoiceCollection()->count() == 0) {
|
| 242 |
+
if(in_array($mPAY24Result->getParam('P_TYPE'), MPay24MagentoShop::getAllowedAuth())) {
|
| 243 |
+
$onlineCapture = false;
|
| 244 |
+
$mif = true;
|
| 245 |
+
} else {
|
| 246 |
+
$onlineCapture = true;
|
| 247 |
+
$mif = false;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
$order->getPayment()->setAmountCharged($mPAY24Result->getParam('PRICE')/100)->save();
|
| 251 |
+
$order->getPayment()->setAdditionalInformation('error', false)->save();
|
| 252 |
+
$order->sendOrderUpdateEmail();
|
| 253 |
+
|
| 254 |
+
if($order->getInvoiceCollection()->count() == 0) {
|
| 255 |
+
if($confirmation)
|
| 256 |
+
$this->_createInvoice($order, true, true, $onlineCapture);
|
| 257 |
+
else
|
| 258 |
+
$this->_createInvoice($order, true, $mif, $onlineCapture);
|
| 259 |
+
$order->save();
|
| 260 |
+
}
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
$order->addStatusToHistory($s, Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("BILLED") .' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]', true)->save();
|
| 264 |
+
|
| 265 |
+
$order->save();
|
| 266 |
+
break;
|
| 267 |
+
case 'CREDITED':
|
| 268 |
+
if ($order->getTotalOnlineRefunded() == 0.00) {
|
| 269 |
+
$creditmemo = Mage::getModel('sales/service_order', $order)
|
| 270 |
+
->prepareCreditmemo()
|
| 271 |
+
->setPaymentRefundDisallowed(true)
|
| 272 |
+
->setAutomaticallyCreated(true)
|
| 273 |
+
->register();
|
| 274 |
+
|
| 275 |
+
$creditmemo->addComment(Mage::helper('mpay24')->__("Credit memo has been created automatically through of MI/F crediting!"));
|
| 276 |
+
$creditmemo->save();
|
| 277 |
+
|
| 278 |
+
$order->getPayment()->refund($creditmemo)->save();
|
| 279 |
+
$order->sendOrderUpdateEmail();
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 283 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 284 |
+
|
| 285 |
+
$this->_addChildTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND,
|
| 286 |
+
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
| 287 |
+
|
| 288 |
+
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE, Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("CREDITED") . ' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]')->save();
|
| 289 |
+
$order->save();
|
| 290 |
+
|
| 291 |
+
break;
|
| 292 |
+
case 'SUSPENDED':
|
| 293 |
+
if($order->getId()) {
|
| 294 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 295 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 296 |
+
$order->getPayment()->setAdditionalInformation('error', false)->save();
|
| 297 |
+
$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("SUSPENDED") . ' [ '.$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]');
|
| 298 |
+
}
|
| 299 |
+
$order->save();
|
| 300 |
+
break;
|
| 301 |
+
case 'REVERSED':
|
| 302 |
+
if($order->getState() != Mage_Sales_Model_Order::STATE_CANCELED)
|
| 303 |
+
foreach ($order->getInvoiceCollection() as $orderInvoice) {
|
| 304 |
+
$order->getPayment()->setAdditionalInformation('MIFReverse', true)->save();
|
| 305 |
+
$order->getPayment()->void($orderInvoice)->save();
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 309 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 310 |
+
$order->sendOrderUpdateEmail();
|
| 311 |
+
$order->addStatusToHistory($order->getState(), Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("REVERSED") .' [ ' . $mPAY24Result->getParam('CURRENCY') . " " .$order->formatPriceTxt($mPAY24Result->getParam('PRICE')/100).' ]', true)->save();
|
| 312 |
+
$order->save();
|
| 313 |
+
break;
|
| 314 |
+
case 'ERROR':
|
| 315 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', $mPAY24Result->getParam('MPAYTID'))->save();
|
| 316 |
+
$order->getPayment()->setAdditionalInformation('appr_code', $apprCode)->save();
|
| 317 |
+
$order->getPayment()->setAdditionalInformation('error', true)->save();
|
| 318 |
+
|
| 319 |
+
//@todo cancel an order only if the customer is back to the shop
|
| 320 |
+
//if($order->canCancel() && $order->getState() != Mage_Sales_Model_Order::STATE_CANCELED && $order->getData('status') != Mage_Sales_Model_Order::STATE_CANCELED)
|
| 321 |
+
//$order->cancel($order->getPayment())->save();
|
| 322 |
+
|
| 323 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('mpay24')->__("$confirmationCalled") . Mage::helper('mpay24')->__("ERROR") . " " . $order->getPayment()->getAdditionalInformation('error_text'));
|
| 324 |
+
$order->save();
|
| 325 |
+
|
| 326 |
+
break;
|
| 327 |
+
default:
|
| 328 |
+
break;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
if(in_array($mPAY24Result->getParam('TSTATUS'), array("RESERVED", "BILLED", "CREDITED")) && Mage::getStoreConfig('mpay24/mpay24/billingAddressMode') == "ReadWrite") {
|
| 332 |
+
if(!$mPAY24Result->getParam('BILLING_ADDR') || $mPAY24Result->getParam('BILLING_ADDR') == '') {
|
| 333 |
+
$billingAddressMode = new Mage_Core_Model_Config();
|
| 334 |
+
$billingAddressMode->saveConfig('mpay24/mpay24/billingAddressMode', 'ReadOnly', 'default', "");
|
| 335 |
+
|
| 336 |
+
$request = $this->getRequest();
|
| 337 |
+
|
| 338 |
+
$template = $this->_initTemplate('id');
|
| 339 |
+
|
| 340 |
+
$template->setTemplateSubject(Mage::helper('mpay24')->__("ATTENTION!"))
|
| 341 |
+
->setTemplateCode('ADDR_MODE')
|
| 342 |
+
->setTemplateText('<table>
|
| 343 |
+
<thead>
|
| 344 |
+
<tr>
|
| 345 |
+
<th>'.Mage::helper('mpay24')->__("The billing address las not returned by mPAY24!").'</th>
|
| 346 |
+
</tr>
|
| 347 |
+
</thead>
|
| 348 |
+
<tbody>
|
| 349 |
+
<tr>
|
| 350 |
+
<td>
|
| 351 |
+
<p>
|
| 352 |
+
{{var reason}}
|
| 353 |
+
</p>
|
| 354 |
+
</td>
|
| 355 |
+
</tr>
|
| 356 |
+
</tbody>
|
| 357 |
+
</table>');
|
| 358 |
+
|
| 359 |
+
// The Id you just marked...
|
| 360 |
+
if (!$template->getId())
|
| 361 |
+
$template->setTemplateType(Mage_Core_Model_Email_Template::TYPE_HTML);
|
| 362 |
+
|
| 363 |
+
if($request->getParam('_change_type_flag')) {
|
| 364 |
+
$template->setTemplateType(Mage_Core_Model_Email_Template::TYPE_TEXT);
|
| 365 |
+
$template->setTemplateStyles('');
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
$template->save();
|
| 369 |
+
|
| 370 |
+
|
| 371 |
+
// Define the sender, here we query Magento default email (in the configuration)
|
| 372 |
+
// For customer support email, use : 'trans_email/ident_support/...'
|
| 373 |
+
$sender = Array('name' => Mage::getStoreConfig('trans_email/ident_general/name'),
|
| 374 |
+
'email' => Mage::getStoreConfig('trans_email/ident_general/email'));
|
| 375 |
+
|
| 376 |
+
// Set you store
|
| 377 |
+
// This information may be taken from the current logged in user
|
| 378 |
+
$store = Mage::app()->getStore();
|
| 379 |
+
|
| 380 |
+
// In this array, you set the variables you use in your template
|
| 381 |
+
$vars = Array(
|
| 382 |
+
'reason' => Mage::helper('mpay24')->__("ATTENTION! - It is possible that the billing address for the order ID '") .
|
| 383 |
+
$order->getIncrementId() . Mage::helper('mpay24')->__("was changed by the customer, but not in your shop! The billing address mode was set back to 'ReadOnly'! If you want to use the mode 'ReadWrite', the variable 'BILLING_ADDR' has to be activated for the 'TRANSACTIONSTATUS' request by mPAY24. Please contact (including your merchant ID '") . Mage::getStoreConfig('mpay24/mpay24as/merchantid')
|
| 384 |
+
. Mage::helper('mpay24')->__("') mPAY24 (support@mpay24.com)!"));
|
| 385 |
+
|
| 386 |
+
// You don't care about this...
|
| 387 |
+
$translate = Mage::getSingleton('core/translate');
|
| 388 |
+
|
| 389 |
+
// Send your email
|
| 390 |
+
Mage::getModel('core/email_template')->sendTransactional($template->getId(),
|
| 391 |
+
$sender,
|
| 392 |
+
Mage::getStoreConfig('trans_email/ident_general/email'),
|
| 393 |
+
Mage::getStoreConfig('trans_email/ident_general/name'),
|
| 394 |
+
$vars,
|
| 395 |
+
$store->getId());
|
| 396 |
+
|
| 397 |
+
// You don't care as well
|
| 398 |
+
$translate->setTranslateInline(true);
|
| 399 |
+
|
| 400 |
+
$template->delete();
|
| 401 |
+
} else {
|
| 402 |
+
$billingAddress = new DOMDocument();
|
| 403 |
+
$billingAddress->loadXML(trim($mPAY24Result->getParam('BILLING_ADDR')));
|
| 404 |
+
$billingAddress->saveXML();
|
| 405 |
+
|
| 406 |
+
$name = $billingAddress->getElementsByTagName("Name")->item(0)->nodeValue;
|
| 407 |
+
$street = $billingAddress->getElementsByTagName("Street")->item(0)->nodeValue;
|
| 408 |
+
$street2 = $billingAddress->getElementsByTagName("Street2")->item(0)->nodeValue;
|
| 409 |
+
$zip = $billingAddress->getElementsByTagName("Zip")->item(0)->nodeValue;
|
| 410 |
+
$city = $billingAddress->getElementsByTagName("City")->item(0)->nodeValue;
|
| 411 |
+
$countryCode = $billingAddress->getElementsByTagName("Country")->item(0)->getAttribute("code");
|
| 412 |
+
|
| 413 |
+
//Build billing address for customer, for checkout
|
| 414 |
+
if(strpos($name, " "))
|
| 415 |
+
$_billing_address = array (
|
| 416 |
+
'firstname' => substr($name, 0, strpos($name, " ")),
|
| 417 |
+
'lastname' => substr($name, strpos($name, " ")+1),
|
| 418 |
+
'street' => array (
|
| 419 |
+
'0' => $street,
|
| 420 |
+
'1' => $street2,
|
| 421 |
+
),
|
| 422 |
+
|
| 423 |
+
'city' => $city,
|
| 424 |
+
'postcode' => $zip,
|
| 425 |
+
'country_id' => $countryCode,
|
| 426 |
+
'prefix' => '',
|
| 427 |
+
'middlename' => '',
|
| 428 |
+
'suffix' => '',
|
| 429 |
+
'company' => '',
|
| 430 |
+
'region' => '',
|
| 431 |
+
'region_id' => '',
|
| 432 |
+
'telephone' => '',
|
| 433 |
+
'fax' => ''
|
| 434 |
+
);
|
| 435 |
+
else
|
| 436 |
+
$_billing_address = array (
|
| 437 |
+
'firstname' => $name,
|
| 438 |
+
'lastname' => '',
|
| 439 |
+
'street' => array (
|
| 440 |
+
'0' => $street,
|
| 441 |
+
'1' => $street2,
|
| 442 |
+
),
|
| 443 |
+
|
| 444 |
+
'city' => $city,
|
| 445 |
+
'postcode' => $zip,
|
| 446 |
+
'country_id' => $countryCode,
|
| 447 |
+
'prefix' => '',
|
| 448 |
+
'middlename' => '',
|
| 449 |
+
'suffix' => '',
|
| 450 |
+
'company' => '',
|
| 451 |
+
'region' => '',
|
| 452 |
+
'region_id' => '',
|
| 453 |
+
'telephone' => '',
|
| 454 |
+
'fax' => ''
|
| 455 |
+
);
|
| 456 |
+
|
| 457 |
+
if(Mage::helper('customer')->isLoggedIn()) {
|
| 458 |
+
$addressAlreadySaved = false;
|
| 459 |
+
|
| 460 |
+
foreach(Mage::getSingleton('customer/session')->getCustomer()->getAddressesCollection() as $a)
|
| 461 |
+
if($a->getFirstname() == substr($name, 0, strpos($name, " ")) && $a->getLastname() == substr($name, strpos($name, " ")+1)
|
| 462 |
+
&& $a->getStreet1() == $street && $a->getStreet2() == $street2 && $a->getCity() == $city
|
| 463 |
+
&& $a->getPostcode() == $zip && $a->getCountry() == $countryCode)
|
| 464 |
+
$addressAlreadySaved = true;
|
| 465 |
+
|
| 466 |
+
if(!$addressAlreadySaved) {
|
| 467 |
+
$billAddress = Mage::getModel('customer/address');
|
| 468 |
+
$billAddress->setData($_billing_address)
|
| 469 |
+
->setCustomerId(Mage::getSingleton('customer/session')->getCustomer()->getId())
|
| 470 |
+
->setIsDefaultBilling('0')
|
| 471 |
+
->setIsDefaultShipping('0')
|
| 472 |
+
->setSaveInAddressBook('1');
|
| 473 |
+
|
| 474 |
+
$billAddress->save();
|
| 475 |
+
}
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
// set Billing Address
|
| 479 |
+
$addressId = $order->getBillingAddress()->getId();
|
| 480 |
+
$address = Mage::getModel('sales/order_address')->load($addressId);
|
| 481 |
+
$address->addData($_billing_address);
|
| 482 |
+
$address->implodeStreetAddress()->save();Mage::log($_billing_address);
|
| 483 |
+
|
| 484 |
+
$order->setBillingAddress($address);
|
| 485 |
+
$order->save();
|
| 486 |
+
}
|
| 487 |
+
}
|
| 488 |
+
} else {
|
| 489 |
+
if($order->canCancel() && $order->getState() != Mage_Sales_Model_Order::STATE_CANCELED && $order->getData('status') != Mage_Sales_Model_Order::STATE_CANCELED)
|
| 490 |
+
$order->cancel($order->getPayment())->save();
|
| 491 |
+
|
| 492 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('mpay24')->__("The transaction was canceled by the customer"), true)->save();
|
| 493 |
+
$order->getPayment()->setAdditionalInformation('status', true)->save();
|
| 494 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', 'N/A')->save();
|
| 495 |
+
$order->getPayment()->setAdditionalInformation('appr_code', 'N/A')->save();
|
| 496 |
+
}
|
| 497 |
+
break;
|
| 498 |
+
case "ERROR":
|
| 499 |
+
if($mPAY24Result->getReturnCode() == 'NOT_FOUND' && $order->getPayment()->getAdditionalInformation('cancelButton'))
|
| 500 |
+
$updateResult = 'The order was canceled by the customer';
|
| 501 |
+
else
|
| 502 |
+
$updateResult = Mage::helper('mpay24')->__("The transaction was not found!");
|
| 503 |
+
|
| 504 |
+
// if($order->canCancel() && $order->getState() != Mage_Sales_Model_Order::STATE_CANCELED && $order->getData('status') != Mage_Sales_Model_Order::STATE_CANCELED)
|
| 505 |
+
// $order->cancel($order->getPayment())->save();
|
| 506 |
+
|
| 507 |
+
$order->addStatusToHistory($order->getStatus(), Mage::helper('mpay24')->__($updateResult), true)->save();
|
| 508 |
+
$order->getPayment()->setAdditionalInformation('status', true)->save();
|
| 509 |
+
$order->getPayment()->setAdditionalInformation('mpay_tid', 'N/A')->save();
|
| 510 |
+
$order->getPayment()->setAdditionalInformation('appr_code', 'N/A')->save();
|
| 511 |
+
break;
|
| 512 |
+
default:
|
| 513 |
+
break;
|
| 514 |
+
}
|
| 515 |
+
}
|
| 516 |
return $updateResult;
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
protected function _initTemplate($idFieldName = 'template_id') {
|
| 520 |
+
Mage::log('mPAY24 Extension: initTemplate called');
|
| 521 |
$this->_title($this->__('System'))->_title($this->__('Transactional Emails'));
|
| 522 |
|
| 523 |
$id = (int)$this->getRequest()->getParam($idFieldName);
|
| 524 |
$model = Mage::getModel('adminhtml/email_template');
|
| 525 |
|
| 526 |
+
if ($id)
|
| 527 |
+
$model->load($id);
|
| 528 |
|
| 529 |
if (!Mage::registry('email_template'))
|
| 530 |
+
Mage::register('email_template', $model);
|
| 531 |
|
| 532 |
+
if (!Mage::registry('current_email_template'))
|
| 533 |
+
Mage::register('current_email_template', $model);
|
| 534 |
|
| 535 |
return $model;
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
public function _createInvoice($order, $capture=false, $mif=false, $onlineCapture=true) {
|
| 539 |
+
Mage::log('mPAY24 Extension: create invoice called');
|
| 540 |
+
if ($order->canInvoice()) {
|
| 541 |
+
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
| 542 |
+
|
| 543 |
+
if (!$invoice->getTotalQty())
|
| 544 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
|
| 545 |
+
|
| 546 |
+
if($capture && $onlineCapture)
|
| 547 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
|
| 548 |
+
|
| 549 |
+
$invoice->register();
|
| 550 |
+
Mage::log("mPAY24 Extension: Invoice registered!");
|
| 551 |
+
|
| 552 |
+
Mage::getModel('core/resource_transaction')
|
| 553 |
+
->addObject($invoice)
|
| 554 |
+
->addObject($invoice->getOrder())
|
| 555 |
+
->save();
|
| 556 |
+
|
| 557 |
+
$order->save();
|
| 558 |
+
|
| 559 |
+
if($capture)
|
| 560 |
+
foreach ($order->getInvoiceCollection() as $orderInvoice)
|
| 561 |
+
if ($order->getTotalPaid() == 0.00) {
|
| 562 |
+
$orderInvoice->pay();
|
| 563 |
+
$orderInvoice->save();
|
| 564 |
+
|
| 565 |
+
if($mif)
|
| 566 |
+
$order->getPayment()->setAdditionalInformation('MIFClear', true)->save();
|
| 567 |
+
|
| 568 |
+
$order->getPayment()->capture($orderInvoice)->save();
|
| 569 |
+
}
|
| 570 |
+
|
| 571 |
+
$invoice->sendEmail(true, '');
|
| 572 |
+
return true;
|
| 573 |
+
} else
|
| 574 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));
|
| 575 |
+
}
|
| 576 |
+
|
| 577 |
/**
|
| 578 |
+
* Add transaction to payment with defined type
|
| 579 |
*
|
| 580 |
+
* @param string $typeTarget The type of the current transaction ('Authorization', 'Capture', 'Refund', etc)
|
| 581 |
+
* @param string $typeParent The type of the parent transaction ('Authorization', 'Capture', 'Refund', etc)
|
| 582 |
*/
|
| 583 |
protected function _addChildTransaction($typeTarget, $typeParent = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH) {
|
| 584 |
+
Mage::log('mPAY24 Extension: addChildTransaction called');
|
| 585 |
+
$payment = $this->getOrder()->getPayment();
|
| 586 |
$parentTransactionId = $this->getOrder()->getIncrementId();
|
| 587 |
+
|
| 588 |
if ($typeParent != Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH)
|
| 589 |
+
$parentTransactionId .= '-' . $typeParent;
|
| 590 |
+
else
|
| 591 |
+
$payment->setIsTransactionClosed(false);
|
| 592 |
+
|
| 593 |
+
$parentTransaction = $payment->getTransaction($parentTransactionId);
|
| 594 |
+
|
| 595 |
if ($parentTransaction) {
|
| 596 |
+
$payment->setParentTransactionId($parentTransactionId)
|
| 597 |
+
->setTransactionId($parentTransactionId . '-' . $typeTarget)
|
| 598 |
+
->addTransaction($typeTarget);
|
| 599 |
+
|
| 600 |
+
if ($this->getOrder()->getTotalDue() < .0001)
|
| 601 |
+
$parentTransaction->setIsClosed(true)->save();
|
| 602 |
+
}
|
| 603 |
+
}
|
| 604 |
+
}
|
app/code/community/Mpay24/Mpay24/etc/config.xml
CHANGED
|
@@ -1,243 +1,244 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
</
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
|
|
|
| 227 |
<show_free_products>0</show_free_products>
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
</config>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Mpay24_Mpay24>
|
| 5 |
+
<version>1.4.5</version>
|
| 6 |
+
</Mpay24_Mpay24>
|
| 7 |
+
</modules>
|
| 8 |
+
|
| 9 |
+
<global>
|
| 10 |
+
<events>
|
| 11 |
+
<controller_action_postdispatch_adminhtml_system_config_save>
|
| 12 |
+
<observers>
|
| 13 |
+
<mpay24>
|
| 14 |
+
<type>singleton</type>
|
| 15 |
+
<class>mpay24/observer</class>
|
| 16 |
+
<method>afterSave</method>
|
| 17 |
+
</mpay24>
|
| 18 |
+
</observers>
|
| 19 |
+
</controller_action_postdispatch_adminhtml_system_config_save>
|
| 20 |
+
</events>
|
| 21 |
+
|
| 22 |
+
<models>
|
| 23 |
+
<mpay24>
|
| 24 |
+
<class>Mpay24_Mpay24_Model</class>
|
| 25 |
+
<resourceModel>mpay24_mysql4</resourceModel>
|
| 26 |
+
</mpay24>
|
| 27 |
+
<mpay24_mysql4>
|
| 28 |
+
<class>Mpay24_Mpay24_Model_Mysql4</class>
|
| 29 |
+
<entities>
|
| 30 |
+
<mpay24_debug><table>mpay24_debug</table></mpay24_debug>
|
| 31 |
+
</entities>
|
| 32 |
+
</mpay24_mysql4>
|
| 33 |
+
<mpay24_entity>
|
| 34 |
+
<class>Mpay24_Mpay24_Model_Entity</class>
|
| 35 |
+
</mpay24_entity>
|
| 36 |
+
</models>
|
| 37 |
+
|
| 38 |
+
<blocks>
|
| 39 |
+
<mpay24>
|
| 40 |
+
<class>Mpay24_Mpay24_Block</class>
|
| 41 |
+
</mpay24>
|
| 42 |
+
</blocks>
|
| 43 |
+
|
| 44 |
+
<helpers>
|
| 45 |
+
<mpay24>
|
| 46 |
+
<class>Mpay24_Mpay24_Helper</class>
|
| 47 |
+
</mpay24>
|
| 48 |
+
</helpers>
|
| 49 |
+
|
| 50 |
+
<resources>
|
| 51 |
+
<mpay24_setup>
|
| 52 |
+
<setup>
|
| 53 |
+
<module>Mpay24_Mpay24</module>
|
| 54 |
+
<class>Mpay24_Mpay24_Model_Entity_Setup</class>
|
| 55 |
+
</setup>
|
| 56 |
+
<connection>
|
| 57 |
+
<use>core_setup</use>
|
| 58 |
+
</connection>
|
| 59 |
+
</mpay24_setup>
|
| 60 |
+
|
| 61 |
+
<mpay24_write>
|
| 62 |
+
<connection>
|
| 63 |
+
<use>core_write</use>
|
| 64 |
+
</connection>
|
| 65 |
+
</mpay24_write>
|
| 66 |
+
<mpay24_read>
|
| 67 |
+
<connection>
|
| 68 |
+
<use>core_read</use>
|
| 69 |
+
</connection>
|
| 70 |
+
</mpay24_read>
|
| 71 |
+
</resources>
|
| 72 |
+
|
| 73 |
+
<payment>
|
| 74 |
+
<groups>
|
| 75 |
+
<mpay24>mPAY24</mpay24>
|
| 76 |
+
</groups>
|
| 77 |
+
</payment>
|
| 78 |
+
</global>
|
| 79 |
+
|
| 80 |
+
<frontend>
|
| 81 |
+
<secure_url>
|
| 82 |
+
<mpay24_payment>/mpay24/payment</mpay24_payment>
|
| 83 |
+
</secure_url>
|
| 84 |
+
|
| 85 |
+
<routers>
|
| 86 |
+
<mpay24>
|
| 87 |
+
<use>standard</use>
|
| 88 |
+
<args>
|
| 89 |
+
<module>Mpay24_Mpay24</module>
|
| 90 |
+
<frontName>mpay24</frontName>
|
| 91 |
+
</args>
|
| 92 |
+
</mpay24>
|
| 93 |
+
</routers>
|
| 94 |
+
|
| 95 |
+
<layout>
|
| 96 |
+
<updates>
|
| 97 |
+
<mpay24>
|
| 98 |
+
<file>mpay24.xml</file>
|
| 99 |
+
</mpay24>
|
| 100 |
+
</updates>
|
| 101 |
+
</layout>
|
| 102 |
+
|
| 103 |
+
<translate>
|
| 104 |
+
<modules>
|
| 105 |
+
<Mpay24_Mpay24>
|
| 106 |
+
<files>
|
| 107 |
+
<default>Mpay24_Mpay24.csv</default>
|
| 108 |
+
</files>
|
| 109 |
+
</Mpay24_Mpay24>
|
| 110 |
+
</modules>
|
| 111 |
+
</translate>
|
| 112 |
+
</frontend>
|
| 113 |
+
|
| 114 |
+
<admin>
|
| 115 |
+
<routers>
|
| 116 |
+
<mpay24>
|
| 117 |
+
<use>admin</use>
|
| 118 |
+
<args>
|
| 119 |
+
<module>Mpay24_Mpay24</module>
|
| 120 |
+
<frontName>mpay24</frontName>
|
| 121 |
+
</args>
|
| 122 |
+
</mpay24>
|
| 123 |
+
</routers>
|
| 124 |
+
</admin>
|
| 125 |
+
|
| 126 |
+
<adminhtml>
|
| 127 |
+
<acl>
|
| 128 |
+
<resources>
|
| 129 |
+
<all>
|
| 130 |
+
<title>Allow Everything</title>
|
| 131 |
+
</all>
|
| 132 |
+
|
| 133 |
+
<admin>
|
| 134 |
+
<children>
|
| 135 |
+
<system>
|
| 136 |
+
<children>
|
| 137 |
+
<config>
|
| 138 |
+
<children>
|
| 139 |
+
<mpay24>
|
| 140 |
+
<title>mPAY24 API</title>
|
| 141 |
+
</mpay24>
|
| 142 |
+
</children>
|
| 143 |
+
</config>
|
| 144 |
+
</children>
|
| 145 |
+
</system>
|
| 146 |
+
</children>
|
| 147 |
+
</admin>
|
| 148 |
+
</resources>
|
| 149 |
+
</acl>
|
| 150 |
+
|
| 151 |
+
<translate>
|
| 152 |
+
<modules>
|
| 153 |
+
<Mpay24_Mpay24>
|
| 154 |
+
<files>
|
| 155 |
+
<default>Mpay24_Mpay24.csv</default>
|
| 156 |
+
</files>
|
| 157 |
+
</Mpay24_Mpay24>
|
| 158 |
+
</modules>
|
| 159 |
+
</translate>
|
| 160 |
+
</adminhtml>
|
| 161 |
+
|
| 162 |
+
<default>
|
| 163 |
+
<mpay24>
|
| 164 |
+
<mpay24as>
|
| 165 |
+
<active>1</active>
|
| 166 |
+
<title>mPAY24</title>
|
| 167 |
+
<system>Test</system>
|
| 168 |
+
<merchantid backend_model="adminhtml/system_config_backend_encrypted"/>
|
| 169 |
+
<old_merchantid />
|
| 170 |
+
<soap_pass backend_model="adminhtml/system_config_backend_encrypted"/>
|
| 171 |
+
<debug>1</debug>
|
| 172 |
+
<use_proxy>0</use_proxy>
|
| 173 |
+
<allowed_ips>213.164.23.169,213.164.25.245,127.0.0.1</allowed_ips>
|
| 174 |
+
</mpay24as>
|
| 175 |
+
<mpay24sporder>
|
| 176 |
+
<style>margin-left: auto; margin-right: auto; width: 600px;</style>
|
| 177 |
+
<logostyle></logostyle>
|
| 178 |
+
<pageheaderstyle></pageheaderstyle>
|
| 179 |
+
<pagecaptionstyle></pagecaptionstyle>
|
| 180 |
+
<pagestyle></pagestyle>
|
| 181 |
+
<inputfieldsstyle></inputfieldsstyle>
|
| 182 |
+
<dropdownlistsstyle></dropdownlistsstyle>
|
| 183 |
+
<buttonsstyle></buttonsstyle>
|
| 184 |
+
<errorsstyle></errorsstyle>
|
| 185 |
+
<successtitlestyle></successtitlestyle>
|
| 186 |
+
<errortitlestyle></errortitlestyle>
|
| 187 |
+
<footerstyle></footerstyle>
|
| 188 |
+
</mpay24sporder>
|
| 189 |
+
<mpay24spsc>
|
| 190 |
+
<sc_row>Number,ProductNr,Description,Package,Quantity,ItemPrice,Price</sc_row>
|
| 191 |
+
<sc_style></sc_style>
|
| 192 |
+
<sc_header></sc_header>
|
| 193 |
+
<sc_headerstyle></sc_headerstyle>
|
| 194 |
+
<sc_captionstyle></sc_captionstyle>
|
| 195 |
+
<sc_numberheader></sc_numberheader>
|
| 196 |
+
<sc_numberstyle></sc_numberstyle>
|
| 197 |
+
<sc_productnrheader></sc_productnrheader>
|
| 198 |
+
<sc_productnrstyle></sc_productnrstyle>
|
| 199 |
+
<sc_descriptionheader></sc_descriptionheader>
|
| 200 |
+
<sc_descriptionstyle></sc_descriptionstyle>
|
| 201 |
+
<sc_packageheader></sc_packageheader>
|
| 202 |
+
<sc_packagestyle></sc_packagestyle>
|
| 203 |
+
<sc_quantityheader></sc_quantityheader>
|
| 204 |
+
<sc_quantitystyle></sc_quantitystyle>
|
| 205 |
+
<sc_itempriceheader></sc_itempriceheader>
|
| 206 |
+
<sc_mpay24itempricestyle></sc_mpay24itempricestyle>
|
| 207 |
+
<sc_priceheader></sc_priceheader>
|
| 208 |
+
<sc_pricestyle></sc_pricestyle>
|
| 209 |
+
<description></description>
|
| 210 |
+
<item_style1></item_style1>
|
| 211 |
+
<item_style2></item_style2>
|
| 212 |
+
<discount_headerstyle></discount_headerstyle>
|
| 213 |
+
<discount_style></discount_style>
|
| 214 |
+
<shipping_costs_headerstyle></shipping_costs_headerstyle>
|
| 215 |
+
<shipping_costs_style></shipping_costs_style>
|
| 216 |
+
<tax_headerstyle></tax_headerstyle>
|
| 217 |
+
<tax_style></tax_style>
|
| 218 |
+
<price_header></price_header>
|
| 219 |
+
<price_headerstyle></price_headerstyle>
|
| 220 |
+
<price_style></price_style>
|
| 221 |
+
<subtotal_header></subtotal_header>
|
| 222 |
+
<subtotal_headerstyle></subtotal_headerstyle>
|
| 223 |
+
<subtotal_style></subtotal_style>
|
| 224 |
+
</mpay24spsc>
|
| 225 |
+
<mpay24>
|
| 226 |
+
<payments_active>false</payments_active>
|
| 227 |
+
<billingAddressMode>ReadOnly</billingAddressMode>
|
| 228 |
<show_free_products>0</show_free_products>
|
| 229 |
+
</mpay24>
|
| 230 |
+
</mpay24>
|
| 231 |
+
<payment>
|
| 232 |
+
<mpay24>
|
| 233 |
+
<model>mpay24/selectpayment</model>
|
| 234 |
+
<active_payments></active_payments>
|
| 235 |
+
<active_payment_types></active_payment_types>
|
| 236 |
+
<payments_count>0</payments_count>
|
| 237 |
+
<payments_error></payments_error>
|
| 238 |
+
<payment_action>authorize</payment_action>
|
| 239 |
+
<paid_order_status>processing</paid_order_status>
|
| 240 |
+
<group>mpay24</group>
|
| 241 |
+
</mpay24>
|
| 242 |
+
</payment>
|
| 243 |
+
</default>
|
| 244 |
</config>
|
app/code/community/Mpay24/Mpay24/etc/system.xml
CHANGED
|
@@ -2,523 +2,524 @@
|
|
| 2 |
<config>
|
| 3 |
<sections>
|
| 4 |
<mpay24 translate="label" module="mpay24">
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
<sort_order>3</sort_order>
|
| 68 |
-
</old_merchantid>
|
| 69 |
-
<soap_pass translate="label">
|
| 70 |
-
<label>SOAP password</label>
|
| 71 |
-
<frontend_type>password</frontend_type>
|
| 72 |
-
<backend_model>mpay24/system_config_backend_encrypted</backend_model>
|
| 73 |
-
<sort_order>4</sort_order>
|
| 74 |
-
<show_in_default>1</show_in_default>
|
| 75 |
-
<show_in_website>1</show_in_website>
|
| 76 |
-
<show_in_store>1</show_in_store>
|
| 77 |
-
<depends><active>1</active></depends>
|
| 78 |
-
<comment>The SOAP password provided by mPAY24</comment>
|
| 79 |
-
</soap_pass>
|
| 80 |
-
<debug>
|
| 81 |
-
<label>Debug</label>
|
| 82 |
-
<frontend_type>select</frontend_type>
|
| 83 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 84 |
-
<sort_order>5</sort_order>
|
| 85 |
-
<show_in_default>1</show_in_default>
|
| 86 |
-
<show_in_website>1</show_in_website>
|
| 87 |
-
<show_in_store>1</show_in_store>
|
| 88 |
-
<depends><active>1</active></depends>
|
| 89 |
-
</debug>
|
| 90 |
-
<use_proxy translate="label">
|
| 91 |
-
<label>API uses proxy</label>
|
| 92 |
-
<frontend_type>select</frontend_type>
|
| 93 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 94 |
-
<sort_order>7</sort_order>
|
| 95 |
-
<show_in_default>1</show_in_default>
|
| 96 |
-
<show_in_website>1</show_in_website>
|
| 97 |
-
<show_in_store>1</show_in_store>
|
| 98 |
-
<depends><active>1</active></depends>
|
| 99 |
-
</use_proxy>
|
| 100 |
-
<proxy_host translate="label">
|
| 101 |
-
<label>Proxy Host</label>
|
| 102 |
-
<frontend_type>text</frontend_type>
|
| 103 |
-
<sort_order>8</sort_order>
|
| 104 |
-
<show_in_default>1</show_in_default>
|
| 105 |
-
<show_in_website>1</show_in_website>
|
| 106 |
-
<show_in_store>1</show_in_store>
|
| 107 |
-
<depends><use_proxy>1</use_proxy></depends>
|
| 108 |
-
</proxy_host>
|
| 109 |
-
<proxy_port translate="label">
|
| 110 |
-
<label>Proxy Port</label>
|
| 111 |
-
<frontend_type>text</frontend_type>
|
| 112 |
-
<sort_order>9</sort_order>
|
| 113 |
-
<show_in_default>1</show_in_default>
|
| 114 |
-
<show_in_website>1</show_in_website>
|
| 115 |
-
<show_in_store>1</show_in_store>
|
| 116 |
-
<depends><use_proxy>1</use_proxy></depends>
|
| 117 |
-
</proxy_port>
|
| 118 |
-
<allowed_ips translate="label">
|
| 119 |
-
<label>Allowed IPs for the Confirmation</label>
|
| 120 |
-
<frontend_type>multiselect</frontend_type>
|
| 121 |
-
<sort_order>10</sort_order>
|
| 122 |
-
<source_model>mpay24/source_allowedIPs</source_model>
|
| 123 |
-
<show_in_default>1</show_in_default>
|
| 124 |
-
<show_in_website>1</show_in_website>
|
| 125 |
-
<show_in_store>1</show_in_store>
|
| 126 |
-
</allowed_ips>
|
| 127 |
-
</fields>
|
| 128 |
-
</mpay24as>
|
| 129 |
-
|
| 130 |
-
<!-- <mpay24sporder>
|
| 131 |
-
<label>mPAY24 Selectpayment Order Design</label>
|
| 132 |
-
<frontend_type>text</frontend_type>
|
| 133 |
-
<sort_order>2</sort_order>
|
| 134 |
-
<expanded>0</expanded>
|
| 135 |
-
<show_in_default>1</show_in_default>
|
| 136 |
-
<show_in_website>1</show_in_website>
|
| 137 |
-
<show_in_store>1</show_in_store>
|
| 138 |
-
<fields>
|
| 139 |
-
<style translate="label">
|
| 140 |
-
<label>Style</label>
|
| 141 |
-
<frontend_type>text</frontend_type>
|
| 142 |
-
<sort_order>101</sort_order>
|
| 143 |
-
<show_in_default>1</show_in_default>
|
| 144 |
-
<show_in_website>1</show_in_website>
|
| 145 |
-
<show_in_store>0</show_in_store>
|
| 146 |
-
</style>
|
| 147 |
-
<logostyle translate="label">
|
| 148 |
-
<label>LogoStyle</label>
|
| 149 |
-
<frontend_type>text</frontend_type>
|
| 150 |
-
<sort_order>102</sort_order>
|
| 151 |
-
<show_in_default>1</show_in_default>
|
| 152 |
-
<show_in_website>1</show_in_website>
|
| 153 |
-
<show_in_store>0</show_in_store>
|
| 154 |
-
</logostyle>
|
| 155 |
-
<pageheaderstyle translate="label">
|
| 156 |
-
<label>PageHeaderStyle</label>
|
| 157 |
-
<frontend_type>text</frontend_type>
|
| 158 |
-
<sort_order>103</sort_order>
|
| 159 |
-
<show_in_default>1</show_in_default>
|
| 160 |
-
<show_in_website>1</show_in_website>
|
| 161 |
-
<show_in_store>0</show_in_store>
|
| 162 |
-
</pageheaderstyle>
|
| 163 |
-
<pagecaptionstyle translate="label">
|
| 164 |
-
<label>PageCaptionStyle</label>
|
| 165 |
-
<frontend_type>text</frontend_type>
|
| 166 |
-
<sort_order>104</sort_order>
|
| 167 |
-
<show_in_default>1</show_in_default>
|
| 168 |
-
<show_in_website>1</show_in_website>
|
| 169 |
-
<show_in_store>0</show_in_store>
|
| 170 |
-
</pagecaptionstyle>
|
| 171 |
-
<pagestyle translate="label">
|
| 172 |
-
<label>PageStyle</label>
|
| 173 |
-
<frontend_type>text</frontend_type>
|
| 174 |
-
<sort_order>105</sort_order>
|
| 175 |
-
<show_in_default>1</show_in_default>
|
| 176 |
-
<show_in_website>1</show_in_website>
|
| 177 |
-
<show_in_store>0</show_in_store>
|
| 178 |
-
</pagestyle>
|
| 179 |
-
<inputfieldsstyle translate="label">
|
| 180 |
-
<label>InputFieldsStyle</label>
|
| 181 |
-
<frontend_type>text</frontend_type>
|
| 182 |
-
<sort_order>106</sort_order>
|
| 183 |
-
<show_in_default>1</show_in_default>
|
| 184 |
-
<show_in_website>1</show_in_website>
|
| 185 |
-
<show_in_store>0</show_in_store>
|
| 186 |
-
</inputfieldsstyle>
|
| 187 |
-
<dropdownlistsstyle translate="label">
|
| 188 |
-
<label>DropDownListsStyle</label>
|
| 189 |
-
<frontend_type>text</frontend_type>
|
| 190 |
-
<sort_order>107</sort_order>
|
| 191 |
-
<show_in_default>1</show_in_default>
|
| 192 |
-
<show_in_website>1</show_in_website>
|
| 193 |
-
<show_in_store>0</show_in_store>
|
| 194 |
-
</dropdownlistsstyle>
|
| 195 |
-
<buttonsstyle translate="label">
|
| 196 |
-
<label>ButtonsStyle</label>
|
| 197 |
-
<frontend_type>text</frontend_type>
|
| 198 |
-
<sort_order>108</sort_order>
|
| 199 |
-
<show_in_default>1</show_in_default>
|
| 200 |
-
<show_in_website>1</show_in_website>
|
| 201 |
-
<show_in_store>0</show_in_store>
|
| 202 |
-
</buttonsstyle>
|
| 203 |
-
<errorsstyle translate="label">
|
| 204 |
-
<label>ErrorsStyle</label>
|
| 205 |
-
<frontend_type>text</frontend_type>
|
| 206 |
-
<sort_order>109</sort_order>
|
| 207 |
-
<show_in_default>1</show_in_default>
|
| 208 |
-
<show_in_website>1</show_in_website>
|
| 209 |
-
<show_in_store>0</show_in_store>
|
| 210 |
-
</errorsstyle>
|
| 211 |
-
<successtitlestyle translate="label">
|
| 212 |
-
<label>SuccessTitleStyle</label>
|
| 213 |
-
<frontend_type>text</frontend_type>
|
| 214 |
-
<sort_order>110</sort_order>
|
| 215 |
-
<show_in_default>1</show_in_default>
|
| 216 |
-
<show_in_website>1</show_in_website>
|
| 217 |
-
<show_in_store>0</show_in_store>
|
| 218 |
-
</successtitlestyle>
|
| 219 |
-
<errortitlestyle translate="label">
|
| 220 |
-
<label>ErrorTitleStyle</label>
|
| 221 |
-
<frontend_type>text</frontend_type>
|
| 222 |
-
<sort_order>111</sort_order>
|
| 223 |
-
<show_in_default>1</show_in_default>
|
| 224 |
-
<show_in_website>1</show_in_website>
|
| 225 |
-
<show_in_store>0</show_in_store>
|
| 226 |
-
</errortitlestyle>
|
| 227 |
-
<footerstyle translate="label">
|
| 228 |
-
<label>FooterStyle</label>
|
| 229 |
-
<frontend_type>text</frontend_type>
|
| 230 |
-
<sort_order>112</sort_order>
|
| 231 |
-
<show_in_default>1</show_in_default>
|
| 232 |
-
<show_in_website>1</show_in_website>
|
| 233 |
-
<show_in_store>0</show_in_store>
|
| 234 |
-
</footerstyle>
|
| 235 |
-
</fields>
|
| 236 |
-
</mpay24sporder>
|
| 237 |
-
<mpay24spsc translate="label">
|
| 238 |
-
<label>mPAY24 Selectpayment ShoppingCart Design</label>
|
| 239 |
-
<frontend_type>text</frontend_type>
|
| 240 |
<sort_order>3</sort_order>
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 520 |
</mpay24spsc> -->
|
| 521 |
-
|
| 522 |
<mpay24 translate="label" module="mpay24">
|
| 523 |
<label>Payment systems</label>
|
| 524 |
<expanded>1</expanded>
|
|
@@ -765,7 +766,7 @@
|
|
| 765 |
<show_in_website>1</show_in_website>
|
| 766 |
<show_in_store>1</show_in_store>
|
| 767 |
<depends><payments_active>true</payments_active></depends>
|
| 768 |
-
</ps_20>
|
| 769 |
<ps_21>
|
| 770 |
<label>PS_21</label>
|
| 771 |
<frontend_type>select</frontend_type>
|
|
@@ -1105,10 +1106,10 @@
|
|
| 1105 |
<show_in_website>1</show_in_website>
|
| 1106 |
<show_in_store>1</show_in_store>
|
| 1107 |
<comment>Show the free 'children' products of configurable products in the mPAY24 shopping cart</comment>
|
| 1108 |
-
</show_free_products>
|
| 1109 |
</fields>
|
| 1110 |
</mpay24>
|
| 1111 |
</groups>
|
| 1112 |
-
</mpay24>
|
| 1113 |
</sections>
|
| 1114 |
</config>
|
| 2 |
<config>
|
| 3 |
<sections>
|
| 4 |
<mpay24 translate="label" module="mpay24">
|
| 5 |
+
<label>mPAY24</label>
|
| 6 |
+
<tab>sales</tab>
|
| 7 |
+
<frontend_type>text</frontend_type>
|
| 8 |
+
<sort_order>349</sort_order>
|
| 9 |
+
<show_in_default>1</show_in_default>
|
| 10 |
+
<show_in_website>1</show_in_website>
|
| 11 |
+
<show_in_store>1</show_in_store>
|
| 12 |
+
<groups>
|
| 13 |
+
<mpay24as translate="label">
|
| 14 |
+
<label>mPAY24 Account Settings</label>
|
| 15 |
+
<frontend_type>text</frontend_type>
|
| 16 |
+
<sort_order>1</sort_order>
|
| 17 |
+
<expanded>1</expanded>
|
| 18 |
+
<show_in_default>1</show_in_default>
|
| 19 |
+
<show_in_website>1</show_in_website>
|
| 20 |
+
<show_in_store>1</show_in_store>
|
| 21 |
+
<fields>
|
| 22 |
+
<active translate="label comment">
|
| 23 |
+
<label>mPAY24 enabled</label>
|
| 24 |
+
<frontend_type>select</frontend_type>
|
| 25 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 26 |
+
<config_path>payment/mpay24/active</config_path>
|
| 27 |
+
<sort_order>0</sort_order>
|
| 28 |
+
<show_in_default>1</show_in_default>
|
| 29 |
+
<show_in_website>1</show_in_website>
|
| 30 |
+
<show_in_store>1</show_in_store>
|
| 31 |
+
</active>
|
| 32 |
+
<title translate="label">
|
| 33 |
+
<label>Title</label>
|
| 34 |
+
<config_path>payment/mpay24/title</config_path>
|
| 35 |
+
<frontend_type>text</frontend_type>
|
| 36 |
+
<sort_order>1</sort_order>
|
| 37 |
+
<show_in_default>1</show_in_default>
|
| 38 |
+
<show_in_website>1</show_in_website>
|
| 39 |
+
<show_in_store>1</show_in_store>
|
| 40 |
+
<depends><active>1</active></depends>
|
| 41 |
+
</title>
|
| 42 |
+
<system translate="comment">
|
| 43 |
+
<label>System</label>
|
| 44 |
+
<frontend_type>select</frontend_type>
|
| 45 |
+
<source_model>mpay24/source_system</source_model>
|
| 46 |
+
<sort_order>2</sort_order>
|
| 47 |
+
<show_in_default>1</show_in_default>
|
| 48 |
+
<show_in_website>1</show_in_website>
|
| 49 |
+
<show_in_store>1</show_in_store>
|
| 50 |
+
<depends><active>1</active></depends>
|
| 51 |
+
<comment>When switching the system, please set the right merchant ID and SOAP password!</comment>
|
| 52 |
+
</system>
|
| 53 |
+
<merchantid translate="label">
|
| 54 |
+
<label>Merchant ID</label>
|
| 55 |
+
<frontend_type>text</frontend_type>
|
| 56 |
+
<backend_model>mpay24/system_config_backend_encrypted</backend_model>
|
| 57 |
+
<sort_order>3</sort_order>
|
| 58 |
+
<show_in_default>1</show_in_default>
|
| 59 |
+
<show_in_website>1</show_in_website>
|
| 60 |
+
<show_in_store>1</show_in_store>
|
| 61 |
+
<depends><active>1</active></depends>
|
| 62 |
+
<comment>The Merchant ID provided by mPAY24</comment>
|
| 63 |
+
</merchantid>
|
| 64 |
+
<old_merchantid>
|
| 65 |
+
<label>OLD Merchant ID</label>
|
| 66 |
+
<frontend_type>text</frontend_type>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
<sort_order>3</sort_order>
|
| 68 |
+
</old_merchantid>
|
| 69 |
+
<soap_pass translate="label">
|
| 70 |
+
<label>SOAP password</label>
|
| 71 |
+
<frontend_type>password</frontend_type>
|
| 72 |
+
<backend_model>mpay24/system_config_backend_encrypted</backend_model>
|
| 73 |
+
<sort_order>4</sort_order>
|
| 74 |
+
<show_in_default>1</show_in_default>
|
| 75 |
+
<show_in_website>1</show_in_website>
|
| 76 |
+
<show_in_store>1</show_in_store>
|
| 77 |
+
<depends><active>1</active></depends>
|
| 78 |
+
<comment>The SOAP password provided by mPAY24</comment>
|
| 79 |
+
</soap_pass>
|
| 80 |
+
<debug>
|
| 81 |
+
<label>Debug</label>
|
| 82 |
+
<frontend_type>select</frontend_type>
|
| 83 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 84 |
+
<sort_order>5</sort_order>
|
| 85 |
+
<show_in_default>1</show_in_default>
|
| 86 |
+
<show_in_website>1</show_in_website>
|
| 87 |
+
<show_in_store>1</show_in_store>
|
| 88 |
+
<depends><active>1</active></depends>
|
| 89 |
+
</debug>
|
| 90 |
+
<use_proxy translate="label">
|
| 91 |
+
<label>API uses proxy</label>
|
| 92 |
+
<frontend_type>select</frontend_type>
|
| 93 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 94 |
+
<sort_order>7</sort_order>
|
| 95 |
+
<show_in_default>1</show_in_default>
|
| 96 |
+
<show_in_website>1</show_in_website>
|
| 97 |
+
<show_in_store>1</show_in_store>
|
| 98 |
+
<depends><active>1</active></depends>
|
| 99 |
+
</use_proxy>
|
| 100 |
+
<proxy_host translate="label">
|
| 101 |
+
<label>Proxy Host</label>
|
| 102 |
+
<frontend_type>text</frontend_type>
|
| 103 |
+
<sort_order>8</sort_order>
|
| 104 |
+
<show_in_default>1</show_in_default>
|
| 105 |
+
<show_in_website>1</show_in_website>
|
| 106 |
+
<show_in_store>1</show_in_store>
|
| 107 |
+
<depends><use_proxy>1</use_proxy></depends>
|
| 108 |
+
</proxy_host>
|
| 109 |
+
<proxy_port translate="label">
|
| 110 |
+
<label>Proxy Port</label>
|
| 111 |
+
<frontend_type>text</frontend_type>
|
| 112 |
+
<sort_order>9</sort_order>
|
| 113 |
+
<show_in_default>1</show_in_default>
|
| 114 |
+
<show_in_website>1</show_in_website>
|
| 115 |
+
<show_in_store>1</show_in_store>
|
| 116 |
+
<depends><use_proxy>1</use_proxy></depends>
|
| 117 |
+
</proxy_port>
|
| 118 |
+
<allowed_ips translate="label">
|
| 119 |
+
<label>Allowed IPs for the Confirmation</label>
|
| 120 |
+
<frontend_type>multiselect</frontend_type>
|
| 121 |
+
<sort_order>10</sort_order>
|
| 122 |
+
<source_model>mpay24/source_allowedIPs</source_model>
|
| 123 |
+
<show_in_default>1</show_in_default>
|
| 124 |
+
<show_in_website>1</show_in_website>
|
| 125 |
+
<show_in_store>1</show_in_store>
|
| 126 |
+
</allowed_ips>
|
| 127 |
+
</fields>
|
| 128 |
+
</mpay24as>
|
| 129 |
+
|
| 130 |
+
<!-- <mpay24sporder>
|
| 131 |
+
<label>mPAY24 Selectpayment Order Design</label>
|
| 132 |
+
<frontend_type>text</frontend_type>
|
| 133 |
+
<sort_order>2</sort_order>
|
| 134 |
+
<expanded>0</expanded>
|
| 135 |
+
<show_in_default>1</show_in_default>
|
| 136 |
+
<show_in_website>1</show_in_website>
|
| 137 |
+
<show_in_store>1</show_in_store>
|
| 138 |
+
<fields>
|
| 139 |
+
<style translate="label">
|
| 140 |
+
<label>Style</label>
|
| 141 |
+
<frontend_type>text</frontend_type>
|
| 142 |
+
<sort_order>101</sort_order>
|
| 143 |
+
<show_in_default>1</show_in_default>
|
| 144 |
+
<show_in_website>1</show_in_website>
|
| 145 |
+
<show_in_store>0</show_in_store>
|
| 146 |
+
</style>
|
| 147 |
+
<logostyle translate="label">
|
| 148 |
+
<label>LogoStyle</label>
|
| 149 |
+
<frontend_type>text</frontend_type>
|
| 150 |
+
<sort_order>102</sort_order>
|
| 151 |
+
<show_in_default>1</show_in_default>
|
| 152 |
+
<show_in_website>1</show_in_website>
|
| 153 |
+
<show_in_store>0</show_in_store>
|
| 154 |
+
</logostyle>
|
| 155 |
+
<pageheaderstyle translate="label">
|
| 156 |
+
<label>PageHeaderStyle</label>
|
| 157 |
+
<frontend_type>text</frontend_type>
|
| 158 |
+
<sort_order>103</sort_order>
|
| 159 |
+
<show_in_default>1</show_in_default>
|
| 160 |
+
<show_in_website>1</show_in_website>
|
| 161 |
+
<show_in_store>0</show_in_store>
|
| 162 |
+
</pageheaderstyle>
|
| 163 |
+
<pagecaptionstyle translate="label">
|
| 164 |
+
<label>PageCaptionStyle</label>
|
| 165 |
+
<frontend_type>text</frontend_type>
|
| 166 |
+
<sort_order>104</sort_order>
|
| 167 |
+
<show_in_default>1</show_in_default>
|
| 168 |
+
<show_in_website>1</show_in_website>
|
| 169 |
+
<show_in_store>0</show_in_store>
|
| 170 |
+
</pagecaptionstyle>
|
| 171 |
+
<pagestyle translate="label">
|
| 172 |
+
<label>PageStyle</label>
|
| 173 |
+
<frontend_type>text</frontend_type>
|
| 174 |
+
<sort_order>105</sort_order>
|
| 175 |
+
<show_in_default>1</show_in_default>
|
| 176 |
+
<show_in_website>1</show_in_website>
|
| 177 |
+
<show_in_store>0</show_in_store>
|
| 178 |
+
</pagestyle>
|
| 179 |
+
<inputfieldsstyle translate="label">
|
| 180 |
+
<label>InputFieldsStyle</label>
|
| 181 |
+
<frontend_type>text</frontend_type>
|
| 182 |
+
<sort_order>106</sort_order>
|
| 183 |
+
<show_in_default>1</show_in_default>
|
| 184 |
+
<show_in_website>1</show_in_website>
|
| 185 |
+
<show_in_store>0</show_in_store>
|
| 186 |
+
</inputfieldsstyle>
|
| 187 |
+
<dropdownlistsstyle translate="label">
|
| 188 |
+
<label>DropDownListsStyle</label>
|
| 189 |
+
<frontend_type>text</frontend_type>
|
| 190 |
+
<sort_order>107</sort_order>
|
| 191 |
+
<show_in_default>1</show_in_default>
|
| 192 |
+
<show_in_website>1</show_in_website>
|
| 193 |
+
<show_in_store>0</show_in_store>
|
| 194 |
+
</dropdownlistsstyle>
|
| 195 |
+
<buttonsstyle translate="label">
|
| 196 |
+
<label>ButtonsStyle</label>
|
| 197 |
+
<frontend_type>text</frontend_type>
|
| 198 |
+
<sort_order>108</sort_order>
|
| 199 |
+
<show_in_default>1</show_in_default>
|
| 200 |
+
<show_in_website>1</show_in_website>
|
| 201 |
+
<show_in_store>0</show_in_store>
|
| 202 |
+
</buttonsstyle>
|
| 203 |
+
<errorsstyle translate="label">
|
| 204 |
+
<label>ErrorsStyle</label>
|
| 205 |
+
<frontend_type>text</frontend_type>
|
| 206 |
+
<sort_order>109</sort_order>
|
| 207 |
+
<show_in_default>1</show_in_default>
|
| 208 |
+
<show_in_website>1</show_in_website>
|
| 209 |
+
<show_in_store>0</show_in_store>
|
| 210 |
+
</errorsstyle>
|
| 211 |
+
<successtitlestyle translate="label">
|
| 212 |
+
<label>SuccessTitleStyle</label>
|
| 213 |
+
<frontend_type>text</frontend_type>
|
| 214 |
+
<sort_order>110</sort_order>
|
| 215 |
+
<show_in_default>1</show_in_default>
|
| 216 |
+
<show_in_website>1</show_in_website>
|
| 217 |
+
<show_in_store>0</show_in_store>
|
| 218 |
+
</successtitlestyle>
|
| 219 |
+
<errortitlestyle translate="label">
|
| 220 |
+
<label>ErrorTitleStyle</label>
|
| 221 |
+
<frontend_type>text</frontend_type>
|
| 222 |
+
<sort_order>111</sort_order>
|
| 223 |
+
<show_in_default>1</show_in_default>
|
| 224 |
+
<show_in_website>1</show_in_website>
|
| 225 |
+
<show_in_store>0</show_in_store>
|
| 226 |
+
</errortitlestyle>
|
| 227 |
+
<footerstyle translate="label">
|
| 228 |
+
<label>FooterStyle</label>
|
| 229 |
+
<frontend_type>text</frontend_type>
|
| 230 |
+
<sort_order>112</sort_order>
|
| 231 |
+
<show_in_default>1</show_in_default>
|
| 232 |
+
<show_in_website>1</show_in_website>
|
| 233 |
+
<show_in_store>0</show_in_store>
|
| 234 |
+
</footerstyle>
|
| 235 |
+
</fields>
|
| 236 |
+
</mpay24sporder>
|
| 237 |
+
|
| 238 |
+
<mpay24spsc translate="label">
|
| 239 |
+
<label>mPAY24 Selectpayment ShoppingCart Design</label>
|
| 240 |
+
<frontend_type>text</frontend_type>
|
| 241 |
+
<sort_order>3</sort_order>
|
| 242 |
+
<expanded>0</expanded>
|
| 243 |
+
<show_in_default>1</show_in_default>
|
| 244 |
+
<show_in_website>1</show_in_website>
|
| 245 |
+
<show_in_store>1</show_in_store>
|
| 246 |
+
<fields>
|
| 247 |
+
<sc_row translate="label">
|
| 248 |
+
<label>ShoppingCart Rows</label>
|
| 249 |
+
<frontend_type>multiselect</frontend_type>
|
| 250 |
+
<sort_order>50</sort_order>
|
| 251 |
+
<source_model>mpay24/source_shoppingCartRowsAction</source_model>
|
| 252 |
+
<show_in_default>1</show_in_default>
|
| 253 |
+
<show_in_website>1</show_in_website>
|
| 254 |
+
<show_in_store>0</show_in_store>
|
| 255 |
+
</sc_row>
|
| 256 |
+
<sc_style translate="label">
|
| 257 |
+
<label>Style</label>
|
| 258 |
+
<frontend_type>text</frontend_type>
|
| 259 |
+
<sort_order>101</sort_order>
|
| 260 |
+
<show_in_default>1</show_in_default>
|
| 261 |
+
<show_in_website>1</show_in_website>
|
| 262 |
+
<show_in_store>0</show_in_store>
|
| 263 |
+
</sc_style>
|
| 264 |
+
<sc_header translate="label">
|
| 265 |
+
<label>Header</label>
|
| 266 |
+
<frontend_type>text</frontend_type>
|
| 267 |
+
<sort_order>102</sort_order>
|
| 268 |
+
<show_in_default>1</show_in_default>
|
| 269 |
+
<show_in_website>1</show_in_website>
|
| 270 |
+
<show_in_store>0</show_in_store>
|
| 271 |
+
</sc_header>
|
| 272 |
+
<sc_headerstyle translate="label">
|
| 273 |
+
<label>HeaderStyle</label>
|
| 274 |
+
<frontend_type>text</frontend_type>
|
| 275 |
+
<sort_order>103</sort_order>
|
| 276 |
+
<show_in_default>1</show_in_default>
|
| 277 |
+
<show_in_website>1</show_in_website>
|
| 278 |
+
<show_in_store>0</show_in_store>
|
| 279 |
+
</sc_headerstyle>
|
| 280 |
+
<sc_captionstyle translate="label">
|
| 281 |
+
<label>CaptionStyle</label>
|
| 282 |
+
<frontend_type>text</frontend_type>
|
| 283 |
+
<sort_order>104</sort_order>
|
| 284 |
+
<show_in_default>1</show_in_default>
|
| 285 |
+
<show_in_website>1</show_in_website>
|
| 286 |
+
<show_in_store>0</show_in_store>
|
| 287 |
+
</sc_captionstyle>
|
| 288 |
+
<sc_numberheader translate="label">
|
| 289 |
+
<label>NumberHeader</label>
|
| 290 |
+
<frontend_type>text</frontend_type>
|
| 291 |
+
<sort_order>105</sort_order>
|
| 292 |
+
<show_in_default>1</show_in_default>
|
| 293 |
+
<show_in_website>1</show_in_website>
|
| 294 |
+
<show_in_store>0</show_in_store>
|
| 295 |
+
</sc_numberheader>
|
| 296 |
+
<sc_numberstyle translate="label">
|
| 297 |
+
<label>NumberStyle</label>
|
| 298 |
+
<frontend_type>text</frontend_type>
|
| 299 |
+
<sort_order>106</sort_order>
|
| 300 |
+
<show_in_default>1</show_in_default>
|
| 301 |
+
<show_in_website>1</show_in_website>
|
| 302 |
+
<show_in_store>0</show_in_store>
|
| 303 |
+
</sc_numberstyle>
|
| 304 |
+
<sc_productnrheader translate="label">
|
| 305 |
+
<label>ProductNrHeader</label>
|
| 306 |
+
<frontend_type>text</frontend_type>
|
| 307 |
+
<sort_order>107</sort_order>
|
| 308 |
+
<show_in_default>1</show_in_default>
|
| 309 |
+
<show_in_website>1</show_in_website>
|
| 310 |
+
<show_in_store>0</show_in_store>
|
| 311 |
+
</sc_productnrheader>
|
| 312 |
+
<sc_productnrstyle translate="label">
|
| 313 |
+
<label>ProductNrStyle</label>
|
| 314 |
+
<frontend_type>text</frontend_type>
|
| 315 |
+
<sort_order>108</sort_order>
|
| 316 |
+
<show_in_default>1</show_in_default>
|
| 317 |
+
<show_in_website>1</show_in_website>
|
| 318 |
+
<show_in_store>0</show_in_store>
|
| 319 |
+
</sc_productnrstyle>
|
| 320 |
+
<sc_descriptionheader translate="label">
|
| 321 |
+
<label>DescriptionHeader</label>
|
| 322 |
+
<frontend_type>text</frontend_type>
|
| 323 |
+
<sort_order>109</sort_order>
|
| 324 |
+
<show_in_default>1</show_in_default>
|
| 325 |
+
<show_in_website>1</show_in_website>
|
| 326 |
+
<show_in_store>0</show_in_store>
|
| 327 |
+
</sc_descriptionheader>
|
| 328 |
+
<sc_descriptionstyle translate="label">
|
| 329 |
+
<label>DescriptionStyle</label>
|
| 330 |
+
<frontend_type>text</frontend_type>
|
| 331 |
+
<sort_order>110</sort_order>
|
| 332 |
+
<show_in_default>1</show_in_default>
|
| 333 |
+
<show_in_website>1</show_in_website>
|
| 334 |
+
<show_in_store>0</show_in_store>
|
| 335 |
+
</sc_descriptionstyle>
|
| 336 |
+
<sc_packageheader translate="label">
|
| 337 |
+
<label>PackageHeader</label>
|
| 338 |
+
<frontend_type>text</frontend_type>
|
| 339 |
+
<sort_order>111</sort_order>
|
| 340 |
+
<show_in_default>1</show_in_default>
|
| 341 |
+
<show_in_website>1</show_in_website>
|
| 342 |
+
<show_in_store>0</show_in_store>
|
| 343 |
+
</sc_packageheader>
|
| 344 |
+
<sc_packagestyle translate="label">
|
| 345 |
+
<label>PackageStyle</label>
|
| 346 |
+
<frontend_type>text</frontend_type>
|
| 347 |
+
<sort_order>112</sort_order>
|
| 348 |
+
<show_in_default>1</show_in_default>
|
| 349 |
+
<show_in_website>1</show_in_website>
|
| 350 |
+
<show_in_store>0</show_in_store>
|
| 351 |
+
</sc_packagestyle>
|
| 352 |
+
<sc_quantityheader translate="label">
|
| 353 |
+
<label>QuantityHeader</label>
|
| 354 |
+
<frontend_type>text</frontend_type>
|
| 355 |
+
<sort_order>113</sort_order>
|
| 356 |
+
<show_in_default>1</show_in_default>
|
| 357 |
+
<show_in_website>1</show_in_website>
|
| 358 |
+
<show_in_store>0</show_in_store>
|
| 359 |
+
</sc_quantityheader>
|
| 360 |
+
<sc_quantitystyle translate="label">
|
| 361 |
+
<label>QuantityStyle</label>
|
| 362 |
+
<frontend_type>text</frontend_type>
|
| 363 |
+
<sort_order>114</sort_order>
|
| 364 |
+
<show_in_default>1</show_in_default>
|
| 365 |
+
<show_in_website>1</show_in_website>
|
| 366 |
+
<show_in_store>0</show_in_store>
|
| 367 |
+
</sc_quantitystyle>
|
| 368 |
+
<sc_itempriceheader translate="label">
|
| 369 |
+
<label>ItemPriceHeader</label>
|
| 370 |
+
<frontend_type>text</frontend_type>
|
| 371 |
+
<sort_order>115</sort_order>
|
| 372 |
+
<show_in_default>1</show_in_default>
|
| 373 |
+
<show_in_website>1</show_in_website>
|
| 374 |
+
<show_in_store>0</show_in_store>
|
| 375 |
+
</sc_itempriceheader>
|
| 376 |
+
<sc_itempricestyle translate="label">
|
| 377 |
+
<label>ItemPriceStyle</label>
|
| 378 |
+
<frontend_type>text</frontend_type>
|
| 379 |
+
<sort_order>116</sort_order>
|
| 380 |
+
<show_in_default>1</show_in_default>
|
| 381 |
+
<show_in_website>1</show_in_website>
|
| 382 |
+
<show_in_store>0</show_in_store>
|
| 383 |
+
</sc_itempricestyle>
|
| 384 |
+
<sc_priceheader translate="label">
|
| 385 |
+
<label>PriceHeader</label>
|
| 386 |
+
<frontend_type>text</frontend_type>
|
| 387 |
+
<sort_order>117</sort_order>
|
| 388 |
+
<show_in_default>1</show_in_default>
|
| 389 |
+
<show_in_website>1</show_in_website>
|
| 390 |
+
<show_in_store>0</show_in_store>
|
| 391 |
+
</sc_priceheader>
|
| 392 |
+
<sc_pricestyle translate="label">
|
| 393 |
+
<label>PriceStyle</label>
|
| 394 |
+
<frontend_type>text</frontend_type>
|
| 395 |
+
<sort_order>118</sort_order>
|
| 396 |
+
<show_in_default>1</show_in_default>
|
| 397 |
+
<show_in_website>1</show_in_website>
|
| 398 |
+
<show_in_store>0</show_in_store>
|
| 399 |
+
</sc_pricestyle>
|
| 400 |
+
<description translate="label">
|
| 401 |
+
<label>Description</label>
|
| 402 |
+
<frontend_type>text</frontend_type>
|
| 403 |
+
<sort_order>119</sort_order>
|
| 404 |
+
<show_in_default>1</show_in_default>
|
| 405 |
+
<show_in_website>1</show_in_website>$value == 'JCB'
|
| 406 |
+
<show_in_store>0</show_in_store>
|
| 407 |
+
</description>
|
| 408 |
+
<item_style1 translate="label">
|
| 409 |
+
<label>ItemStyle Line 1</label>
|
| 410 |
+
<frontend_type>text</frontend_type>
|
| 411 |
+
<sort_order>120</sort_order>
|
| 412 |
+
<show_in_default>1</show_in_default>
|
| 413 |
+
<show_in_website>1</show_in_website>
|
| 414 |
+
<show_in_store>0</show_in_store>
|
| 415 |
+
</item_style1>
|
| 416 |
+
<item_style2 translate="label">
|
| 417 |
+
<label>ItemStyle Line 2</label>
|
| 418 |
+
<frontend_type>text</frontend_type>
|
| 419 |
+
<sort_order>121</sort_order>
|
| 420 |
+
<show_in_default>1</show_in_default>
|
| 421 |
+
<show_in_website>1</show_in_website>
|
| 422 |
+
<show_in_store>0</show_in_store>
|
| 423 |
+
</item_style2>
|
| 424 |
+
<discount_headerstyle translate="label">
|
| 425 |
+
<label>Discount HeaderStyle</label>
|
| 426 |
+
<frontend_type>text</frontend_type>
|
| 427 |
+
<sort_order>123</sort_order>
|
| 428 |
+
<show_in_default>1</show_in_default>
|
| 429 |
+
<show_in_website>1</show_in_website>
|
| 430 |
+
<show_in_store>0</show_in_store>
|
| 431 |
+
</discount_headerstyle>
|
| 432 |
+
<discount_style translate="label">
|
| 433 |
+
<label>Discount Style</label>
|
| 434 |
+
<frontend_type>text</frontend_type>
|
| 435 |
+
<sort_order>124</sort_order>
|
| 436 |
+
<show_in_default>1</show_in_default>
|
| 437 |
+
<show_in_website>1</show_in_website>
|
| 438 |
+
<show_in_store>0</show_in_store>
|
| 439 |
+
</discount_style>
|
| 440 |
+
<shipping_costs_headerstyle translate="label">
|
| 441 |
+
<label>Ship.Costs HeaderStyle</label>
|
| 442 |
+
<frontend_type>text</frontend_type>
|
| 443 |
+
<sort_order>126</sort_order>
|
| 444 |
+
<show_in_default>1</show_in_default>
|
| 445 |
+
<show_in_website>1</show_in_website>
|
| 446 |
+
<show_in_store>0</show_in_store>
|
| 447 |
+
</shipping_costs_headerstyle>
|
| 448 |
+
<shipping_costs_style translate="label">
|
| 449 |
+
<label>Ship.Costs Style</label>
|
| 450 |
+
<frontend_type>text</frontend_type>
|
| 451 |
+
<sort_order>127</sort_order>
|
| 452 |
+
<show_in_default>1</show_in_default>
|
| 453 |
+
<show_in_website>1</show_in_website>
|
| 454 |
+
<show_in_store>0</show_in_store>
|
| 455 |
+
</shipping_costs_style>
|
| 456 |
+
<tax_headerstyle translate="label">
|
| 457 |
+
<label>Tax HeaderStyle</label>
|
| 458 |
+
<frontend_type>text</frontend_type>
|
| 459 |
+
<sort_order>129</sort_order>
|
| 460 |
+
<show_in_default>1</show_in_default>
|
| 461 |
+
<show_in_website>1</show_in_website>
|
| 462 |
+
<show_in_store>0</show_in_store>
|
| 463 |
+
</tax_headerstyle>
|
| 464 |
+
<tax_style translate="label">
|
| 465 |
+
<label>Tax Style</label>
|
| 466 |
+
<frontend_type>text</frontend_type>
|
| 467 |
+
<sort_order>130</sort_order>
|
| 468 |
+
<show_in_default>1</show_in_default>
|
| 469 |
+
<show_in_website>1</show_in_website>
|
| 470 |
+
<show_in_store>0</show_in_store>
|
| 471 |
+
</tax_style>
|
| 472 |
+
<price_header translate="label">
|
| 473 |
+
<label>Price Header</label>
|
| 474 |
+
<frontend_type>text</frontend_type>
|
| 475 |
+
<sort_order>132</sort_order>
|
| 476 |
+
<show_in_default>1</show_in_default>
|
| 477 |
+
<show_in_website>1</show_in_website>
|
| 478 |
+
<show_in_store>0</show_in_store>
|
| 479 |
+
</price_header>
|
| 480 |
+
<price_headerstyle translate="label">
|
| 481 |
+
<label>Price HeaderStyle</label>
|
| 482 |
+
<frontend_type>text</frontend_type>
|
| 483 |
+
<sort_order>133</sort_order>
|
| 484 |
+
<show_in_default>1</show_in_default>
|
| 485 |
+
<show_in_website>1</show_in_website>
|
| 486 |
+
<show_in_store>0</show_in_store>
|
| 487 |
+
</price_headerstyle>
|
| 488 |
+
<price_style translate="label">
|
| 489 |
+
<label>Price Style</label>
|
| 490 |
+
<frontend_type>text</frontend_type>
|
| 491 |
+
<sort_order>134</sort_order>
|
| 492 |
+
<show_in_default>1</show_in_default>
|
| 493 |
+
<show_in_website>1</show_in_website>
|
| 494 |
+
<show_in_store>0</show_in_store>
|
| 495 |
+
</price_style>
|
| 496 |
+
<subtotal_header translate="label">
|
| 497 |
+
<label>Subtotal Header</label>
|
| 498 |
+
<frontend_type>text</frontend_type>
|
| 499 |
+
<sort_order>135</sort_order>
|
| 500 |
+
<show_in_default>1</show_in_default>
|
| 501 |
+
<show_in_website>1</show_in_website>
|
| 502 |
+
<show_in_store>0</show_in_store>
|
| 503 |
+
</subtotal_header>
|
| 504 |
+
<subtotal_headerstyle translate="label">
|
| 505 |
+
<label>Subtotal HeaderStyle</label>
|
| 506 |
+
<frontend_type>text</frontend_type>
|
| 507 |
+
<sort_order>136</sort_order>
|
| 508 |
+
<show_in_default>1</show_in_default>
|
| 509 |
+
<show_in_website>1</show_in_website>
|
| 510 |
+
<show_in_store>0</show_in_store>
|
| 511 |
+
</subtotal_headerstyle>
|
| 512 |
+
<subtotal_style translate="label">
|
| 513 |
+
<label>Subtotal Style</label>
|
| 514 |
+
<frontend_type>text</frontend_type>
|
| 515 |
+
<sort_order>137</sort_order>
|
| 516 |
+
<show_in_default>1</show_in_default>
|
| 517 |
+
<show_in_website>1</show_in_website>
|
| 518 |
+
<show_in_store>0</show_in_store>
|
| 519 |
+
</subtotal_style>
|
| 520 |
+
</fields>
|
| 521 |
</mpay24spsc> -->
|
| 522 |
+
|
| 523 |
<mpay24 translate="label" module="mpay24">
|
| 524 |
<label>Payment systems</label>
|
| 525 |
<expanded>1</expanded>
|
| 766 |
<show_in_website>1</show_in_website>
|
| 767 |
<show_in_store>1</show_in_store>
|
| 768 |
<depends><payments_active>true</payments_active></depends>
|
| 769 |
+
</ps_20>
|
| 770 |
<ps_21>
|
| 771 |
<label>PS_21</label>
|
| 772 |
<frontend_type>select</frontend_type>
|
| 1106 |
<show_in_website>1</show_in_website>
|
| 1107 |
<show_in_store>1</show_in_store>
|
| 1108 |
<comment>Show the free 'children' products of configurable products in the mPAY24 shopping cart</comment>
|
| 1109 |
+
</show_free_products>
|
| 1110 |
</fields>
|
| 1111 |
</mpay24>
|
| 1112 |
</groups>
|
| 1113 |
+
</mpay24>
|
| 1114 |
</sections>
|
| 1115 |
</config>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.4.3.php
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$this->startSetup();
|
| 22 |
+
|
| 23 |
+
$this->run("DELETE FROM {$this->getTable('core_config_data')} WHERE `path` LIKE '%mpay%'");
|
| 24 |
+
|
| 25 |
+
$this->run("
|
| 26 |
+
|
| 27 |
+
-- DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 28 |
+
CREATE TABLE {$this->getTable('mpay24_debug')} (
|
| 29 |
+
`debug_id` int(10) unsigned NOT NULL auto_increment,
|
| 30 |
+
`request_body` text,
|
| 31 |
+
`response_body` text,
|
| 32 |
+
`request_serialized` text,
|
| 33 |
+
`result_serialized` text,
|
| 34 |
+
`request_dump` text,
|
| 35 |
+
`result_dump` text,
|
| 36 |
+
`time_stamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
| 37 |
+
ON UPDATE CURRENT_TIMESTAMP,
|
| 38 |
+
PRIMARY KEY (`debug_id`)
|
| 39 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
| 40 |
+
|
| 41 |
+
");
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
$installer->run("
|
| 45 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 46 |
+
");
|
| 47 |
+
|
| 48 |
+
$installer->run("
|
| 49 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 50 |
+
");
|
| 51 |
+
|
| 52 |
+
$this->endSetup();
|
| 53 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.4.4.php
CHANGED
|
@@ -12,10 +12,10 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
$this->startSetup();
|
|
@@ -24,10 +24,9 @@ $this->run("DELETE FROM {$this->getTable('core_config_data')} WHERE `path` LIKE
|
|
| 24 |
|
| 25 |
$this->run("DROP TABLE if exists {$this->getTable('mpay24_debug')};");
|
| 26 |
|
| 27 |
-
|
| 28 |
$installer->run("UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';");
|
| 29 |
|
| 30 |
$installer->run("UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';");
|
| 31 |
|
| 32 |
$this->endSetup();
|
| 33 |
-
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
$this->startSetup();
|
| 24 |
|
| 25 |
$this->run("DROP TABLE if exists {$this->getTable('mpay24_debug')};");
|
| 26 |
|
|
|
|
| 27 |
$installer->run("UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';");
|
| 28 |
|
| 29 |
$installer->run("UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';");
|
| 30 |
|
| 31 |
$this->endSetup();
|
| 32 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-install-1.4.5.php
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$this->startSetup();
|
| 22 |
+
|
| 23 |
+
$this->run("DELETE FROM {$this->getTable('core_config_data')} WHERE `path` LIKE '%mpay%'");
|
| 24 |
+
|
| 25 |
+
$this->run("DROP TABLE if exists {$this->getTable('mpay24_debug')};");
|
| 26 |
+
|
| 27 |
+
$installer->run("UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';");
|
| 28 |
+
|
| 29 |
+
$installer->run("UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';");
|
| 30 |
+
|
| 31 |
+
$this->endSetup();
|
| 32 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-0.6.2-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-0.6.2-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-0.6.2-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.0-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.0-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.0-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.4-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.4-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.4-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.6-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.6-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.6-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.7-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.7-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.0.7-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.1-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.1-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.1-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.7-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.7-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.7-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.8-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.8-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.8-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.9-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.9-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.1.9-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.0-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.0-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.0-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.1-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.1-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.1-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.2-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.2-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.2.2-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.3.0-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.3.0-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.3.0-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.0-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.0-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.0-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.1-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.1-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.1-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.2-1.4.3.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.2-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.2-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.3-1.4.4.php
CHANGED
|
@@ -12,27 +12,27 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.3-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/code/community/Mpay24/Mpay24/sql/mpay24_setup/mysql4-upgrade-1.4.4-1.4.5.php
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
$code = 'mpay24';
|
| 22 |
+
$installer = $this;
|
| 23 |
+
|
| 24 |
+
$installer->startSetup();
|
| 25 |
+
$installer->run("
|
| 26 |
+
DROP TABLE if exists {$this->getTable('mpay24_debug')};
|
| 27 |
+
");
|
| 28 |
+
|
| 29 |
+
$installer->run("
|
| 30 |
+
UPDATE `sales_flat_quote_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 31 |
+
");
|
| 32 |
+
|
| 33 |
+
$installer->run("
|
| 34 |
+
UPDATE `sales_flat_order_payment` SET `method` = 'mpay24' WHERE `method` LIKE 'mpay24_sp_cc';
|
| 35 |
+
");
|
| 36 |
+
|
| 37 |
+
$installer->endSetup();
|
| 38 |
+
?>
|
app/design/adminhtml/default/default/template/mpay24/info/selectpayment.phtml
CHANGED
|
@@ -12,17 +12,17 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
-
<p><b>
|
| 22 |
-
<?php echo "<label for='brand'>".Mage::helper('mpay24')->__("Payment method")."</label><span name='brand' style='float: right; margin-right: 400px;'><img src='https://www.mpay24.com/
|
| 23 |
-
|
| 24 |
<?php if($this->getMethod()->getData('info_instance')->getOrder() !== null): ?>
|
| 25 |
-
|
| 26 |
-
|
| 27 |
<?php endif; ?>
|
| 28 |
</p><br/>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
+
<p><b>
|
| 22 |
+
<?php echo "<label for='brand'>".Mage::helper('mpay24')->__("Payment method")."</label><span name='brand' style='float: right; margin-right: 400px;'><img src='https://www.mpay24.com/merchadm/img/ptypes/".$this->getPMethId().".png' alt='".$this->getPType()."-".$this->getBrand()."' title='".$this->getPType()."-".$this->getBrand()."'>".' ('.Mage::getStoreConfig('payment/mpay24/title').')'."</span>"; ?></b><br/>
|
| 23 |
+
<br/>
|
| 24 |
<?php if($this->getMethod()->getData('info_instance')->getOrder() !== null): ?>
|
| 25 |
+
<b><?php echo "<label for='mpaytid'>MPAYTID</label><span name='mpaytid' style='float: right; margin-right: 400px;'>".$this->htmlEscape($this->getInfo()->getOrder()->getPayment()->getAdditionalInformation('mpay_tid'))."</span>"; ?></b>
|
| 26 |
+
<br/><b><?php echo "<label for='appr_code'>".Mage::helper('mpay24')->__("Approval code")."</label><span name='appr_code' style='float: right; margin-right: 400px;'>".$this->htmlEscape($this->getInfo()->getOrder()->getPayment()->getAdditionalInformation('appr_code'))."</span>"; ?></b>
|
| 27 |
<?php endif; ?>
|
| 28 |
</p><br/>
|
app/design/frontend/default/default/layout/mpay24.xml
CHANGED
|
@@ -1,27 +1,26 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<layout version="0.1.0">
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
<!-- <reference name="content"> -->
|
| 8 |
<!-- <block type="mpay24/mpay24" name="payment_redirect" template="mpay24/payment.phtml"/> -->
|
| 9 |
<!-- </reference> -->
|
| 10 |
-
|
| 11 |
-
|
| 12 |
<!-- reference name="head">
|
| 13 |
<action method="addJs"><script>varien/product.js</script></action>
|
| 14 |
</reference>
|
| 15 |
<reference name="content">
|
| 16 |
<block type="mpay24/index" name="payment_index" template="mpay24/paymen.phtml" />
|
| 17 |
</reference -->
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
</layout>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<layout version="0.1.0">
|
| 3 |
+
<mpay24_payment_payment>
|
| 4 |
+
<reference name="root">
|
| 5 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
| 6 |
+
</reference>
|
| 7 |
<!-- <reference name="content"> -->
|
| 8 |
<!-- <block type="mpay24/mpay24" name="payment_redirect" template="mpay24/payment.phtml"/> -->
|
| 9 |
<!-- </reference> -->
|
| 10 |
+
|
|
|
|
| 11 |
<!-- reference name="head">
|
| 12 |
<action method="addJs"><script>varien/product.js</script></action>
|
| 13 |
</reference>
|
| 14 |
<reference name="content">
|
| 15 |
<block type="mpay24/index" name="payment_index" template="mpay24/paymen.phtml" />
|
| 16 |
</reference -->
|
| 17 |
+
</mpay24_payment_payment>
|
| 18 |
+
<mpay24_payment_errormsg>
|
| 19 |
+
<reference name="root">
|
| 20 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
| 21 |
+
</reference>
|
| 22 |
+
<reference name="content">
|
| 23 |
+
<block type="mpay24/mpay24" name="errormsg" template="mpay24/error.phtml"/>
|
| 24 |
+
</reference>
|
| 25 |
+
</mpay24_payment_errormsg>
|
| 26 |
</layout>
|
app/design/frontend/default/default/template/mpay24/form/area.phtml
CHANGED
|
@@ -12,137 +12,148 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
-
<?php
|
| 22 |
-
|
| 23 |
-
|
| 24 |
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true') {
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
}
|
| 30 |
?>
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 136 |
-
<td height="1" bgcolor="#ffffff"></td>
|
| 137 |
-
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 138 |
-
<td height="1" colspan="2"></td>
|
| 139 |
-
</tr>
|
| 140 |
-
<tr>
|
| 141 |
-
<td height="1" colspan="3"></td>
|
| 142 |
-
<td height="1" bgcolor="#b3b3b3"></td>
|
| 143 |
-
<td height="1" colspan="3"></td>
|
| 144 |
-
</tr>
|
| 145 |
-
</table>
|
| 146 |
-
</li>
|
| 147 |
-
<?php endif;?>
|
| 148 |
</ul>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
+
<?php
|
| 22 |
+
$_code=$this->getMethodCode();
|
| 23 |
+
|
| 24 |
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true') {
|
| 25 |
+
$brandsAndTypes = explode(", ", Mage::getStoreConfig('mpay24/mpay24/active_payment_types'));
|
| 26 |
+
$brands = array();
|
| 27 |
+
foreach($brandsAndTypes as $brandAndType)
|
| 28 |
+
$brands[substr($brandAndType, 0, strpos($brandAndType, "=>"))] = substr($brandAndType, strpos($brandAndType, "=>")+2);
|
| 29 |
}
|
| 30 |
?>
|
| 31 |
+
<script>
|
| 32 |
+
var selectedPayment = "../../../web/img/logos/payment-mpay24";
|
| 33 |
+
var brand = "";
|
| 34 |
+
|
| 35 |
+
function activate(input, id, description) {
|
| 36 |
+
brand = description;
|
| 37 |
+
if(input.parentNode.getAttribute('style') == "border-width: 1px; border-style: inset; border-color: transparent;") {
|
| 38 |
+
var inputs = document.getElementById('mpay24_table').getElementsByTagName('input');
|
| 39 |
+
|
| 40 |
+
for(i=0; i<inputs.length; i++) {
|
| 41 |
+
inputs[i].parentNode.setAttribute('style', "border-width: 1px; border-style: inset; border-color: transparent;");
|
| 42 |
+
inputs[i].disabled = true;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
document.getElementById('mpay24_table').disabled = true;
|
| 46 |
+
|
| 47 |
+
input.parentNode.setAttribute('style', "border-width: 1px; border-style: inset; border-color: blue;");
|
| 48 |
+
document.getElementById(id).disabled = false;
|
| 49 |
|
| 50 |
+
selectedPayment = id;
|
| 51 |
+
payment.save();
|
| 52 |
+
} else {
|
| 53 |
+
input.parentNode.setAttribute('style', "border-width: 1px; border-style: inset; border-color: transparent;");
|
| 54 |
+
document.getElementById(id).disabled = true;
|
| 55 |
+
document.getElementById('mpay24_table').disabled = false;
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
</script>
|
| 59 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 60 |
+
<li>
|
| 61 |
+
<b>
|
| 62 |
+
<?php if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true')
|
| 63 |
+
echo Mage::helper('mpay24')->__("You can choose the payment system you want to use now or do it when you are redirected to the mPAY24 pay page after placing the order.");
|
| 64 |
+
else
|
| 65 |
+
echo Mage::helper('mpay24')->__("You can choose the payment system you want to use after you are redirected to the mPAY24 pay page after placing the order.");
|
| 66 |
+
?>
|
| 67 |
+
</b>
|
| 68 |
+
</li>
|
| 69 |
|
| 70 |
+
<?php if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true'):?>
|
| 71 |
+
<li>
|
| 72 |
+
<table style="padding:10px 15px 15px;">
|
| 73 |
+
<tr>
|
| 74 |
+
<td height="1" colspan="3"></td>
|
| 75 |
+
<td height="1" bgcolor="#b3b3b3"></td>
|
| 76 |
+
<td height="1" colspan="3"></td>
|
| 77 |
+
</tr>
|
| 78 |
+
<tr>
|
| 79 |
+
<td height="1" colspan="2"></td>
|
| 80 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 81 |
+
<td height="1" bgcolor="#ffffff"></td>
|
| 82 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 83 |
+
<td height="1" colspan="2"></td>
|
| 84 |
+
</tr>
|
| 85 |
+
<tr>
|
| 86 |
+
<td height="2" width="1"></td>
|
| 87 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 88 |
+
<td height="2" colspan="3" bgcolor="#ffffff"></td>
|
| 89 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 90 |
+
<td height="2" width="1"></td>
|
| 91 |
+
</tr>
|
| 92 |
+
<tr>
|
| 93 |
+
<td width="1" bgcolor="#b3b3b3"></td>
|
| 94 |
+
<td width="3" colspan="2" bgcolor="#ffffff"></td>
|
| 95 |
+
<td bgcolor="#ffffff">
|
| 96 |
+
<table id='mpay24_table' style="width: 100%;">
|
| 97 |
+
<colgroup>
|
| 98 |
+
<col width="70%">
|
| 99 |
+
<col width="30%">
|
| 100 |
+
</colgroup>
|
| 101 |
+
<tr>
|
| 102 |
+
<td colspan="2">
|
| 103 |
+
<div style="width: 500px;"><!-- 248 -->
|
| 104 |
+
<?php foreach ($this->getActiveMethods() as $id => $payment):
|
| 105 |
+
if(strlen($id) == 1)
|
| 106 |
+
$id = "00$id";
|
| 107 |
+
elseif(strlen($id) == 2)
|
| 108 |
+
$id = "0$id";
|
| 109 |
+
?>
|
| 110 |
+
<div style="border:5px solid transparent; float:left;">
|
| 111 |
+
<div style="border-width: 1px; border-style: inset; border-color: transparent;">
|
| 112 |
+
<a href="#" onclick="activate(this, '<?php echo $id;?>', '<?php echo $payment['DESCR']?>')"><img src='https://www.mpay24.com/merchadm/img/ptypes/<?php echo $id?>.png' alt='<?php echo $payment['DESCR']?>' title='<?php echo $payment['DESCR']?>' ></a>
|
| 113 |
+
<input type="hidden" id='<?php echo $id;?>' name='mpay24_ps' value='<?php echo $id;?>' disabled />
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
<?php endforeach; ?>
|
| 117 |
+
<input type="hidden" id='mpay24_all' name='mpay24_ps' value='false' />
|
| 118 |
+
</div>
|
| 119 |
+
</td>
|
| 120 |
+
</tr>
|
| 121 |
+
<tr>
|
| 122 |
+
<td colspan="2">
|
| 123 |
+
<div style="padding-bottom: 2px; border-top: 1px solid #b3b3b3"></div>
|
| 124 |
+
</td>
|
| 125 |
+
</tr>
|
| 126 |
+
<tr>
|
| 127 |
+
<td></td>
|
| 128 |
+
<td>
|
| 129 |
+
<img style="float:right" src="https://www.mpay24.com/web/img/logos/payment-mpay24.png" alt="mPAY24" title="mPAY24" width="40%" height="40%">
|
| 130 |
+
</td>
|
| 131 |
+
</tr>
|
| 132 |
+
</table>
|
| 133 |
+
</td>
|
| 134 |
+
<td width="3" colspan="2" bgcolor="#ffffff"></td>
|
| 135 |
+
<td width="1" bgcolor="#b3b3b3"></td>
|
| 136 |
+
</tr>
|
| 137 |
+
<tr>
|
| 138 |
+
<td height="2" width="1"></td>
|
| 139 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 140 |
+
<td height="2" colspan="3" bgcolor="#ffffff"></td>
|
| 141 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 142 |
+
<td height="2" width="1"></td>
|
| 143 |
+
</tr>
|
| 144 |
+
<tr>
|
| 145 |
+
<td height="1" colspan="2"></td>
|
| 146 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 147 |
+
<td height="1" bgcolor="#ffffff"></td>
|
| 148 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 149 |
+
<td height="1" colspan="2"></td>
|
| 150 |
+
</tr>
|
| 151 |
+
<tr>
|
| 152 |
+
<td height="1" colspan="3"></td>
|
| 153 |
+
<td height="1" bgcolor="#b3b3b3"></td>
|
| 154 |
+
<td height="1" colspan="3"></td>
|
| 155 |
+
</tr>
|
| 156 |
+
</table>
|
| 157 |
+
</li>
|
| 158 |
+
<?php endif;?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
</ul>
|
app/design/frontend/default/default/template/mpay24/form/dropDown.phtml
CHANGED
|
@@ -12,141 +12,151 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
-
<?php
|
| 22 |
-
|
| 23 |
-
|
| 24 |
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true') {
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
}
|
| 32 |
-
?>
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
var eSelect = document.getElementById('mpay24_ps');
|
| 36 |
var mpay24PsImg = document.getElementById('mpay24_img');
|
| 37 |
eSelect.onchange = function() {
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
}
|
| 43 |
}
|
| 44 |
}
|
| 45 |
</script>
|
| 46 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
<?php endforeach; ?>
|
| 107 |
-
</select>
|
| 108 |
-
</td>
|
| 109 |
-
<td>
|
| 110 |
-
<img id="mpay24_img" src='https://www.mpay24.com/app/checkout/img/brands/[brand].gif' alt='Description' title='Description' style="display: none; margin-top: 19px; margin-bottom: 19px;">
|
| 111 |
-
</td>
|
| 112 |
-
</tr>
|
| 113 |
-
<tr>
|
| 114 |
-
<td colspan="2">
|
| 115 |
-
<div style="padding-bottom: 2px; border-top: 1px solid #b3b3b3"></div>
|
| 116 |
-
</td>
|
| 117 |
-
</tr>
|
| 118 |
-
<tr>
|
| 119 |
-
<td></td>
|
| 120 |
-
<td>
|
| 121 |
-
<img style="float:right" src="https://www.mpay24.com/web/img/logos/payment-mpay24.png" alt="mPAY24" title="mPAY24" width="40%" height="40%">
|
| 122 |
-
</td>
|
| 123 |
-
</tr>
|
| 124 |
-
</table>
|
| 125 |
-
</td>
|
| 126 |
-
<td width="3" colspan="2" bgcolor="#ffffff"></td>
|
| 127 |
-
<td width="1" bgcolor="#b3b3b3"></td>
|
| 128 |
-
</tr>
|
| 129 |
-
<tr>
|
| 130 |
-
<td height="2" width="1"></td>
|
| 131 |
-
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 132 |
-
<td height="2" colspan="3" bgcolor="#ffffff"></td>
|
| 133 |
-
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 134 |
-
<td height="2" width="1"></td>
|
| 135 |
-
</tr>
|
| 136 |
-
<tr>
|
| 137 |
-
<td height="1" colspan="2"></td>
|
| 138 |
-
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 139 |
-
<td height="1" bgcolor="#ffffff"></td>
|
| 140 |
-
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 141 |
-
<td height="1" colspan="2"></td>
|
| 142 |
-
</tr>
|
| 143 |
-
<tr>
|
| 144 |
-
<td height="1" colspan="3"></td>
|
| 145 |
-
<td height="1" bgcolor="#b3b3b3"></td>
|
| 146 |
-
<td height="1" colspan="3"></td>
|
| 147 |
-
</tr>
|
| 148 |
-
</table>
|
| 149 |
-
</div>
|
| 150 |
-
</li>
|
| 151 |
-
<?php endif;?>
|
| 152 |
</ul>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
+
<?php
|
| 22 |
+
$_code=$this->getMethodCode();
|
| 23 |
+
|
| 24 |
if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true') {
|
| 25 |
+
$brandsAndTypes = explode(", ", Mage::getStoreConfig('mpay24/mpay24/active_payment_types'));
|
| 26 |
+
$brands = array();
|
| 27 |
+
foreach($brandsAndTypes as $brandAndType)
|
| 28 |
+
$brands[substr($brandAndType, 0, strpos($brandAndType, "=>"))] = substr($brandAndType, strpos($brandAndType, "=>")+2);
|
| 29 |
+
|
| 30 |
+
$temp_brand="";
|
| 31 |
}
|
| 32 |
+
?>
|
| 33 |
+
<script type="text/javascript">
|
| 34 |
+
var selectedPayment = "../../../web/img/logos/payment-mpay24";
|
| 35 |
+
window.onload = function() {
|
| 36 |
+
var inputs = document.getElementById('mpay24_table').getElementsByTagName('input');
|
| 37 |
+
|
| 38 |
+
for(i=0; i<inputs.length; i++)
|
| 39 |
+
inputs[i].disabled = true;
|
| 40 |
+
|
| 41 |
var eSelect = document.getElementById('mpay24_ps');
|
| 42 |
var mpay24PsImg = document.getElementById('mpay24_img');
|
| 43 |
eSelect.onchange = function() {
|
| 44 |
+
if(eSelect.value != "false")
|
| 45 |
+
mpay24PsImg.style.display = 'block';
|
| 46 |
+
else
|
| 47 |
+
mpay24PsImg.style.display = 'none';
|
|
|
|
| 48 |
}
|
| 49 |
}
|
| 50 |
</script>
|
| 51 |
<ul id="payment_form_<?php echo $_code ?>" style="display:none;">
|
| 52 |
+
<li>
|
| 53 |
+
<b>
|
| 54 |
+
<?php if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true')
|
| 55 |
+
echo Mage::helper('mpay24')->__("You can choose the payment system you want to use now or do it when you are redirected to the mPAY24 pay page after placing the order.");
|
| 56 |
+
else
|
| 57 |
+
echo Mage::helper('mpay24')->__("You can choose the payment system you want to use after you are redirected to the mPAY24 pay page after placing the order.");
|
| 58 |
+
?>
|
| 59 |
+
</b>
|
| 60 |
+
</li>
|
| 61 |
+
|
| 62 |
+
<?php if(Mage::getStoreConfig('mpay24/mpay24/payments_active') == 'true'):?>
|
| 63 |
+
<li>
|
| 64 |
+
<div id="myDIV" style="min-height:100px; padding:10px 15px 15px;">
|
| 65 |
+
|
| 66 |
+
<table>
|
| 67 |
+
<tr>
|
| 68 |
+
<td height="1" colspan="3"></td>
|
| 69 |
+
<td height="1" bgcolor="#b3b3b3"></td>
|
| 70 |
+
<td height="1" colspan="3"></td>
|
| 71 |
+
</tr>
|
| 72 |
+
<tr>
|
| 73 |
+
<td height="1" colspan="2"></td>
|
| 74 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 75 |
+
<td height="1" bgcolor="#ffffff"></td>
|
| 76 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 77 |
+
<td height="1" colspan="2"></td>
|
| 78 |
+
</tr>
|
| 79 |
+
<tr>
|
| 80 |
+
<td height="2" width="1"></td>
|
| 81 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 82 |
+
<td height="2" colspan="3" bgcolor="#ffffff"></td>
|
| 83 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 84 |
+
<td height="2" width="1"></td>
|
| 85 |
+
</tr>
|
| 86 |
+
<tr>
|
| 87 |
+
<td width="1" bgcolor="#b3b3b3"></td>
|
| 88 |
+
<td width="3" colspan="2" bgcolor="#ffffff"></td>
|
| 89 |
+
<td bgcolor="#ffffff">
|
| 90 |
+
<table id='mpay24_table' style="width: 100%;">
|
| 91 |
+
<colgroup>
|
| 92 |
+
<col width="70%">
|
| 93 |
+
<col width="30%">
|
| 94 |
+
</colgroup>
|
| 95 |
+
<tr>
|
| 96 |
+
<td>
|
| 97 |
+
<select id="mpay24_ps" name="mpay24_ps" style="margin-top: 20px; margin-bottom:20px; width: 256px" title="mPAY24 <?php echo Mage::helper('mpay24')->__("Payment method");?>" onchange="document.getElementById('mpay24_img').style.display = (this.selectedIndex != 0) ? 'block' : 'none';
|
| 98 |
+
document.getElementById('mpay24_img').src='https://www.mpay24.com/merchadm/img/ptypes/'+this.options[this.selectedIndex].value+'.png';selectedPayment=this.options[this.selectedIndex].value;">
|
| 99 |
+
<option value="false">mPAY24 (<?php echo Mage::helper('mpay24')->__("All payment methods") ?>)</option>
|
| 100 |
+
<?php foreach ($this->getActiveMethods() as $id => $payment):
|
| 101 |
+
$changed = false;
|
| 102 |
+
if($temp_brand == "" || $temp_brand != $payment['P_TYPE']) {
|
| 103 |
+
if($temp_brand == "")
|
| 104 |
+
echo "</optgroup>";
|
| 105 |
+
$temp_brand = $payment['P_TYPE'];
|
| 106 |
+
echo "<optgroup label='$temp_brand'>";
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
if(strlen($id) == 1)
|
| 110 |
+
$id = "00$id";
|
| 111 |
+
elseif(strlen($id) == 2)
|
| 112 |
+
$id = "0$id";
|
| 113 |
+
?>
|
| 114 |
|
| 115 |
+
<option value="<?php echo $id ?>"><?php echo $payment['DESCR']?></option>
|
| 116 |
+
<?php endforeach; ?>
|
| 117 |
+
</select>
|
| 118 |
+
</td>
|
| 119 |
+
<td>
|
| 120 |
+
<img id="mpay24_img" src='' style="display: none; margin-top: 19px; margin-bottom: 19px;">
|
| 121 |
+
</td>
|
| 122 |
+
</tr>
|
| 123 |
+
<tr>
|
| 124 |
+
<td colspan="2">
|
| 125 |
+
<div style="padding-bottom: 2px; border-top: 1px solid #b3b3b3"></div>
|
| 126 |
+
</td>
|
| 127 |
+
</tr>
|
| 128 |
+
<tr>
|
| 129 |
+
<td></td>
|
| 130 |
+
<td>
|
| 131 |
+
<img style="float:right" src="https://www.mpay24.com/web/img/logos/payment-mpay24.png" alt="mPAY24" title="mPAY24" width="40%" height="40%">
|
| 132 |
+
</td>
|
| 133 |
+
</tr>
|
| 134 |
+
</table>
|
| 135 |
+
</td>
|
| 136 |
+
<td width="3" colspan="2" bgcolor="#ffffff"></td>
|
| 137 |
+
<td width="1" bgcolor="#b3b3b3"></td>
|
| 138 |
+
</tr>
|
| 139 |
+
<tr>
|
| 140 |
+
<td height="2" width="1"></td>
|
| 141 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 142 |
+
<td height="2" colspan="3" bgcolor="#ffffff"></td>
|
| 143 |
+
<td height="2" width="1" bgcolor="#b3b3b3"></td>
|
| 144 |
+
<td height="2" width="1"></td>
|
| 145 |
+
</tr>
|
| 146 |
+
<tr>
|
| 147 |
+
<td height="1" colspan="2"></td>
|
| 148 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 149 |
+
<td height="1" bgcolor="#ffffff"></td>
|
| 150 |
+
<td height="1" width="2" bgcolor="#b3b3b3"></td>
|
| 151 |
+
<td height="1" colspan="2"></td>
|
| 152 |
+
</tr>
|
| 153 |
+
<tr>
|
| 154 |
+
<td height="1" colspan="3"></td>
|
| 155 |
+
<td height="1" bgcolor="#b3b3b3"></td>
|
| 156 |
+
<td height="1" colspan="3"></td>
|
| 157 |
+
</tr>
|
| 158 |
+
</table>
|
| 159 |
+
</div>
|
| 160 |
+
</li>
|
| 161 |
+
<?php endif;?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
</ul>
|
app/design/frontend/default/default/template/mpay24/info/selectpayment.phtml
CHANGED
|
@@ -12,15 +12,20 @@
|
|
| 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
|
| 16 |
-
* @package
|
| 17 |
-
* @author
|
| 18 |
-
* @license
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
-
<p><b>
|
| 22 |
-
<?php
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
<?php if($this->getMethod()->getData('info_instance')->getOrder() !== null): ?>
|
| 25 |
-
|
| 26 |
<?php endif; ?>
|
| 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 Filipp Akinfiev
|
| 18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 19 |
*/
|
| 20 |
?>
|
| 21 |
+
<p><b>
|
| 22 |
+
<?php
|
| 23 |
+
// $pMethId = $this->getPMethId();
|
| 24 |
+
// if($pMethId == 0)
|
| 25 |
+
// $pMethId = "../../../web/img/logos/payment-mpay24";
|
| 26 |
+
|
| 27 |
+
echo "<img onerror='if(typeof selectedPayment === \"undefined\") selectedPayment=\"../../../web/img/logos/payment-mpay24\"; this.src=\"https://www.mpay24.com/merchadm/img/ptypes/\" + selectedPayment + \".png\";this.title=brand;this.alt=brand;' style='max-width: 40%;padding-top: 5px;' src='https://www.mpay24.com/merchadm/img/ptypes/".$this->getPMethId().".png' alt='".$this->getPType()."-".$this->getBrand()."' title='".$this->getPType()."-".$this->getBrand()."'>".' ('.Mage::getStoreConfig('payment/mpay24/title').')' ?></b><br/>
|
| 28 |
+
|
| 29 |
<?php if($this->getMethod()->getData('info_instance')->getOrder() !== null): ?>
|
| 30 |
+
<?php echo Mage::helper('mpay24')->__("Approval code") . ": " . $this->htmlEscape($this->getInfo()->getOrder()->getPayment()->getAdditionalInformation('appr_code')) ?><br/>
|
| 31 |
<?php endif; ?>
|
app/etc/modules/Mpay24_Mpay24.xml
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
</config>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Mpay24_Mpay24>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
<depends>
|
| 8 |
+
<Mage_Payment />
|
| 9 |
+
</depends>
|
| 10 |
+
<version>1.4.5</version>
|
| 11 |
+
</Mpay24_Mpay24>
|
| 12 |
+
</modules>
|
| 13 |
+
</config>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>mPAY24</name>
|
| 4 |
-
<version>1.4.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>Open Software License (OSL 3.0)</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -26,17 +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>Bug fixing and
|
| 30 |
-

|
| 31 |
-
1. Orders which have status 'REDIRECTED' can be canceled/voided.
|
| 32 |
-

|
| 33 |
-
2. An eps problem was solved
|
| 34 |
-

|
| 35 |
-
3. There are specified IPs which are allowed for the confirmation requests. In case the request is coming not from one of these IPs a TRANSACTIONSTATUS request is executed.</notes>
|
| 36 |
<authors><author><name>Filipp Akinfiev</name><user>auto-converted</user><email>firedrago.magento@gmail.com</email></author></authors>
|
| 37 |
-
<date>2013-
|
| 38 |
-
<time>
|
| 39 |
-
<contents><target name="magelocale"><dir name="de_AT"><file name="Mpay24_Mpay24.csv" hash="e55fbe56741682943f5565fec1b47442"/></dir><dir name="de_DE"><file name="Mpay24_Mpay24.csv" hash="e55fbe56741682943f5565fec1b47442"/></dir><dir name="de_CH"><file name="Mpay24_Mpay24.csv" hash="e55fbe56741682943f5565fec1b47442"/></dir><dir name="en_US"><file name="Mpay24_Mpay24.csv" hash="1cfa1bb474c632817c46f68b80669662"/></dir></target><target name="mageetc"><dir name="modules"><file name="Mpay24_Mpay24.xml" hash="
|
| 40 |
<compatible/>
|
| 41 |
<dependencies/>
|
| 42 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>mPAY24</name>
|
| 4 |
+
<version>1.4.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>Bug fixing and Klarna upgrades</notes>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
<authors><author><name>Filipp Akinfiev</name><user>auto-converted</user><email>firedrago.magento@gmail.com</email></author></authors>
|
| 31 |
+
<date>2013-07-15</date>
|
| 32 |
+
<time>12:31:54</time>
|
| 33 |
+
<contents><target name="magelocale"><dir name="de_AT"><file name="Mpay24_Mpay24.csv" hash="e55fbe56741682943f5565fec1b47442"/></dir><dir name="de_DE"><file name="Mpay24_Mpay24.csv" hash="e55fbe56741682943f5565fec1b47442"/></dir><dir name="de_CH"><file name="Mpay24_Mpay24.csv" hash="e55fbe56741682943f5565fec1b47442"/></dir><dir name="en_US"><file name="Mpay24_Mpay24.csv" hash="1cfa1bb474c632817c46f68b80669662"/></dir></target><target name="mageetc"><dir name="modules"><file name="Mpay24_Mpay24.xml" hash="9caa078c8d501daf44c43c96c285944d"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="mpay24"><dir name="form"><file name="area.phtml" hash="094f87bd0c18680526b71a15a921f4d9"/><file name="dropDown.phtml" hash="710cfd110e7bed5243a858f036c032b3"/></dir><dir name="info"><file name="selectpayment.phtml" hash="8226793abeeefcd1eac82c0726ce1819"/></dir></dir></dir><dir name="layout"><file name="mpay24.xml" hash="3417d5919482983b50e3d95820bbce4f"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="mpay24"><dir name="info"><file name="selectpayment.phtml" hash="370e2123561715591462cafc0af8d3d4"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Mpay24"><dir name="Mpay24"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Fieldset.php" hash="cb5955592fa8c56116ff86bc184e1cf8"/></dir></dir></dir></dir><dir name="Form"><file name="Selectpayment.php" hash="33c7e9d835118bcc70375b5c14bb5002"/></dir><dir name="Info"><file name="Selectpayment.php" hash="bc8da2bca1747af4def3a512acf3dc9c"/></dir><file name="Form.php" hash="d86b90b41641d7906348b0c746f446ec"/><file name="Mpay24.php" hash="4e1cb8cfea5f4b8f8a30d1423d7faa80"/><file name="ParentRedirect.php" hash="de08767824ea258fbfe743e48ad96b51"/></dir><dir name="Helper"><file name="Data.php" hash="a03853a3a120aea062b057c3f076da69"/></dir><dir name="Model"><dir name="Api"><dir name="xmls"><file name="1900000046.xml" hash=""/><file name="1900000047.xml" hash=""/><file name="1900000048.xml" hash=""/><file name="1900000049.xml" hash=""/><file name="1900000050.xml" hash=""/><file name="1900000051.xml" hash=""/><file name="Example_MDXI.xml" hash="660e8669bc96a337f3df4eafdc14d10f"/></dir><file name="MDXI.xsd" hash="1fe34d745ec21a9443d69be1d22ef402"/><file name="MPay24Api.php" hash="62a2baccad331e4028aa1ce477494e19"/><file name="MPay24MagentoShop.php" hash="5cbbc793a0f42581dbd775eb5d8f5c3a"/><file name="MPay24Shop.php" hash="bca4ac4968f1b9a6a95b808c1c285975"/><file name="cacert.pem" hash="4e0c8fcca8148533e6723f94463a3c73"/><file name="curllog.log" hash=""/><file name="orderXML.php" hash="be050d973024293b02244b46f0ab1c06"/></dir><dir name="Entity"><file name="Setup.php" hash="9018084a94bdb33d414e00a292f07620"/></dir><dir name="Method"><file name="Abstract.php" hash="be7ce6e978a0f7d910cab9926f287fd2"/><file name="Selectpayment.php" hash="42281735de0765dfc8513b7d4177c8d5"/></dir><dir name="Mpay24"><file name="Debug.php" hash="81e9f542ff38674def60b0b0cbf7415f"/></dir><dir name="Mysql4"><dir name="Mpay24"><dir name="Debug"><file name="Collection.php" hash="a666401af236feec1445997b2bec0b9c"/></dir><file name="Debug.php" hash="57bdb58db32907167967b9544bf0fae8"/></dir><file name="Setup.php" hash="e4b289f35d15f495ab0e8438d5a79834"/></dir><dir name="Source"><file name="AllowedIPs.php" hash="a623cab8d99169439c05007f97cc77f1"/><file name="BillAddr.php" hash="92594658bbd8b596336e8aa864596533"/><file name="ClearingAction.php" hash="4b2c3280fb7113d30cc51f224cbe3b7e"/><file name="FormTemplate.php" hash="862e898a14478959b9fb48fd93273609"/><file name="PaidOrder.php" hash="1852bbc6940be99928a5a81287c013d2"/><file name="PaymentsActive.php" hash="2307fb5d5c556af6130022f8c8d6ed2b"/><file name="Request.php" hash="9d26e8fb2e5e924d7b0cfdfe32aa9fca"/><file name="Result.php" hash="c170c561846a3e98f61918e8f7551fb8"/><file name="ShoppingCartRowsAction.php" hash="fefe4440476a8c055e700f54c4fbdbfb"/><file name="System.php" hash="fbd3e48cd38de26eec765c66943e39d3"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Encrypted.php" hash="cd54d9f1b22da04d51ced935a151b3a9"/></dir></dir></dir><file name="Config.php" hash="ede3ad7c0a6c6457263d6fecba118529"/><file name="Observer.php" hash="dc5c5d0b282ccd0e18843d9b6e1ba8bf"/><file name="Selectpayment.php" hash="d752b7a45d4ddfb73c08354bfaddb21d"/><file name="Session.php" hash="e92db9dba87f3baf415430774e414b04"/></dir><dir name="controllers"><file name="IndexController.php" hash="9ccac5fd19e5f5bb0d58056b3db16c42"/><file name="PaymentController.php" hash="496a3133f74c1ffadf8794388c8851ce"/></dir><dir name="etc"><file name="config.xml" hash="3a82b45c926ea6da5c4c3d045373badb"/><file name="system.xml" hash="4a844eee313d9cbde6e58896f8bc23b6"/></dir><dir name="sql"><dir name="mpay24_setup"><file name="mysql4-install-1.4.3.php" hash="b6a95bf6a44a51443ff6e6e870490d61"/><file name="mysql4-install-1.4.4.php" hash="7ba433e629adbbfdd35cbedf8b85918b"/><file name="mysql4-install-1.4.5.php" hash="7ba433e629adbbfdd35cbedf8b85918b"/><file name="mysql4-upgrade-0.6.2-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-0.6.2-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-0.6.2-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.0-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.0-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.0-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.4-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.4-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.4-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.6-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.6-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.6-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.7-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.7-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.0.7-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.1-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.1-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.1-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.7-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.7-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.7-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.8-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.8-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.8-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.9-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.9-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.1.9-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.0-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.0-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.0-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.1-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.1-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.1-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.2-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.2-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.2.2-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.3.0-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.3.0-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.3.0-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.0-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.0-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.0-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.1-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.1-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.1-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.2-1.4.3.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.2-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.2-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.3-1.4.4.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.3-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/><file name="mysql4-upgrade-1.4.4-1.4.5.php" hash="8c9e784c460a57d05d53656e5a9baeea"/></dir></dir></dir></dir></target></contents>
|
| 34 |
<compatible/>
|
| 35 |
<dependencies/>
|
| 36 |
</package>
|
