From 9bb265e3f4e65c26ec99725cd8e611a8ed6d5470 Mon Sep 17 00:00:00 2001 From: Lee Saferite Date: Wed, 28 Jul 2010 09:49:05 -0400 Subject: [PATCH] Import Magento Release 1.4.1.1 --- .gitignore | 2 +- RELEASE_NOTES.txt | 112 + app/Mage.php | 2 +- .../Phoenix/Moneybookers/Model/Abstract.php | 15 - .../Phoenix/Moneybookers/etc/config.xml | 95 +- .../Phoenix/Moneybookers/etc/system.xml | 85 + .../mysql4-upgrade-1.2-1.2.0.1.php | 41 + .../Block/Sales/Order/Creditmemo/Totals.php | 158 +- .../Block/System/Convert/Profile/Run.php | 2 +- .../Form/Renderer/Fieldset/Element.php | 2 +- .../Block/Widget/Grid/Column/Filter/Date.php | 1 + .../Adminhtml/Model/Sales/Order/Create.php | 2 + .../Mage/Adminhtml/Model/Search/Order.php | 33 +- .../Config/Source/Payment/Allmethods.php | 15 +- .../Sales/Billing/AgreementController.php | 4 +- .../System/Convert/ProfileController.php | 2 +- .../Mage/Api/Model/Server/Adapter/Soap.php | 1 + .../Block/Product/List/Toolbar/Pager.php | 2 +- .../Eav/Mysql4/Product/Indexer/Price.php | 28 +- .../Mage/Catalog/Model/Template/Filter.php | 39 + .../Block/Qtyincrements.php} | 56 +- .../Mage/CatalogInventory/Helper/Data.php | 4 +- .../CatalogInventory/Helper/Minsaleqty.php | 204 ++ .../CatalogInventory/Model/Mysql4/Stock.php | 4 +- .../Mage/CatalogInventory/Model/Observer.php | 35 +- .../Mage/CatalogInventory/Model/Stock.php | 14 +- .../CatalogInventory/Model/Stock/Item.php | 111 +- .../System/Config/Backend/Minsaleqty.php | 53 +- .../Model/Mysql4/Rule/Collection.php | 14 + .../core/Mage/CatalogRule/Model/Observer.php | 58 + app/code/core/Mage/CatalogRule/etc/config.xml | 8 + .../core/Mage/Centinel/Model/Observer.php | 29 +- .../core/Mage/Centinel/Model/State/Jcb.php | 15 +- app/code/core/Mage/Centinel/etc/config.xml | 6 +- app/code/core/Mage/Checkout/Helper/Data.php | 2 +- .../Checkout/Model/Type/Multishipping.php | 18 +- .../core/Mage/Checkout/Model/Type/Onepage.php | 5 + .../controllers/MultishippingController.php | 54 +- .../controllers/OnepageController.php | 5 +- app/code/core/Mage/Chronopay/Block/Form.php | 42 - app/code/core/Mage/Chronopay/Block/Info.php | 48 - .../Mage/Chronopay/Block/Standard/Failure.php | 37 - .../Mage/Chronopay/Block/Standard/Form.php | 43 - .../Chronopay/Block/Standard/Redirect.php | 59 - app/code/core/Mage/Chronopay/Helper/Data.php | 38 - .../core/Mage/Chronopay/Model/Api/Debug.php | 41 - app/code/core/Mage/Chronopay/Model/Config.php | 126 - .../core/Mage/Chronopay/Model/Gateway.php | 341 --- .../Mage/Chronopay/Model/Gateway/Request.php | 38 - .../Mage/Chronopay/Model/Gateway/Result.php | 38 - .../Mage/Chronopay/Model/Mysql4/Api/Debug.php | 42 - .../Model/Mysql4/Api/Debug/Collection.php | 41 - .../Mage/Chronopay/Model/Mysql4/Setup.php | 39 - .../Mage/Chronopay/Model/Source/Cctype.php | 40 - .../Mage/Chronopay/Model/Source/Language.php | 50 - .../Chronopay/Model/Source/PaymentAction.php | 49 - .../core/Mage/Chronopay/Model/Standard.php | 273 --- .../controllers/StandardController.php | 219 -- app/code/core/Mage/Chronopay/etc/config.xml | 142 -- app/code/core/Mage/Chronopay/etc/system.xml | 272 --- .../chronopay_setup/mysql4-install-0.1.0.php | 45 - .../Mage/Core/Model/Email/Template/Filter.php | 1 + .../Core/Model/Mysql4/Collection/Abstract.php | 30 + app/code/core/Mage/Cybermut/Block/Error.php | 37 - app/code/core/Mage/Cybermut/Block/Form.php | 43 - .../core/Mage/Cybermut/Block/Redirect.php | 63 - app/code/core/Mage/Cybermut/Helper/Data.php | 38 - .../core/Mage/Cybermut/Model/Api/Debug.php | 41 - .../Mage/Cybermut/Model/Mysql4/Api/Debug.php | 42 - .../Model/Mysql4/Api/Debug/Collection.php | 41 - .../core/Mage/Cybermut/Model/Mysql4/Setup.php | 39 - app/code/core/Mage/Cybermut/Model/Payment.php | 378 --- .../core/Mage/Cybermut/Model/Source/Bank.php | 49 - .../Mage/Cybermut/Model/Source/Language.php | 52 - .../controllers/PaymentController.php | 203 -- app/code/core/Mage/Cybermut/etc/config.xml | 110 - app/code/core/Mage/Cybermut/etc/system.xml | 174 -- .../cybermut_setup/mysql4-install-0.1.0.php | 45 - app/code/core/Mage/Cybersource/Block/Form.php | 96 - app/code/core/Mage/Cybersource/Block/Info.php | 75 - .../core/Mage/Cybersource/Helper/Data.php | 33 - .../core/Mage/Cybersource/Model/Api/Debug.php | 38 - .../Model/Api/ExtendedSoapClient.php | 117 - .../core/Mage/Cybersource/Model/Config.php | 62 - .../Cybersource/Model/Mysql4/Api/Debug.php | 39 - .../Model/Mysql4/Api/Debug/Collection.php | 39 - .../Mage/Cybersource/Model/Mysql4/Setup.php | 38 - app/code/core/Mage/Cybersource/Model/Soap.php | 582 ----- .../Mage/Cybersource/Model/Source/Cctype.php | 33 - .../Model/Source/PaymentAction.php | 42 - app/code/core/Mage/Cybersource/etc/config.xml | 123 - app/code/core/Mage/Cybersource/etc/system.xml | 160 -- .../mysql4-install-0.7.0.php | 54 - app/code/core/Mage/Eway/Block/Form.php | 42 - app/code/core/Mage/Eway/Block/Info.php | 48 - .../core/Mage/Eway/Block/Secure/Failure.php | 53 - app/code/core/Mage/Eway/Block/Secure/Form.php | 41 - .../core/Mage/Eway/Block/Secure/Redirect.php | 57 - .../core/Mage/Eway/Block/Shared/Failure.php | 55 - app/code/core/Mage/Eway/Block/Shared/Form.php | 42 - .../core/Mage/Eway/Block/Shared/Redirect.php | 58 - .../core/Mage/Eway/Controller/Abstract.php | 178 -- app/code/core/Mage/Eway/Helper/Data.php | 37 - app/code/core/Mage/Eway/Model/Api/Debug.php | 40 - app/code/core/Mage/Eway/Model/Direct.php | 309 --- .../core/Mage/Eway/Model/Mysql4/Api/Debug.php | 40 - .../Model/Mysql4/Api/Debug/Collection.php | 40 - .../core/Mage/Eway/Model/Mysql4/Setup.php | 38 - app/code/core/Mage/Eway/Model/Secure.php | 54 - app/code/core/Mage/Eway/Model/Shared.php | 254 -- .../core/Mage/Eway/Model/Source/Cctype.php | 40 - .../Eway/controllers/SecureController.php | 42 - .../Eway/controllers/SharedController.php | 42 - app/code/core/Mage/Eway/etc/config.xml | 142 -- app/code/core/Mage/Eway/etc/system.xml | 354 --- .../sql/eway_setup/mysql4-install-0.1.0.php | 46 - app/code/core/Mage/Flo2Cash/Block/Form.php | 41 - app/code/core/Mage/Flo2Cash/Block/Info.php | 48 - app/code/core/Mage/Flo2Cash/Helper/Data.php | 37 - .../core/Mage/Flo2Cash/Model/Api/Debug.php | 40 - .../Mage/Flo2Cash/Model/Mysql4/Api/Debug.php | 40 - .../Model/Mysql4/Api/Debug/Collection.php | 40 - .../core/Mage/Flo2Cash/Model/Mysql4/Setup.php | 37 - .../Mage/Flo2Cash/Model/Source/Cctype.php | 40 - .../Flo2Cash/Model/Source/PaymentAction.php | 49 - app/code/core/Mage/Flo2Cash/Model/Web.php | 304 --- app/code/core/Mage/Flo2Cash/etc/config.xml | 121 - app/code/core/Mage/Flo2Cash/etc/system.xml | 176 -- .../flo2cash_setup/mysql4-install-0.1.0.php | 47 - .../mysql4-upgrade-0.1.0-0.1.1.php | 32 - .../Block/Adminhtml/Items/Renderer/Id.php | 2 +- .../core/Mage/GoogleBase/Model/Config.php | 2 +- app/code/core/Mage/GoogleBase/etc/config.xml | 2 +- app/code/core/Mage/GoogleBase/etc/system.xml | 3 +- .../mysql4-upgrade-0.1.1-0.1.2.php} | 30 +- .../Mage/Ideal/Block/Advanced/Failure.php | 55 - .../core/Mage/Ideal/Block/Advanced/Form.php | 52 - .../Mage/Ideal/Block/Advanced/Redirect.php | 45 - .../core/Mage/Ideal/Block/Basic/Failure.php | 55 - app/code/core/Mage/Ideal/Block/Basic/Form.php | 42 - .../core/Mage/Ideal/Block/Basic/Redirect.php | 59 - app/code/core/Mage/Ideal/Helper/Data.php | 46 - app/code/core/Mage/Ideal/Model/Advanced.php | 237 -- .../core/Mage/Ideal/Model/Api/Advanced.php | 507 ---- .../Api/Advanced/AcquirerStatusRequest.php | 61 - .../Api/Advanced/AcquirerStatusResponse.php | 44 - .../Model/Api/Advanced/AcquirerTrxRequest.php | 84 - .../Api/Advanced/AcquirerTrxResponse.php | 41 - .../Model/Api/Advanced/DirectoryRequest.php | 36 - .../Model/Api/Advanced/DirectoryResponse.php | 50 - .../Mage/Ideal/Model/Api/Advanced/Issuer.php | 41 - .../Mage/Ideal/Model/Api/Advanced/Request.php | 80 - .../Ideal/Model/Api/Advanced/Response.php | 54 - .../Ideal/Model/Api/Advanced/Security.php | 155 -- app/code/core/Mage/Ideal/Model/Api/Debug.php | 40 - app/code/core/Mage/Ideal/Model/Basic.php | 220 -- .../Mage/Ideal/Model/Mysql4/Api/Debug.php | 42 - .../Model/Mysql4/Api/Debug/Collection.php | 41 - .../core/Mage/Ideal/Model/Mysql4/Setup.php | 37 - app/code/core/Mage/Ideal/Model/Observer.php | 58 - .../core/Mage/Ideal/Model/Source/Language.php | 47 - .../Ideal/controllers/AdvancedController.php | 195 -- .../Ideal/controllers/BasicController.php | 247 -- app/code/core/Mage/Ideal/etc/config.xml | 136 -- app/code/core/Mage/Ideal/etc/system.xml | 326 --- .../sql/ideal_setup/mysql4-install-0.1.0.php | 51 - app/code/core/Mage/Ogone/Block/Form.php | 39 - app/code/core/Mage/Ogone/Block/Info.php | 41 - app/code/core/Mage/Ogone/Block/Paypage.php | 41 - app/code/core/Mage/Ogone/Block/Placeform.php | 90 - app/code/core/Mage/Ogone/Helper/Data.php | 70 - app/code/core/Mage/Ogone/Model/Api.php | 268 --- app/code/core/Mage/Ogone/Model/Api/Debug.php | 40 - app/code/core/Mage/Ogone/Model/Config.php | 151 -- .../Mage/Ogone/Model/Mysql4/Api/Debug.php | 40 - .../Mage/Ogone/Model/Source/PaymentAction.php | 45 - .../core/Mage/Ogone/Model/Source/Pmlist.php | 45 - .../core/Mage/Ogone/Model/Source/Template.php | 44 - .../Mage/Ogone/controllers/ApiController.php | 482 ---- app/code/core/Mage/Ogone/etc/config.xml | 137 -- app/code/core/Mage/Ogone/etc/system.xml | 234 -- .../sql/ogone_setup/mysql4-install-0.0.1.php | 46 - .../Oscommerce/Block/Adminhtml/Import.php | 43 - .../Block/Adminhtml/Import/Edit.php | 68 - .../Block/Adminhtml/Import/Edit/Form.php | 52 - .../Adminhtml/Import/Edit/Tab/General.php | 110 - .../Block/Adminhtml/Import/Edit/Tab/Run.php | 239 -- .../Block/Adminhtml/Import/Edit/Tabs.php | 66 - .../Block/Adminhtml/Import/Grid.php | 94 - .../Oscommerce/Block/Adminhtml/Import/Run.php | 293 --- .../Mage/Oscommerce/Block/Adminhtml/Order.php | 43 - .../Oscommerce/Block/Adminhtml/Order/Grid.php | 128 - .../Oscommerce/Block/Adminhtml/Order/View.php | 102 - .../core/Mage/Oscommerce/Block/Order/List.php | 73 - .../core/Mage/Oscommerce/Block/Order/View.php | 69 - app/code/core/Mage/Oscommerce/Helper/Data.php | 35 - .../core/Mage/Oscommerce/Model/Config.php | 49 - .../Oscommerce/Model/Mysql4/Oscommerce.php | 2113 ----------------- .../Model/Mysql4/Oscommerce/Collection.php | 38 - .../Model/Mysql4/Oscommerce/Order.php | 81 - .../Mysql4/Oscommerce/Order/Collection.php | 55 - .../core/Mage/Oscommerce/Model/Oscommerce.php | 87 - .../Oscommerce/Model/Oscommerce/Order.php | 55 - .../core/Mage/Oscommerce/Model/Session.php | 39 - .../Adminhtml/ImportController.php | 432 ---- .../controllers/Adminhtml/OrderController.php | 107 - .../controllers/OrderController.php | 100 - .../core/Mage/Oscommerce/etc/adminhtml.xml | 80 - .../core/Mage/Oscommerce/etc/charsets.xml | 595 ----- app/code/core/Mage/Oscommerce/etc/config.xml | 159 -- .../oscommerce_setup/mysql4-install-0.8.0.php | 72 - .../mysql4-upgrade-0.8.0-0.8.1.php | 47 - .../mysql4-upgrade-0.8.2-0.8.3.php | 125 - .../mysql4-upgrade-0.8.3-0.8.4.php | 36 - .../mysql4-upgrade-0.8.4-0.8.5.php | 37 - .../mysql4-upgrade-0.8.5-0.8.6.php | 37 - .../mysql4-upgrade-0.8.6-0.8.7.php | 39 - .../mysql4-upgrade-0.8.7-0.8.8.php | 41 - .../mysql4-upgrade-0.8.8-0.8.9.php | 41 - .../mysql4-upgrade-0.8.9-0.8.10.php | 38 - .../Mage/Paybox/Block/Adminhtml/Cart/Type.php | 46 - .../Block/Adminhtml/Cart/Type/Select.php | 56 - .../core/Mage/Paybox/Block/Direct/Form.php | 42 - .../core/Mage/Paybox/Block/Direct/Info.php | 48 - .../core/Mage/Paybox/Block/System/Error.php | 93 - .../core/Mage/Paybox/Block/System/Failure.php | 61 - .../core/Mage/Paybox/Block/System/Form.php | 42 - .../Mage/Paybox/Block/System/Redirect.php | 57 - app/code/core/Mage/Paybox/Helper/Data.php | 37 - app/code/core/Mage/Paybox/Model/Api/Debug.php | 40 - app/code/core/Mage/Paybox/Model/Direct.php | 503 ---- .../Mage/Paybox/Model/Mysql4/Api/Debug.php | 40 - .../Model/Mysql4/Api/Debug/Collection.php | 40 - .../Paybox/Model/Mysql4/Question/Number.php | 41 - .../core/Mage/Paybox/Model/Mysql4/Setup.php | 37 - .../Mage/Paybox/Model/Question/Number.php | 95 - .../Mage/Paybox/Model/Source/CartType.php | 61 - .../core/Mage/Paybox/Model/Source/Cctype.php | 40 - .../Mage/Paybox/Model/Source/Language.php | 50 - .../Paybox/Model/Source/ManagementMode.php | 48 - .../Mage/Paybox/Model/Source/MethodCall.php | 45 - .../Paybox/Model/Source/PaymentAction.php | 43 - .../Mage/Paybox/Model/Source/PaymentMode.php | 45 - .../Mage/Paybox/Model/Source/PaymentType.php | 48 - app/code/core/Mage/Paybox/Model/System.php | 517 ---- .../Paybox/controllers/SystemController.php | 364 --- app/code/core/Mage/Paybox/etc/config.xml | 120 - app/code/core/Mage/Paybox/etc/currency.xml | 209 -- app/code/core/Mage/Paybox/etc/system.xml | 459 ---- .../sql/paybox_setup/mysql4-install-0.1.0.php | 47 - .../mysql4-upgrade-0.1.0-0.1.1.php | 33 - .../mysql4-upgrade-0.1.1-0.1.2.php | 44 - .../mysql4-upgrade-0.1.2-0.1.3.php | 33 - app/code/core/Mage/Payment/Helper/Data.php | 3 + .../Mage/Payment/Model/Billing/Agreement.php | 2 +- .../core/Mage/Payment/Model/Method/Cc.php | 9 +- .../core/Mage/Paypal/Block/Express/Form.php | 2 +- .../core/Mage/Paypal/Block/Standard/Form.php | 2 +- .../Mage/Paypal/Block/Standard/Redirect.php | 2 +- .../Paypal/Controller/Express/Abstract.php | 8 +- app/code/core/Mage/Paypal/Helper/Data.php | 17 +- .../Mage/Paypal/Model/Express/Checkout.php | 14 + .../Mage/Paypal/Model/Method/Agreement.php | 1 + .../core/Mage/Paypal/Model/Payflowpro.php | 467 ++-- app/code/core/Mage/Paypal/etc/system.xml | 6 +- app/code/core/Mage/PaypalUk/Model/Direct.php | 2 +- app/code/core/Mage/PaypalUk/Model/Express.php | 2 +- .../Mage/Protx/Block/Standard/Failure.php | 56 - .../core/Mage/Protx/Block/Standard/Form.php | 43 - .../Mage/Protx/Block/Standard/Redirect.php | 58 - app/code/core/Mage/Protx/Helper/Data.php | 38 - app/code/core/Mage/Protx/Model/Api/Debug.php | 41 - app/code/core/Mage/Protx/Model/Config.php | 179 -- .../Mage/Protx/Model/Mysql4/Api/Debug.php | 42 - .../Model/Mysql4/Api/Debug/Collection.php | 41 - .../core/Mage/Protx/Model/Mysql4/Setup.php | 39 - app/code/core/Mage/Protx/Model/Session.php | 42 - .../Mage/Protx/Model/Source/ModeAction.php | 49 - .../Mage/Protx/Model/Source/PaymentAction.php | 46 - app/code/core/Mage/Protx/Model/Standard.php | 462 ---- .../Protx/controllers/StandardController.php | 271 --- app/code/core/Mage/Protx/etc/config.xml | 109 - app/code/core/Mage/Protx/etc/system.xml | 167 -- .../sql/protx_setup/mysql4-install-0.1.0.php | 46 - app/code/core/Mage/Rss/Block/Order/Status.php | 6 +- app/code/core/Mage/Rss/Model/Mysql4/Order.php | 248 +- .../Mage/Rule/Model/Condition/Combine.php | 20 +- .../Billing/Agreement/View/Tab/Info.php | 4 +- .../Mage/Sales/Model/Billing/Agreement.php | 32 +- .../core/Mage/Sales/Model/Mysql4/Order.php | 14 + .../Sales/Model/Mysql4/Order/Collection.php | 67 +- .../Model/Mysql4/Order/Item/Collection.php | 12 +- .../Order/Payment/Transaction/Collection.php | 1 + .../Order/Shipment/Track/Collection.php | 14 +- .../Model/Mysql4/Order/Status/History.php | 2 +- app/code/core/Mage/Sales/Model/Order.php | 2 +- app/code/core/Mage/Sales/Model/Order/Api.php | 41 +- .../core/Mage/Sales/Model/Order/Api/V2.php | 38 +- .../Model/Order/Creditmemo/Total/Shipping.php | 14 +- .../core/Mage/Sales/Model/Order/Invoice.php | 10 + .../Mage/Sales/Model/Order/Invoice/Api.php | 7 +- .../core/Mage/Sales/Model/Order/Payment.php | 22 +- .../core/Mage/Sales/Model/Order/Shipment.php | 7 + .../Mage/Sales/Model/Order/Shipment/Api.php | 1 + .../core/Mage/Sales/Model/Service/Quote.php | 35 +- .../Model/Mysql4/Rule/Collection.php | 19 + .../core/Mage/SalesRule/Model/Observer.php | 57 + app/code/core/Mage/SalesRule/etc/config.xml | 10 + .../core/Mage/Shipping/Model/Shipping.php | 3 + app/code/core/Mage/Strikeiron/Helper/Data.php | 38 - .../Model/Currency/Import/Strikeiron.php | 104 - .../Mage/Strikeiron/Model/Mysql4/Taxrate.php | 106 - .../Model/Mysql4/Taxrate/Collection.php | 51 - .../Model/Service/AddressVerification.php | 49 - .../Mage/Strikeiron/Model/Service/Base.php | 61 - .../Model/Service/EmailVerification.php | 48 - .../Model/Service/ForeignExchangeRates.php | 45 - .../Strikeiron/Model/Service/SalesUseTax.php | 40 - .../Model/Service/SalesUseTaxBasic.php | 45 - .../Model/Service/SalesUseTaxComplete.php | 45 - .../Model/Service/UsAddressVerification.php | 45 - .../core/Mage/Strikeiron/Model/Session.php | 39 - .../Model/Source/ErrorAddressAction.php | 42 - .../Strikeiron/Model/Source/SalesTaxType.php | 42 - .../Model/Source/Salestaxminmax.php | 42 - .../Model/Source/UndeterminedEmailAction.php | 42 - .../core/Mage/Strikeiron/Model/Strikeiron.php | 391 --- .../core/Mage/Strikeiron/Model/Taxrate.php | 37 - .../Strikeiron/controllers/TestController.php | 42 - .../core/Mage/Strikeiron/etc/adminhtml.xml | 49 - app/code/core/Mage/Strikeiron/etc/config.xml | 140 -- app/code/core/Mage/Strikeiron/etc/system.xml | 293 --- .../strikeiron_setup/mysql4-install-0.9.1.php | 48 - .../Mage/Tax/Model/Sales/Total/Quote/Tax.php | 13 +- app/code/core/Mage/Usa/etc/config.xml | 1 + .../adminhtml/default/default/layout/main.xml | 2 +- .../default/template/chronopay/form.phtml | 81 - .../default/template/chronopay/info.phtml | 31 - .../default/template/chronopay/pdf/info.phtml | 33 - .../default/template/cms/browser/js.phtml | 2 +- .../default/template/cybersource/form.phtml | 162 -- .../default/template/cybersource/info.phtml | 39 - .../template/cybersource/pdf/info.phtml | 43 - .../default/default/template/eway/form.phtml | 82 - .../default/default/template/eway/info.phtml | 30 - .../default/template/eway/pdf/info.phtml | 31 - .../default/template/flo2cash/form.phtml | 82 - .../default/template/flo2cash/info.phtml | 31 - .../default/template/flo2cash/pdf/info.phtml | 33 - .../template/ideal/advanced/info.phtml | 33 - .../template/ideal/advanced/pdf/info.phtml | 29 - .../default/default/template/ogone/info.phtml | 29 - .../template/oscommerce/convert/run.phtml | 252 -- .../template/oscommerce/order/view.phtml | 241 -- .../paybox/adminhtml/cart/type/select.phtml | 45 - .../default/template/paybox/direct/form.phtml | 82 - .../default/template/paybox/direct/info.phtml | 31 - .../template/paybox/direct/pdf/info.phtml | 33 - .../system/config/fieldset/global.phtml | 2 +- .../form/renderer/fieldset/element.phtml | 2 +- .../template/tag/edit/serializer.phtml | 8 +- .../base/default/layout/chronopay.xml | 42 - .../frontend/base/default/layout/cybermut.xml | 40 - .../frontend/base/default/layout/eway.xml | 53 - .../frontend/base/default/layout/ideal.xml | 51 - .../frontend/base/default/layout/ogone.xml | 59 - .../base/default/layout/oscommerce.xml | 41 - .../frontend/base/default/layout/paybox.xml | 56 - .../frontend/base/default/layout/protx.xml | 43 - .../frontend/base/default/layout/wishlist.xml | 214 +- .../qtyincrements.phtml} | 16 +- .../cataloginventory/stockqty/composite.phtml | 124 +- .../cataloginventory/stockqty/default.phtml | 70 +- .../template/checkout/cart/sidebar.phtml | 2 +- .../default/template/chronopay/form.phtml | 90 - .../default/template/chronopay/info.phtml | 34 - .../template/chronopay/standard/failure.phtml | 30 - .../template/chronopay/standard/form.phtml | 30 - .../default/template/cybermut/error.phtml | 30 - .../base/default/template/cybermut/form.phtml | 30 - .../default/template/cybersource/form.phtml | 190 -- .../default/template/cybersource/info.phtml | 38 - .../default/template/email/order/items.phtml | 2 +- .../base/default/template/eway/form.phtml | 91 - .../base/default/template/eway/info.phtml | 33 - .../template/eway/secure/failure.phtml | 31 - .../default/template/eway/secure/form.phtml | 30 - .../template/eway/shared/failure.phtml | 31 - .../default/template/eway/shared/form.phtml | 30 - .../base/default/template/flo2cash/form.phtml | 90 - .../base/default/template/flo2cash/info.phtml | 34 - .../template/ideal/advanced/failure.phtml | 31 - .../template/ideal/advanced/form.phtml | 42 - .../template/ideal/basic/failure.phtml | 31 - .../default/template/ideal/basic/form.phtml | 30 - .../base/default/template/ogone/form.phtml | 33 - .../base/default/template/ogone/info.phtml | 27 - .../base/default/template/ogone/paypage.phtml | 28 - .../default/template/ogone/placeform.phtml | 45 - .../template/oscommerce/order/list.phtml | 56 - .../template/oscommerce/order/view.phtml | 141 -- .../default/template/paybox/direct/form.phtml | 92 - .../default/template/paybox/direct/info.phtml | 34 - .../template/paybox/system/error.phtml | 31 - .../default/template/paybox/system/form.phtml | 30 - .../default/template/payment/form/cc.phtml | 26 +- .../template/protx/standard/failure.phtml | 31 - .../template/protx/standard/form.phtml | 30 - .../default/iphone/layout/oscommerce.xml | 41 - .../catalog/product/list/toolbar/pager.phtml | 2 +- .../template/oscommerce/order/list.phtml | 56 - .../template/oscommerce/order/view.phtml | 139 -- .../default/modern/layout/wishlist.xml | 214 +- .../catalog/product/list/toolbar/pager.phtml | 2 +- .../default/template/install/begin.phtml | 2 +- app/etc/modules/Mage_Chronopay.xml | 38 - app/etc/modules/Mage_Cybermut.xml | 38 - app/etc/modules/Mage_Cybersource.xml | 38 - app/etc/modules/Mage_Eway.xml | 38 - app/etc/modules/Mage_Flo2Cash.xml | 38 - app/etc/modules/Mage_Ideal.xml | 38 - app/etc/modules/Mage_Ogone.xml | 39 - app/etc/modules/Mage_Oscommerce.xml | 41 - app/etc/modules/Mage_Paybox.xml | 38 - app/etc/modules/Mage_Protx.xml | 38 - app/etc/modules/Mage_Strikeiron.xml | 38 - app/locale/en_US/Mage_Adminhtml.csv | 4 + app/locale/en_US/Mage_CatalogRule.csv | 1 + app/locale/en_US/Mage_Chronopay.csv | 49 - app/locale/en_US/Mage_Cybermut.csv | 35 - app/locale/en_US/Mage_Cybersource.csv | 41 - app/locale/en_US/Mage_Eway.csv | 38 - app/locale/en_US/Mage_Flo2Cash.csv | 27 - app/locale/en_US/Mage_Ideal.csv | 60 - app/locale/en_US/Mage_Ogone.csv | 73 - app/locale/en_US/Mage_Oscommerce.csv | 128 - app/locale/en_US/Mage_Paybox.csv | 106 - app/locale/en_US/Mage_Paypal.csv | 14 +- app/locale/en_US/Mage_PaypalUk.csv | 2 +- app/locale/en_US/Mage_Protx.csv | 31 - app/locale/en_US/Mage_Sales.csv | 2 +- app/locale/en_US/Mage_SalesRule.csv | 1 + app/locale/en_US/Mage_Strikeiron.csv | 47 - .../email/strikeiron_email_warning.html | 10 - js/prototype/validation.js | 17 +- lib/Varien/Data/Collection/Db.php | 29 +- pkginfo/Mage_Cybermut.txt | 1 - pkginfo/Mage_Paybox.txt | 1 - 448 files changed, 2081 insertions(+), 32084 deletions(-) create mode 100644 app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/mysql4-upgrade-1.2-1.2.0.1.php rename app/code/core/Mage/{Ideal/Block/Advanced/Info.php => CatalogInventory/Block/Qtyincrements.php} (51%) create mode 100644 app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php delete mode 100644 app/code/core/Mage/Chronopay/Block/Form.php delete mode 100644 app/code/core/Mage/Chronopay/Block/Info.php delete mode 100644 app/code/core/Mage/Chronopay/Block/Standard/Failure.php delete mode 100644 app/code/core/Mage/Chronopay/Block/Standard/Form.php delete mode 100644 app/code/core/Mage/Chronopay/Block/Standard/Redirect.php delete mode 100644 app/code/core/Mage/Chronopay/Helper/Data.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Config.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Gateway.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Gateway/Request.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Gateway/Result.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug/Collection.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Source/Cctype.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Source/Language.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Source/PaymentAction.php delete mode 100644 app/code/core/Mage/Chronopay/Model/Standard.php delete mode 100644 app/code/core/Mage/Chronopay/controllers/StandardController.php delete mode 100644 app/code/core/Mage/Chronopay/etc/config.xml delete mode 100644 app/code/core/Mage/Chronopay/etc/system.xml delete mode 100644 app/code/core/Mage/Chronopay/sql/chronopay_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Cybermut/Block/Error.php delete mode 100644 app/code/core/Mage/Cybermut/Block/Form.php delete mode 100644 app/code/core/Mage/Cybermut/Block/Redirect.php delete mode 100644 app/code/core/Mage/Cybermut/Helper/Data.php delete mode 100644 app/code/core/Mage/Cybermut/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug/Collection.php delete mode 100644 app/code/core/Mage/Cybermut/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Cybermut/Model/Payment.php delete mode 100644 app/code/core/Mage/Cybermut/Model/Source/Bank.php delete mode 100644 app/code/core/Mage/Cybermut/Model/Source/Language.php delete mode 100644 app/code/core/Mage/Cybermut/controllers/PaymentController.php delete mode 100644 app/code/core/Mage/Cybermut/etc/config.xml delete mode 100644 app/code/core/Mage/Cybermut/etc/system.xml delete mode 100644 app/code/core/Mage/Cybermut/sql/cybermut_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Cybersource/Block/Form.php delete mode 100644 app/code/core/Mage/Cybersource/Block/Info.php delete mode 100644 app/code/core/Mage/Cybersource/Helper/Data.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Api/ExtendedSoapClient.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Config.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug/Collection.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Soap.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Source/Cctype.php delete mode 100644 app/code/core/Mage/Cybersource/Model/Source/PaymentAction.php delete mode 100644 app/code/core/Mage/Cybersource/etc/config.xml delete mode 100644 app/code/core/Mage/Cybersource/etc/system.xml delete mode 100644 app/code/core/Mage/Cybersource/sql/cybersource_setup/mysql4-install-0.7.0.php delete mode 100644 app/code/core/Mage/Eway/Block/Form.php delete mode 100644 app/code/core/Mage/Eway/Block/Info.php delete mode 100644 app/code/core/Mage/Eway/Block/Secure/Failure.php delete mode 100644 app/code/core/Mage/Eway/Block/Secure/Form.php delete mode 100644 app/code/core/Mage/Eway/Block/Secure/Redirect.php delete mode 100644 app/code/core/Mage/Eway/Block/Shared/Failure.php delete mode 100644 app/code/core/Mage/Eway/Block/Shared/Form.php delete mode 100644 app/code/core/Mage/Eway/Block/Shared/Redirect.php delete mode 100644 app/code/core/Mage/Eway/Controller/Abstract.php delete mode 100644 app/code/core/Mage/Eway/Helper/Data.php delete mode 100644 app/code/core/Mage/Eway/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Eway/Model/Direct.php delete mode 100644 app/code/core/Mage/Eway/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Eway/Model/Mysql4/Api/Debug/Collection.php delete mode 100644 app/code/core/Mage/Eway/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Eway/Model/Secure.php delete mode 100644 app/code/core/Mage/Eway/Model/Shared.php delete mode 100644 app/code/core/Mage/Eway/Model/Source/Cctype.php delete mode 100644 app/code/core/Mage/Eway/controllers/SecureController.php delete mode 100644 app/code/core/Mage/Eway/controllers/SharedController.php delete mode 100644 app/code/core/Mage/Eway/etc/config.xml delete mode 100644 app/code/core/Mage/Eway/etc/system.xml delete mode 100644 app/code/core/Mage/Eway/sql/eway_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Flo2Cash/Block/Form.php delete mode 100644 app/code/core/Mage/Flo2Cash/Block/Info.php delete mode 100644 app/code/core/Mage/Flo2Cash/Helper/Data.php delete mode 100644 app/code/core/Mage/Flo2Cash/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug/Collection.php delete mode 100644 app/code/core/Mage/Flo2Cash/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Flo2Cash/Model/Source/Cctype.php delete mode 100644 app/code/core/Mage/Flo2Cash/Model/Source/PaymentAction.php delete mode 100644 app/code/core/Mage/Flo2Cash/Model/Web.php delete mode 100644 app/code/core/Mage/Flo2Cash/etc/config.xml delete mode 100644 app/code/core/Mage/Flo2Cash/etc/system.xml delete mode 100644 app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-upgrade-0.1.0-0.1.1.php rename app/code/core/Mage/{Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.1-0.8.2.php => GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php} (64%) delete mode 100644 app/code/core/Mage/Ideal/Block/Advanced/Failure.php delete mode 100755 app/code/core/Mage/Ideal/Block/Advanced/Form.php delete mode 100755 app/code/core/Mage/Ideal/Block/Advanced/Redirect.php delete mode 100644 app/code/core/Mage/Ideal/Block/Basic/Failure.php delete mode 100755 app/code/core/Mage/Ideal/Block/Basic/Form.php delete mode 100755 app/code/core/Mage/Ideal/Block/Basic/Redirect.php delete mode 100755 app/code/core/Mage/Ideal/Helper/Data.php delete mode 100755 app/code/core/Mage/Ideal/Model/Advanced.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusRequest.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusResponse.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxRequest.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxResponse.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryRequest.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryResponse.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/Issuer.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/Request.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/Response.php delete mode 100755 app/code/core/Mage/Ideal/Model/Api/Advanced/Security.php delete mode 100644 app/code/core/Mage/Ideal/Model/Api/Debug.php delete mode 100755 app/code/core/Mage/Ideal/Model/Basic.php delete mode 100644 app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug/Collection.php delete mode 100755 app/code/core/Mage/Ideal/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Ideal/Model/Observer.php delete mode 100644 app/code/core/Mage/Ideal/Model/Source/Language.php delete mode 100755 app/code/core/Mage/Ideal/controllers/AdvancedController.php delete mode 100755 app/code/core/Mage/Ideal/controllers/BasicController.php delete mode 100755 app/code/core/Mage/Ideal/etc/config.xml delete mode 100755 app/code/core/Mage/Ideal/etc/system.xml delete mode 100755 app/code/core/Mage/Ideal/sql/ideal_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Ogone/Block/Form.php delete mode 100644 app/code/core/Mage/Ogone/Block/Info.php delete mode 100644 app/code/core/Mage/Ogone/Block/Paypage.php delete mode 100644 app/code/core/Mage/Ogone/Block/Placeform.php delete mode 100644 app/code/core/Mage/Ogone/Helper/Data.php delete mode 100644 app/code/core/Mage/Ogone/Model/Api.php delete mode 100644 app/code/core/Mage/Ogone/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Ogone/Model/Config.php delete mode 100644 app/code/core/Mage/Ogone/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Ogone/Model/Source/PaymentAction.php delete mode 100644 app/code/core/Mage/Ogone/Model/Source/Pmlist.php delete mode 100644 app/code/core/Mage/Ogone/Model/Source/Template.php delete mode 100644 app/code/core/Mage/Ogone/controllers/ApiController.php delete mode 100644 app/code/core/Mage/Ogone/etc/config.xml delete mode 100644 app/code/core/Mage/Ogone/etc/system.xml delete mode 100644 app/code/core/Mage/Ogone/sql/ogone_setup/mysql4-install-0.0.1.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Form.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/General.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/Run.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tabs.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Grid.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Order.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/Grid.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/View.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Order/List.php delete mode 100644 app/code/core/Mage/Oscommerce/Block/Order/View.php delete mode 100644 app/code/core/Mage/Oscommerce/Helper/Data.php delete mode 100644 app/code/core/Mage/Oscommerce/Model/Config.php delete mode 100644 app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce.php delete mode 100755 app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Collection.php delete mode 100644 app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order.php delete mode 100644 app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order/Collection.php delete mode 100755 app/code/core/Mage/Oscommerce/Model/Oscommerce.php delete mode 100644 app/code/core/Mage/Oscommerce/Model/Oscommerce/Order.php delete mode 100644 app/code/core/Mage/Oscommerce/Model/Session.php delete mode 100644 app/code/core/Mage/Oscommerce/controllers/Adminhtml/ImportController.php delete mode 100644 app/code/core/Mage/Oscommerce/controllers/Adminhtml/OrderController.php delete mode 100644 app/code/core/Mage/Oscommerce/controllers/OrderController.php delete mode 100644 app/code/core/Mage/Oscommerce/etc/adminhtml.xml delete mode 100644 app/code/core/Mage/Oscommerce/etc/charsets.xml delete mode 100755 app/code/core/Mage/Oscommerce/etc/config.xml delete mode 100755 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-install-0.8.0.php delete mode 100755 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.0-0.8.1.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.2-0.8.3.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.3-0.8.4.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.4-0.8.5.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.5-0.8.6.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.6-0.8.7.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.7-0.8.8.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.8-0.8.9.php delete mode 100644 app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.9-0.8.10.php delete mode 100644 app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type.php delete mode 100644 app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type/Select.php delete mode 100644 app/code/core/Mage/Paybox/Block/Direct/Form.php delete mode 100644 app/code/core/Mage/Paybox/Block/Direct/Info.php delete mode 100644 app/code/core/Mage/Paybox/Block/System/Error.php delete mode 100644 app/code/core/Mage/Paybox/Block/System/Failure.php delete mode 100644 app/code/core/Mage/Paybox/Block/System/Form.php delete mode 100644 app/code/core/Mage/Paybox/Block/System/Redirect.php delete mode 100644 app/code/core/Mage/Paybox/Helper/Data.php delete mode 100644 app/code/core/Mage/Paybox/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Paybox/Model/Direct.php delete mode 100644 app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug/Collection.php delete mode 100644 app/code/core/Mage/Paybox/Model/Mysql4/Question/Number.php delete mode 100644 app/code/core/Mage/Paybox/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Paybox/Model/Question/Number.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/CartType.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/Cctype.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/Language.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/ManagementMode.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/MethodCall.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/PaymentAction.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/PaymentMode.php delete mode 100644 app/code/core/Mage/Paybox/Model/Source/PaymentType.php delete mode 100644 app/code/core/Mage/Paybox/Model/System.php delete mode 100644 app/code/core/Mage/Paybox/controllers/SystemController.php delete mode 100644 app/code/core/Mage/Paybox/etc/config.xml delete mode 100644 app/code/core/Mage/Paybox/etc/currency.xml delete mode 100644 app/code/core/Mage/Paybox/etc/system.xml delete mode 100644 app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.0-0.1.1.php delete mode 100644 app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.1-0.1.2.php delete mode 100644 app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.2-0.1.3.php delete mode 100644 app/code/core/Mage/Protx/Block/Standard/Failure.php delete mode 100644 app/code/core/Mage/Protx/Block/Standard/Form.php delete mode 100644 app/code/core/Mage/Protx/Block/Standard/Redirect.php delete mode 100644 app/code/core/Mage/Protx/Helper/Data.php delete mode 100644 app/code/core/Mage/Protx/Model/Api/Debug.php delete mode 100644 app/code/core/Mage/Protx/Model/Config.php delete mode 100644 app/code/core/Mage/Protx/Model/Mysql4/Api/Debug.php delete mode 100644 app/code/core/Mage/Protx/Model/Mysql4/Api/Debug/Collection.php delete mode 100644 app/code/core/Mage/Protx/Model/Mysql4/Setup.php delete mode 100644 app/code/core/Mage/Protx/Model/Session.php delete mode 100644 app/code/core/Mage/Protx/Model/Source/ModeAction.php delete mode 100644 app/code/core/Mage/Protx/Model/Source/PaymentAction.php delete mode 100644 app/code/core/Mage/Protx/Model/Standard.php delete mode 100644 app/code/core/Mage/Protx/controllers/StandardController.php delete mode 100644 app/code/core/Mage/Protx/etc/config.xml delete mode 100644 app/code/core/Mage/Protx/etc/system.xml delete mode 100644 app/code/core/Mage/Protx/sql/protx_setup/mysql4-install-0.1.0.php delete mode 100644 app/code/core/Mage/Strikeiron/Helper/Data.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Currency/Import/Strikeiron.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate/Collection.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/AddressVerification.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/Base.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/EmailVerification.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/ForeignExchangeRates.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/SalesUseTax.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxBasic.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxComplete.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Service/UsAddressVerification.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Session.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Source/ErrorAddressAction.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Source/SalesTaxType.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Source/Salestaxminmax.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Source/UndeterminedEmailAction.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Strikeiron.php delete mode 100644 app/code/core/Mage/Strikeiron/Model/Taxrate.php delete mode 100644 app/code/core/Mage/Strikeiron/controllers/TestController.php delete mode 100644 app/code/core/Mage/Strikeiron/etc/adminhtml.xml delete mode 100644 app/code/core/Mage/Strikeiron/etc/config.xml delete mode 100644 app/code/core/Mage/Strikeiron/etc/system.xml delete mode 100644 app/code/core/Mage/Strikeiron/sql/strikeiron_setup/mysql4-install-0.9.1.php delete mode 100644 app/design/adminhtml/default/default/template/chronopay/form.phtml delete mode 100644 app/design/adminhtml/default/default/template/chronopay/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/chronopay/pdf/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/cybersource/form.phtml delete mode 100644 app/design/adminhtml/default/default/template/cybersource/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/cybersource/pdf/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/eway/form.phtml delete mode 100644 app/design/adminhtml/default/default/template/eway/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/eway/pdf/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/flo2cash/form.phtml delete mode 100644 app/design/adminhtml/default/default/template/flo2cash/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/flo2cash/pdf/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/ideal/advanced/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/ideal/advanced/pdf/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/ogone/info.phtml delete mode 100755 app/design/adminhtml/default/default/template/oscommerce/convert/run.phtml delete mode 100644 app/design/adminhtml/default/default/template/oscommerce/order/view.phtml delete mode 100644 app/design/adminhtml/default/default/template/paybox/adminhtml/cart/type/select.phtml delete mode 100644 app/design/adminhtml/default/default/template/paybox/direct/form.phtml delete mode 100644 app/design/adminhtml/default/default/template/paybox/direct/info.phtml delete mode 100644 app/design/adminhtml/default/default/template/paybox/direct/pdf/info.phtml delete mode 100644 app/design/frontend/base/default/layout/chronopay.xml delete mode 100644 app/design/frontend/base/default/layout/cybermut.xml delete mode 100644 app/design/frontend/base/default/layout/eway.xml delete mode 100644 app/design/frontend/base/default/layout/ideal.xml delete mode 100644 app/design/frontend/base/default/layout/ogone.xml delete mode 100644 app/design/frontend/base/default/layout/oscommerce.xml delete mode 100644 app/design/frontend/base/default/layout/paybox.xml delete mode 100644 app/design/frontend/base/default/layout/protx.xml rename app/design/frontend/base/default/template/{ideal/advanced/info.phtml => cataloginventory/qtyincrements.phtml} (75%) delete mode 100644 app/design/frontend/base/default/template/chronopay/form.phtml delete mode 100644 app/design/frontend/base/default/template/chronopay/info.phtml delete mode 100644 app/design/frontend/base/default/template/chronopay/standard/failure.phtml delete mode 100644 app/design/frontend/base/default/template/chronopay/standard/form.phtml delete mode 100644 app/design/frontend/base/default/template/cybermut/error.phtml delete mode 100644 app/design/frontend/base/default/template/cybermut/form.phtml delete mode 100644 app/design/frontend/base/default/template/cybersource/form.phtml delete mode 100644 app/design/frontend/base/default/template/cybersource/info.phtml delete mode 100644 app/design/frontend/base/default/template/eway/form.phtml delete mode 100644 app/design/frontend/base/default/template/eway/info.phtml delete mode 100644 app/design/frontend/base/default/template/eway/secure/failure.phtml delete mode 100644 app/design/frontend/base/default/template/eway/secure/form.phtml delete mode 100644 app/design/frontend/base/default/template/eway/shared/failure.phtml delete mode 100644 app/design/frontend/base/default/template/eway/shared/form.phtml delete mode 100644 app/design/frontend/base/default/template/flo2cash/form.phtml delete mode 100644 app/design/frontend/base/default/template/flo2cash/info.phtml delete mode 100644 app/design/frontend/base/default/template/ideal/advanced/failure.phtml delete mode 100755 app/design/frontend/base/default/template/ideal/advanced/form.phtml delete mode 100644 app/design/frontend/base/default/template/ideal/basic/failure.phtml delete mode 100755 app/design/frontend/base/default/template/ideal/basic/form.phtml delete mode 100644 app/design/frontend/base/default/template/ogone/form.phtml delete mode 100644 app/design/frontend/base/default/template/ogone/info.phtml delete mode 100644 app/design/frontend/base/default/template/ogone/paypage.phtml delete mode 100644 app/design/frontend/base/default/template/ogone/placeform.phtml delete mode 100644 app/design/frontend/base/default/template/oscommerce/order/list.phtml delete mode 100644 app/design/frontend/base/default/template/oscommerce/order/view.phtml delete mode 100644 app/design/frontend/base/default/template/paybox/direct/form.phtml delete mode 100644 app/design/frontend/base/default/template/paybox/direct/info.phtml delete mode 100644 app/design/frontend/base/default/template/paybox/system/error.phtml delete mode 100644 app/design/frontend/base/default/template/paybox/system/form.phtml delete mode 100644 app/design/frontend/base/default/template/protx/standard/failure.phtml delete mode 100644 app/design/frontend/base/default/template/protx/standard/form.phtml delete mode 100644 app/design/frontend/default/iphone/layout/oscommerce.xml delete mode 100644 app/design/frontend/default/iphone/template/oscommerce/order/list.phtml delete mode 100644 app/design/frontend/default/iphone/template/oscommerce/order/view.phtml delete mode 100644 app/etc/modules/Mage_Chronopay.xml delete mode 100644 app/etc/modules/Mage_Cybermut.xml delete mode 100644 app/etc/modules/Mage_Cybersource.xml delete mode 100644 app/etc/modules/Mage_Eway.xml delete mode 100644 app/etc/modules/Mage_Flo2Cash.xml delete mode 100644 app/etc/modules/Mage_Ideal.xml delete mode 100644 app/etc/modules/Mage_Ogone.xml delete mode 100644 app/etc/modules/Mage_Oscommerce.xml delete mode 100644 app/etc/modules/Mage_Paybox.xml delete mode 100644 app/etc/modules/Mage_Protx.xml delete mode 100644 app/etc/modules/Mage_Strikeiron.xml delete mode 100644 app/locale/en_US/Mage_Chronopay.csv delete mode 100644 app/locale/en_US/Mage_Cybermut.csv delete mode 100644 app/locale/en_US/Mage_Cybersource.csv delete mode 100644 app/locale/en_US/Mage_Eway.csv delete mode 100644 app/locale/en_US/Mage_Flo2Cash.csv delete mode 100644 app/locale/en_US/Mage_Ideal.csv delete mode 100644 app/locale/en_US/Mage_Ogone.csv delete mode 100644 app/locale/en_US/Mage_Oscommerce.csv delete mode 100644 app/locale/en_US/Mage_Paybox.csv delete mode 100644 app/locale/en_US/Mage_Protx.csv delete mode 100644 app/locale/en_US/Mage_Strikeiron.csv delete mode 100644 app/locale/en_US/template/email/strikeiron_email_warning.html delete mode 100644 pkginfo/Mage_Cybermut.txt delete mode 100644 pkginfo/Mage_Paybox.txt diff --git a/.gitignore b/.gitignore index 94bac9a080..00d7fce045 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,5 @@ # Dynamic data that doesn't need to be in the repo /var/* /media/* -/app/etc/local.xml /app/etc/use_cache.ser +local.xml diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 821277eeee..2328d04de9 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,115 @@ +==== 1.4.1.1 ==== + +=== Changes === +* Checkout: added dispatching event 'checkout_submit_all_after' into all checkout models +* Centinel: changed event for resetting validation state +* Added check for Order ID before try to lookup transactions by Transaction Id +* Added cvv field for Mastero/Switch/Solo cards. Also fixed html formatting. +* Re-factored saving relation of billing agreement with order. +* Added Qty Increments update in products mass-update. +* Added ability to update filter map in Varien_Data_Collection_Db +* Added comment about American Express cards in PayPal system configuration (http://www.paypal.com/amexupdate). + +=== Fixes === +* Fixed Tax calculation for Downloadable product in purchase it through PayPal Express Checkout +* Fixed "Notice: Undefined property: Mage_Catalog_Model_Template_Filter::$_useAbsoluteLinks " when you use WISIWYG Editor for field "Description" +* Fixed Website PayPal Standard payment method is not working with Reward Point, Store Credit and gift Cards +* Fixed Multiple address checkout with PauPalUK direct + 3d secure validation. Payment information error. Please start over. +* Fixed Fatal error onBilling Agreement Related page with applied filters +* Fixed The product's "Stock Status" is not changed from "In Stock" to "Out of Stock" +* Fixed Qty of the product continues to decline when the "Decrease Stock When Order is Placed" is set to "No" +* Fixed If set "Manage Stock" to "No": Qty decreasing when product is ordered +* Fixed The bottom part of the list "Payment Method" in SCPR has too much free place +** if title of Payment Method is empty, get it from overloaded configData('title') method of concrete Payment Method class +** rework. Delegate to Mage::helper('payment')->getPaymentMethodList method for retrieve all payment methods +** fixed by used new config features in 1.4.1 ver - in system.xml +** delete getConfigData method +** add config_path with 'payment' section to each field in system.xml +** in sql-upgrade change path to 'payment' section in core_config_data table +* Fixed tax calculation in case Unit Price Tax with settings applying customer tax "After Discount". +* Fixed Solo cards JS validation. Added expdate field to solo and maestro cards. Also removed some duplicates in credit card IIN ranges. +* Fixed Maestro/Switch/Solo cards js validation on payment form: Added additional issue_number and issue_date checks. +* Fixed fatal error in catalog/shopping cart rules based on recently deleted attribute. +* Fixed incorrect redirect after order placing failed, during second try of order placing. +* Fixed exception when "Created At" filter used on Transactions page. +* Fixed incorrect redirect during multishipping checkout as guest. +* Fixed issue with updating qty and addresses during checkout with multiple addresses which resets shipping address to the default billing address. +* Payflow pro: +** "Sale" action does not work. +** Missed transaction ID on fraud services filter triggered. +** Sub-standard order processing flow control and verbosity. +** Inappropriate "state" passed to the gateway in the order addresses. +* Fixed centinel JCB validation. +* Fixed #14885: Unable to upload products into GoogleBase. +* Fixed issue with creating credit memo for partial capture online invoice for the order witch where placed through Website Payments Pro (Payflow Edition) Payment method. +* PayPal: fixed grammar in payment form/redirect text messages (EC, WPS) +* Fixed: Subscribe to Order Status at the front end causing Fatal error: Call to undefined method Mage_Sales_Model_Mysql4_Order_Invoice::getDefaultAttributes() in app/code/core/Mage/Eav/Model/Config.php on line 438 +* Fixed fatal error when a configured payment method doesn't exist anymore +* Fixed fatal error: Call to a member function getError() on a non-object in app/code/core/Mage/Shipping/Model/Shipping.php on line 143 +* Fixed syntax error caused by accidental manual conflict resolving in Mage_Api_Model_Server_Adapter_Soap +* Fixed qty increments checking business logic for bundle products +* Fixed Mage_Sales_Model_Mysql4_Order_Collection::addFieldToSearchFilter() to be compatible with flat sales structure +* Fixed salesOrderList() broken API call +* Fixed #18534: order_increment_id empty with api salesOrderInvoiceInfo +* Fixed missing files and typo in Mage_Sales_Model_Order::prepareShipment() method described at http://www.magentocommerce.com/boards/viewthread/195761/P0/#top +* Fixed adding tracking for sales_order_shipment.create API call; fixed #17820: Api v2 Shippment create not working +* Fixed upgrading Sales module from backported 1.3 to 1.4: copied 0.9.38-0.9.39 upgrades to 1.3.99-1.4.0.0 + +=== Known Issue === +* Google checkout notification duplicates orders or double-process them on timeouts + + + +==== 1.4.x-devel-73934 ==== + +=== Changes === +* Re-factored saving relation of billing agreement with order. +* Added Qty Increments update in products mass-update. + +== Fixes == +* Fixed tax calculation in case Unit Price Tax with settings applying customer tax "After Discount". +* Fixed Solo cards JS validation. Added expdate field to solo and maestro cards. Also removed some duplicates in credit card IIN ranges. +* Fixed Maestro/Switch/Solo cards js validation on payment form: Added additional issue_number and issue_date checks. +* Fixed fatal error in catalog/shopping cart rules based on recently deleted attribute. +* Fixed incorrect redirect after order placing failed, during second try of order placing. +* Fixed exception when "Created At" filter used on Transactions page. +* Fixed incorrect redirect during multishipping checkout as guest. +* Fixed issue with updating qty and addresses during checkout with multiple addresses which resets shipping address to the default billing address. +* Payflow pro: +** "Sale" action does not work. +** Missed transaction ID on fraud services filter triggered. +** Sub-standard order processing flow control and verbosity. +** Inappropriate "state" passed to the gateway in the order addresses. +* Fixed centinel JCB validation. +* Fixed #14885: Unable to upload products into GoogleBase. +* Fixed issue with creating credit memo for partial capture online invoice for the order witch where placed through Website Payments Pro (Payflow Edition) Payment method. + +==== 1.4.x-devel-71052 ==== + +=== Fixes === +* PayPal: fixed grammar in payment form/redirect text messages (EC, WPS) +* Fixed: Subscribe to Order Status at the front end causing Fatal error: Call to undefined method Mage_Sales_Model_Mysql4_Order_Invoice::getDefaultAttributes() in app/code/core/Mage/Eav/Model/Config.php on line 438 +* Fixed fatal error when a configured payment method doesn't exist anymore +* Fixed fatal error: Call to a member function getError() on a non-object in app/code/core/Mage/Shipping/Model/Shipping.php on line 143 +* Fixed syntax error caused by accidental manual conflict resolving in Mage_Api_Model_Server_Adapter_Soap + + +==== 1.4.x-devel-70699 ==== + +=== Changes === +* Added ability to update filter map in Varien_Data_Collection_Db +* Added comment about American Express cards in PayPal system configuration (http://www.paypal.com/amexupdate). + +=== Fixes === +* Fixed qty increments checking business logic for bundle products +* Fixed Mage_Sales_Model_Mysql4_Order_Collection::addFieldToSearchFilter() to be compatible with flat sales structure +* Fixed salesOrderList() broken API call +* Fixed #18534: order_increment_id empty with api salesOrderInvoiceInfo +* Fixed missing files and typo in Mage_Sales_Model_Order::prepareShipment() method described at http://www.magentocommerce.com/boards/viewthread/195761/P0/#top +* Fixed adding tracking for sales_order_shipment.create API call; fixed #17820: Api v2 Shippment create not working +* Fixed upgrading Sales module from backported 1.3 to 1.4: copied 0.9.38-0.9.39 upgrades to 1.3.99-1.4.0.0 + + ==== 1.4.1.0 ==== === Improvements === diff --git a/app/Mage.php b/app/Mage.php index b1ce249c5e..cec1153838 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -153,7 +153,7 @@ public static function getVersionInfo() 'major' => '1', 'minor' => '4', 'revision' => '1', - 'patch' => '0', + 'patch' => '1', 'stability' => '', 'number' => '', ); diff --git a/app/code/community/Phoenix/Moneybookers/Model/Abstract.php b/app/code/community/Phoenix/Moneybookers/Model/Abstract.php index 9a281d4649..7c743473a6 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Abstract.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Abstract.php @@ -205,19 +205,4 @@ public function getConfigPaymentAction() $paymentAction = $this->getConfigData('payment_action'); return empty($paymentAction) ? true : $paymentAction; } - - /** - * Retrieve information from payment configuration - * - * @param string $field - * @return mixed - */ - public function getConfigData($field, $storeId = null) - { - if (null === $storeId) { - $storeId = $this->getStore(); - } - $path = 'moneybookers/'.$this->getCode().'/'.$field; - return Mage::getStoreConfig($path, $storeId); - } } diff --git a/app/code/community/Phoenix/Moneybookers/etc/config.xml b/app/code/community/Phoenix/Moneybookers/etc/config.xml index 364e9a7206..b9252b3743 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/config.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/config.xml @@ -22,7 +22,7 @@ - 1.2 + 1.2.0.1 @@ -147,85 +147,14 @@ - moneybookers/acc - mbookers - - - moneybookers/csi - mbookers - - - moneybookers/did - mbookers - - - moneybookers/dnk - mbookers - - - moneybookers/ebt - mbookers - - - moneybookers/ent mbookers - - - moneybookers/gcb - mbookers - - - moneybookers/gir - mbookers - - - moneybookers/idl - mbookers - - - moneybookers/lsr - mbookers - - - moneybookers/npy - mbookers - - - moneybookers/pli - mbookers - - - moneybookers/psp - mbookers - - - moneybookers/pwy - mbookers - - - moneybookers/sft - mbookers - - - moneybookers/so2 - mbookers - - - moneybookers/wlt - mbookers - - - - - 0 - - 0 moneybookers/acc Credit Card / Visa, Mastercard, AMEX, JCB, Diners 0 + mbookers 0 moneybookers/csi CartaSi @@ -233,6 +162,7 @@ IT + mbookers 0 moneybookers/did Lastschrift (ELV) @@ -240,6 +170,7 @@ DE + mbookers 0 moneybookers/dnk Dankort @@ -247,6 +178,7 @@ DK + mbookers 0 moneybookers/ebt Nordea Solo @@ -254,6 +186,7 @@ SE + mbookers 0 moneybookers/ent eNETS @@ -261,6 +194,7 @@ SG + mbookers 0 moneybookers/gcb Carte Bleue @@ -268,6 +202,7 @@ FR + mbookers 0 moneybookers/gir Giropay @@ -275,6 +210,7 @@ DE + mbookers 0 moneybookers/idl iDeal @@ -282,6 +218,7 @@ NL + mbookers 0 moneybookers/lsr Laser @@ -289,6 +226,7 @@ IE + mbookers 0 moneybookers/npy EPS Online-Überweisung @@ -296,6 +234,7 @@ AT + mbookers 0 moneybookers/pli POLi @@ -303,6 +242,7 @@ AU + mbookers 0 moneybookers/psp Postepay @@ -310,6 +250,7 @@ IT + mbookers 0 moneybookers/pwy All Polish Banks @@ -317,6 +258,7 @@ PL + mbookers 0 moneybookers/sft Sofortüberweisung @@ -324,6 +266,7 @@ DE + mbookers 0 moneybookers/so2 Nordea Solo @@ -331,11 +274,17 @@ FI + mbookers 0 moneybookers/wlt Moneybookers eWallet 0 + + + + 0 + diff --git a/app/code/community/Phoenix/Moneybookers/etc/system.xml b/app/code/community/Phoenix/Moneybookers/etc/system.xml index c582c016ca..eb970f470a 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/system.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/system.xml @@ -85,6 +85,7 @@ select + payment/moneybookers_acc/active adminhtml/system_config_source_yesno 1 1 @@ -94,6 +95,7 @@ text + payment/moneybookers_acc/sort_order 3 1 1 @@ -102,6 +104,7 @@ <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_acc/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -110,6 +113,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_acc/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -119,6 +123,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_acc/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -139,6 +144,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_csi/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -148,6 +154,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_csi/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -156,6 +163,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_csi/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -164,6 +172,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_csi/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -173,6 +182,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_csi/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -193,6 +203,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_did/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -202,6 +213,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_did/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -210,6 +222,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_did/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -218,6 +231,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_did/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -227,6 +241,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_did/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -247,6 +262,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_dnk/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -256,6 +272,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_dnk/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -264,6 +281,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_dnk/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -272,6 +290,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_dnk/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -281,6 +300,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_dnk/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -301,6 +321,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_ebt/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -310,6 +331,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_ebt/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -318,6 +340,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_ebt/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -325,6 +348,7 @@ + payment/moneybookers_ebt/allowspecific allowspecific 6 adminhtml/system_config_source_payment_allspecificcountries @@ -335,6 +359,7 @@ multiselect + payment/moneybookers_ebt/specificcountry 7 adminhtml/system_config_source_country 1 @@ -355,6 +380,7 @@ select + payment/moneybookers_ent/active adminhtml/system_config_source_yesno 1 1 @@ -364,6 +390,7 @@ text + payment/moneybookers_ent/sort_order 3 1 1 @@ -372,6 +399,7 @@ <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_ent/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -380,6 +408,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_ent/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -389,6 +418,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_ent/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -409,6 +439,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_gcb/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -418,6 +449,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_gcb/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -426,6 +458,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_gcb/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -434,6 +467,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_gcb/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -443,6 +477,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_gcb/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -463,6 +498,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_gir/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -472,6 +508,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_gir/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -480,6 +517,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_gir/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -488,6 +526,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_gir/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -497,6 +536,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_gir/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -517,6 +557,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_idl/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -526,6 +567,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_idl/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -534,6 +576,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_idl/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -542,6 +585,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_idl/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -551,6 +595,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_idl/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -571,6 +616,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_lsr/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -580,6 +626,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_lsr/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -588,6 +635,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_lsr/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -596,6 +644,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_lsr/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -605,6 +654,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_lsr/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -625,6 +675,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_npy/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -634,6 +685,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_npy/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -642,6 +694,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_npy/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -650,6 +703,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_npy/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -659,6 +713,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_npy/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -679,6 +734,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_pli/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -688,6 +744,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_pli/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -696,6 +753,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_pli/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -704,6 +762,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_pli/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -713,6 +772,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_pli/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -733,6 +793,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_psp/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -742,6 +803,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_psp/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -750,6 +812,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_psp/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -758,6 +821,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_psp/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -767,6 +831,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_psp/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -787,6 +852,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_pwy/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -796,6 +862,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_pwy/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -804,6 +871,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_pwy/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -812,6 +880,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_pwy/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -821,6 +890,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_pwy/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -841,6 +911,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_sft/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -850,6 +921,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_sft/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -858,6 +930,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_sft/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -866,6 +939,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_sft/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -875,6 +949,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_sft/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -895,6 +970,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_so2/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -904,6 +980,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_so2/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -912,6 +989,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_so2/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -920,6 +998,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_so2/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -929,6 +1008,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_so2/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> @@ -949,6 +1029,7 @@ <active translate="label"> <label>Enabled</label> <frontend_type>select</frontend_type> + <config_path>payment/moneybookers_wlt/active</config_path> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> @@ -958,6 +1039,7 @@ <sort_order translate="label"> <label>Sort Order</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_wlt/sort_order</config_path> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -966,6 +1048,7 @@ <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> + <config_path>payment/moneybookers_wlt/title</config_path> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> @@ -974,6 +1057,7 @@ <allowspecific translate="label"> <label>Payment from Applicable Countries</label> <frontend_type>allowspecific</frontend_type> + <config_path>payment/moneybookers_wlt/allowspecific</config_path> <sort_order>6</sort_order> <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> <show_in_default>1</show_in_default> @@ -983,6 +1067,7 @@ <specificcountry translate="label"> <label>Payment from Specific Countries</label> <frontend_type>multiselect</frontend_type> + <config_path>payment/moneybookers_wlt/specificcountry</config_path> <sort_order>7</sort_order> <source_model>adminhtml/system_config_source_country</source_model> <show_in_default>1</show_in_default> diff --git a/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/mysql4-upgrade-1.2-1.2.0.1.php b/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/mysql4-upgrade-1.2-1.2.0.1.php new file mode 100644 index 0000000000..5e3f2b8160 --- /dev/null +++ b/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/mysql4-upgrade-1.2-1.2.0.1.php @@ -0,0 +1,41 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * @category Phoenix + * @package Phoenix_Moneybookers + * @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; + +$installer->startSetup(); +$conn = $installer->getConnection(); + +$select = $conn + ->select() + ->from($this->getTable('core/config_data'), array('scope', 'scope_id', 'path', 'value')) + ->where(new Zend_Db_Expr("path LIKE 'moneybookers/moneybookers%'")); +$data = $conn->fetchAll($select); + +if (!empty($data)) { + foreach ($data as $key => $value) { + $data[$key]['path'] = preg_replace('/^moneybookers\/moneybookers/', 'payment/moneybookers', $value['path']); + } + $conn->insertOnDuplicate($this->getTable('core/config_data'), $data, array('path')); + $conn->delete($this->getTable('core/config_data'), new Zend_Db_Expr("path LIKE 'moneybookers/moneybookers%'")); +} + +$installer->endSetup(); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php index bbebb8a5ef..78d04b047e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php @@ -1,79 +1,79 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Adminhtml - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Adminhtml order creditmemo totals block - * - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Totals extends Mage_Adminhtml_Block_Sales_Totals -{ - protected $_creditmemo; - - public function getCreditmemo() - { - if ($this->_creditmemo === null) { - if ($this->hasData('creditmemo')) { - $this->_creditmemo = $this->_getData('creditmemo'); - } elseif (Mage::registry('current_creditmemo')) { - $this->_creditmemo = Mage::registry('current_creditmemo'); - } elseif ($this->getParentBlock() && $this->getParentBlock()->getCreditmemo()) { - $this->_creditmemo = $this->getParentBlock()->getCreditmemo(); - } - } - return $this->_creditmemo; - } - - public function getSource() - { - return $this->getCreditmemo(); - } - - /** - * Initialize creditmemo totals array - * - * @return Mage_Sales_Block_Order_Totals - */ - protected function _initTotals() - { - parent::_initTotals(); - $this->addTotal(new Varien_Object(array( - 'code' => 'adjustment_positive', - 'value' => $this->getSource()->getAdjustmentPositive(), - 'base_value'=> $this->getSource()->getBaseAdjustmentPositive(), - 'label' => $this->helper('sales')->__('Adjustment Refund') - ))); - $this->addTotal(new Varien_Object(array( - 'code' => 'adjustment_negative', - 'value' => $this->getSource()->getAdjustmentNegative(), - 'base_value'=> $this->getSource()->getBaseAdjustmentNegative(), - 'label' => $this->helper('sales')->__('Adjustment Fee') - ))); - return $this; - } -} +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Adminhtml order creditmemo totals block + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Totals extends Mage_Adminhtml_Block_Sales_Totals +{ + protected $_creditmemo; + + public function getCreditmemo() + { + if ($this->_creditmemo === null) { + if ($this->hasData('creditmemo')) { + $this->_creditmemo = $this->_getData('creditmemo'); + } elseif (Mage::registry('current_creditmemo')) { + $this->_creditmemo = Mage::registry('current_creditmemo'); + } elseif ($this->getParentBlock() && $this->getParentBlock()->getCreditmemo()) { + $this->_creditmemo = $this->getParentBlock()->getCreditmemo(); + } + } + return $this->_creditmemo; + } + + public function getSource() + { + return $this->getCreditmemo(); + } + + /** + * Initialize creditmemo totals array + * + * @return Mage_Sales_Block_Order_Totals + */ + protected function _initTotals() + { + parent::_initTotals(); + $this->addTotal(new Varien_Object(array( + 'code' => 'adjustment_positive', + 'value' => $this->getSource()->getAdjustmentPositive(), + 'base_value'=> $this->getSource()->getBaseAdjustmentPositive(), + 'label' => $this->helper('sales')->__('Adjustment Refund') + ))); + $this->addTotal(new Varien_Object(array( + 'code' => 'adjustment_negative', + 'value' => $this->getSource()->getAdjustmentNegative(), + 'base_value'=> $this->getSource()->getBaseAdjustmentNegative(), + 'label' => $this->helper('sales')->__('Adjustment Fee') + ))); + return $this; + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php index faaa5a8c2a..0fc4173101 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Form/Renderer/Fieldset/Element.php index 9171ca11b0..f8d81b7804 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Form/Renderer/Fieldset/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php index 05ca5dc4ec..6a5c2627ae 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php @@ -100,6 +100,7 @@ function showCalendar(event){ </script>'; return $html; } + public function getEscapedValue($index=null) { $value = $this->getValue($index); diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php index 7553eab9a2..ba8ace1d9b 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -1207,6 +1207,8 @@ public function createOrder() $order->sendNewOrderEmail(); } + Mage::dispatchEvent('checkout_submit_all_after', array('order' => $order, 'quote' => $quote)); + return $order; } diff --git a/app/code/core/Mage/Adminhtml/Model/Search/Order.php b/app/code/core/Mage/Adminhtml/Model/Search/Order.php index ae86c3f8db..1e4ae7faa6 100644 --- a/app/code/core/Mage/Adminhtml/Model/Search/Order.php +++ b/app/code/core/Mage/Adminhtml/Model/Search/Order.php @@ -34,33 +34,22 @@ public function load() return $this; } + $query = $this->getQuery(); //TODO: add full name logic $collection = Mage::getResourceModel('sales/order_collection') ->addAttributeToSelect('*') + ->addAttributeToSearchFilter(array( + array('attribute'=>'increment_id', 'like'=>$query.'%'), + array('attribute'=>'billing_firstname', 'like'=>$query.'%'), + array('attribute'=>'billing_lastname', 'like'=>$query.'%'), + array('attribute'=>'billing_telephone', 'like'=>$query.'%'), + array('attribute'=>'billing_postcode', 'like'=>$query.'%'), - ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id') - ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id') - ->joinAttribute('billing_telephone', 'order_address/telephone', 'billing_address_id') - ->joinAttribute('billing_postcode', 'order_address/postcode', 'billing_address_id') - - ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id') - ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id') - ->joinAttribute('shipping_telephone', 'order_address/telephone', 'shipping_address_id') - ->joinAttribute('shipping_postcode', 'order_address/postcode', 'shipping_address_id') - - ->addAttributeToFilter(array( - array('attribute'=>'increment_id', 'like'=>$this->getQuery().'%'), - array('attribute'=>'billing_firstname', 'like'=>$this->getQuery().'%'), - array('attribute'=>'billing_lastname', 'like'=>$this->getQuery().'%'), - array('attribute'=>'billing_telephone', 'like'=>$this->getQuery().'%'), - array('attribute'=>'billing_postcode', 'like'=>$this->getQuery().'%'), - - array('attribute'=>'shipping_firstname', 'like'=>$this->getQuery().'%'), - array('attribute'=>'shipping_lastname', 'like'=>$this->getQuery().'%'), - array('attribute'=>'shipping_telephone', 'like'=>$this->getQuery().'%'), - array('attribute'=>'shipping_postcode', 'like'=>$this->getQuery().'%'), + array('attribute'=>'shipping_firstname', 'like'=>$query.'%'), + array('attribute'=>'shipping_lastname', 'like'=>$query.'%'), + array('attribute'=>'shipping_telephone', 'like'=>$query.'%'), + array('attribute'=>'shipping_postcode', 'like'=>$query.'%'), )) - ->setCurPage($this->getStart()) ->setPageSize($this->getLimit()) ->load(); diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php index 033631f636..062b16bbd2 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php @@ -26,22 +26,9 @@ class Mage_Adminhtml_Model_System_Config_Source_Payment_Allmethods { - protected function _getPaymentMethods() - { - return Mage::getSingleton('payment/config')->getAllMethods(); - } - public function toOptionArray() { - $methods = array(array('value'=>'', 'label'=>'')); - foreach ($this->_getPaymentMethods() as $paymentCode=>$paymentModel) { - $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title'); - $methods[$paymentCode] = array( - 'label' => $paymentTitle, - 'value' => $paymentCode, - ); - } - + $methods = Mage::helper('payment')->getPaymentMethodList(true, true, true); return $methods; } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php index bdc3b10636..87e6f348f0 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php @@ -68,7 +68,6 @@ public function viewAction() ->_title($this->__('Billing Agreements')) ->_title(sprintf("#%s", $agreementModel->getReferenceId())); - Mage::register('current_billing_agreement', $agreementModel); $this->loadLayout() ->_setActiveMenu('sales/billing_agreement') ->renderLayout(); @@ -85,6 +84,7 @@ public function viewAction() */ public function ordersGridAction() { + $this->_initBillingAgreement(); $this->loadLayout(false) ->renderLayout(); } @@ -163,6 +163,8 @@ protected function _initBillingAgreement() $this->_getSession()->addError($this->__('Wrong billing agreement ID specified.')); return false; } + + Mage::register('current_billing_agreement', $agreementModel); return $agreementModel; } diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php b/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php index dcb84c5e58..b5917128b4 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php index af6f2f7a8f..ab8af1a924 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -132,6 +132,7 @@ public function run() } else { $this->fault('0', 'Unable to load Soap extension on the server'); + } return $this; } diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar/Pager.php b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar/Pager.php index 3ec3d59237..937b30197d 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar/Pager.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar/Pager.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php index 9946ffd373..67b4b73b08 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php @@ -237,13 +237,30 @@ public function catalogProductMassAction(Mage_Index_Model_Event $event) if ($pCount * 0.3 < count($processIds) + $aCount + $bCount) { return $this->reindexAll(); } + $this->reindexProductIds($processIds); + return $this; + } + /** + * Reindex product prices for specified product ids + * + * @param array | int $ids + * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price + */ + public function reindexProductIds($ids) + { + if (empty($ids)) { + return $this; + } + if (!is_array($ids)) { + $ids = array($ids); + } $this->clearTemporaryIndexTable(); - + $write = $this->_getWriteAdapter(); // retrieve products types $select = $write->select() ->from($this->getTable('catalog/product'), array('entity_id', 'type_id')) - ->where('entity_id IN(?)', $processIds); + ->where('entity_id IN(?)', $ids); $pairs = $write->fetchPairs($select); $byType = array(); foreach ($pairs as $productId => $productType) { @@ -274,8 +291,8 @@ public function catalogProductMassAction(Mage_Index_Model_Event $event) ->where('l.child_id IN(?)', $notCompositeIds); $pairs = $write->fetchPairs($select); foreach ($pairs as $productId => $productType) { - if (!in_array($productId, $processIds)) { - $processIds[] = $productId; + if (!in_array($productId, $ids)) { + $ids[] = $productId; $byType[$productType][$productId] = $productId; $compositeIds[$productId] = $productId; } @@ -293,8 +310,7 @@ public function catalogProductMassAction(Mage_Index_Model_Event $event) } } - $this->_copyIndexDataToMainTable($processIds); - + $this->_copyIndexDataToMainTable($ids); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Template/Filter.php b/app/code/core/Mage/Catalog/Model/Template/Filter.php index a61e6a6b74..2bf51d8d00 100644 --- a/app/code/core/Mage/Catalog/Model/Template/Filter.php +++ b/app/code/core/Mage/Catalog/Model/Template/Filter.php @@ -35,6 +35,45 @@ */ class Mage_Catalog_Model_Template_Filter extends Varien_Filter_Template { + /** + * Use absolute links flag + * + * @var bool + */ + protected $_useAbsoluteLinks = false; + + /** + * Whether to allow SID in store directive: NO + * + * @var bool + */ + protected $_useSessionInUrl = false; + + /** + * Set use absolute links flag + * + * @param bool $flag + * @return Mage_Core_Model_Email_Template_Filter + */ + public function setUseAbsoluteLinks($flag) + { + $this->_useAbsoluteLinks = $flag; + return $this; + } + + /** + * Setter whether SID is allowed in store directive + * Doesn't set anything intentionally, since SID is not allowed in any kind of emails + * + * @param bool $flag + * @return Mage_Core_Model_Email_Template_Filter + */ + public function setUseSessionInUrl($flag) + { + $this->_useSessionInUrl = $flag; + return $this; + } + /** * Retrieve Skin URL directive * diff --git a/app/code/core/Mage/Ideal/Block/Advanced/Info.php b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php similarity index 51% rename from app/code/core/Mage/Ideal/Block/Advanced/Info.php rename to app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php index 6faf947ad6..9789602127 100644 --- a/app/code/core/Mage/Ideal/Block/Advanced/Info.php +++ b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php @@ -19,45 +19,61 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Ideal + * @package Mage_CatalogInventory * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + /** - * iDEAL Advanced Info Block + * Product qty increments block * - * @category Mage - * @package Mage_Ideal + * @category Mage + * @package Mage_CatalogInventory * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Ideal_Block_Advanced_Info extends Mage_Payment_Block_Info +class Mage_CatalogInventory_Block_Qtyincrements extends Mage_Core_Block_Template { - protected function _construct() + /** + * Qty Increments cache + * + * @var float|false + */ + protected $_qtyIncrements; + + /** + * Retrieve current product object + * + * @return Mage_Catalog_Model_Product + */ + protected function _getProduct() { - parent::_construct(); - $this->setTemplate('ideal/advanced/info.phtml'); + return Mage::registry('current_product'); } - public function toPdf() + /** + * Retrieve current product name + * + * @return string + */ + public function getProductName() { - $this->setTemplate('ideal/advanced/pdf/info.phtml'); - return $this->toHtml(); + return $this->_getProduct()->getName(); } /** - * Gets Issuer Title from Payment Attribute + * Retrieve product qty increments * - * @return string + * @return float|false */ - public function getIssuerTitle() + public function getProductQtyIncrements() { - if ($this->getInfo() instanceof Mage_Sales_Model_Quote_Payment) { - $issuerList = unserialize($this->getInfo()->getIdealIssuerList()); - return $issuerList[$this->getInfo()->getIdealIssuerId()]; - } else { - return $this->getInfo()->getIdealIssuerTitle(); + if ($this->_qtyIncrements === null) { + $this->_qtyIncrements = $this->_getProduct()->getStockItem()->getQtyIncrements(); + if (!$this->_getProduct()->isSaleable()) { + $this->_qtyIncrements = false; + } } + return $this->_qtyIncrements; } - } diff --git a/app/code/core/Mage/CatalogInventory/Helper/Data.php b/app/code/core/Mage/CatalogInventory/Helper/Data.php index dc51d20afc..1266194a3d 100644 --- a/app/code/core/Mage/CatalogInventory/Helper/Data.php +++ b/app/code/core/Mage/CatalogInventory/Helper/Data.php @@ -94,7 +94,9 @@ public function getConfigItemOptions() 'min_sale_qty', 'max_sale_qty', 'notify_stock_qty', - 'manage_stock' + 'manage_stock', + 'enable_qty_increments', + 'qty_increments', ); } diff --git a/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php new file mode 100644 index 0000000000..bea9b52d12 --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php @@ -0,0 +1,204 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CatalogInventory + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * MinSaleQty value manipulation helper + */ +class Mage_CatalogInventory_Helper_Minsaleqty +{ + /** + * Retrieve fixed qty value + * + * @param mixed $qty + * @return float|null + */ + protected function _fixQty($qty) + { + return (!empty($qty) ? (float)$qty : null); + } + + /** + * Generate a storable representation of a value + * + * @param mixed $value + * @return string + */ + protected function _serializeValue($value) + { + if (is_numeric($value)) { + $data = (float)$value; + return (string)$data; + } else if (is_array($value)) { + $data = array(); + foreach ($value as $groupId => $qty) { + if (!array_key_exists($groupId, $data)) { + $data[$groupId] = $this->_fixQty($qty); + } + } + if (count($data) == 1 && array_key_exists(Mage_Customer_Model_Group::CUST_GROUP_ALL, $data)) { + return (string)$data[Mage_Customer_Model_Group::CUST_GROUP_ALL]; + } + return serialize($data); + } else { + return ''; + } + } + + /** + * Create a value from a storable representation + * + * @param mixed $value + * @return array + */ + protected function _unserializeValue($value) + { + if (is_numeric($value)) { + return array( + Mage_Customer_Model_Group::CUST_GROUP_ALL => $this->_fixQty($value) + ); + } else if (is_string($value) && !empty($value)) { + return unserialize($value); + } else { + return array(); + } + } + + /** + * Check whether value is in form retrieved by _encodeArrayFieldValue() + * + * @param mixed + * @return bool + */ + protected function _isEncodedArrayFieldValue($value) + { + if (!is_array($value)) { + return false; + } + unset($value['__empty']); + foreach ($value as $_id => $row) { + if (!is_array($row) || !array_key_exists('customer_group_id', $row) || !array_key_exists('min_sale_qty', $row)) { + return false; + } + } + return true; + } + + /** + * Encode value to be used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract + * + * @param array + * @return array + */ + protected function _encodeArrayFieldValue(array $value) + { + $result = array(); + foreach ($value as $groupId => $qty) { + $_id = Mage::helper('core')->uniqHash('_'); + $result[$_id] = array( + 'customer_group_id' => $groupId, + 'min_sale_qty' => $this->_fixQty($qty), + ); + } + return $result; + } + + /** + * Decode value from used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract + * + * @param array + * @return array + */ + protected function _decodeArrayFieldValue(array $value) + { + $result = array(); + unset($value['__empty']); + foreach ($value as $_id => $row) { + if (!is_array($row) || !array_key_exists('customer_group_id', $row) || !array_key_exists('min_sale_qty', $row)) { + continue; + } + $groupId = $row['customer_group_id']; + $qty = $this->_fixQty($row['min_sale_qty']); + $result[$groupId] = $qty; + } + return $result; + } + + /** + * Retrieve min_sale_qty value from config + * + * @param int $customerGroupId + * @param mixed $store + * @return float|null + */ + public function getConfigValue($customerGroupId, $store = null) + { + $value = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MIN_SALE_QTY, $store); + $value = $this->_unserializeValue($value); + if ($this->_isEncodedArrayFieldValue($value)) { + $value = $this->_decodeArrayFieldValue($value); + } + $result = null; + foreach ($value as $groupId => $qty) { + if ($groupId == $customerGroupId) { + $result = $qty; + break; + } else if ($groupId == Mage_Customer_Model_Group::CUST_GROUP_ALL) { + $result = $qty; + } + } + return $this->_fixQty($result); + } + + /** + * Make value readable by Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract + * + * @param mixed $value + * @return array + */ + public function makeArrayFieldValue($value) + { + $value = $this->_unserializeValue($value); + if (!$this->_isEncodedArrayFieldValue($value)) { + $value = $this->_encodeArrayFieldValue($value); + } + return $value; + } + + /** + * Make value ready for store + * + * @param mixed $value + * @return string + */ + public function makeStorableArrayFieldValue($value) + { + if ($this->_isEncodedArrayFieldValue($value)) { + $value = $this->_decodeArrayFieldValue($value); + } + $value = $this->_serializeValue($value); + return $value; + } +} diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php index 59f4b323b7..a8a816a3b9 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock.php @@ -71,8 +71,10 @@ public function lockProductItems($stock, $productIds) public function getProductsStock($stock, $productIds, $lockRows = false) { $itemTable = $this->getTable('cataloginventory/stock_item'); + $productTable = $this->getTable('catalog/product'); $select = $this->_getWriteAdapter()->select() - ->from($itemTable) + ->from(array('si' => $itemTable)) + ->join(array('p' => $productTable), 'p.entity_id=si.product_id', array('type_id')) ->where('stock_id=?', $stock->getId()) ->where('product_id IN(?)', $productIds) ->forUpdate($lockRows); diff --git a/app/code/core/Mage/CatalogInventory/Model/Observer.php b/app/code/core/Mage/CatalogInventory/Model/Observer.php index 5fd60e90ca..8493914126 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Observer.php +++ b/app/code/core/Mage/CatalogInventory/Model/Observer.php @@ -41,6 +41,8 @@ class Mage_CatalogInventory_Model_Observer */ protected $_checkedProductsQty = array(); + protected $_itemsForReindex = array(); + /** * Add stock information to product * @@ -211,6 +213,17 @@ public function checkQuoteItemQty($observer) $qty = $quoteItem->getProduct()->getTypeInstance(true)->prepareQuoteItemQty($qty, $quoteItem->getProduct()); $quoteItem->setData('qty', $qty); + $stockItem = $quoteItem->getProduct()->getStockItem(); + if ($stockItem) { + $result = $stockItem->checkQtyIncrements($qty); + if ($result->getHasError()) { + $quoteItem->setHasError(true) + ->setMessage($result->getMessage()); + $quoteItem->getQuote()->setHasError(true) + ->addMessage($result->getQuoteMessage(), $result->getQuoteMessageIndex()); + } + } + foreach ($options as $option) { /* @var $option Mage_Sales_Model_Quote_Item_Option */ $optionQty = $qty * $option->getValue(); @@ -221,6 +234,10 @@ public function checkQuoteItemQty($observer) if (!$stockItem instanceof Mage_CatalogInventory_Model_Stock_Item) { Mage::throwException(Mage::helper('cataloginventory')->__('The stock item for Product in option is not valid.')); } + /** + * don't check qty increments value for option product + */ + $stockItem->setSuppressCheckQtyIncrements(true); $qtyForCheck = $this->_getProductQtyForCheck($option->getProduct()->getId(), $increaseOptionQty); @@ -341,14 +358,19 @@ protected function _getProductQtyForCheck($productId, $itemQty) } /** - * Subtrack quote items qtys from stock items related with quote items products + * Subtrack quote items qtys from stock items related with quote items products. + * Used before order placing to make order save/place transaction smaller + * * @param Varien_Event_Observer $observer */ public function subtractQuoteInventory(Varien_Event_Observer $observer) { $quote = $observer->getEvent()->getQuote(); $items = $this->_getProductsQty($quote->getAllItems()); - Mage::getSingleton('cataloginventory/stock')->registerProductsSale($items); + /** + * Remember items + */ + $this->_itemsForReindex = Mage::getSingleton('cataloginventory/stock')->registerProductsSale($items); return $this; } @@ -422,7 +444,8 @@ protected function _getProductsQty($relatedItems) } /** - * Refresh stock index for specific stock items + * Refresh stock index for specific stock items after succesful order placement + * * @param $observer */ public function reindexQuoteInventory($observer) @@ -439,6 +462,12 @@ public function reindexQuoteInventory($observer) } } Mage::getResourceSingleton('cataloginventory/indexer_stock')->reindexProducts($productIds); + $productIds = array(); + foreach ($this->_itemsForReindex as $item) { + $item->save(); + $productIds[] = $item->getProductId(); + } + Mage::getResourceSingleton('catalog/product_indexer_price')->reindexProductIds($productIds); return $this; } diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Stock.php index 2397ca792f..c91a9d352b 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock.php @@ -108,7 +108,8 @@ protected function _prepareProductQtys($items) } else { $stockItem = $item['item']; } - if ($stockItem->getId() && Mage::helper('catalogInventory')->isQty($stockItem->getTypeId())) { + $canSubtractQty = $stockItem->getId() && $stockItem->canSubtractQty(); + if ($canSubtractQty && Mage::helper('catalogInventory')->isQty($stockItem->getTypeId())) { $qtys[$productId] = $item['qty']; } } @@ -116,9 +117,11 @@ protected function _prepareProductQtys($items) } /** - * Subtract product qtys from stock + * Subtract product qtys from stock. + * Return array of items that require full save * * @param array $items + * @return array */ public function registerProductsSale($items) { @@ -126,16 +129,21 @@ public function registerProductsSale($items) $item = Mage::getModel('cataloginventory/stock_item'); $this->_getResource()->beginTransaction(); $stockInfo = $this->_getResource()->getProductsStock($this, array_keys($qtys), true); + $fullSaveItems = array(); foreach ($stockInfo as $itemInfo) { $item->setData($itemInfo); if (!$item->checkQty($qtys[$item->getProductId()])) { $this->_getResource()->commit(); Mage::throwException(Mage::helper('cataloginventory')->__('Not all products are available in the requested quantity')); } + $item->subtractQty($qtys[$item->getProductId()]); + if (!$item->verifyStock() || $item->verifyNotification()) { + $fullSaveItems[] = clone $item; + } } $this->_getResource()->correctItemsQty($this, $qtys, '-'); $this->_getResource()->commit(); - return $this; + return $fullSaveItems; } /** diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php index 46d53808d3..da3c792a11 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php @@ -144,17 +144,22 @@ public function loadByProduct($product) */ public function subtractQty($qty) { - if (!$this->getManageStock()) { - return $this; + if ($this->canSubtractQty()) { + $this->setQty($this->getQty()-$qty); } - $config = Mage::getStoreConfigFlag(self::XML_PATH_CAN_SUBTRACT); - if (!$config) { - return $this; - } - $this->setQty($this->getQty()-$qty); return $this; } + /** + * Check if is possible subtract value from item qty + * + * @return bool + */ + public function canSubtractQty() + { + return $this->getManageStock() && Mage::getStoreConfigFlag(self::XML_PATH_CAN_SUBTRACT); + } + /** * Add quantity process * @@ -264,25 +269,11 @@ public function getMinSaleQty() if (!array_key_exists($customerGroupId, $this->_minSaleQtyCache)) { $minSaleQty = null; if ($this->getUseConfigMinSaleQty()) { - $backendModel = Mage::getSingleton('cataloginventory/system_config_backend_minsaleqty'); - $backendModel->loadByValue(Mage::getStoreConfig(self::XML_PATH_MIN_SALE_QTY)); - $minSaleQtyItems = $backendModel->getValue(); - if ($minSaleQtyItems && is_array($minSaleQtyItems)) { - foreach ($minSaleQtyItems as $_id => $item) { - if ($item['customer_group_id'] == $customerGroupId) { - $minSaleQty = $item['min_sale_qty']; - break; - } else if ($item['customer_group_id'] == Mage_Customer_Model_Group::CUST_GROUP_ALL) { - $minSaleQty = $item['min_sale_qty']; - } - } - } + $minSaleQty = Mage::helper('cataloginventory/minsaleqty')->getConfigValue($customerGroupId); } else { $minSaleQty = $this->getData('min_sale_qty'); } - if ($minSaleQty !== null) { - $minSaleQty = (float)$minSaleQty; - } + $minSaleQty = (!empty($minSaleQty) ? (float)$minSaleQty : null); $this->_minSaleQtyCache[$customerGroupId] = $minSaleQty; } return $this->_minSaleQtyCache[$customerGroupId]; @@ -488,11 +479,8 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) return $result; } - if ($this->getQtyIncrements() && ($qty % $this->getQtyIncrements() != 0)) { - $result->setHasError(true) - ->setMessage(Mage::helper('cataloginventory')->__('This product is available for purchase in increments of %s only.', $this->getQtyIncrements() * 1)) - ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in the requested quantity.')) - ->setQuoteMessageIndex('qty'); + $result->addData($this->checkQtyIncrements($qty)->getData()); + if ($result->getHasError()) { return $result; } @@ -523,6 +511,28 @@ public function checkQuoteItemQty($qty, $summaryQty, $origQty = 0) return $result; } + /** + * Check qty increments + * + * @param int|float $qty + * @return Varien_Object + */ + public function checkQtyIncrements($qty) + { + $result = new Varien_Object(); + if (!$this->getManageStock() || $this->getSuppressCheckQtyIncrements()) { + return $result; + } + $qtyIncrements = $this->getQtyIncrements(); + if ($qtyIncrements && ($qty % $qtyIncrements != 0)) { + $result->setHasError(true) + ->setMessage(Mage::helper('cataloginventory')->__('This product is available for purchase in increments of %s only.', $qtyIncrements * 1)) + ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in the requested quantity.')) + ->setQuoteMessageIndex('qty'); + } + return $result; + } + /** * Add join for catalog in stock field to product collection * @@ -565,19 +575,18 @@ protected function _beforeSave() if ($productTypeId = $this->getProductTypeId()) { $typeId = $productTypeId; } + $isQty = Mage::helper('catalogInventory')->isQty($typeId); if ($isQty) { - if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_NO) { - if ($this->getQty() <= $this->getMinQty()) { - $this->setIsInStock(false) - ->setStockStatusChangedAutomaticallyFlag(true); - } + if (!$this->verifyStock()) { + $this->setIsInStock(false) + ->setStockStatusChangedAutomaticallyFlag(true); } // if qty is below notify qty, update the low stock date to today date otherwise set null $this->setLowStockDate(null); - if ((float)$this->getQty() < $this->getNotifyStockQty()) { + if ($this->verifyNotification()) { $this->setLowStockDate(Mage::app()->getLocale()->date(null, null, null, false) ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT) ); @@ -587,14 +596,44 @@ protected function _beforeSave() if ($this->hasStockStatusChangedAutomaticallyFlag()) { $this->setStockStatusChangedAutomatically((int)$this->getStockStatusChangedAutomaticallyFlag()); } - } - else { + } else { $this->setQty(0); } return $this; } + /** + * Chceck if item should be in stock or out of stock based on $qty param of existing item qty + * + * @param float|null $qty + * @return bool true - item in stock | false - item out of stock + */ + public function verifyStock($qty = null) + { + if ($qty === null) { + $qty = $this->getQty(); + } + if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_NO && $qty <= $this->getMinQty()) { + return false; + } + return true; + } + + /** + * Check if item qty require stock status notification + * + * @param float | null $qty + * @return bool (true - if require, false - if not require) + */ + public function verifyNotification($qty = null) + { + if ($qty === null) { + $qty = $this->getQty(); + } + return (float)$qty < $this->getNotifyStockQty(); + } + /** * Process stock status index on item after commit * diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php index a1cad4540f..75b8b05beb 100644 --- a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php @@ -28,7 +28,7 @@ * Backend for serialized array data * */ -class Mage_CatalogInventory_Model_System_Config_Backend_Minsaleqty extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array +class Mage_CatalogInventory_Model_System_Config_Backend_Minsaleqty extends Mage_Core_Model_Config_Data { /** * Process data after load @@ -36,20 +36,8 @@ class Mage_CatalogInventory_Model_System_Config_Backend_Minsaleqty extends Mage_ protected function _afterLoad() { $value = $this->getValue(); - if (empty($value)) { - $this->setValue(array()); - } else { - try { - parent::_afterLoad(); - } catch(Exception $e) { - $this->setValue(array( - Mage::helper('core')->uniqHash('_') => array( - 'customer_group_id' => Mage_Customer_Model_Group::CUST_GROUP_ALL, - 'min_sale_qty' => $value, - ) - )); - } - } + $value = Mage::helper('cataloginventory/minsaleqty')->makeArrayFieldValue($value); + $this->setValue($value); } /** @@ -58,38 +46,7 @@ protected function _afterLoad() protected function _beforeSave() { $value = $this->getValue(); - if (is_array($value)) { - unset($value['__empty']); - - $foundGroups = array(); - $hasGroupAllOnly = false; - $groupAllQty = null; - foreach ($value as $k => $v) { - if (in_array($v['customer_group_id'], $foundGroups)) { - unset($value[$k]); - continue; - } - $foundGroups[] = $v['customer_group_id']; - if ($v['customer_group_id'] == Mage_Customer_Model_Group::CUST_GROUP_ALL) { - $hasGroupAllOnly = true; - $groupAllQty = $v['min_sale_qty']; - } else { - $hasGroupAllOnly = false; - } - } - if ($hasGroupAllOnly) { - $this->setValue($groupAllQty); - } else { - parent::_beforeSave(); - } - } - } - - /** - * Load model by raw value - */ - public function loadByValue($value) - { - return $this->setValue($value)->afterLoad(); + $value = Mage::helper('cataloginventory/minsaleqty')->makeStorableArrayFieldValue($value); + $this->setValue($value); } } diff --git a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php index e5ce52113d..9aed8411f1 100644 --- a/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Mysql4/Rule/Collection.php @@ -57,4 +57,18 @@ public function addWebsiteFilter($websiteIds) } return $this; } + + /** + * Find product attribute in conditions or actions + * + * @param string $attributeCode + * @return Mage_CatalogRule_Model_Mysql4_Rule_Collection + */ + public function addAttributeInConditionFilter($attributeCode) + { + $match = sprintf('%%%s%%', substr(serialize(array('attribute' => $attributeCode)), 5, -1)); + $this->addFieldToFilter('conditions_serialized', array('like' => $match)); + + return $this; + } } diff --git a/app/code/core/Mage/CatalogRule/Model/Observer.php b/app/code/core/Mage/CatalogRule/Model/Observer.php index 9a072c4e13..58ea401f43 100644 --- a/app/code/core/Mage/CatalogRule/Model/Observer.php +++ b/app/code/core/Mage/CatalogRule/Model/Observer.php @@ -203,4 +203,62 @@ public function prepareCatalogProductPriceIndexTable(Varien_Event_Observer $obse return $this; } + + /** + * After delete attribute check rules that contains deleted attribute + * If rules was found they will seted to inactive and added notice to admin session + * + * @param Varien_Event_Observer $observer + * @return Mage_CatalogRule_Model_Observer + */ + public function catalogAttributeDeleteAfter(Varien_Event_Observer $observer) + { + $attribute = $observer->getEvent()->getAttribute(); + $attributeCode = $attribute->getAttributeCode(); + if ($attribute->getIsUsedForPromoRules()) { + /* @var $collection Mage_CatalogRule_Model_Mysql4_Rule_Collection */ + $collection = Mage::getResourceModel('catalogrule/rule_collection') + ->addAttributeInConditionFilter($attributeCode); + $hasRule = false; + foreach ($collection as $rule) { + /* @var $rule Mage_CatalogRule_Model_Rule */ + $rule->setIsActive(0); + /* @var $conditionInstance Mage_CatalogRule_Model_Rule_Condition_Combine */ + $this->_removeAttributeFromConditions($rule->getConditions(), $attributeCode); + $rule->save(); + + $hasRule = true; + } + + if ($hasRule) { + Mage::getModel('catalogrule/rule')->applyAll(); + Mage::getSingleton('adminhtml/session')->addWarning( + Mage::helper('catalogrule')->__('Catalog Price Rules based on deleted attribute "%s" has been disabled.', $attributeCode)); + } + } + + return $this; + } + + /** + * Remove catalog attribute condition by attribute code from rule conditions + * + * @param Mage_CatalogRule_Model_Rule_Condition_Combine $combine + * @param string $attributeCode + */ + protected function _removeAttributeFromConditions($combine, $attributeCode) + { + $conditions = $combine->getConditions(); + foreach ($conditions as $conditionId => $condition) { + if ($condition instanceof Mage_CatalogRule_Model_Rule_Condition_Combine) { + $this->_removeAttributeFromConditions($condition, $attributeCode); + } + if ($condition instanceof Mage_CatalogRule_Model_Rule_Condition_Product) { + if ($condition->getAttribute() == $attributeCode) { + unset($conditions[$conditionId]); + } + } + } + $combine->setConditions($conditions); + } } diff --git a/app/code/core/Mage/CatalogRule/etc/config.xml b/app/code/core/Mage/CatalogRule/etc/config.xml index d74e50426f..d4ceb641a8 100644 --- a/app/code/core/Mage/CatalogRule/etc/config.xml +++ b/app/code/core/Mage/CatalogRule/etc/config.xml @@ -133,6 +133,14 @@ </catalogrule> </observers> </catalog_product_import_after> + <catalog_entity_attribute_delete_after> + <observers> + <catalogrule> + <class>catalogrule/observer</class> + <method>catalogAttributeDeleteAfter</method> + </catalogrule> + </observers> + </catalog_entity_attribute_delete_after> </events> </adminhtml> diff --git a/app/code/core/Mage/Centinel/Model/Observer.php b/app/code/core/Mage/Centinel/Model/Observer.php index ea2a1ddcaf..b455c7220e 100644 --- a/app/code/core/Mage/Centinel/Model/Observer.php +++ b/app/code/core/Mage/Centinel/Model/Observer.php @@ -103,18 +103,39 @@ public function paymentFormBlockToHtmlBefore($observer) } /** - * Reset validation data + * Reset validation data * * @param Varien_Object $observer * @return Mage_Centinel_Model_Observer */ - public function salesOrderPaymentPlaceEnd($observer) + public function checkoutSubmitAllAfter($observer) { - $payment = $observer->getEvent()->getPayment(); - $method = $payment->getMethodInstance(); + $method = false; + + if ($order = $observer->getEvent()->getOrder()) { + $method = $order->getPayment()->getMethodInstance(); + } elseif ($orders = $observer->getEvent()->getOrders()) { + if ($order = array_shift($orders)) { + $method = $order->getPayment()->getMethodInstance(); + } + } + if ($method && $method->getIsCentinelValidationEnabled()) { $method->getCentinelValidator()->reset(); } return $this; } + + /** + * Reset validation data + * @deprecated back compatibility alias for checkoutSubmitAllAfter + * + * @param Varien_Object $observer + * @return Mage_Centinel_Model_Observer + */ + public function salesOrderPaymentPlaceEnd($observer) + { + $this->checkoutSubmitAllAfter($observer); + return $this; + } } diff --git a/app/code/core/Mage/Centinel/Model/State/Jcb.php b/app/code/core/Mage/Centinel/Model/State/Jcb.php index a07eea9b28..9c34227441 100644 --- a/app/code/core/Mage/Centinel/Model/State/Jcb.php +++ b/app/code/core/Mage/Centinel/Model/State/Jcb.php @@ -37,11 +37,12 @@ class Mage_Centinel_Model_State_Jcb extends Mage_Centinel_Model_StateAbstract */ public function isLookupSuccessful() { - if ($this->_isLookupStrictSuccessful() || $this->_isLookupSoftSuccessful()) { + if ($this->_isLookupStrictSuccessful()) { + return true; + } elseif (!$this->getIsModeStrict() && $this->_isLookupSoftSuccessful()) { return true; - } else { - return false; } + return false; } /** @@ -106,7 +107,7 @@ public function isAuthenticateSuccessful() //Test case 5 if ($paResStatus == 'U' && $signatureVerification == 'Y' && $eciFlag == '07' && - $xid != '' && $cavv == '' && $errorNo == '') { + $xid != '' && $cavv == '' && $errorNo == '0') { if ($this->getIsModeStrict()) { return false; } else { @@ -116,7 +117,7 @@ public function isAuthenticateSuccessful() //Test case 10 if ($paResStatus == '' && $signatureVerification == '' && $eciFlag == '07' && - $xid == '' && $cavv == '' && $errorNo != '') { + $xid == '' && $cavv == '' && $errorNo != '0') { return false; } @@ -160,7 +161,7 @@ private function _isLookupSoftSuccessful() $enrolled = $this->getLookupEnrolled(); //Test cases 5 - if ($enrolled == 'N/A' && $acsUrl == '' && $payload == '' && $errorNo == '0') { + if ($enrolled == '' && $acsUrl == '' && $payload == '' && $errorNo == '0') { return true; } @@ -170,7 +171,7 @@ private function _isLookupSoftSuccessful() } //Test cases 8,9 - if ($enrolled == '' && $acsUrl == '' && $payload == '' && $errorNo != '') { + if ($enrolled == '' && $acsUrl == '' && $payload == '' && $errorNo != '0') { return true; } diff --git a/app/code/core/Mage/Centinel/etc/config.xml b/app/code/core/Mage/Centinel/etc/config.xml index f868ab4fdb..94870ed3a4 100644 --- a/app/code/core/Mage/Centinel/etc/config.xml +++ b/app/code/core/Mage/Centinel/etc/config.xml @@ -41,14 +41,14 @@ </centinel> </observers> </sales_convert_quote_to_order> - <sales_order_payment_place_end> + <checkout_submit_all_after> <observers> <centinel> <class>centinel/observer</class> - <method>salesOrderPaymentPlaceEnd</method> + <method>checkoutSubmitAllAfter</method> </centinel> </observers> - </sales_order_payment_place_end> + </checkout_submit_all_after> </events> </global> <frontend> diff --git a/app/code/core/Mage/Checkout/Helper/Data.php b/app/code/core/Mage/Checkout/Helper/Data.php index afc5242534..9427d555db 100644 --- a/app/code/core/Mage/Checkout/Helper/Data.php +++ b/app/code/core/Mage/Checkout/Helper/Data.php @@ -242,7 +242,7 @@ public function isMultishippingCheckoutAvailable() $quote = $this->getQuote(); $isMultiShipping = (bool)(int)Mage::getStoreConfig('shipping/option/checkout_multiple'); if ((!$quote) || !$quote->hasItems()) { - return false; + return $isMultiShipping; } $maximunQty = (int)Mage::getStoreConfig('shipping/option/checkout_multiple_maximum_qty'); return $isMultiShipping diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php index 7b99242fd0..66cb9dc2db 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php +++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php @@ -33,6 +33,16 @@ */ class Mage_Checkout_Model_Type_Multishipping extends Mage_Checkout_Model_Type_Abstract { + /** + * Quote shipping addresses items cache + * + * @var array + */ + protected $_quoteShippingAddressesItems; + + /** + * Constructor + */ public function __construct() { parent::__construct(); @@ -51,7 +61,6 @@ protected function _init() * reset quote shipping addresses and items */ $quote = $this->getQuote(); - $quote->setIsMultiShipping(true); if (!$this->getCustomer()->getId()) { return $this; } @@ -106,6 +115,9 @@ protected function _init() */ public function getQuoteShippingAddressesItems() { + if ($this->_quoteShippingAddressesItems !== null) { + return $this->_quoteShippingAddressesItems; + } $items = array(); $addresses = $this->getQuote()->getAllAddresses(); foreach ($addresses as $address) { @@ -135,6 +147,7 @@ public function getQuoteShippingAddressesItems() } } } + $this->_quoteShippingAddressesItems = $items; return $items; } @@ -495,6 +508,9 @@ public function createOrders() $this->getQuote() ->setIsActive(false) ->save(); + + Mage::dispatchEvent('checkout_submit_all_after', array('orders' => $orders, 'quote' => $this->getQuote())); + return $this; } diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index 0e379e1adf..f0964c78b2 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -673,6 +673,11 @@ public function saveOrder() // TODO: send recurring profile emails } + Mage::dispatchEvent( + 'checkout_submit_all_after', + array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles) + ); + return $this; } diff --git a/app/code/core/Mage/Checkout/controllers/MultishippingController.php b/app/code/core/Mage/Checkout/controllers/MultishippingController.php index 84f4355abe..7ab85570ac 100644 --- a/app/code/core/Mage/Checkout/controllers/MultishippingController.php +++ b/app/code/core/Mage/Checkout/controllers/MultishippingController.php @@ -61,6 +61,16 @@ protected function _getHelper() return Mage::helper('checkout/url'); } + /** + * Retrieve checkout session + * + * @return Mage_Checkout_Model_Session + */ + protected function _getCheckoutSession() + { + return Mage::getSingleton('checkout/session'); + } + /** * Action predispatch * @@ -73,6 +83,23 @@ public function preDispatch() parent::preDispatch(); $action = $this->getRequest()->getActionName(); + + /** + * Catch index action call to set some flags before checkout/type_multishipping model initialization + */ + if (preg_match('#^index#', $action)) { + $this->_getCheckoutSession()->getQuote()->setIsMultiShipping(true); + $this->_getCheckoutSession()->setCheckoutState( + Mage_Checkout_Model_Session::CHECKOUT_STATE_BEGIN + ); + } + else if (!$this->_getCheckoutSession()->getQuote()->getIsMultiShipping() + && !preg_match('#^(login|register|success)#', $action)) { + $this->_redirect('*/*/index'); + $this->setFlag('', self::FLAG_NO_DISPATCH, true); + return $this; + } + if (!preg_match('#^(login|register)#', $action)) { if (!Mage::getSingleton('customer/session')->authenticate($this, $this->_getHelper()->getMSLoginUrl())) { $this->setFlag('', self::FLAG_NO_DISPATCH, true); @@ -89,7 +116,7 @@ public function preDispatch() return $this; } - if (Mage::getSingleton('checkout/session')->getCartWasUpdated(true) + if ($this->_getCheckoutSession()->getCartWasUpdated(true) && !in_array($action, array('index', 'login', 'register', 'addresses', 'success'))) { $this->_redirectUrl($this->_getHelper()->getCartUrl()); $this->setFlag('', self::FLAG_NO_DISPATCH, true); @@ -113,10 +140,7 @@ public function preDispatch() */ public function indexAction() { - Mage::getSingleton('checkout/session')->setCartWasUpdated(false); - $this->_getCheckout()->getCheckoutSession()->setCheckoutState( - Mage_Checkout_Model_Session::CHECKOUT_STATE_BEGIN - ); + $this->_getCheckoutSession()->setCartWasUpdated(false); $this->_redirect('*/*/addresses'); } @@ -222,11 +246,11 @@ public function addressesPostAction() } } catch (Mage_Core_Exception $e) { - Mage::getSingleton('checkout/session')->addError($e->getMessage()); + $this->_getCheckoutSession()->addError($e->getMessage()); $this->_redirect('*/*/addresses'); } catch (Exception $e) { - Mage::getSingleton('checkout/session')->addException( + $this->_getCheckoutSession()->addException( $e, Mage::helper('checkout')->__('Data saving problem') ); @@ -322,7 +346,7 @@ public function shippingPostAction() $this->_redirect('*/*/billing'); } catch (Exception $e){ - Mage::getSingleton('checkout/session')->addError($e->getMessage()); + $this->_getCheckoutSession()->addError($e->getMessage()); $this->_redirect('*/*/shipping'); } } @@ -370,7 +394,7 @@ public function billingAction() // $this->_redirect('*/*/overview'); // } // catch (Exception $e) { -// Mage::getSingleton('checkout/session')->addError($e->getMessage()); +// $this->_getCheckoutSession()->addError($e->getMessage()); // $this->_redirect('*/*/billing'); // } // } @@ -425,12 +449,12 @@ public function overviewAction() $this->renderLayout(); } catch (Mage_Core_Exception $e) { - Mage::getSingleton('checkout/session')->addError($e->getMessage()); + $this->_getCheckoutSession()->addError($e->getMessage()); $this->_redirect('*/*/billing'); } catch (Exception $e) { Mage::logException($e); - Mage::getSingleton('checkout/session')->addException($e, $this->__('Cannot open the overview page')); + $this->_getCheckoutSession()->addException($e, $this->__('Cannot open the overview page')); $this->_redirect('*/*/billing'); } } @@ -445,7 +469,7 @@ public function overviewPostAction() if ($requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds()) { $postedAgreements = array_keys($this->getRequest()->getPost('agreement', array())); if ($diff = array_diff($requiredAgreements, $postedAgreements)) { - Mage::getSingleton('checkout/session')->addError($this->__('Please agree to all Terms and Conditions before placing the order.')); + $this->_getCheckoutSession()->addError($this->__('Please agree to all Terms and Conditions before placing the order.')); $this->_redirect('*/*/billing'); return; } @@ -473,17 +497,17 @@ public function overviewPostAction() catch (Mage_Checkout_Exception $e) { Mage::helper('checkout')->sendPaymentFailedEmail($this->_getCheckout()->getQuote(), $e->getMessage(), 'multi-shipping'); $this->_getCheckout()->getCheckoutSession()->clear(); - Mage::getSingleton('checkout/session')->addError($e->getMessage()); + $this->_getCheckoutSession()->addError($e->getMessage()); $this->_redirect('*/cart'); } catch (Mage_Core_Exception $e){ Mage::helper('checkout')->sendPaymentFailedEmail($this->_getCheckout()->getQuote(), $e->getMessage(), 'multi-shipping'); - Mage::getSingleton('checkout/session')->addError($e->getMessage()); + $this->_getCheckoutSession()->addError($e->getMessage()); $this->_redirect('*/*/billing'); } catch (Exception $e){ Mage::helper('checkout')->sendPaymentFailedEmail($this->_getCheckout()->getQuote(), $e->getMessage(), 'multi-shipping'); - Mage::getSingleton('checkout/session')->addError('Order place error.'); + $this->_getCheckoutSession()->addError('Order place error.'); $this->_redirect('*/*/billing'); } } diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php index 4cba74f960..2ce1b12f9e 100644 --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php @@ -474,17 +474,14 @@ public function saveOrderAction() } $this->getOnepage()->getCheckout()->setUpdateSection(null); } - - $this->getOnepage()->getQuote()->save(); } catch (Exception $e) { Mage::logException($e); Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage()); $result['success'] = false; $result['error'] = true; $result['error_messages'] = $this->__('There was an error processing your order. Please contact us or try again later.'); - $this->getOnepage()->getQuote()->save(); } - + $this->getOnepage()->getQuote()->save(); /** * when there is redirect to third party, we don't want to save order yet. * we will save the order in return action. diff --git a/app/code/core/Mage/Chronopay/Block/Form.php b/app/code/core/Mage/Chronopay/Block/Form.php deleted file mode 100644 index 21e08b9147..0000000000 --- a/app/code/core/Mage/Chronopay/Block/Form.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * ChronoPay Gateway Form Block - * - * @category Mage - * @package Mage_Chronopay - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Block_Form extends Mage_Payment_Block_Form_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('chronopay/form.phtml'); - } - -} diff --git a/app/code/core/Mage/Chronopay/Block/Info.php b/app/code/core/Mage/Chronopay/Block/Info.php deleted file mode 100644 index 7c21e59768..0000000000 --- a/app/code/core/Mage/Chronopay/Block/Info.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay Payment Gateway Info Block - * - * @category Mage - * @package Mage_Chronopay - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Block_Info extends Mage_Payment_Block_Info_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('chronopay/info.phtml'); - } - - public function toPdf() - { - $this->setTemplate('chronopay/pdf/info.phtml'); - return $this->toHtml(); - } - -} diff --git a/app/code/core/Mage/Chronopay/Block/Standard/Failure.php b/app/code/core/Mage/Chronopay/Block/Standard/Failure.php deleted file mode 100644 index 702a545657..0000000000 --- a/app/code/core/Mage/Chronopay/Block/Standard/Failure.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -/** - * Failure Response from Chronopay - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Block_Standard_Failure - * @author Magento Core Team <core@magentocommerce.com> -*/ - -class Mage_Chronopay_Block_Standard_Failure extends Mage_Core_Block_Template -{ -} diff --git a/app/code/core/Mage/Chronopay/Block/Standard/Form.php b/app/code/core/Mage/Chronopay/Block/Standard/Form.php deleted file mode 100644 index 0d713414f8..0000000000 --- a/app/code/core/Mage/Chronopay/Block/Standard/Form.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Form Block - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Block_Standard_Form - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Block_Standard_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('chronopay/standard/form.phtml'); - parent::_construct(); - } -} diff --git a/app/code/core/Mage/Chronopay/Block/Standard/Redirect.php b/app/code/core/Mage/Chronopay/Block/Standard/Redirect.php deleted file mode 100644 index 132a0ccbe8..0000000000 --- a/app/code/core/Mage/Chronopay/Block/Standard/Redirect.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Redirect to Chronopay - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Block_Standard_Redirect - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Block_Standard_Redirect extends Mage_Core_Block_Abstract -{ - - protected function _toHtml() - { - $standard = Mage::getModel('chronopay/standard'); - $form = new Varien_Data_Form(); - $form->setAction($standard->getChronopayUrl()) - ->setId('chronopay_standard_checkout') - ->setName('chronopay_standard_checkout') - ->setMethod('POST') - ->setUseContainer(true); - foreach ($standard->setOrder($this->getOrder())->getStandardCheckoutFormFields() as $field => $value) { - $form->addField($field, 'hidden', array('name' => $field, 'value' => $value)); - } - $html = '<html><body>'; - $html.= $this->__('You will be redirected to ChronoPay in a few seconds.'); - $html.= $form->toHtml(); - $html.= '<script type="text/javascript">document.getElementById("chronopay_standard_checkout").submit();</script>'; - $html.= '</body></html>'; - - return $html; - } -} diff --git a/app/code/core/Mage/Chronopay/Helper/Data.php b/app/code/core/Mage/Chronopay/Helper/Data.php deleted file mode 100644 index 2644bdcad4..0000000000 --- a/app/code/core/Mage/Chronopay/Helper/Data.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Data Helper - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Helper_Data - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Helper_Data extends Mage_Core_Helper_Abstract -{ - -} diff --git a/app/code/core/Mage/Chronopay/Model/Api/Debug.php b/app/code/core/Mage/Chronopay/Model/Api/Debug.php deleted file mode 100644 index b50d3bfb76..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Api/Debug.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Api Debug - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Api_Debug - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('chronopay/api_debug'); - } -} diff --git a/app/code/core/Mage/Chronopay/Model/Config.php b/app/code/core/Mage/Chronopay/Model/Config.php deleted file mode 100644 index b104d2e422..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Config.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -/** - * Chronopay Configuration Model - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Config - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Model_Config extends Varien_Object -{ - /** - * Return config var - * - * @param string Var key - * @param string Default value for non-existing key - * @return mixed - */ - public function getConfigData($key, $default=false) - { - if (!$this->hasData($key)) { - $value = Mage::getStoreConfig('payment/chronopay_standard/'.$key); - if (is_null($value) || false===$value) { - $value = $default; - } - $this->setData($key, $value); - } - return $this->getData($key); - } - - /** - * Return Site ID registered in ChronoPay Admnin Panel - * - * @return string Site ID - */ - public function getSiteId () - { - return $this->getConfigData('site_id'); - } - - /** - * Return Product ID (general type payments) registered in ChronoPay Admnin Panel - * - * @return string Product ID - */ - public function getProductId () - { - return $this->getConfigData('product_id'); - } - - /** - * Return Store description sent to Chronopay - * - * @return string Description - */ - public function getDescription () - { - $description = $this->getConfigData('description'); - return $description; - } - - /** - * Return new order status - * - * @return string New order status - */ - public function getNewOrderStatus () - { - return $this->getConfigData('order_status'); - } - - /** - * Return debug flag - * - * @return boolean Debug flag (0/1) - */ - public function getDebug () - { - return $this->getConfigData('debug_flag'); - } - - /** - * Return accepted currency - * - * @return string Currenc - */ - public function getCurrency () - { - return $this->getConfigData('currency'); - } - - /** - * Return client interface language - * - * @return string(2) Accepted language - */ - public function getLanguage () - { - return $this->getConfigData('language'); - } -} diff --git a/app/code/core/Mage/Chronopay/Model/Gateway.php b/app/code/core/Mage/Chronopay/Model/Gateway.php deleted file mode 100644 index f2c31cdb34..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Gateway.php +++ /dev/null @@ -1,341 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -/** - * ChronoPay Gateway Model - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Gateway - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Model_Gateway extends Mage_Payment_Model_Method_Cc -{ - const CGI_URL = 'https://secure.chronopay.com/gateway.cgi'; - - const OPCODE_CHARGING = 1; - const OPCODE_REFUND = 2; - const OPCODE_AUTHORIZE = 4; - const OPCODE_VOID_AUTHORIZE = 5; - const OPCODE_CONFIRM_AUTHORIZE = 6; - const OPCODE_CUSTOMER_FUND_TRANSFER = 8; - - protected $_code = 'chronopay_gateway'; - - protected $_formBlockType = 'chronopay/form'; - protected $_infoBlockType = 'chronopay/info'; - - /** - * Availability options - */ - protected $_isGateway = true; - protected $_canAuthorize = true; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = true; - protected $_canVoid = false; - protected $_canUseInternal = true; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = true; - protected $_canSaveCc = false; - - /** - * Return ip address of customer - * - * @return string - */ - protected function _getIp () - { - return Mage::helper('core/http')->getRemoteAddr(); - } - - /** - * Return shared secret key from config - * - * @return string - */ - protected function _getSharedSecret () - { - return $this->getConfigData('shared_secret'); - } - - public function authorize(Varien_Object $payment, $amount) - { - $payment->setAmount($amount); - $payment->setOpcode(self::OPCODE_AUTHORIZE); - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - if (!$result->getError()) { - $payment->setStatus(self::STATUS_APPROVED) - ->setCcTransId($result->getTransaction()) - ->setTransactionId($result->getTransaction()) - ->setIsTransactionClosed(0); - } else { - Mage::throwException($result->getError()); - } - - return $this; - } - - public function capture(Varien_Object $payment, $amount) - { - $payment->setAmount($amount); - if ($payment->getParentTransactionId()) { - $this->setTransactionId($payment->getParentTransactionId()); - $payment->setOpcode(self::OPCODE_CONFIRM_AUTHORIZE); - } else { - $payment->setOpcode(self::OPCODE_CHARGING); - } - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - if (!$result->getError()) { - $payment->setStatus(self::STATUS_APPROVED) - ->setTransactionId($result->getTransaction()); - } else { - Mage::throwException($result->getError()); - } - - return $this; - } - - public function refund(Varien_Object $payment, $amount) - { - $payment->setAmount($amount); - $payment->setOpcode(self::OPCODE_REFUND); - - $this->setTransactionId($payment->getParentTransactionId()); - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - - $payment->setStatus(self::STATUS_APPROVED) - ->setTransactionId($result->getTransaction()) - ->setIsTransactionClosed(1); - - return $this; - } - - /** - * Building request array - * - * @param Varien_Object - * @return array - */ - protected function _buildRequest(Varien_Object $payment) - { - $order = $payment->getOrder(); - $billing = $order->getBillingAddress(); - $streets = $billing->getStreet(); - $street = isset($streets[0]) && $streets[0] != '' - ? $streets[0] - : (isset($streets[1]) && $streets[1] != '' ? $streets[1] : ''); - - $request = Mage::getModel('chronopay/gateway_request') - ->setOpcode($payment->getOpcode()) - ->setProductId($this->getConfigData('product_id')); - - switch ($request->getOpcode()) { - case self::OPCODE_CUSTOMER_FUND_TRANSFER : - $request->setCustomer($order->getCustomerId()) - ->setAmount(sprintf('%.2f', $payment->getAmount())) - ->setCurrency($order->getBaseCurrencyCode()); - break; - case self::OPCODE_CHARGING : - case self::OPCODE_REFUND : - case self::OPCODE_AUTHORIZE : - case self::OPCODE_VOID_AUTHORIZE : - $request->setFname($billing->getFirstname()) - ->setLname($billing->getLastname()) - ->setCardholder($payment->getCcOwner()) - ->setZip($billing->getPostcode()) - ->setStreet($street) - ->setCity($billing->getCity()) - ->setState($billing->getRegionModel()->getCode()) - ->setCountry($billing->getCountryModel()->getIso3Code()) - ->setEmail($order->getCustomerEmail()) - ->setPhone($billing->getTelephone()) - ->setIp($this->_getIp()) - ->setCardNo($payment->getCcNumber()) - ->setCvv($payment->getCcCid()) - ->setExpirey($payment->getCcExpYear()) - ->setExpirem(sprintf('%02d', $payment->getCcExpMonth())) - ->setAmount(sprintf('%.2f', $payment->getAmount())) - ->setCurrency($order->getBaseCurrencyCode()); - break; - default : - Mage::throwException( - Mage::helper('chronopay')->__('Invalid operation code.') - ); - break; - } - - $request->setShowTransactionId(1); - - if ($this->getTransactionId()) { - $request->setTransaction($this->getTransactionId()); - } - - - $hash = $this->_getHash($request); - $request->setHash($hash); - return $request; - } - - /** - * Send request to gateway - * - * @param Mage_Chronopay_Model_Gateway_Request - * @return mixed - */ - protected function _postRequest(Mage_Chronopay_Model_Gateway_Request $request) - { - $result = Mage::getModel('chronopay/gateway_result'); - - $client = new Varien_Http_Client(); - - $url = $this->getConfigData('cgi_url'); - $client->setUri($url ? $url : self::CGI_URL); - $client->setConfig(array( - 'maxredirects' => 0, - 'timeout' => 30, - )); - $client->setParameterPost($request->getData()); - $client->setMethod(Zend_Http_Client::POST); - - $debugData = array('request' => $request->getData()); - - try { - $response = $client->request(); - $body = $response->getRawBody(); - - if (preg_match('/(T\|(.+)\|[\r\n]{0,}){0,1}(Y\|(.+)?|\|)|(N\|(.+[\r\n]{0,}.+){0,})/', $body, $matches)) { - - $transactionId = $matches[2]; - $message = isset($matches[4])?trim($matches[4], '|'):''; - - if (isset($matches[5], $matches[6])) { - $result->setError($matches[6]); - Mage::throwException($matches[6]); - } - - if ($message == 'Completed') { - $result->setTransaction($request->getTransaction()); - } - - if (strlen($transactionId)) { - $result->setTransaction($transactionId); - } - - if (!$result->getTransaction()) { - Mage::throwException(Mage::helper('chronopay')->__('The transaction ID is invalid.')); - } - } else { - Mage::throwException(Mage::helper('chronopay')->__('Invalid response format.')); - } - } - catch (Exception $e) { - $result->setResponseCode(-1) - ->setResponseReasonCode($e->getCode()) - ->setResponseReasonText($e->getMessage()); - - $exceptionMsg = Mage::helper('chronopay')->__('Gateway request error: %s', $e->getMessage()); - - $debugData['result'] = $result->getData(); - $this->_debug($debugData); - - Mage::throwException($exceptionMsg); - } - - $debugData['result'] = $result->getData(); - $this->_debug($debugData); - return $result; - } - - /** - * Generate MD5 hash for transaction checksum - * - * @param Mage_Chronopay_Model_Gateway_Request - * @return string MD5 - */ - protected function _getHash(Mage_Chronopay_Model_Gateway_Request $request) - { - $hashArray = array( - $this->_getSharedSecret(), - $request->getOpcode(), - $request->getProductId() - ); - - switch ($request->getOpcode()) { - case self::OPCODE_CHARGING : - case self::OPCODE_AUTHORIZE : - $hashArray[] = $request->getFname(); - $hashArray[] = $request->getLname(); - $hashArray[] = $request->getStreet(); - $hashArray[] = $this->_getIp(); - $hashArray[] = $request->getCardNo(); - $hashArray[] = $request->getAmount(); - break; - - case self::OPCODE_VOID_AUTHORIZE : - case self::OPCODE_CONFIRM_AUTHORIZE : - $hashArray[] = $request->getTransaction(); - break; - - case self::OPCODE_REFUND : - $hashArray[] = $request->getTransaction(); - $hashArray[] = $request->getAmount(); - break; - - case self::OPCODE_CUSTOMER_FUND_TRANSFER : - $hashArray[] = $request->getCustomer(); - $hashArray[] = $request->getTransaction(); - $hashArray[] = $request->getAmount(); - break; - - default : - Mage::throwException( - Mage::helper('chronopay')->__('Invalid operation code.') - ); - break; - } - - return md5(implode('', $hashArray)); - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Chronopay/Model/Gateway/Request.php b/app/code/core/Mage/Chronopay/Model/Gateway/Request.php deleted file mode 100644 index be8d3160c6..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Gateway/Request.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay Gateway Request - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Gateway_Request - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Model_Gateway_Request extends Varien_Object -{ -} diff --git a/app/code/core/Mage/Chronopay/Model/Gateway/Result.php b/app/code/core/Mage/Chronopay/Model/Gateway/Result.php deleted file mode 100644 index 7103156d0b..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Gateway/Result.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay Gateway Result - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Gateway_Result - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Model_Gateway_Result extends Varien_Object -{ -} diff --git a/app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug.php deleted file mode 100644 index f4c855b9c1..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay API Debug Resource - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Mysql4_Api_Debug - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('chronopay/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index 33f470180d..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay API Debug Resource Collection - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Mysql4_Api_Debug_Collection - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('chronopay/api_debug'); - } -} diff --git a/app/code/core/Mage/Chronopay/Model/Mysql4/Setup.php b/app/code/core/Mage/Chronopay/Model/Mysql4/Setup.php deleted file mode 100644 index fc7c5c67dd..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Mysql4/Setup.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Setup model - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Mysql4_Setup - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup -{ - -} diff --git a/app/code/core/Mage/Chronopay/Model/Source/Cctype.php b/app/code/core/Mage/Chronopay/Model/Source/Cctype.php deleted file mode 100644 index d6a75d4873..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Source/Cctype.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay CC Types Source Model - * - * @category Mage - * @package Mage_Chronopay - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype -{ - public function getAllowedTypes() - { - return array('VI', 'MC', 'AE', 'DICL', 'JCB', 'ENR', 'SS', 'DI'); - } -} diff --git a/app/code/core/Mage/Chronopay/Model/Source/Language.php b/app/code/core/Mage/Chronopay/Model/Source/Language.php deleted file mode 100644 index 28daf9d6eb..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Source/Language.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay Allowed languages Resource - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Source_Language - * @author Magento Core Team <core@magentocommerce.com> - */ - -class Mage_Chronopay_Model_Source_Language -{ - public function toOptionArray() - { - return array( - array('value' => 'EN', 'label' => Mage::helper('chronopay')->__('English')), - array('value' => 'RU', 'label' => Mage::helper('chronopay')->__('Russian')), - array('value' => 'NL', 'label' => Mage::helper('chronopay')->__('Dutch')), - array('value' => 'DE', 'label' => Mage::helper('chronopay')->__('German')), - ); - } -} - - - diff --git a/app/code/core/Mage/Chronopay/Model/Source/PaymentAction.php b/app/code/core/Mage/Chronopay/Model/Source/PaymentAction.php deleted file mode 100644 index e9c37cd6ca..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Source/PaymentAction.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay Payment Action Dropdown source - * - * @category Mage - * @package Mage_Chronopay - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Model_Source_PaymentAction -{ - public function toOptionArray() - { - return array( - array( - 'value' => Mage_Chronopay_Model_Gateway::ACTION_AUTHORIZE, - 'label' => Mage::helper('chronopay')->__('Authorize Only') - ), - array( - 'value' => Mage_Chronopay_Model_Gateway::ACTION_AUTHORIZE_CAPTURE, - 'label' => Mage::helper('chronopay')->__('Authorize and Capture') - ), - ); - } -} diff --git a/app/code/core/Mage/Chronopay/Model/Standard.php b/app/code/core/Mage/Chronopay/Model/Standard.php deleted file mode 100644 index d005f769c8..0000000000 --- a/app/code/core/Mage/Chronopay/Model/Standard.php +++ /dev/null @@ -1,273 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay Standard Model - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_Model_Standard - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Chronopay_Model_Standard extends Mage_Payment_Model_Method_Abstract -{ - protected $_code = 'chronopay_standard'; - protected $_formBlockType = 'chronopay/standard_form'; - - protected $_isGateway = false; - protected $_canAuthorize = true; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = false; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = false; - - protected $_order = null; - - - /** - * Get Config model - * - * @return object Mage_Chronopay_Model_Config - */ - public function getConfig() - { - return Mage::getSingleton('chronopay/config'); - } - - /** - * Payment validation - * - * @param none - * @return Mage_Chronopay_Model_Standard - */ - public function validate() - { - parent::validate(); - $paymentInfo = $this->getInfoInstance(); - if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { - $currency_code = $paymentInfo->getOrder()->getBaseCurrencyCode(); - } else { - $currency_code = $paymentInfo->getQuote()->getBaseCurrencyCode(); - } - if ($currency_code != $this->getConfig()->getCurrency()) { - Mage::throwException(Mage::helper('chronopay')->__('The selected currency code (%s) is not compatible with ChronoPay.', $currency_code)); - } - return $this; - } - - /** - * Capture payment - * - * @param Varien_Object $orderPayment - * @return Mage_Payment_Model_Abstract - */ - public function capture (Varien_Object $payment, $amount) - { - $payment->setStatus(self::STATUS_APPROVED) - ->setTransactionId($this->getTransactionId()); - - return $this; - } - - /** - * Returns Target URL - * - * @return string Target URL - */ - public function getChronopayUrl () - { - return 'https://secure.chronopay.com/index_shop.cgi'; - } - - /** - * Return URL for Chronopay success response - * - * @return string URL - */ - protected function getSuccessURL () - { - return Mage::getUrl('chronopay/standard/success', array('_secure' => true)); - } - - /** - * Return URL for Chronopay notification - * - * @return string Notification URL - */ - protected function getNotificationURL () - { - return Mage::getUrl('chronopay/standard/notify', array('_secure' => true)); - } - - /** - * Return URL for Chronopay failure response - * - * @return string URL - */ - protected function getFailureURL () - { - return Mage::getUrl('chronopay/standard/failure', array('_secure' => true)); - } - - /** - * Form block description - * - * @return object - */ - public function createFormBlock($name) - { - $block = $this->getLayout()->createBlock('chronopay/form_standard', $name); - $block->setMethod($this->_code); - $block->setPayment($this->getPayment()); - - return $block; - } - - /** - * Return Order Place Redirect URL - * - * @return string Order Redirect URL - */ - public function getOrderPlaceRedirectUrl() - { - return Mage::getUrl('chronopay/standard/redirect'); - } - - /** - * Return Standard Checkout Form Fields for request to Chronopay - * - * @return array Array of hidden form fields - */ - public function getStandardCheckoutFormFields () - { - $order = $this->getOrder(); - if (!($order instanceof Mage_Sales_Model_Order)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve the order object.')); - } - - $billingAddress = $order->getBillingAddress(); - - $streets = $billingAddress->getStreet(); - $street = isset($streets[0]) && $streets[0] != '' - ? $streets[0] - : (isset($streets[1]) && $streets[1] != '' ? $streets[1] : ''); - - if ($this->getConfig()->getDescription()) { - $transDescription = $this->getConfig()->getDescription(); - } else { - $transDescription = Mage::helper('chronopay')->__('Order #%s', $order->getRealOrderId()); - } - - if ($order->getCustomerEmail()) { - $email = $order->getCustomerEmail(); - } elseif ($billingAddress->getEmail()) { - $email = $billingAddress->getEmail(); - } else { - $email = ''; - } - - $fields = array( - 'product_id' => $this->getConfig()->getProductId(), - 'product_name' => $transDescription, - 'product_price' => $order->getBaseGrandTotal(), - 'language' => $this->getConfig()->getLanguage(), - 'f_name' => $billingAddress->getFirstname(), - 's_name' => $billingAddress->getLastname(), - 'street' => $street, - 'city' => $billingAddress->getCity(), - 'state' => $billingAddress->getRegionModel()->getCode(), - 'zip' => $billingAddress->getPostcode(), - 'country' => $billingAddress->getCountryModel()->getIso3Code(), - 'phone' => $billingAddress->getTelephone(), - 'email' => $email, - 'cb_url' => $this->getNotificationURL(), - 'cb_type' => 'P', // POST method used (G - GET method) - 'decline_url' => $this->getFailureURL(), - 'cs1' => Mage::helper('core')->encrypt($order->getRealOrderId()) - ); - - $this->_debug(array('request' => $fields)); - return $fields; - } - - /** - * Validate Response from ChronoPay - * - * @param array Post data returned from ChronoPay - * @return mixed - */ - public function validateResponse ($data) - { - $order = $this->getOrder(); - - if (!($order instanceof Mage_Sales_Model_Order)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve the order object.')); - } - - try { - $ok = is_array($data) - && isset($data['transaction_type']) && $data['transaction_type'] != '' - && isset($data['customer_id']) && $data['customer_id'] != '' - && isset($data['site_id']) && $data['site_id'] != '' - && isset($data['product_id']) && $data['product_id'] != ''; - - if (!$ok) { - throw new Exception('Cannot restore order or invalid order ID'); - } - - // validate site ID - if ($this->getConfig()->getSiteId() != $data['site_id']) { - throw new Exception('Invalid site ID'); - } - - // validate product ID - if ($this->getConfig()->getProductId() != $data['product_id']) { - throw new Exception('Invalid product ID'); - } - - // Successful transaction type - if (!in_array($data['transaction_type'], array('initial', 'onetime'))) { - throw new Exception('Transaction is not successful'); - } - - } catch (Exception $e) { - return $e; - } - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Chronopay/controllers/StandardController.php b/app/code/core/Mage/Chronopay/controllers/StandardController.php deleted file mode 100644 index 5a1603eb88..0000000000 --- a/app/code/core/Mage/Chronopay/controllers/StandardController.php +++ /dev/null @@ -1,219 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Chronopay Standard Front Controller - * - * @category Mage - * @package Mage_Chronopay - * @name Mage_Chronopay_StandardController - * @author Magento Core Team <core@magentocommerce.com> -*/ -class Mage_Chronopay_StandardController extends Mage_Core_Controller_Front_Action -{ - /** - * Order instance - */ - protected $_order; - - /** - * Return debug flag - * - * @return boolean - */ - public function getDebug () - { - return Mage::getSingleton('chronopay/config')->getDebug(); - } - - /** - * Get order - * - * @return Mage_Sales_Model_Order - */ - public function getOrder () - { - if ($this->_order == null) { - $session = Mage::getSingleton('checkout/session'); - $this->_order = Mage::getModel('sales/order'); - $this->_order->loadByIncrementId($session->getLastRealOrderId()); - } - return $this->_order; - } - - /** - * When a customer chooses Chronopay on Checkout/Payment page - * - */ - public function redirectAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setChronopayStandardQuoteId($session->getQuoteId()); - - $order = $this->getOrder(); - - if (!$order->getId()) { - $this->norouteAction(); - return; - } - - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('chronopay')->__('The customer was redirected to Chronopay.') - ); - $order->save(); - - $this->getResponse() - ->setBody($this->getLayout() - ->createBlock('chronopay/standard_redirect') - ->setOrder($order) - ->toHtml()); - - $session->unsQuoteId(); - } - - /** - * Success response from Chronopay - */ - public function successAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setQuoteId($session->getChronopayStandardQuoteId()); - $session->unsChronopayStandardQuoteId(); - - $order = $this->getOrder(); - - if (!$order->getId()) { - $this->norouteAction(); - return; - } - - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('chronopay')->__('The customer has successfully returned from Chronopay.') - ); - - $order->save(); - $this->_redirect('checkout/onepage/success'); - } - - - /** - * Notification Action from ChronoPay - */ - public function notifyAction () - { - $postData = $this->getRequest()->getPost(); - - if (!count($postData)) { - $this->norouteAction(); - return; - } - - if ($this->getDebug()) { - $debug = Mage::getModel('chronopay/api_debug'); - if (isset($postData['cs2']) && $postData['cs2'] > 0) { - $debug->setId($postData['cs2']); - } - $debug->setResponseBody(print_r($postData,1))->save(); - } - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId(Mage::helper('core')->decrypt($postData['cs1'])); - if ($order->getId()) { - $result = $order->getPayment()->getMethodInstance()->setOrder($order)->validateResponse($postData); - - if ($result instanceof Exception) { - if ($order->getId()) { - $order->addStatusToHistory( - $order->getStatus(), - $result->getMessage() - ); - $order->cancel(); - } - Mage::throwException($result->getMessage()); - return; - } - - $order->sendNewOrderEmail(); - - $order->getPayment()->getMethodInstance()->setTransactionId($postData['transaction_id']); - - if ($this->saveInvoice($order)) { - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true); - } - $order->save(); - } - } - - /** - * Save invoice for order - * - * @param Mage_Sales_Model_Order $order - * @return boolean Can save invoice or not - */ - protected function saveInvoice (Mage_Sales_Model_Order $order) - { - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - return true; - } - - return false; - } - - /** - * Failure response from Chronopay - */ - public function failureAction () - { - $errorMsg = Mage::helper('chronopay')->__('An error occurred during the paying process.'); - - $order = $this->getOrder(); - - if (!$order->getId()) { - $this->norouteAction(); - return; - } - - if ($order instanceof Mage_Sales_Model_Order && $order->getId()) { - $order->addStatusToHistory($order->getStatus(), $errorMsg); - $order->cancel(); - $order->save(); - } - - $this->loadLayout(); - $this->renderLayout(); - - Mage::getSingleton('checkout/session')->unsLastRealOrderId(); - } - -} diff --git a/app/code/core/Mage/Chronopay/etc/config.xml b/app/code/core/Mage/Chronopay/etc/config.xml deleted file mode 100644 index b2bff2d2f3..0000000000 --- a/app/code/core/Mage/Chronopay/etc/config.xml +++ /dev/null @@ -1,142 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Chronopay - * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<config> - <modules> - <Mage_Chronopay> - <version>0.1.0</version> - </Mage_Chronopay> - </modules> - <global> - <models> - <chronopay> - <class>Mage_Chronopay_Model</class> - <resourceModel>chronopay_mysql4</resourceModel> - </chronopay> - <chronopay_mysql4> - <class>Mage_Chronopay_Model_Mysql4</class> - <entities> - <api_debug><table>chronopay_api_debug</table></api_debug> - </entities> - </chronopay_mysql4> - </models> - <resources> - <chronopay_setup> - <setup> - <module>Mage_Chronopay</module> - <class>Mage_Chronopay_Model_Mysql4_Setup</class> - </setup> - </chronopay_setup> - </resources> - <blocks> - <chronopay><class>Mage_Chronopay_Block</class></chronopay> - </blocks> - <payment> - <cc> - <types> - <DI> - <code>DI</code> - <name>Discover</name> - <order>60</order> - </DI> - <DICL> - <code>DICL</code> - <name>Diners Club</name> - <order>62</order> - </DICL> - <ENR> - <code>ENR</code> - <name>enRoute</name> - <order>63</order> - </ENR> - <SS> - <code>SS</code> - <name>Maestro/Solo</name> - <order>64</order> - </SS> - </types> - </cc> - </payment> - </global> - <frontend> - <secure_url> - <chronopay_standard>/chronopay/standard</chronopay_standard> - </secure_url> - <routers> - <chronopay> - <use>standard</use> - <args> - <module>Mage_Chronopay</module> - <frontName>chronopay</frontName> - </args> - </chronopay> - </routers> - <translate> - <modules> - <Mage_Chronopay> - <files> - <default>Mage_Chronopay.csv</default> - </files> - </Mage_Chronopay> - </modules> - </translate> - <layout> - <updates> - <chronopay> - <file>chronopay.xml</file> - </chronopay> - </updates> - </layout> - </frontend> - <adminhtml> - <translate> - <modules> - <Mage_Chronopay> - <files> - <default>Mage_Chronopay.csv</default> - </files> - </Mage_Chronopay> - </modules> - </translate> - </adminhtml> - <default> - <payment> - <chronopay_standard> - <model>chronopay/standard</model> - <title>ChronoPay Standard - 0 - O - - - chronopay/gateway - ChronoPay Gateway - 0 - O - - - - diff --git a/app/code/core/Mage/Chronopay/etc/system.xml b/app/code/core/Mage/Chronopay/etc/system.xml deleted file mode 100644 index d330685e18..0000000000 --- a/app/code/core/Mage/Chronopay/etc/system.xml +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - - - Specify access URL: {STORE_URL}/chronopay/standard/success in the ChronoPay client admin. - text - 251 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>2</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - text - 3 - 1 - 1 - 0 - - - - text - 4 - 1 - 1 - 0 - - - - Order number will be used if left empty. - text - 5 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_currency - 6 - 1 - 1 - 0 - - - - select - chronopay/source_language - 7 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 8 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 9 - 1 - 1 - 0 - - - - allowspecific - 10 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 11 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 12 - 1 - 1 - 0 - - - - - - text - 251 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 0 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>10</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - select - chronopay/source_paymentAction - 20 - 1 - 1 - 0 - - - - text - 30 - 1 - 1 - 0 - - - - text - 40 - 1 - 1 - 0 - - - - text - 50 - 1 - 1 - 0 - - - - multiselect - chronopay/source_cctype - 60 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_currency - 70 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 80 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 90 - 1 - 1 - 0 - - - - allowspecific - 100 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 110 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 120 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Chronopay/sql/chronopay_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Chronopay/sql/chronopay_setup/mysql4-install-0.1.0.php deleted file mode 100644 index 505f38aba2..0000000000 --- a/app/code/core/Mage/Chronopay/sql/chronopay_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,45 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$this->getTable('chronopay_api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Core/Model/Email/Template/Filter.php b/app/code/core/Mage/Core/Model/Email/Template/Filter.php index 81f6887186..214d5eb6d3 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Filter.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Filter.php @@ -95,6 +95,7 @@ public function setUseAbsoluteLinks($flag) */ public function setUseSessionInUrl($flag) { + $this->_useSessionInUrl = $flag; return $this; } diff --git a/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php b/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php index c641de4683..3520981eb2 100644 --- a/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php +++ b/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php @@ -297,6 +297,36 @@ public function addFieldToSelect($field, $alias = null) return $this; } + /** + * Add attribute expression (SUM, COUNT, etc) + * + * Example: ('sub_total', 'SUM({{attribute}})', 'revenue') + * Example: ('sub_total', 'SUM({{revenue}})', 'revenue') + * + * For some functions like SUM use groupByAttribute. + * + * @param string $alias + * @param string $expression + * @param array $fields + * @return Mage_Eav_Model_Entity_Collection_Abstract + */ + public function addExpressionFieldToSelect($alias, $expression, $fields) + { + // validate alias + if(!is_array($fields)) { + $fields = array($fields=>$fields); + } + + $fullExpression = $expression; + foreach($fields as $fieldKey=>$fieldItem) { + $fullExpression = str_replace('{{' . $fieldKey . '}}', $fieldItem, $fullExpression); + } + + $this->getSelect()->columns(array($alias=>$fullExpression)); + + return $this; + } + /** * Removes field from select * diff --git a/app/code/core/Mage/Cybermut/Block/Error.php b/app/code/core/Mage/Cybermut/Block/Error.php deleted file mode 100644 index 88bc7639d0..0000000000 --- a/app/code/core/Mage/Cybermut/Block/Error.php +++ /dev/null @@ -1,37 +0,0 @@ - -*/ -class Mage_Cybermut_Block_Error extends Mage_Core_Block_Template -{ -} diff --git a/app/code/core/Mage/Cybermut/Block/Form.php b/app/code/core/Mage/Cybermut/Block/Form.php deleted file mode 100644 index a6125813fe..0000000000 --- a/app/code/core/Mage/Cybermut/Block/Form.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class Mage_Cybermut_Block_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('cybermut/form.phtml'); - parent::_construct(); - } - -} diff --git a/app/code/core/Mage/Cybermut/Block/Redirect.php b/app/code/core/Mage/Cybermut/Block/Redirect.php deleted file mode 100644 index edff301f45..0000000000 --- a/app/code/core/Mage/Cybermut/Block/Redirect.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -class Mage_Cybermut_Block_Redirect extends Mage_Core_Block_Abstract -{ - - protected function _toHtml() - { - $standard = Mage::getModel('cybermut/payment'); - $form = new Varien_Data_Form(); - $form->setAction($standard->getCybermutUrl()) - ->setId('cybermut_payment_checkout') - ->setName('cybermut_payment_checkout') - ->setMethod('POST') - ->setUseContainer(true); - foreach ($standard->setOrder($this->getOrder())->getStandardCheckoutFormFields() as $field => $value) { - $form->addField($field, 'hidden', array('name' => $field, 'value' => $value)); - } - - $formHTML = $form->toHtml(); - - $html = ''; - $html.= $this->__('You will be redirected to Cybermut in a few seconds.'); - $html.= $formHTML; - $html.= ''; - $html.= ''; - - $standard->debugData(array('request' => $formHTML)); - - return $html; - } -} diff --git a/app/code/core/Mage/Cybermut/Helper/Data.php b/app/code/core/Mage/Cybermut/Helper/Data.php deleted file mode 100644 index d25b5b6a32..0000000000 --- a/app/code/core/Mage/Cybermut/Helper/Data.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class Mage_Cybermut_Helper_Data extends Mage_Core_Helper_Abstract -{ - -} diff --git a/app/code/core/Mage/Cybermut/Model/Api/Debug.php b/app/code/core/Mage/Cybermut/Model/Api/Debug.php deleted file mode 100644 index 2af8a62014..0000000000 --- a/app/code/core/Mage/Cybermut/Model/Api/Debug.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Cybermut_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('cybermut/api_debug'); - } -} diff --git a/app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug.php deleted file mode 100644 index a871b91ad5..0000000000 --- a/app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - -class Mage_Cybermut_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('cybermut/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index eefa80ea10..0000000000 --- a/app/code/core/Mage/Cybermut/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Cybermut_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('cybermut/api_debug'); - } -} diff --git a/app/code/core/Mage/Cybermut/Model/Mysql4/Setup.php b/app/code/core/Mage/Cybermut/Model/Mysql4/Setup.php deleted file mode 100644 index 97a08dcc0f..0000000000 --- a/app/code/core/Mage/Cybermut/Model/Mysql4/Setup.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - -class Mage_Cybermut_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup -{ - -} diff --git a/app/code/core/Mage/Cybermut/Model/Payment.php b/app/code/core/Mage/Cybermut/Model/Payment.php deleted file mode 100644 index 44dad8ce17..0000000000 --- a/app/code/core/Mage/Cybermut/Model/Payment.php +++ /dev/null @@ -1,378 +0,0 @@ - - */ - -class Mage_Cybermut_Model_Payment extends Mage_Payment_Model_Method_Abstract -{ - protected $_code = 'cybermut_payment'; - protected $_formBlockType = 'cybermut/form'; - - // Cybermut return codes of payment - const RETURN_CODE_ACCEPTED = 'paiement'; - const RETURN_CODE_TEST_ACCEPTED = 'payetest'; - const RETURN_CODE_ERROR = 'Annulation'; - - // Payment configuration - protected $_isGateway = false; - protected $_canAuthorize = true; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = false; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = false; - - // Order instance - protected $_order = null; - - /** - * Return CyberMut protocol version - * - * @return string Protocol version - */ - protected function getVersion() - { - return '1.2open'; - } - - /** - * Returns Target URL - * - * @return string Target URL - */ - public function getCybermutUrl() - { - $url = ''; - switch ($this->getConfigData('bank')) - { - default: - case 'mutuel': - $url = $this->getConfigData('test_mode') - ? 'https://paiement.creditmutuel.fr/test/paiement.cgi' - : 'https://paiement.creditmutuel.fr/paiement.cgi'; - break; - case 'cic': - $url = $this->getConfigData('test_mode') - ? 'https://ssl.paiement.cic-banques.fr/test/paiement.cgi' - : 'https://ssl.paiement.cic-banques.fr/paiement.cgi'; - break; - case 'obc': - $url = $this->getConfigData('test_mode') - ? 'https://ssl.paiement.banque-obc.fr/test/paiement.cgi' - : 'https://ssl.paiement.banque-obc.fr/paiement.cgi'; - break; - } - return $url; - } - - /** - * Return back URL - * - * @return string URL - */ - protected function getReturnURL() - { - return $this->getSuccessURL(); - } - - /** - * Return URL for Cybermut success response - * - * @return string URL - */ - protected function getSuccessURL() - { - return Mage::getUrl('cybermut/payment/success', array('_secure' => true)); - } - - /** - * Return URL for Cybermut failure response - * - * @return string URL - */ - protected function getErrorURL() - { - return Mage::getUrl('cybermut/payment/error', array('_secure' => true)); - } - - /** - * Capture payment - * - * @param Varien_Object $orderPayment - * @return Mage_Payment_Model_Abstract - */ - public function capture(Varien_Object $payment, $amount) - { - $payment->setStatus(self::STATUS_APPROVED) - ->setLastTransId($this->getTransactionId()); - - return $this; - } - - /** - * Form block description - * - * @return object - */ - public function createFormBlock($name) - { - $block = $this->getLayout()->createBlock('cybermut/form_payment', $name); - $block->setMethod($this->_code); - $block->setPayment($this->getPayment()); - - return $block; - } - - /** - * Return Order Place Redirect URL - * - * @return string Order Redirect URL - */ - public function getOrderPlaceRedirectUrl() - { - return Mage::getUrl('cybermut/payment/redirect'); - } - - /** - * Return Standard Checkout Form Fields for request to Cybermut - * - * @return array Array of hidden form fields - */ - public function getStandardCheckoutFormFields() - { - $order = $this->getOrder(); - if (!($order instanceof Mage_Sales_Model_Order)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve order object')); - } - - $description = $this->getConfigData('description') - ? $this->getConfigData('description') - : Mage::helper('cybermut')->__('Order #%s', $order->getRealOrderId()); - - $fields = array( - 'version' => $this->getVersion(), - 'TPE' => $this->getConfigData('tpe_no'), - 'date' => date('d/m/Y:H:i:s'), - 'montant' => sprintf('%.2f', $order->getBaseGrandTotal()) . $order->getBaseCurrencyCode(), - 'reference' => $order->getRealOrderId(), - 'texte-libre' => $description, - 'lgue' => $this->getConfigData('language'), - 'societe' => $this->getConfigData('site_code'), - 'url_retour' => $this->getReturnURL(), - 'url_retour_ok' => $this->getSuccessURL(), - 'url_retour_err' => $this->getErrorURL(), - 'bouton' => 'ButtonLabel' - ); - - $fields['MAC'] = $this->_getMAC($fields); - - return $fields; - } - - /** - * Prepare string for MAC generation - * - * @param array $data - * @return string MAC string - */ - protected function _getMAC($data) - { - $string = sprintf('%s*%s*%s*%s*%s*%s*%s*%s*', - $data['TPE'], - $data['date'], - $data['montant'], - $data['reference'], - $data['texte-libre'], - $data['version'], - $data['lgue'], - $data['societe'] - ); - - return $this->_CMCIC_hmac($string); - } - - /** - * Return SHA key - * - * @return string SHA key - */ - protected function _getSHAKey() - { - return $this->getConfigData('sha_key'); - } - - /** - * Return merchant key - * - * @return string Merchant key - */ - protected function _getKey() - { - return $this->getConfigData('key'); - } - - /** - * Return MAC string for payment authentification - * - * @param string $string - * @return string MAC - */ - protected function _CMCIC_hmac($string) - { - $pass = $this->_getSHAKey(); - $k1 = pack("H*",sha1($this->_getSHAKey())); - $l1 = strlen($k1); - $k2 = pack("H*", $this->_getKey()); - $l2 = strlen($k2); - if ($l1 > $l2) { - $k2 = str_pad($k2, $l1, chr(0x00)); - } elseif ($l2 > $l1) { - $k1 = str_pad($k1, $l2, chr(0x00)); - } - return strtolower($this->_hmacSHA1($k1 ^ $k2, $string)); - } - - /** - * MAC generation algorithm - * - * @param string $key - * @param string $string - * @return string MAC - */ - protected function _hmacSHA1($key, $string) - { - $length = 64; // block length for SHA1 - if (strlen($key) > $length) { - $key = pack("H*",sha1($key)); - } - $key = str_pad($key, $length, chr(0x00)); - $ipad = str_pad('', $length, chr(0x36)); - $opad = str_pad('', $length, chr(0x5c)); - $k_ipad = $key ^ $ipad ; - $k_opad = $key ^ $opad; - - return sha1($k_opad . pack("H*",sha1($k_ipad . $string))); - } - - /** - * Return MAC string on basis of Cybermut response data - * - * @param array $data - * @return string MAC - */ - public function getResponseMAC($data) - { - $string = sprintf('%s%s+%s+%s+%s+%s+%s+%s+', - $data['retourPLUS'], - $data['TPE'], - $data['date'], - $data['montant'], - $data['reference'], - $data['texte-libre'], - $this->getVersion(), - $data['code-retour'] - ); - return strtoupper($this->_CMCIC_hmac($string)); - } - - /** - * Transaction successful or not - * - * @param string $returnCode - * @return boolean - */ - public function isSuccessfulPayment($returnCode) - { - return in_array($returnCode, array(self::RETURN_CODE_ACCEPTED, self::RETURN_CODE_TEST_ACCEPTED)); - } - - /** - * Output success response and stop the script - */ - public function generateSuccessResponse() - { - die($this->getSuccessResponse()); - } - - /** - * Output failure response and stop the script - */ - public function generateErrorResponse() - { - die($this->getErrorResponse()); - } - - /** - * Return response for Cybermut success payment - * - * @return string Success response string - */ - public function getSuccessResponse() - { - $response = array( - 'Pragma: no-cache', - 'Content-type : text/plain', - 'Version: 1', - 'OK' - ); - return implode("\n", $response) . "\n"; - } - - /** - * Return response for Cybermut failure payment - * - * @return string Failure response string - */ - public function getErrorResponse() - { - $response = array( - 'Pragma: no-cache', - 'Content-type : text/plain', - 'Version: 1', - 'Document falsifie' - ); - return implode("\n", $response) . "\n"; - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Cybermut/Model/Source/Bank.php b/app/code/core/Mage/Cybermut/Model/Source/Bank.php deleted file mode 100644 index cc79558244..0000000000 --- a/app/code/core/Mage/Cybermut/Model/Source/Bank.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ - -class Mage_Cybermut_Model_Source_Bank -{ - public function toOptionArray() - { - return array( - array('value' => 'mutuel', 'label' => Mage::helper('cybermut')->__('Credit Mutuel')), - array('value' => 'cic', 'label' => Mage::helper('cybermut')->__('Groupe CIC')), - array('value' => 'obc', 'label' => Mage::helper('cybermut')->__('OBC')), - ); - } -} - - - diff --git a/app/code/core/Mage/Cybermut/Model/Source/Language.php b/app/code/core/Mage/Cybermut/Model/Source/Language.php deleted file mode 100644 index ac4a4d7d9d..0000000000 --- a/app/code/core/Mage/Cybermut/Model/Source/Language.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ - -class Mage_Cybermut_Model_Source_Language -{ - public function toOptionArray() - { - return array( - array('value' => 'EN', 'label' => Mage::helper('cybermut')->__('English')), - array('value' => 'FR', 'label' => Mage::helper('cybermut')->__('French')), - array('value' => 'DE', 'label' => Mage::helper('cybermut')->__('German')), - array('value' => 'IT', 'label' => Mage::helper('cybermut')->__('Italian')), - array('value' => 'ES', 'label' => Mage::helper('cybermut')->__('Spain')), - array('value' => 'NL', 'label' => Mage::helper('cybermut')->__('Dutch')), - ); - } -} - - - diff --git a/app/code/core/Mage/Cybermut/controllers/PaymentController.php b/app/code/core/Mage/Cybermut/controllers/PaymentController.php deleted file mode 100644 index fc8e4402a3..0000000000 --- a/app/code/core/Mage/Cybermut/controllers/PaymentController.php +++ /dev/null @@ -1,203 +0,0 @@ - - */ -class Mage_Cybermut_PaymentController extends Mage_Core_Controller_Front_Action -{ - /** - * Order instance - */ - protected $_order; - - /** - * Get order - * - * @return Mage_Sales_Model_Order - */ - public function getOrder() - { - if ($this->_order == null) { - $session = Mage::getSingleton('checkout/session'); - $this->_order = Mage::getModel('sales/order'); - $this->_order->loadByIncrementId($session->getLastRealOrderId()); - } - return $this->_order; - } - - /** - * When a customer chooses Cybermut on Checkout/Payment page - * - */ - public function redirectAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setCybermutPaymentQuoteId($session->getQuoteId()); - - $order = $this->getOrder(); - - if (!$order->getId()) { - $this->norouteAction(); - return; - } - - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('cybermut')->__('Customer was redirected to Cybermut') - ); - $order->save(); - - $this->getResponse() - ->setBody($this->getLayout() - ->createBlock('cybermut/redirect') - ->setOrder($order) - ->toHtml()); - - $session->unsQuoteId(); - } - - /** - * Cybermut response router - * - */ - public function notifyAction() - { - $model = Mage::getModel('cybermut/payment'); - - if (!$this->getRequest()->isPost()) { - $model->generateErrorResponse(); - } - - $postData = $this->getRequest()->getPost(); - $returnedMAC = $this->getRequest()->getPost('MAC'); - $correctMAC = $model->getResponseMAC($postData); - - $model->debugData(array('result' => $postData)); - - $order = Mage::getModel('sales/order') - ->loadByIncrementId($this->getRequest()->getPost('reference')); - - if (!$order->getId()) { - $model->generateErrorResponse(); - } - - if ($returnedMAC == $correctMAC && $model->isSuccessfulPayment($this->getRequest()->getPost('code-retour'))) { - $order->addStatusToHistory($model->getConfigData('order_status')); - $order->sendNewOrderEmail(); - if ($this->saveInvoice($order)) { -// $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true); - } - $order->save(); - $model->generateSuccessResponse(); - } else { - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('cybermut')->__('Returned MAC is invalid. Order cancelled.') - ); - $order->cancel(); - $order->save(); - $model->generateErrorResponse(); - } - } - - /** - * Save invoice for order - * - * @param Mage_Sales_Model_Order $order - * @return boolean Can save invoice or not - */ - protected function saveInvoice(Mage_Sales_Model_Order $order) - { - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - return true; - } - - return false; - } - - /** - * Success payment page - */ - public function successAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setQuoteId($session->getCybermutPaymentQuoteId()); - $session->unsCybermutPaymentQuoteId(); - - $order = $this->getOrder(); - - if (!$order->getId()) { - $this->norouteAction(); - return; - } - - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('cybermut')->__('The customer successfully returned from Cybermut.') - ); - - $order->save(); - $this->_redirect('checkout/onepage/success'); - } - - /** - * Failure payment page - */ - public function errorAction() - { - $errorMsg = Mage::helper('cybermut')->__(' There was an error occurred during paying process.'); - - $order = $this->getOrder(); - - if (!$order->getId()) { - $this->norouteAction(); - return; - } - if ($order instanceof Mage_Sales_Model_Order && $order->getId()) { - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('cybermut')->__('Customer has returned from Cybermut.') . $errorMsg - ); - $order->cancel(); - $order->save(); - } - - $this->loadLayout(); - $this->renderLayout(); - Mage::getSingleton('checkout/session')->unsLastRealOrderId(); - } -} diff --git a/app/code/core/Mage/Cybermut/etc/config.xml b/app/code/core/Mage/Cybermut/etc/config.xml deleted file mode 100644 index 8dd0d81bdd..0000000000 --- a/app/code/core/Mage/Cybermut/etc/config.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - 0.1.0 - - - - - - Mage_Cybermut_Model - cybermut_mysql4 - - - Mage_Cybermut_Model_Mysql4 - - cybermut_api_debug
-
-
-
- - - - Mage_Cybermut - Mage_Cybermut_Model_Mysql4_Setup - - - - - Mage_Cybermut_Block - -
- - - /cybermut/payment - - - - standard - - Mage_Cybermut - cybermut - - - - - - - - Mage_Cybermut.csv - - - - - - - - cybermut.xml - - - - - - - - - - Mage_Cybermut.csv - - - - - - - - - cybermut/payment - CyberMUT-P@iement - 0 - O - - - -
diff --git a/app/code/core/Mage/Cybermut/etc/system.xml b/app/code/core/Mage/Cybermut/etc/system.xml deleted file mode 100644 index 38746f9494..0000000000 --- a/app/code/core/Mage/Cybermut/etc/system.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - text - 300 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>2</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - text - 3 - 1 - 1 - 0 - - - - text - 4 - 1 - 1 - 0 - - - - text - 5 - 1 - 1 - 0 - - - - text - 6 - 1 - 1 - 0 - - - - select - cybermut/source_bank - 7 - 1 - 1 - 0 - - - - Order number will be used if left empty. - text - 8 - 1 - 1 - 0 - - - - select - cybermut/source_language - 9 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 10 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 11 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status - 12 - 1 - 1 - 0 - - - - allowspecific - 13 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 14 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 15 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Cybermut/sql/cybermut_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Cybermut/sql/cybermut_setup/mysql4-install-0.1.0.php deleted file mode 100644 index 1aad9275d2..0000000000 --- a/app/code/core/Mage/Cybermut/sql/cybermut_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,45 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$this->getTable('cybermut_api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Cybersource/Block/Form.php b/app/code/core/Mage/Cybersource/Block/Form.php deleted file mode 100644 index e847e7fa9e..0000000000 --- a/app/code/core/Mage/Cybersource/Block/Form.php +++ /dev/null @@ -1,96 +0,0 @@ -setTemplate('cybersource/form.phtml'); - } - - protected function _getConfig() - { - return Mage::getSingleton('cybersource/config'); - } - - /** - * Retrieve availables credit card types - * - * @return array - */ - public function getCcAvailableTypes() - { - $types = $this->_getConfig()->getCcTypes(); - if ($method = $this->getMethod()) { - $availableTypes = $method->getConfigData('cctypes'); - if ($availableTypes) { - $availableTypes = explode(',', $availableTypes); - foreach ($types as $code=>$name) { - if (!in_array($code, $availableTypes)) { - unset($types[$code]); - } - } - } - } - return $types; - } - - - /* - * solo/switch card start year - * @return array - */ - public function getSsStartYears() - { - $years = array(); - $first = date("Y"); - - for ($index=5; $index>=0; $index--) { - $year = $first - $index; - $years[$year] = $year; - } - $years = array(0=>$this->__('Year'))+$years; - return $years; - } - - /* - * switch/solo card type available - */ - public function hasSsCardType() - { - $availableTypes =$this->getMethod()->getConfigData('cctypes'); - if ($availableTypes) { - $availableTypes = explode(',', $availableTypes); - if (in_array('SS', $availableTypes)) { - return true; - } - } - return false; - } - -} diff --git a/app/code/core/Mage/Cybersource/Block/Info.php b/app/code/core/Mage/Cybersource/Block/Info.php deleted file mode 100644 index 8f8053c802..0000000000 --- a/app/code/core/Mage/Cybersource/Block/Info.php +++ /dev/null @@ -1,75 +0,0 @@ -setTemplate('cybersource/info.phtml'); - } - - protected function _getConfig() - { - return Mage::getSingleton('cybersource/config'); - } - - - /** - * Retrieve credit card type name - * - * @return string - */ - public function getCcTypeName() - { - $types = $this->_getConfig()->getCcTypes(); - if (isset($types[$this->getInfo()->getCcType()])) { - return $types[$this->getInfo()->getCcType()]; - } - return $this->getInfo()->getCcType(); - } - - /** - * Retrieve CC start month for switch/solo card - * - * @return string - */ - public function getCcStartMonth() - { - $month = $this->getInfo()->getCcSsStartMonth(); - if ($month<10) { - $month = '0'.$month; - } - return $month; - } - - public function toPdf() - { - $this->setTemplate('cybersource/pdf/info.phtml'); - return $this->toHtml(); - } -} diff --git a/app/code/core/Mage/Cybersource/Helper/Data.php b/app/code/core/Mage/Cybersource/Helper/Data.php deleted file mode 100644 index d9abf1addb..0000000000 --- a/app/code/core/Mage/Cybersource/Helper/Data.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -class Mage_Cybersource_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('cybersource/api_debug'); - } -} diff --git a/app/code/core/Mage/Cybersource/Model/Api/ExtendedSoapClient.php b/app/code/core/Mage/Cybersource/Model/Api/ExtendedSoapClient.php deleted file mode 100644 index faadfe8828..0000000000 --- a/app/code/core/Mage/Cybersource/Model/Api/ExtendedSoapClient.php +++ /dev/null @@ -1,117 +0,0 @@ -_storeId = $storeId; - return $this; - } - - /** - * Store Id getter - * - * @return int - */ - public function getStoreId() - { - return $this->_storeId; - } - - /** - * XPaths that should be replaced in debug with '***' - * - * @var array - */ - protected $_debugReplacePrivateDataXPaths = array( - '//*[contains(name(),\'merchantID\')]/text()', - '//*[contains(name(),\'card\')]/*/text()', - '//*[contains(name(),\'UsernameToken\')]/*/text()' - ); - - public function __construct($wsdl, $options = array()) - { - parent::__construct($wsdl, $options); - } - - protected function getBaseApi() - { - return Mage::getSingleton('cybersource/soap'); - } - - public function __doRequest($request, $location, $action, $version) - { - $api = $this->getBaseApi(); - $user = $api->getConfigData('merchant_id', $this->getStoreId()); - $password = $api->getConfigData('security_key', $this->getStoreId()); - $soapHeader = "$user$password"; - - $requestDOM = new DOMDocument('1.0'); - $soapHeaderDOM = new DOMDocument('1.0'); - $requestDOM->loadXML($request); - $soapHeaderDOM->loadXML($soapHeader); - - $node = $requestDOM->importNode($soapHeaderDOM->firstChild, true); - $requestDOM->firstChild->insertBefore( - $node, $requestDOM->firstChild->firstChild); - - $request = $requestDOM->saveXML(); - $requestDOMXPath = new DOMXPath($requestDOM); - foreach ($this->_debugReplacePrivateDataXPaths as $xPath) { - foreach ($requestDOMXPath->query($xPath) as $element) { - $element->data = '***'; - } - } - - $debugData = array('request' => $requestDOM->saveXML()); - try { - $response = parent::__doRequest($request, $location, $action, $version); - } - catch (Exception $e) { - $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode()); - $api->debugData($debugData); - throw $e; - } - - $debugData['result'] = $response; - $api->debugData($debugData); - - return $response; - } -} diff --git a/app/code/core/Mage/Cybersource/Model/Config.php b/app/code/core/Mage/Cybersource/Model/Config.php deleted file mode 100644 index 261c37ac74..0000000000 --- a/app/code/core/Mage/Cybersource/Model/Config.php +++ /dev/null @@ -1,62 +0,0 @@ -_ccTypes = array(); - $added = false; - foreach ($pTypes as $code => $name) { - if ($code=='OT') { - $added = true; - $this->addExtraCcTypes(); - } - $this->_ccTypes[$code] = $name; - } - if (!$added) { - $this->addExtraCcTypes(); - } - return $this->_ccTypes; - } - - public function addExtraCcTypes() - { - $this->_ccTypes['JCB'] = Mage::helper('cybersource')->__('JCB'); - $this->_ccTypes['LASER'] = Mage::helper('cybersource')->__('Laser'); - $this->_ccTypes['UATP'] = Mage::helper('cybersource')->__('UATP'); - $this->_ccTypes['MCI'] = Mage::helper('cybersource')->__('Maestro (International)'); - $this->_ccTypes[Mage_Cybersource_Model_Soap::CC_CARDTYPE_SS] = Mage::helper('cybersource')->__('Maestro/Solo(UK Domestic)'); - - } - -} diff --git a/app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug.php deleted file mode 100644 index 0dbff5b8f8..0000000000 --- a/app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class Mage_Cybersource_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('cybersource/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index 413078a908..0000000000 --- a/app/code/core/Mage/Cybersource/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class Mage_Cybersource_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('cybersource/api_debug'); - } -} diff --git a/app/code/core/Mage/Cybersource/Model/Mysql4/Setup.php b/app/code/core/Mage/Cybersource/Model/Mysql4/Setup.php deleted file mode 100644 index ce538d8be2..0000000000 --- a/app/code/core/Mage/Cybersource/Model/Mysql4/Setup.php +++ /dev/null @@ -1,38 +0,0 @@ -getInfoInstance(); - - if ($data->getCcType()==self::CC_CARDTYPE_SS) { - $info->setCcSsIssue($data->getCcSsIssue()) - ->setCcSsStartMonth($data->getCcSsStartMonth()) - ->setCcSsStartYear($data->getCcSsStartYear()) - ; - } - return $this; - } - - /** - * Validate payment method information object - * - * @param Mage_Payment_Model_Info $info - * @return Mage_Payment_Model_Abstract - */ - public function validate() - { - if (!extension_loaded('soap')) { - Mage::throwException(Mage::helper('cybersource')->__('SOAP extension is not enabled. Please contact us.')); - } - /** - * to validate paymene method is allowed for billing country or not - */ - $paymentInfo = $this->getInfoInstance(); - if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { - $billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId(); - } else { - $billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId(); - } - if (!$this->canUseForCountry($billingCountry)) { - Mage::throwException($this->_getHelper()->__('Selected payment type is not allowed for billing country.')); - } - - $info = $this->getInfoInstance(); - $errorMsg = false; - $availableTypes = explode(',',$this->getConfigData('cctypes')); - - $ccNumber = $info->getCcNumber(); - - // remove credit card number delimiters such as "-" and space - $ccNumber = preg_replace('/[\-\s]+/', '', $ccNumber); - $info->setCcNumber($ccNumber); - - $ccType = ''; - - if (!$this->_validateExpDate($info->getCcExpYear(), $info->getCcExpMonth())) { - $errorCode = 'ccsave_expiration,ccsave_expiration_yr'; - $errorMsg = $this->_getHelper()->__('Incorrect credit card expiration date.'); - } - - if (in_array($info->getCcType(), $availableTypes)){ - if ($this->validateCcNum($ccNumber) - // Other credit card type number validation - || ($this->OtherCcType($info->getCcType()) && $this->validateCcNumOther($ccNumber))) { - - $ccType = 'OT'; - $ccTypeRegExpList = array( - 'VI' => '/^4[0-9]{12}([0-9]{3})?$/', // Visa - 'MC' => '/^5[1-5][0-9]{14}$/', // Master Card - 'AE' => '/^3[47][0-9]{13}$/', // American Express - 'DI' => '/^6011[0-9]{12}$/', // Discovery - 'JCB' => '/^(3[0-9]{15}|(2131|1800)[0-9]{12})$/', // JCB - 'LASER' => '/^(6304|6706|6771|6709)[0-9]{12}([0-9]{3})?$/' // LASER - ); - - foreach ($ccTypeRegExpList as $ccTypeMatch=>$ccTypeRegExp) { - if (preg_match($ccTypeRegExp, $ccNumber)) { - $ccType = $ccTypeMatch; - break; - } - } - - if (!$this->OtherCcType($info->getCcType()) && $ccType!=$info->getCcType()) { - $errorCode = 'ccsave_cc_type,ccsave_cc_number'; - $errorMsg = $this->_getHelper()->__('Credit card number mismatch with credit card type.'); - } - } - else { - $errorCode = 'ccsave_cc_number'; - $errorMsg = $this->_getHelper()->__('Invalid Credit Card Number'); - } - - } - else { - $errorCode = 'ccsave_cc_type'; - $errorMsg = $this->_getHelper()->__('Credit card type is not allowed for this payment method.'); - } - - //validate credit card verification number - if ($errorMsg === false && $this->hasVerification()) { - $verifcationRegEx = $this->getVerificationRegEx(); - $regExp = isset($verifcationRegEx[$info->getCcType()]) ? $verifcationRegEx[$info->getCcType()] : ''; - if (!$info->getCcCid() || !$regExp || !preg_match($regExp ,$info->getCcCid())){ - $errorMsg = $this->_getHelper()->__('Please enter a valid credit card verification number.'); - } - } - - if($errorMsg){ - Mage::throwException($errorMsg); - } - return $this; - } - - /** - * Getting Soap Api object - * - * @param array $options - * @return Mage_Cybersource_Model_Api_ExtendedSoapClient - */ - protected function getSoapApi($options = array()) - { - $wsdl = $this->getConfigData('test') ? self::WSDL_URL_TEST : self::WSDL_URL_LIVE; - $_api = new Mage_Cybersource_Model_Api_ExtendedSoapClient($wsdl, $options); - $_api->setStoreId($this->getStore()); - return $_api; - } - - /** - * Initializing soap header - */ - protected function iniRequest() - { - $this->_request = new stdClass(); - $this->_request->merchantID = $this->getConfigData('merchant_id'); - $this->_request->merchantReferenceCode = $this->_generateReferenceCode(); - - $this->_request->clientLibrary = "PHP"; - $this->_request->clientLibraryVersion = phpversion(); - $this->_request->clientEnvironment = php_uname(); - } - - /** - * Random generator for merchant referenc code - * - * @return random number - */ - protected function _generateReferenceCode() - { - return Mage::helper('core')->uniqHash(); - } - - /** - * Getting customer IP address - * - * @return IP address string - */ - protected function getIpAddress() - { - return Mage::helper('core/http')->getRemoteAddr(); - } - - /** - * Assigning billing address to soap - * - * @param Varien_Object $billing - * @param String $email - */ - protected function addBillingAddress($billing, $email) - { - if (!$email) { - $email = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getEmail(); - } - $billTo = new stdClass(); - $billTo->firstName = $billing->getFirstname(); - $billTo->lastName = $billing->getLastname(); - $billTo->company = $billing->getCompany(); - $billTo->street1 = $billing->getStreet(1); - $billTo->street2 = $billing->getStreet(2); - $billTo->city = $billing->getCity(); - $billTo->state = $billing->getRegion(); - $billTo->postalCode = $billing->getPostcode(); - $billTo->country = $billing->getCountry(); - $billTo->phoneNumber = $billing->getTelephone(); - $billTo->email = ($email ? $email : Mage::getStoreConfig('trans_email/ident_general/email')); - $billTo->ipAddress = $this->getIpAddress(); - $this->_request->billTo = $billTo; - } - - /** - * Assigning shipping address to soap object - * - * @param Varien_Object $shipping - */ - protected function addShippingAddress($shipping) - { - //checking if we have shipping address, in case of virtual order we will not have it - if ($shipping) { - $shipTo = new stdClass(); - $shipTo->firstName = $shipping->getFirstname(); - $shipTo->lastName = $shipping->getLastname(); - $shipTo->company = $shipping->getCompany(); - $shipTo->street1 = $shipping->getStreet(1); - $shipTo->street2 = $shipping->getStreet(2); - $shipTo->city = $shipping->getCity(); - $shipTo->state = $shipping->getRegion(); - $shipTo->postalCode = $shipping->getPostcode(); - $shipTo->country = $shipping->getCountry(); - $shipTo->phoneNumber = $shipping->getTelephone(); - $this->_request->shipTo = $shipTo; - } - } - - /** - * Assigning credit card information - * - * @param Mage_Model_Order_Payment $payment - */ - protected function addCcInfo($payment) - { - $card = new stdClass(); - $card->fullName = $payment->getCcOwner(); - $card->accountNumber = $payment->getCcNumber(); - $card->expirationMonth = $payment->getCcExpMonth(); - $card->expirationYear = $payment->getCcExpYear(); - if ($payment->hasCcCid()) { - $card->cvNumber = $payment->getCcCid(); - } - if ($payment->getCcType()==self::CC_CARDTYPE_SS && $payment->hasCcSsIssue()) { - $card->issueNumber = $payment->getCcSsIssue(); - } - if ($payment->getCcType()==self::CC_CARDTYPE_SS && $payment->hasCcSsStartYear()) { - $card->startMonth = $payment->getCcSsStartMonth(); - $card->startYear = $payment->getCcSsStartYear(); - } - $this->_request->card = $card; - } - - /** - * Authorizing payment - * - * @param Varien_Object $payment - * @param float $amount - * @return Mage_Cybersource_Model_Soap - */ - public function authorize(Varien_Object $payment, $amount) - { - $error = false; - - $soapClient = $this->getSoapApi(); - - $this->iniRequest(); - - $ccAuthService = new stdClass(); - $ccAuthService->run = "true"; - $this->_request->ccAuthService = $ccAuthService; - $this->addBillingAddress($payment->getOrder()->getBillingAddress(), $payment->getOrder()->getCustomerEmail()); - $this->addShippingAddress($payment->getOrder()->getShippingAddress()); - $this->addCcInfo($payment); - - $purchaseTotals = new stdClass(); - $purchaseTotals->currency = $payment->getOrder()->getBaseCurrencyCode(); - $purchaseTotals->grandTotalAmount = $amount; - $this->_request->purchaseTotals = $purchaseTotals; - - try { - $result = $soapClient->runTransaction($this->_request); - if ($result->reasonCode==self::RESPONSE_CODE_SUCCESS) { - $payment->setLastTransId($result->requestID) - ->setCcTransId($result->requestID) - ->setTransactionId($result->requestID) - ->setIsTransactionClosed(0) - ->setCybersourceToken($result->requestToken) - ->setCcAvsStatus($result->ccAuthReply->avsCode); - /* - * checking if we have cvCode in response bc - * if we don't send cvn we don't get cvCode in response - */ - if (isset($result->ccAuthReply->cvCode)) { - $payment->setCcCidStatus($result->ccAuthReply->cvCode); - } - } else { - $error = Mage::helper('cybersource')->__('There is an error in processing the payment. Please try again or contact us.'); - } - } catch (Exception $e) { - Mage::throwException( - Mage::helper('cybersource')->__('Gateway request error: %s', $e->getMessage()) - ); - } - - if ($error !== false) { - Mage::throwException($error); - } - return $this; - } - - /** - * Capturing payment - * - * @param Varien_Object $payment - * @param float $amount - * @return Mage_Cybersource_Model_Soap - */ - public function capture(Varien_Object $payment, $amount) - { - $error = false; - $soapClient = $this->getSoapApi(); - $this->iniRequest(); - - if ($payment->getParentTransactionId() && $payment->getCybersourceToken()) { - $ccCaptureService = new stdClass(); - $ccCaptureService->run = "true"; - $ccCaptureService->authRequestToken = $payment->getCybersourceToken(); - $ccCaptureService->authRequestID = $payment->getParentTransactionId(); - $this->_request->ccCaptureService = $ccCaptureService; - - $item0 = new stdClass(); - $item0->unitPrice = $amount; - $item0->id = 0; - $this->_request->item = array($item0); - } else { - $ccAuthService = new stdClass(); - $ccAuthService->run = "true"; - $this->_request->ccAuthService = $ccAuthService; - - $ccCaptureService = new stdClass(); - $ccCaptureService->run = "true"; - $this->_request->ccCaptureService = $ccCaptureService; - - $this->addBillingAddress($payment->getOrder()->getBillingAddress(), $payment->getOrder()->getCustomerEmail()); - $this->addShippingAddress($payment->getOrder()->getShippingAddress()); - $this->addCcInfo($payment); - - $purchaseTotals = new stdClass(); - $purchaseTotals->currency = $payment->getOrder()->getBaseCurrencyCode(); - $purchaseTotals->grandTotalAmount = $amount; - $this->_request->purchaseTotals = $purchaseTotals; - } - try { - $result = $soapClient->runTransaction($this->_request); - if ($result->reasonCode==self::RESPONSE_CODE_SUCCESS) { - /* - for multiple capture we need to use the latest capture transaction id - */ - $payment->setLastTransId($result->requestID) - ->setLastCybersourceToken($result->requestToken) - ->setCcTransId($result->requestID) - ->setTransactionId($result->requestID) - ->setCybersourceToken($result->requestToken) - ; - } else { - $error = Mage::helper('cybersource')->__('There is an error in processing the payment. Please try again or contact us.'); - } - } catch (Exception $e) { - Mage::throwException( - Mage::helper('cybersource')->__('Gateway request error: %s', $e->getMessage()) - ); - } - if ($error !== false) { - Mage::throwException($error); - } - return $this; - } - - /** - * To assign transaction id and token after capturing payment - * - * @param Mage_Sale_Model_Order_Invoice $invoice - * @param Mage_Sale_Model_Order_Payment $payment - * @return Mage_Cybersource_Model_Soap - */ - public function processInvoice($invoice, $payment) - { - parent::processInvoice($invoice, $payment); - $invoice->setTransactionId($payment->getLastTransId()); - $invoice->setCybersourceToken($payment->getLastCybersourceToken()); - return $this; - } - - /** - * To assign transaction id and token before voiding the transaction - * - * @param Mage_Sale_Model_Order_Invoice $invoice - * @param Mage_Sale_Order_Payment $payment - * @return Mage_Cybersource_Model_Soap - */ - public function processBeforeVoid($invoice, $payment) - { - parent::processBeforeVoid($invoice, $payment); - $payment->setVoidTransactionId($invoice->getTransactionId()); - $payment->setVoidCybersourceToken($invoice->getCybersourceToken()); - return $this; - } - - /** - * Void the payment transaction - * - * @param Mage_Sale_Model_Order_Payment $payment - * @return Mage_Cybersource_Model_Soap - */ - public function void(Varien_Object $payment) - { - $error = false; - if ($payment->getParentTransactionId() && $payment->getVoidCybersourceToken()) { - $soapClient = $this->getSoapApi(); - $this->iniRequest(); - $voidService = new stdClass(); - $voidService->run = "true"; - $voidService->voidRequestToken = $payment->getVoidCybersourceToken(); - $voidService->voidRequestID = $payment->getParentTransactionId(); - $this->_request->voidService = $voidService; - try { - $result = $soapClient->runTransaction($this->_request); - if ($result->reasonCode==self::RESPONSE_CODE_SUCCESS) { - $payment->setTransactionId($result->requestID) - ->setCybersourceToken($result->requestToken) - ->setIsTransactionClosed(1); - } else { - $error = Mage::helper('cybersource')->__('There is an error in processing the payment. Please try again or contact us.'); - } - } catch (Exception $e) { - Mage::throwException( - Mage::helper('cybersource')->__('Gateway request error: %s', $e->getMessage()) - ); - } - }else{ - $error = Mage::helper('cybersource')->__('Invalid transaction id or token'); - } - if ($error !== false) { - Mage::throwException($error); - } - return $this; - } - - /** - * To assign correct transaction id and token before refund - * - * @param Mage_Sale_Model_Order_Invoice $invoice - * @param Mage_Sale_Model_Order_Payment $payment - * @return Mage_Cybersource_Model_Soap - */ - public function processBeforeRefund($invoice, $payment) - { - parent::processBeforeRefund($invoice, $payment); - $payment->setRefundTransactionId($invoice->getTransactionId()); - $payment->setRefundCybersourceToken($invoice->getCybersourceToken()); - return $this; - } - - /** - * Refund the payment transaction - * - * @param Mage_Sale_Model_Order_Payment $payment - * @param flaot $amount - * @return Mage_Cybersource_Model_Soap - */ - public function refund(Varien_Object $payment, $amount) - { - $error = false; - if ($payment->getParentTransactionId() && $payment->getRefundCybersourceToken() && $amount>0) { - $soapClient = $this->getSoapApi(); - $this->iniRequest(); - $ccCreditService = new stdClass(); - $ccCreditService->run = "true"; - $ccCreditService->captureRequestToken = $payment->getCybersourceToken(); - $ccCreditService->captureRequestID = $payment->getParentTransactionId(); - $this->_request->ccCreditService = $ccCreditService; - - $purchaseTotals = new stdClass(); - $purchaseTotals->grandTotalAmount = $amount; - $this->_request->purchaseTotals = $purchaseTotals; - - try { - $result = $soapClient->runTransaction($this->_request); - if ($result->reasonCode==self::RESPONSE_CODE_SUCCESS) { - $payment->setTransactionId($result->requestID) - ->setIsTransactionClosed(1) - ->setLastCybersourceToken($result->requestToken) - ; - } else { - $error = Mage::helper('cybersource')->__('There is an error in processing the payment. Please try again or contact us.'); - } - } catch (Exception $e) { - Mage::throwException( - Mage::helper('cybersource')->__('Gateway request error: %s', $e->getMessage()) - ); - } - } else { - $error = Mage::helper('cybersource')->__('Error in refunding the payment.'); - } - if ($error !== false) { - Mage::throwException($error); - } - return $this; - } - - - /** - * To assign correct transaction id and token after refund - * - * @param Mage_Sale_Model_Order_Creditmemo $creditmemo - * @param Mage_Sale_Model_Order_Payment $payment - * @return Mage_Cybersource_Model_Soap - */ - public function processCreditmemo($creditmemo, $payment) - { - parent::processCreditmemo($creditmemo, $payment); - $creditmemo->setTransactionId($payment->getLastTransId()); - $creditmemo->setCybersourceToken($payment->getLastCybersourceToken()); - return $this; - } -} diff --git a/app/code/core/Mage/Cybersource/Model/Source/Cctype.php b/app/code/core/Mage/Cybersource/Model/Source/Cctype.php deleted file mode 100644 index 99c87e053d..0000000000 --- a/app/code/core/Mage/Cybersource/Model/Source/Cctype.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -class Mage_Cybersource_Model_Source_PaymentAction -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE, 'label' => Mage::helper('cybersource')->__('Authorization')), - array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE, 'label' => Mage::helper('cybersource')->__('Sale')), - ); - } -} diff --git a/app/code/core/Mage/Cybersource/etc/config.xml b/app/code/core/Mage/Cybersource/etc/config.xml deleted file mode 100644 index 7380872e5b..0000000000 --- a/app/code/core/Mage/Cybersource/etc/config.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - 0.7.0 - - - - - - Mage_Cybersource_Model - cybersource_mysql4 - - - Mage_Cybersource_Model_Mysql4 - - cybersource_api_debug
-
-
-
- - - - Mage_Cybersource - Mage_Cybersource_Model_Mysql4_Setup - - - - - Mage_Cybersource_Block - - - - - - LASER - Laser - 51 - - - UATP - UATP - 52 - - - - -
- - - /cybersource/soap - - - - standard - - Mage_Cybersource - cybersource - - - - - - - - Mage_Cybersource.csv - - - - - - - - - - - Mage_Cybersource.csv - - - - - - - - - - authorize - Credit Card (Cybersource) - processing - AE,VI,MC,DI - cybersource/soap - - - - - -
diff --git a/app/code/core/Mage/Cybersource/etc/system.xml b/app/code/core/Mage/Cybersource/etc/system.xml deleted file mode 100644 index e8a50cf66c..0000000000 --- a/app/code/core/Mage/Cybersource/etc/system.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - text - 500 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>2</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - adminhtml/system_config_backend_encrypted - obscure - 3 - 1 - 1 - 0 - - - - adminhtml/system_config_backend_encrypted - obscure - 4 - 1 - 1 - 0 - - - - select - cybersource/source_paymentAction - 5 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 6 - 1 - 1 - 0 - - - - multiselect - cybersource/source_cctype - 15 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 16 - 1 - 1 - 0 - - - - allowspecific - 50 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 51 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 55 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 56 - 1 - 1 - 0 - - - - text - 100 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Cybersource/sql/cybersource_setup/mysql4-install-0.7.0.php b/app/code/core/Mage/Cybersource/sql/cybersource_setup/mysql4-install-0.7.0.php deleted file mode 100644 index fe4661bf67..0000000000 --- a/app/code/core/Mage/Cybersource/sql/cybersource_setup/mysql4-install-0.7.0.php +++ /dev/null @@ -1,54 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$this->getTable('cybersource_api_debug')}`; -CREATE TABLE `{$this->getTable('cybersource_api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `action` varchar(255), - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); - -$installer->addAttribute('quote_payment', 'cybersource_token', array()); -$installer->addAttribute('order_payment', 'cybersource_token', array()); -$installer->addAttribute('invoice', 'cybersource_token', array()); -$installer->addAttribute('creditmemo', 'cybersource_token', array()); - diff --git a/app/code/core/Mage/Eway/Block/Form.php b/app/code/core/Mage/Eway/Block/Form.php deleted file mode 100644 index ea9e7678a9..0000000000 --- a/app/code/core/Mage/Eway/Block/Form.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Eway_Block_Form extends Mage_Payment_Block_Form_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('eway/form.phtml'); - } - -} diff --git a/app/code/core/Mage/Eway/Block/Info.php b/app/code/core/Mage/Eway/Block/Info.php deleted file mode 100644 index 2f86c53e0a..0000000000 --- a/app/code/core/Mage/Eway/Block/Info.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class Mage_Eway_Block_Info extends Mage_Payment_Block_Info_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('eway/info.phtml'); - } - - public function toPdf() - { - $this->setTemplate('eway/pdf/info.phtml'); - return $this->toHtml(); - } - -} diff --git a/app/code/core/Mage/Eway/Block/Secure/Failure.php b/app/code/core/Mage/Eway/Block/Secure/Failure.php deleted file mode 100644 index 6da24e9f25..0000000000 --- a/app/code/core/Mage/Eway/Block/Secure/Failure.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ - -class Mage_Eway_Block_Secure_Failure extends Mage_Core_Block_Template -{ - /** - * Return Error message - * - * @return string - */ - public function getErrorMessage () - { - return Mage::getSingleton('checkout/session')->getEwayErrorMessage(); - } - - /** - * Get continue shopping url - */ - public function getContinueShoppingUrl() - { - return Mage::getUrl('checkout/cart'); - } -} diff --git a/app/code/core/Mage/Eway/Block/Secure/Form.php b/app/code/core/Mage/Eway/Block/Secure/Form.php deleted file mode 100644 index e4e1833701..0000000000 --- a/app/code/core/Mage/Eway/Block/Secure/Form.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Eway_Block_Secure_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('eway/secure/form.phtml'); - parent::_construct(); - } -} diff --git a/app/code/core/Mage/Eway/Block/Secure/Redirect.php b/app/code/core/Mage/Eway/Block/Secure/Redirect.php deleted file mode 100644 index 851fbbc352..0000000000 --- a/app/code/core/Mage/Eway/Block/Secure/Redirect.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -class Mage_Eway_Block_Secure_Redirect extends Mage_Core_Block_Abstract -{ - protected function _toHtml() - { - $secure = $this->getOrder()->getPayment()->getMethodInstance(); - - $form = new Varien_Data_Form(); - $form->setAction($secure->getEwaySecureUrl()) - ->setId('eway_secure_checkout') - ->setName('eway_secure_checkout') - ->setMethod('POST') - ->setUseContainer(true); - foreach ($secure->getFormFields() as $field=>$value) { - $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value)); - } - $html = ''; - $html.= $this->__('You will be redirected to eWAY 3D-Secure in a few seconds.'); - $html.= $form->toHtml(); - $html.= ''; - $html.= ''; - - return $html; - } -} diff --git a/app/code/core/Mage/Eway/Block/Shared/Failure.php b/app/code/core/Mage/Eway/Block/Shared/Failure.php deleted file mode 100644 index 75f1792038..0000000000 --- a/app/code/core/Mage/Eway/Block/Shared/Failure.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ - -class Mage_Eway_Block_Shared_Failure extends Mage_Core_Block_Template -{ - /** - * Return Error message - * - * @return string - */ - public function getErrorMessage () - { - $msg = Mage::getSingleton('checkout/session')->getEwayErrorMessage(); - Mage::getSingleton('checkout/session')->unsEwayErrorMessage(); - return $msg; - } - - /** - * Get continue shopping url - */ - public function getContinueShoppingUrl() - { - return Mage::getUrl('checkout/cart'); - } -} diff --git a/app/code/core/Mage/Eway/Block/Shared/Form.php b/app/code/core/Mage/Eway/Block/Shared/Form.php deleted file mode 100644 index 8ff3648fa7..0000000000 --- a/app/code/core/Mage/Eway/Block/Shared/Form.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Eway_Block_Shared_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('eway/shared/form.phtml'); - parent::_construct(); - } -} diff --git a/app/code/core/Mage/Eway/Block/Shared/Redirect.php b/app/code/core/Mage/Eway/Block/Shared/Redirect.php deleted file mode 100644 index 8913304739..0000000000 --- a/app/code/core/Mage/Eway/Block/Shared/Redirect.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ -class Mage_Eway_Block_Shared_Redirect extends Mage_Core_Block_Abstract -{ - protected function _toHtml() - { - $shared = $this->getOrder()->getPayment()->getMethodInstance(); - - $form = new Varien_Data_Form(); - $form->setAction($shared->getEwaySharedUrl()) - ->setId('eway_shared_checkout') - ->setName('eway_shared_checkout') - ->setMethod('POST') - ->setUseContainer(true); - foreach ($shared->getFormFields() as $field=>$value) { - $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value)); - } - - $html = ''; - $html.= $this->__('You will be redirected to eWAY in a few seconds.'); - $html.= $form->toHtml(); - $html.= ''; - $html.= ''; - - return $html; - } -} diff --git a/app/code/core/Mage/Eway/Controller/Abstract.php b/app/code/core/Mage/Eway/Controller/Abstract.php deleted file mode 100644 index 111f7fb942..0000000000 --- a/app/code/core/Mage/Eway/Controller/Abstract.php +++ /dev/null @@ -1,178 +0,0 @@ - - */ -abstract class Mage_Eway_Controller_Abstract extends Mage_Core_Controller_Front_Action -{ - protected function _expireAjax() - { - if (!$this->getCheckout()->getQuote()->hasItems()) { - $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired'); - exit; - } - } - - /** - * Redirect Block - * need to be redeclared - */ - protected $_redirectBlockType; - - /** - * Get singleton of Checkout Session Model - * - * @return Mage_Checkout_Model_Session - */ - public function getCheckout() - { - return Mage::getSingleton('checkout/session'); - } - - /** - * when customer select eWay payment method - */ - public function redirectAction() - { - $session = $this->getCheckout(); - $session->setEwayQuoteId($session->getQuoteId()); - $session->setEwayRealOrderId($session->getLastRealOrderId()); - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($session->getLastRealOrderId()); - $order->addStatusToHistory($order->getStatus(), Mage::helper('eway')->__('Customer was redirected to eWAY.')); - $order->save(); - - $this->getResponse()->setBody( - $this->getLayout() - ->createBlock($this->_redirectBlockType) - ->setOrder($order) - ->toHtml() - ); - - $session->unsQuoteId(); - } - - /** - * eWay returns POST variables to this action - */ - public function successAction() - { - $status = $this->_checkReturnedPost(); - - $session = $this->getCheckout(); - - $session->unsEwayRealOrderId(); - $session->setQuoteId($session->getEwayQuoteId(true)); - $session->getQuote()->setIsActive(false)->save(); - - $order = Mage::getModel('sales/order'); - $order->load($this->getCheckout()->getLastOrderId()); - if($order->getId()) { - $order->sendNewOrderEmail(); - } - - if ($status) { - $this->_redirect('checkout/onepage/success'); - } else { - $this->_redirect('*/*/failure'); - } - } - - /** - * Display failure page if error - * - */ - public function failureAction() - { - if (!$this->getCheckout()->getEwayErrorMessage()) { - $this->norouteAction(); - return; - } - - $this->getCheckout()->clear(); - - $this->loadLayout(); - $this->renderLayout(); - } - - /** - * Checking POST variables. - * Creating invoice if payment was successfull or cancel order if payment was declined - */ - protected function _checkReturnedPost() - { - if (!$this->getRequest()->isPost()) { - $this->norouteAction(); - return; - } - $status = true; - $response = $this->getRequest()->getPost(); - - if ($this->getCheckout()->getEwayRealOrderId() != $response['ewayTrxnNumber'] || - $this->getCheckout()->getEwayRealOrderId() != Mage::helper('core')->decrypt($response['eWAYoption2'])) { - $this->norouteAction(); - return; - } - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($response['ewayTrxnNumber']); - - $paymentInst = $order->getPayment()->getMethodInstance(); - $paymentInst->setResponse($response); - - if ($paymentInst->parseResponse()) { - - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - - $paymentInst->setTransactionId($response['ewayTrxnReference']); - $order->addStatusToHistory($order->getStatus(), Mage::helper('eway')->__('The customer has successfully returned from eWAY.')); - } - } else { - $paymentInst->setTransactionId($response['ewayTrxnReference']); - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), Mage::helper('eway')->__('The customer was rejected by eWAY.')); - $status = false; - $this->getCheckout()->setEwayErrorMessage($response['eWAYresponseText']); - } - - $order->save(); - - return $status; - } - -} diff --git a/app/code/core/Mage/Eway/Helper/Data.php b/app/code/core/Mage/Eway/Helper/Data.php deleted file mode 100644 index f1fbbab595..0000000000 --- a/app/code/core/Mage/Eway/Helper/Data.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class Mage_Eway_Helper_Data extends Mage_Core_Helper_Abstract -{ - -} diff --git a/app/code/core/Mage/Eway/Model/Api/Debug.php b/app/code/core/Mage/Eway/Model/Api/Debug.php deleted file mode 100644 index 2300772fc3..0000000000 --- a/app/code/core/Mage/Eway/Model/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Eway_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('eway/api_debug'); - } -} diff --git a/app/code/core/Mage/Eway/Model/Direct.php b/app/code/core/Mage/Eway/Model/Direct.php deleted file mode 100644 index 764827b92c..0000000000 --- a/app/code/core/Mage/Eway/Model/Direct.php +++ /dev/null @@ -1,309 +0,0 @@ - - */ -class Mage_Eway_Model_Direct extends Mage_Payment_Model_Method_Cc -{ - protected $_code = 'eway_direct'; - - protected $_isGateway = true; - protected $_canAuthorize = false; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = true; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = true; - protected $_canSaveCc = true; - - protected $_formBlockType = 'eway/form'; - protected $_infoBlockType = 'eway/info'; - - /** - * @deprecated after 1.4.1.0 - * - * @return string - */ - public function getDebug() - { - return $this->getDebugFlag(); - } - - /** - * Get flag to use CCV or not - * - * @return string - */ - public function getUseccv() - { - return Mage::getStoreConfig('payment/eway_direct/useccv'); - } - - /** - * Get api url of eWAY Direct payment - * - * @return string - */ - public function getApiGatewayUrl() - { - $value = Mage::getStoreConfig('payment/eway_direct/api_url'); - if (!$value || $value === false) { - return 'https://www.eway.com.au/gateway/xmlpayment.asp'; - } - return $value; - } - - /** - * Get Customer Id - * - * @return string - */ - public function getCustomerId() - { - return Mage::getStoreConfig('payment/eway_direct/customer_id'); - } - - /** - * Get currency that accepted by eWAY account - * - * @return string - */ - public function getAccepteCurrency() - { - return Mage::getStoreConfig('payment/' . $this->getCode() . '/currency'); - } - - public function validate() - { - parent::validate(); - $paymentInfo = $this->getInfoInstance(); - if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { - $currency_code = $paymentInfo->getOrder()->getBaseCurrencyCode(); - } else { - $currency_code = $paymentInfo->getQuote()->getBaseCurrencyCode(); - } - if ($currency_code != $this->getAccepteCurrency()) { - Mage::throwException(Mage::helper('eway')->__('Selected currency code (%s) is not compatible with eWAY.', $currency_code)); - } - return $this; - } - - public function capture(Varien_Object $payment, $amount) - { - $this->setAmount($amount) - ->setPayment($payment); - - $result = $this->callDoDirectPayment($payment)!==false; - - if ($result) { - $payment->setStatus(self::STATUS_APPROVED) - ->setTransactionId($this->getTransactionId()) - ->setIsTransactionClosed(0); - } else { - $e = $this->getError(); - if (isset($e['message'])) { - $message = Mage::helper('eway')->__('There has been an error processing your payment.') . $e['message']; - } else { - $message = Mage::helper('eway')->__('There has been an error processing your payment. Please try later or contact us for help.'); - } - Mage::throwException($message); - } - return $this; - } - - public function cancel(Varien_Object $payment) - { - $payment->setStatus(self::STATUS_DECLINED) - ->setIsTransactionClosed(1); - return $this; - } - - /** - * prepare params to send to gateway - * - * @return bool | array - */ - public function callDoDirectPayment() - { - $payment = $this->getPayment(); - $billing = $payment->getOrder()->getBillingAddress(); - - $invoiceDesc = ''; - $lengs = 0; - foreach ($payment->getOrder()->getAllItems() as $item) { - if ($item->getParentItem()) { - continue; - } - if (Mage::helper('core/string')->strlen($invoiceDesc.$item->getName()) > 10000) { - break; - } - $invoiceDesc .= $item->getName() . ', '; - } - $invoiceDesc = Mage::helper('core/string')->substr($invoiceDesc, 0, -2); - - $address = clone $billing; - $address->unsFirstname(); - $address->unsLastname(); - $address->unsPostcode(); - $formatedAddress = ''; - $tmpAddress = explode(' ', str_replace("\n", ' ', trim($address->format('text')))); - foreach ($tmpAddress as $part) { - if (strlen($part) > 0) $formatedAddress .= $part . ' '; - } -// $this->getQuote()->reserveOrderId(); - $xml = ""; - $xml .= "" . $this->getCustomerId() . ""; - $xml .= "" . ($this->getAmount()*100) . ""; - $xml .= "" . htmlentities(trim($payment->getCcOwner()), ENT_QUOTES, 'UTF-8') . ""; - $xml .= "" . $payment->getCcNumber() . ""; - $xml .= "" . $payment->getCcExpMonth() . ""; - $xml .= "" . $payment->getCcExpYear() . ""; - $xml .= "" . '' . ""; - $xml .= "" . htmlentities(trim($invoiceDesc), ENT_QUOTES, 'UTF-8') . ""; - $xml .= "" . htmlentities(trim($billing->getFirstname()), ENT_QUOTES, 'UTF-8') . ""; - $xml .= "" . htmlentities(trim($billing->getLastname()), ENT_QUOTES, 'UTF-8') . ""; - $xml .= "" . htmlentities(trim($payment->getOrder()->getCustomerEmail()), ENT_QUOTES, 'UTF-8') . ""; - $xml .= "" . htmlentities(trim($formatedAddress), ENT_QUOTES, 'UTF-8') . ""; - $xml .= "" . htmlentities(trim($billing->getPostcode()), ENT_QUOTES, 'UTF-8') . ""; -// $xml .= "" . $this->getQuote()->getReservedOrderId() . ""; - $xml .= "" . '' . ""; - - if ($this->getUseccv()) { - $xml .= "" . $payment->getCcCid() . ""; - } - - $xml .= "" . '' . ""; - $xml .= "" . '' . ""; - $xml .= "" . '' . ""; - - - if (Mage::getStoreConfig('payment/eway_direct/use_anti_fraud')) { - $xml .= "". Mage::helper('core/http')->getRemoteAddr() .""; - $xml .= "". $billing->getCountryId() .""; - } - - $xml .= ""; - - $resultArr = $this->call($xml); - - if ($resultArr === false) { - return false; - } - - $this->setTransactionId($resultArr['ewayTrxnNumber']); - - return $resultArr; - } - - /** - * Send params to gateway - * - * @param string $xml - * @return bool | array - */ - public function call($xml) - { - $debugData = array('request' => $xml); - try { - $http = new Varien_Http_Adapter_Curl(); - $config = array('timeout' => 30); - - $http->setConfig($config); - $http->write(Zend_Http_Client::POST, $this->getApiGatewayUrl(), '1.1', array(), $xml); - $response = $http->read(); - - $response = preg_split('/^\r?$/m', $response, 2); - $response = trim($response[1]); - $debugData['result'] = $response; - } - catch (Exception $e) { - $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode()); - $this->_debug($debugData); - throw $e; - } - - $this->_debug($debugData); - - if ($http->getErrno()) { - $http->close(); - $this->setError(array( - 'message' => $http->getError() - )); - return false; - } - $http->close(); - - $parsedResArr = $this->parseXmlResponse($response); - - if ($parsedResArr['ewayTrxnStatus'] == 'True') { - $this->unsError(); - return $parsedResArr; - } - - if (isset($parsedResArr['ewayTrxnError'])) { - $this->setError(array( - 'message' => $parsedResArr['ewayTrxnError'] - )); - } - - return false; - } - - /** - * parse response of gateway - * - * @param string $xmlResponse - * @return array - */ - public function parseXmlResponse($xmlResponse) - { - $xmlObj = simplexml_load_string($xmlResponse); - $newResArr = array(); - foreach ($xmlObj as $key => $val) { - $newResArr[$key] = (string)$val; - } - - return $newResArr; - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } - -} diff --git a/app/code/core/Mage/Eway/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Eway/Model/Mysql4/Api/Debug.php deleted file mode 100644 index 350b2cb71e..0000000000 --- a/app/code/core/Mage/Eway/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Eway_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('eway/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Eway/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Eway/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index 20bc2a8cdc..0000000000 --- a/app/code/core/Mage/Eway/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Eway_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('eway/api_debug'); - } -} diff --git a/app/code/core/Mage/Eway/Model/Mysql4/Setup.php b/app/code/core/Mage/Eway/Model/Mysql4/Setup.php deleted file mode 100644 index 645bacc993..0000000000 --- a/app/code/core/Mage/Eway/Model/Mysql4/Setup.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class Mage_Eway_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup -{ - -} diff --git a/app/code/core/Mage/Eway/Model/Secure.php b/app/code/core/Mage/Eway/Model/Secure.php deleted file mode 100644 index a243ecb81e..0000000000 --- a/app/code/core/Mage/Eway/Model/Secure.php +++ /dev/null @@ -1,54 +0,0 @@ - - */ -class Mage_Eway_Model_Secure extends Mage_Eway_Model_Shared -{ - protected $_code = 'eway_secure'; - - protected $_formBlockType = 'eway/secure_form'; - protected $_paymentMethod = 'secure'; - - /** - * Get url of eWAY 3D-Secure Payment - * - * @return string - */ - public function getEwaySecureUrl() - { - if (!$url = Mage::getStoreConfig('payment/' . $this->getCode() . '/api_url')) { - $url = 'https://www.eway.com.au/gateway_3d/payment.asp'; - } - return $url; - } - -} diff --git a/app/code/core/Mage/Eway/Model/Shared.php b/app/code/core/Mage/Eway/Model/Shared.php deleted file mode 100644 index 21615f5cfc..0000000000 --- a/app/code/core/Mage/Eway/Model/Shared.php +++ /dev/null @@ -1,254 +0,0 @@ - - */ -class Mage_Eway_Model_Shared extends Mage_Payment_Model_Method_Abstract -{ - protected $_code = 'eway_shared'; - - protected $_isGateway = false; - protected $_canAuthorize = false; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = false; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = false; - - protected $_formBlockType = 'eway/shared_form'; - protected $_paymentMethod = 'shared'; - - protected $_order; - - /** - * Get order model - * - * @return Mage_Sales_Model_Order - */ - public function getOrder() - { - if (!$this->_order) { - $paymentInfo = $this->getInfoInstance(); - $this->_order = Mage::getModel('sales/order') - ->loadByIncrementId($paymentInfo->getOrder()->getRealOrderId()); - } - return $this->_order; - } - - /** - * Get Customer Id - * - * @return string - */ - public function getCustomerId() - { - return Mage::getStoreConfig('payment/' . $this->getCode() . '/customer_id'); - } - - /** - * Get currency that accepted by eWAY account - * - * @return string - */ - public function getAccepteCurrency() - { - return Mage::getStoreConfig('payment/' . $this->getCode() . '/currency'); - } - - public function validate() - { - parent::validate(); - $paymentInfo = $this->getInfoInstance(); - if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { - $currency_code = $paymentInfo->getOrder()->getBaseCurrencyCode(); - } else { - $currency_code = $paymentInfo->getQuote()->getBaseCurrencyCode(); - } - if ($currency_code != $this->getAccepteCurrency()) { - Mage::throwException(Mage::helper('eway')->__('Selected currency code (%s) is not compatible with eWAY.', $currency_code)); - } - return $this; - } - - public function getOrderPlaceRedirectUrl() - { - return Mage::getUrl('eway/' . $this->_paymentMethod . '/redirect'); - } - - /** - * prepare params array to send it to gateway page via POST - * - * @return array - */ - public function getFormFields() - { - $billing = $this->getOrder()->getBillingAddress(); - $fieldsArr = array(); - $invoiceDesc = ''; - $lengs = 0; - foreach ($this->getOrder()->getAllItems() as $item) { - if ($item->getParentItem()) { - continue; - } - if (Mage::helper('core/string')->strlen($invoiceDesc.$item->getName()) > 10000) { - break; - } - $invoiceDesc .= $item->getName() . ', '; - } - $invoiceDesc = Mage::helper('core/string')->substr($invoiceDesc, 0, -2); - - $address = clone $billing; - $address->unsFirstname(); - $address->unsLastname(); - $address->unsPostcode(); - $formatedAddress = ''; - $tmpAddress = explode(' ', str_replace("\n", ' ', trim($address->format('text')))); - foreach ($tmpAddress as $part) { - if (strlen($part) > 0) $formatedAddress .= $part . ' '; - } - $paymentInfo = $this->getInfoInstance(); - $fieldsArr['ewayCustomerID'] = $this->getCustomerId(); - $fieldsArr['ewayTotalAmount'] = ($this->getOrder()->getBaseGrandTotal()*100); - $fieldsArr['ewayCustomerFirstName'] = $billing->getFirstname(); - $fieldsArr['ewayCustomerLastName'] = $billing->getLastname(); - $fieldsArr['ewayCustomerEmail'] = $this->getOrder()->getCustomerEmail(); - $fieldsArr['ewayCustomerAddress'] = trim($formatedAddress); - $fieldsArr['ewayCustomerPostcode'] = $billing->getPostcode(); -// $fieldsArr['ewayCustomerInvoiceRef'] = ''; - $fieldsArr['ewayCustomerInvoiceDescription'] = $invoiceDesc; - $fieldsArr['eWAYSiteTitle '] = Mage::app()->getStore()->getFrontendName(); - $fieldsArr['eWAYAutoRedirect'] = 1; - $fieldsArr['ewayURL'] = Mage::getUrl('eway/' . $this->_paymentMethod . '/success', array('_secure' => true)); - $fieldsArr['eWAYTrxnNumber'] = $paymentInfo->getOrder()->getRealOrderId(); - $fieldsArr['ewayOption1'] = ''; - $fieldsArr['ewayOption2'] = Mage::helper('core')->encrypt($fieldsArr['eWAYTrxnNumber']); - $fieldsArr['ewayOption3'] = ''; - - $request = ''; - foreach ($fieldsArr as $k=>$v) { - $request .= '<' . $k . '>' . $v . ''; - } - - $this->_debug(array('request' => $request)); - - return $fieldsArr; - } - - /** - * Get url of eWAY Shared Payment - * - * @return string - */ - public function getEwaySharedUrl() - { - if (!$url = Mage::getStoreConfig('payment/eway_shared/api_url')) { - $url = 'https://www.eway.com.au/gateway/payment.asp'; - } - return $url; - } - - /** - * @deprecated after 1.4.1.0 - * - * @return string - */ - public function getDebug() - { - return $this->getDebugFlag(); - } - - public function capture(Varien_Object $payment, $amount) - { - $payment->setStatus(self::STATUS_APPROVED) - ->setTransactionId($this->getTransactionId()) - ->setIsTransactionClosed(0); - - return $this; - } - - public function cancel(Varien_Object $payment) - { - $payment->setStatus(self::STATUS_DECLINED) - ->setTransactionId($this->getTransactionId()) - ->setIsTransactionClosed(1); - - return $this; - } - - /** - * parse response POST array from gateway page and return payment status - * - * @return bool - */ - public function parseResponse() - { - $response = $this->getResponse(); - - $this->_debug(array('result' => $response)); - - if ($response['ewayTrxnStatus'] == 'True') { - return true; - } - return false; - } - - /** - * Return redirect block type - * - * @return string - */ - public function getRedirectBlockType() - { - return $this->_redirectBlockType; - } - - /** - * Return payment method type string - * - * @return string - */ - public function getPaymentMethodType() - { - return $this->_paymentMethod; - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Eway/Model/Source/Cctype.php b/app/code/core/Mage/Eway/Model/Source/Cctype.php deleted file mode 100644 index a1d4f545b2..0000000000 --- a/app/code/core/Mage/Eway/Model/Source/Cctype.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Eway_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype -{ - public function getAllowedTypes() - { - return array('VI', 'MC', 'AE', 'DICL', 'JCB'); - } -} diff --git a/app/code/core/Mage/Eway/controllers/SecureController.php b/app/code/core/Mage/Eway/controllers/SecureController.php deleted file mode 100644 index 0c5a758088..0000000000 --- a/app/code/core/Mage/Eway/controllers/SecureController.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Eway_SecureController extends Mage_Eway_Controller_Abstract -{ - /** - * Redirect Block Type - * - * @var string - */ - protected $_redirectBlockType = 'eway/secure_redirect'; -} diff --git a/app/code/core/Mage/Eway/controllers/SharedController.php b/app/code/core/Mage/Eway/controllers/SharedController.php deleted file mode 100644 index 4fd9e219f7..0000000000 --- a/app/code/core/Mage/Eway/controllers/SharedController.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Eway_SharedController extends Mage_Eway_Controller_Abstract -{ - /** - * Redirect Block Type - * - * @var string - */ - protected $_redirectBlockType = 'eway/shared_redirect'; -} diff --git a/app/code/core/Mage/Eway/etc/config.xml b/app/code/core/Mage/Eway/etc/config.xml deleted file mode 100644 index bba366fb7e..0000000000 --- a/app/code/core/Mage/Eway/etc/config.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - 0.1.0 - - - - - - Mage_Eway_Model - eway_mysql4 - - - Mage_Eway_Model_Mysql4 - - eway_api_debug
-
-
-
- - - - Mage_Eway - Mage_Eway_Model_Mysql4_Setup - - - - - Mage_Eway_Block - - - - - - DICL - Diners Club - 60 - - - - -
- - - /eway/shared - - - - standard - - Mage_Eway - eway - - - - - - - - Mage_Eway.csv - - - - - - - - eway.xml - - - - - - - - - - Mage_Eway.csv - - - - - - - - - - AUD - authorize_capture - eway/direct - eWAY Direct - processing - AE,VI,MC,DICL,JCB - 0 - 0 - - - - AUD - eway/shared - eWAY Shared - processing - 0 - - - - AUD - eway/secure - eWAY 3D-Secure - processing - 0 - - - -
diff --git a/app/code/core/Mage/Eway/etc/system.xml b/app/code/core/Mage/Eway/etc/system.xml deleted file mode 100644 index bc66fc4535..0000000000 --- a/app/code/core/Mage/Eway/etc/system.xml +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - text - 201 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>2</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - obscure - adminhtml/system_config_backend_encrypted - 3 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_currency - 4 - 1 - 1 - 0 - - - - Set the Beagle anti-fraud gateway URL. - select - adminhtml/system_config_source_yesno - 4 - 1 - 1 - 0 - - - - text - 5 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 6 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 7 - 1 - 1 - 0 - - - - multiselect - eway/source_cctype - 8 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 9 - 1 - 1 - 0 - - - - allowspecific - 10 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 11 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 12 - 1 - 1 - 0 - - - - - - text - 202 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>2</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - obscure - adminhtml/system_config_backend_encrypted - 3 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_currency - 4 - 1 - 1 - 0 - - - - text - 5 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 6 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 7 - 1 - 1 - 0 - - - - allowspecific - 8 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 9 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 10 - 1 - 1 - 0 - - - - - - text - 203 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>2</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - obscure - adminhtml/system_config_backend_encrypted - 3 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_currency - 4 - 1 - 1 - 0 - - - - text - 5 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 6 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 7 - 1 - 1 - 0 - - - - allowspecific - 8 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 9 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 10 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Eway/sql/eway_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Eway/sql/eway_setup/mysql4-install-0.1.0.php deleted file mode 100644 index d48e43bbe7..0000000000 --- a/app/code/core/Mage/Eway/sql/eway_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,46 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$this->getTable('eway/api_debug')}`; -CREATE TABLE `{$this->getTable('eway/api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Flo2Cash/Block/Form.php b/app/code/core/Mage/Flo2Cash/Block/Form.php deleted file mode 100644 index db5b2d74a4..0000000000 --- a/app/code/core/Mage/Flo2Cash/Block/Form.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Flo2Cash_Block_Form extends Mage_Payment_Block_Form_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('flo2cash/form.phtml'); - } -} diff --git a/app/code/core/Mage/Flo2Cash/Block/Info.php b/app/code/core/Mage/Flo2Cash/Block/Info.php deleted file mode 100644 index 5a5d313906..0000000000 --- a/app/code/core/Mage/Flo2Cash/Block/Info.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class Mage_Flo2Cash_Block_Info extends Mage_Payment_Block_Info_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('flo2cash/info.phtml'); - } - - public function toPdf() - { - $this->setTemplate('flo2cash/pdf/info.phtml'); - return $this->toHtml(); - } - -} diff --git a/app/code/core/Mage/Flo2Cash/Helper/Data.php b/app/code/core/Mage/Flo2Cash/Helper/Data.php deleted file mode 100644 index fa61513a63..0000000000 --- a/app/code/core/Mage/Flo2Cash/Helper/Data.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class Mage_Flo2Cash_Helper_Data extends Mage_Core_Helper_Abstract -{ - -} diff --git a/app/code/core/Mage/Flo2Cash/Model/Api/Debug.php b/app/code/core/Mage/Flo2Cash/Model/Api/Debug.php deleted file mode 100644 index 4f11c641f0..0000000000 --- a/app/code/core/Mage/Flo2Cash/Model/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Flo2Cash_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('flo2cash/api_debug'); - } -} diff --git a/app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug.php deleted file mode 100644 index b46b2bcba8..0000000000 --- a/app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Flo2Cash_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('flo2cash/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index 50548162b8..0000000000 --- a/app/code/core/Mage/Flo2Cash/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Flo2Cash_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('flo2cash/api_debug'); - } -} diff --git a/app/code/core/Mage/Flo2Cash/Model/Mysql4/Setup.php b/app/code/core/Mage/Flo2Cash/Model/Mysql4/Setup.php deleted file mode 100644 index a4614f3159..0000000000 --- a/app/code/core/Mage/Flo2Cash/Model/Mysql4/Setup.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class Mage_Flo2Cash_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup -{ - -} diff --git a/app/code/core/Mage/Flo2Cash/Model/Source/Cctype.php b/app/code/core/Mage/Flo2Cash/Model/Source/Cctype.php deleted file mode 100644 index a707fc0df9..0000000000 --- a/app/code/core/Mage/Flo2Cash/Model/Source/Cctype.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Flo2Cash_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype -{ - public function getAllowedTypes() - { - return array('VI', 'MC', 'AE', 'DICL'); - } -} diff --git a/app/code/core/Mage/Flo2Cash/Model/Source/PaymentAction.php b/app/code/core/Mage/Flo2Cash/Model/Source/PaymentAction.php deleted file mode 100644 index 8ebc52e105..0000000000 --- a/app/code/core/Mage/Flo2Cash/Model/Source/PaymentAction.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class Mage_Flo2Cash_Model_Source_PaymentAction -{ - public function toOptionArray() - { - return array( - array( - 'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE, - 'label' => Mage::helper('flo2cash')->__('Authorize') - ), - array( - 'value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE, - 'label' => Mage::helper('flo2cash')->__('Purchase') - ), - ); - } -} diff --git a/app/code/core/Mage/Flo2Cash/Model/Web.php b/app/code/core/Mage/Flo2Cash/Model/Web.php deleted file mode 100644 index 308b195672..0000000000 --- a/app/code/core/Mage/Flo2Cash/Model/Web.php +++ /dev/null @@ -1,304 +0,0 @@ - - */ -class Mage_Flo2Cash_Model_Web extends Mage_Payment_Model_Method_Cc -{ - const WSDL_URL_DEMO = 'http://demo.flo2cash.co.nz/ws/paynzws.asmx?wsdl'; - const WSDL_URL_LIVE = 'https://secure.flo2cash.co.nz/ws/paynzws.asmx?wsdl'; - - protected $_code = 'flo2cash_web'; - - protected $_allowCurrencyCode = array('NZD'); - - /** - * Availability options - */ - protected $_isGateway = true; - protected $_canAuthorize = true; - protected $_canCapture = true; - protected $_canCapturePartial = true; - protected $_canRefund = true; - protected $_canVoid = false; - protected $_canUseInternal = true; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = true; - protected $_canSaveCc = false; - - protected $_ccTypesConvert = array( - 'VI' => 'VISA', - 'MC' => 'MC', - 'DICL' => 'DINERS', - 'AE' => 'AMEX' - ); - - const TRANSACTION_TYPE_PURCHASE = 1; - const TRANSACTION_TYPE_REFUND = 2; - const TRANSACTION_TYPE_AUTHORISE = 3; - const TRANSACTION_TYPE_CAPTURE = 4; - - const TRANSACTION_STATUS_ACCEPTED = 1; - const TRANSACTION_STATUS_DECLINED = 2; - - protected $_formBlockType = 'flo2cash/form'; - protected $_infoBlockType = 'flo2cash/info'; - - /** - * Get Account Id for selected payment action - * - * @return string - */ - public function getAccountId() - { - if ($this->getConfigData('payment_action') == self::ACTION_AUTHORIZE_CAPTURE) { - $acountId = $this->getConfigData('payzn_purchase_account_id'); - } else { - $acountId = $this->getConfigData('payzn_account_id'); - } - return $acountId; - } - - /** - * validate the currency code is avaialable to use for Flo2Cash Basic or not - * - * @return bool - */ - public function validate() - { - parent::validate(); - $paymentInfo = $this->getInfoInstance(); - if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { - $currency_code = $paymentInfo->getOrder()->getBaseCurrencyCode(); - } else { - $currency_code = $paymentInfo->getQuote()->getBaseCurrencyCode(); - } - if (!in_array($currency_code, $this->_allowCurrencyCode)) { - Mage::throwException(Mage::helper('flo2cash')->__('Selected currency code (%s) is not compatible with Flo2Cash', $currency_code)); - } - return $this; - } - - public function authorize(Varien_Object $payment, $amount) - { - $txnDetails = $this->_prepareTxnDetails($payment, $amount); - - $response = $this->_sendRequest($txnDetails); - - if ($response['txn_status'] == self::TRANSACTION_STATUS_DECLINED) { - Mage::throwException(Mage::helper('flo2cash')->__('Payment transaction has been declined.')); - } - - $payment->setStatus(self::STATUS_APPROVED) - ->setCcTransId($response['transaction_id']) - ->setTransactionId($response['transaction_id']) - ->setIsTransactionClosed(1) - ->setFlo2cashAccountId($response['paynz_account_id']); - - return $this; - } - - public function capture(Varien_Object $payment, $amount) - { - $txnDetails = $this->_prepareTxnDetails($payment, $amount); - - $response = $this->_sendRequest($txnDetails); - - if ($response['txn_status'] == self::TRANSACTION_STATUS_DECLINED) { - Mage::throwException(Mage::helper('flo2cash')->__('Payment transaction has been declined.')); - } - - $payment->setStatus(self::STATUS_APPROVED) - ->setTransactionId($response['transaction_id']) - ->setFlo2cashAccountId($response['paynz_account_id']); - - return $this; - } - - public function void(Varien_Object $payment) - { - $payment->setStatus(self::STATUS_SUCCESS ); - return $this; - } - - public function refund(Varien_Object $payment, $amount) - { - if ($payment->getParentTransactionId() && $amount>0) { - - $transId = $payment->getParentTransactionId(); - - $txnDetails = array( - 'txn_type' => self::TRANSACTION_TYPE_REFUND, - 'refund_transaction_id' => $transId, - 'paynz_account_id' => $payment->getFlo2cashAccountId(), - 'amount' => sprintf('%.2f', $amount) - ); - } else { - Mage::throwException(Mage::helper('flo2cash')->__('Error in refunding the payment.')); - } - - $response = $this->_sendRequest($txnDetails); - - if ($response['txn_status'] == self::TRANSACTION_STATUS_DECLINED) { - Mage::throwException(Mage::helper('flo2cash')->__('Payment transaction has been declined.')); - } - - $payment->setTransactionId($response['transaction_id']) - ->setIsTransactionClosed(1); - - return $this; - } - - /** - * Sending SOAP request to gateway - * - * @param array $txnDetails - * @return void - */ - protected function _sendRequest($txnDetails) - { - if ($this->getConfigData('demo_mode')) { - $url = self::WSDL_URL_DEMO; - } else { - $url = self::WSDL_URL_LIVE; - } - - $client = new SoapClient($url); - - $parameters = array( - 'username' => $this->getConfigData('username'), - 'password' => $this->getConfigData('password'), - 'txn_details' => $txnDetails - ); - - $debugData = array('request' => $parameters); - try { - $response = $client->ProcessPayment($parameters); - - $debugData['result'] = $response; - $this->_debug($debugData); - - return (array)$response->ProcessPaymentResult; - } - catch (SoapFault $e) { - - $debugData['result'] = array('error' => $e->getMessage(), 'code' => $e->getCode()); - $this->_debug($debugData); - - if (strpos($e->getMessage(), ' ---> ') !== FALSE) { - list($title, $error) = explode(' ---> ', $e->getMessage()); - } - else { - $error = $e->getMessage(); - } - - Mage::throwException(Mage::helper('flo2cash')->__('Gateway returned an error message: %s', $error)); - } - } - - /** - * Preapare basic paramters for transaction - * - * @param Varien_Object $payment - * @param decimal $amount - * @return array - */ - protected function _prepareTxnDetails(Varien_Object $payment, $amount) - { - if ($payment->getParentTransactionId()) { - $txnDetails = array( - 'txn_type' => self::TRANSACTION_TYPE_CAPTURE, - 'capture_transaction_id' => $payment->getParentTransactionId() - ); - } else { - $billingAddress = $payment->getOrder()->getBillingAddress(); - - if ($payment->getOrder()->getCustomerEmail()) { - $customerEmail = $payment->getOrder()->getCustomerEmail(); - } elseif ($billingAddress->getEmail()) { - $customerEmail = $billingAddress->getEmail(); - } else { - $customerEmail = ''; - } - - $txnDetails = array( - 'card_holder_name' => $payment->getCcOwner(), - 'card_number' => $payment->getCcNumber(), - 'card_type' => $this->_convertCcType($payment->getCcType()), - 'card_expiry' => sprintf('%02d', $payment->getCcExpMonth()).substr($payment->getCcExpYear(), 2, 2), - 'card_csc' => $payment->getCcCid(), - 'customer_email' => $customerEmail - ); - - if ($this->getConfigData('payment_action') == self::ACTION_AUTHORIZE) { - $txnDetails['txn_type'] = self::TRANSACTION_TYPE_AUTHORISE; - } else { - $txnDetails['txn_type'] = self::TRANSACTION_TYPE_PURCHASE; - } - } - - $accountId = $payment->getFlo2cashAccountId(); - //if transaction type is authorize & capture or only authorize - if (is_null($accountId)) { - $accountId = $this->getAccountId(); - } - - $txnDetails = array_merge($txnDetails, array( - //'txn_reference' => $payment->getOrder()->getIncrementId(), - 'merchant_reference' => $payment->getOrder()->getIncrementId(), - 'paynz_account_id' => $accountId, - 'amount' => sprintf('%.2f', $amount), - )); - - return $txnDetails; - } - - /** - * Converst CC Types Code from Magento to Flo2Cash - * - * @param string $magentoCcType - * @return string - */ - protected function _convertCcType($magentoCcType = 'VI') - { - return $this->_ccTypesConvert[$magentoCcType]; - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Flo2Cash/etc/config.xml b/app/code/core/Mage/Flo2Cash/etc/config.xml deleted file mode 100644 index 544d9b997a..0000000000 --- a/app/code/core/Mage/Flo2Cash/etc/config.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - 0.1.1 - - - - - - Mage_Flo2Cash_Model - flo2cash_mysql4 - - - Mage_Flo2Cash_Model_Mysql4 - - flo2cash_api_debug
-
-
-
- - - - Mage_Flo2Cash - Mage_Flo2Cash_Model_Mysql4_Setup - - - - - Mage_Flo2Cash_Block - - - Mage_Flo2Cash_Helper - - - - - - DICL - Diners Club - 60 - - - - -
- - - - standard - - Mage_Flo2Cash - flo2cash - - - - - - - - Mage_Flo2Cash.csv - - - - - - - - flo2cash.xml - - - - - - - - - - Mage_Flo2Cash.csv - - - - - - - - - Flo2Cash Web Service - AE,VI,MC,DICL - 0 - flo2cash/web - - - -
diff --git a/app/code/core/Mage/Flo2Cash/etc/system.xml b/app/code/core/Mage/Flo2Cash/etc/system.xml deleted file mode 100644 index 94d59152dd..0000000000 --- a/app/code/core/Mage/Flo2Cash/etc/system.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - text - 501 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 0 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>10</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - text - 20 - 1 - 1 - 0 - - - - text - 30 - 1 - 1 - 0 - - - - For "Authorize" or "Capture" transactions only. - text - 31 - 1 - 1 - 0 - - - - For "Purchase" transactions only. - text - 32 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 33 - 1 - 1 - 0 - - - - select - flo2cash/source_paymentAction - 40 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 50 - 1 - 1 - 0 - - - - multiselect - flo2cash/source_cctype - 60 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 70 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 75 - 1 - 1 - 0 - - - - allowspecific - 80 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 90 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 100 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-install-0.1.0.php deleted file mode 100644 index fb92f87e16..0000000000 --- a/app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,47 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS `{$this->getTable('flo2cash/api_debug')}`; -CREATE TABLE `{$this->getTable('flo2cash/api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - `exception` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-upgrade-0.1.0-0.1.1.php b/app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-upgrade-0.1.0-0.1.1.php deleted file mode 100644 index 9992c3bc46..0000000000 --- a/app/code/core/Mage/Flo2Cash/sql/flo2cash_setup/mysql4-upgrade-0.1.0-0.1.1.php +++ /dev/null @@ -1,32 +0,0 @@ -startSetup(); - -$installer->addAttribute('order_payment', 'flo2cash_account_id', array()); - -$installer->endSetup(); diff --git a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php index f00ccf8888..bd4d26469b 100644 --- a/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php +++ b/app/code/core/Mage/GoogleBase/Block/Adminhtml/Items/Renderer/Id.php @@ -43,7 +43,7 @@ class Mage_GoogleBase_Block_Adminhtml_Items_Renderer_Id */ public function render(Varien_Object $row) { - $baseUrl = 'http://www.google.com/base/step2offer?docId='; + $baseUrl = 'http://www.google.com/merchants/view?docId='; $itemUrl = $row->getData($this->getColumn()->getIndex()); $urlParts = parse_url($itemUrl); diff --git a/app/code/core/Mage/GoogleBase/Model/Config.php b/app/code/core/Mage/GoogleBase/Model/Config.php index 75bb59270e..6232b09b6f 100644 --- a/app/code/core/Mage/GoogleBase/Model/Config.php +++ b/app/code/core/Mage/GoogleBase/Model/Config.php @@ -68,7 +68,7 @@ public function getAccountLogin($storeId = null) */ public function getAccountPassword($storeId = null) { - return $this->getConfigData('password', $storeId); + return Mage::helper('core')->decrypt($this->getConfigData('password', $storeId)); } /** diff --git a/app/code/core/Mage/GoogleBase/etc/config.xml b/app/code/core/Mage/GoogleBase/etc/config.xml index df6b797f7b..df8ec7dba4 100644 --- a/app/code/core/Mage/GoogleBase/etc/config.xml +++ b/app/code/core/Mage/GoogleBase/etc/config.xml @@ -28,7 +28,7 @@ - 0.1.1 + 0.1.2 diff --git a/app/code/core/Mage/GoogleBase/etc/system.xml b/app/code/core/Mage/GoogleBase/etc/system.xml index 8646a14f9c..9f111995d7 100644 --- a/app/code/core/Mage/GoogleBase/etc/system.xml +++ b/app/code/core/Mage/GoogleBase/etc/system.xml @@ -47,7 +47,8 @@ - password + obscure + adminhtml/system_config_backend_encrypted 2 1 1 diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php similarity index 64% rename from app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.1-0.8.2.php rename to app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php index 4e0b7eaf53..83c45aa094 100644 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php @@ -19,23 +19,25 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Oscommerce + * @package Mage_GoogleBase * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -$installer = $this; -/* @var $installer Mage_Core_Model_Resource_Setup */ - -$installer->startSetup(); - -$installer->run(" -truncate `{$this->getTable('oscommerce_import_type')}`; -insert into `{$this->getTable('oscommerce_import_type')}`(`type_code`,`type_name`) values ('website', 'Website'),('store','Store'),('category','Category'),('product','Product'), ('customer','Customer'),('order','Order'),('group','Store Group'), ('taxclass', 'Product Tax Class'); - -ALTER TABLE `{$this->getTable('oscommerce_import')}` ADD table_prefix VARCHAR(32) DEFAULT NULL; - -"); +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; -$installer->endSetup(); +// encrypt google base passwords +$select = $installer->getConnection()->select() + ->from($installer->getTable('core/config_data')) + ->where('path LIKE ?', 'google/googlebase/password'); +foreach ($installer->getConnection()->fetchAll($select) as $row) { + $bind = array( + 'value' => Mage::helper('core')->encrypt($row['value']) + ); + $where = array( + 'config_id=?' => $row['config_id'] + ); + $installer->getConnection()->update($installer->getTable('core/config_data'), $bind, $where); +} diff --git a/app/code/core/Mage/Ideal/Block/Advanced/Failure.php b/app/code/core/Mage/Ideal/Block/Advanced/Failure.php deleted file mode 100644 index f5b27ae3b3..0000000000 --- a/app/code/core/Mage/Ideal/Block/Advanced/Failure.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ - -class Mage_Ideal_Block_Advanced_Failure extends Mage_Core_Block_Template -{ - /** - * Returns error from session and clears it - * - * @return string - */ - public function getErrorMessage () - { - $error = Mage::getSingleton('checkout/session')->getIdealErrorMessage(); - Mage::getSingleton('checkout/session')->unsIdealErrorMessage(); - return $error; - } - - /** - * Get continue shopping url - */ - public function getContinueShoppingUrl() - { - return Mage::getUrl('checkout/cart'); - } -} diff --git a/app/code/core/Mage/Ideal/Block/Advanced/Form.php b/app/code/core/Mage/Ideal/Block/Advanced/Form.php deleted file mode 100755 index 3b96d8e629..0000000000 --- a/app/code/core/Mage/Ideal/Block/Advanced/Form.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ - -class Mage_Ideal_Block_Advanced_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('ideal/advanced/form.phtml'); - parent::_construct(); - } - - /** - * Return array that contains issuer list - * - * @return array - */ - public function getIssuerList() - { - return $this->getMethod()->getIssuerList(); - } -} diff --git a/app/code/core/Mage/Ideal/Block/Advanced/Redirect.php b/app/code/core/Mage/Ideal/Block/Advanced/Redirect.php deleted file mode 100755 index 879d42ea34..0000000000 --- a/app/code/core/Mage/Ideal/Block/Advanced/Redirect.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ - -class Mage_Ideal_Block_Advanced_Redirect extends Mage_Core_Block_Abstract -{ - protected function _toHtml() - { - $html = ''; - $html.= $this->getMessage(); - $html.= ''; - $html.= ''; - return $html; - } -} diff --git a/app/code/core/Mage/Ideal/Block/Basic/Failure.php b/app/code/core/Mage/Ideal/Block/Basic/Failure.php deleted file mode 100644 index a36cbb7109..0000000000 --- a/app/code/core/Mage/Ideal/Block/Basic/Failure.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ - -class Mage_Ideal_Block_Basic_Failure extends Mage_Core_Block_Template -{ - /** - * Returns error from session and clears it - * - * @return string - */ - public function getErrorMessage () - { - $error = Mage::getSingleton('checkout/session')->getIdealErrorMessage(); - Mage::getSingleton('checkout/session')->unsIdealErrorMessage(); - return $error; - } - - /** - * Get continue shopping url - */ - public function getContinueShoppingUrl() - { - return Mage::getUrl('checkout/cart'); - } -} diff --git a/app/code/core/Mage/Ideal/Block/Basic/Form.php b/app/code/core/Mage/Ideal/Block/Basic/Form.php deleted file mode 100755 index 57f6f6415a..0000000000 --- a/app/code/core/Mage/Ideal/Block/Basic/Form.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - -class Mage_Ideal_Block_Basic_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('ideal/basic/form.phtml'); - parent::_construct(); - } -} diff --git a/app/code/core/Mage/Ideal/Block/Basic/Redirect.php b/app/code/core/Mage/Ideal/Block/Basic/Redirect.php deleted file mode 100755 index 27079b9de3..0000000000 --- a/app/code/core/Mage/Ideal/Block/Basic/Redirect.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ - -class Mage_Ideal_Block_Basic_Redirect extends Mage_Core_Block_Abstract -{ - protected function _toHtml() - { - $basic = $this->getOrder()->getPayment()->getMethodInstance(); - - $form = new Varien_Data_Form(); - $form->setAction($basic->getApiUrl()) - ->setId('ideal_basic_checkout') - ->setName('ideal_basic_checkout') - ->setMethod('POST') - ->setUseContainer(true); - - foreach ($basic->getBasicCheckoutFormFields() as $field=>$value) { - $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value)); - } - - $html = ''; - $html.= $this->__('You will be redirected to iDEAL in a few seconds.'); - $html.= $form->toHtml(); - $html.= ''; - $html.= ''; - return $html; - } -} diff --git a/app/code/core/Mage/Ideal/Helper/Data.php b/app/code/core/Mage/Ideal/Helper/Data.php deleted file mode 100755 index cb7bba06d7..0000000000 --- a/app/code/core/Mage/Ideal/Helper/Data.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ - -class Mage_Ideal_Helper_Data extends Mage_Core_Helper_Abstract -{ - public function encrypt($token) - { - return bin2hex(base64_decode(Mage::helper('core')->encrypt($token))); - } - - public function decrypt($token) - { - return Mage::helper('core')->decrypt(base64_encode(pack('H*', $token))); - } -} diff --git a/app/code/core/Mage/Ideal/Model/Advanced.php b/app/code/core/Mage/Ideal/Model/Advanced.php deleted file mode 100755 index 8dfe84fe70..0000000000 --- a/app/code/core/Mage/Ideal/Model/Advanced.php +++ /dev/null @@ -1,237 +0,0 @@ - - */ - -class Mage_Ideal_Model_Advanced extends Mage_Payment_Model_Method_Abstract -{ - protected $_code = 'ideal_advanced'; - protected $_formBlockType = 'ideal/advanced_form'; - protected $_infoBlockType = 'ideal/advanced_info'; - protected $_allowCurrencyCode = array('EUR', 'GBP', 'USD', 'CAD', 'SHR', 'NOK', 'SEK', 'DKK'); - - protected $_isGateway = false; - protected $_canAuthorize = false; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = false; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = false; - - protected $_issuersList = null; - - public function canUseCheckout() - { - if ($this->getIssuerList() && parent::canUseCheckout()) { - return true; - } else { - return false; - } - } - - public function getOrderPlaceRedirectUrl() - { - return Mage::getUrl('ideal/advanced/redirect', array('_secure' => true)); - } - - /** - * Get iDEAL API Model - * - * @return Mage_Ideal_Api_Advanced - */ - public function getApi() - { - return Mage::getSingleton('ideal/api_advanced')->setPaymentModel($this); - } - - public function getIssuerList($saveAttrbute = false) - { - if ($this->_issuersList == null) { - $request = new Mage_Ideal_Model_Api_Advanced_DirectoryRequest(); - $response = $this->getApi()->processRequest($request, $this->getDebugFlag()); - if ($response) { - $this->_issuersList = $response->getIssuerList(); - return $this->_issuersList; - } else { - $this->_issuersList = null; - $this->setError($this->getApi()->getError()); - return false; - } - } else { - $this->getInfoInstance() - ->setIdealIssuerList(serialize($this->_issuersList)) - ->save(); - return $this->_issuersList; - } - } - - /** - * validate the currency code is avaialable to use for iDEAL Advanced or not - * - * @return bool - */ - public function validate() - { - parent::validate(); - $paymentInfo = $this->getInfoInstance(); - if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { - $currency_code = $paymentInfo->getOrder()->getBaseCurrencyCode(); - } else { - $currency_code = $paymentInfo->getQuote()->getBaseCurrencyCode(); - } - - if (!in_array($currency_code,$this->_allowCurrencyCode)) { - Mage::throwException(Mage::helper('ideal')->__('Selected currency code (%s) is not compatible with iDEAL.', $currency_code)); - } - - return $this; - } - - /** - * Preapre and send transaction request - * - * @param Mage_Sales_Model_Order $order - * @param string $issuerId - * @return Mage_Ideal_Model_Api_Advanced_AcquirerTrxResponse - */ - public function sendTransactionRequest(Mage_Sales_Model_Order $order, $issuerId) - { - $request = new Mage_Ideal_Model_Api_Advanced_AcquirerTrxRequest(); - $request->setIssuerId($issuerId); - $request->setPurchaseId($order->getIncrementId()); - $request->setEntranceCode(Mage::helper('ideal')->encrypt($order->getIncrementId())); - //we need to be sure that we sending number without decimal part - $request->setAmount(floor($order->getBaseGrandTotal()*100)); - $response = $this->getApi()->processRequest($request, $this->getDebugFlag()); - return $response; - } - - /** - * Prepare and send transaction status request - * - * @param string $transactionId - * @return Mage_Ideal_Model_Api_Advanced_AcquirerStatusResponse - */ - public function getTransactionStatus($transactionId) - { - $request = new Mage_Ideal_Model_Api_Advanced_AcquirerStatusRequest(); - $request->setTransactionId($transactionId); - $response = $this->getApi()->processRequest($request, $this->getDebugFlag()); - return $response; - } - - public function capture(Varien_Object $payment, $amount) - { - $payment->setStatus(self::STATUS_APPROVED) - ->setTransactionId($this->getTransactionId()); - - return $this; - } - - public function cancel(Varien_Object $payment) - { - $payment->setStatus(self::STATUS_DECLINED); - - return $this; - } - - /** - * Executes by cron and check transactions status - * for every iDEAL order that was created in last hour - */ - public function transactionStatusCheck($shedule = null) - { - $gmtStamp = Mage::getModel('core/date')->gmtTimestamp(); - $to = $this->getConfigData('cron_start') > 0?$this->getConfigData('cron_start'):1; - $to = date('Y-m-d H:i:s', $gmtStamp - $to * 3600); - - $from = $this->getConfigData('cron_end') > 0?$this->getConfigData('cron_end'):1; - $from = date('Y-m-d H:i:s', $gmtStamp - $from * 86400); - - $paymentCollection = Mage::getModel('sales/order_payment')->getCollection() - ->addAttributeToFilter('last_trans_id', array('neq' => '')) - ->addAttributeToFilter('method', $this->_code) - ->addAttributeToFilter('created_at', array('from' => $from, 'to' => $to, 'datetime' => true)) - ->addAttributeToFilter('ideal_transaction_checked', array('neq' => '1')); - - $order = Mage::getModel('sales/order'); - foreach($paymentCollection->getItems() as $item) { - $order->reset(); - $order->load($item->getParentId()); - $response = $this->getTransactionStatus($item->getLastTransId()); - - if ($response->getTransactionStatus() == Mage_Ideal_Model_Api_Advanced::STATUS_SUCCESS) { - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - - $order->addStatusToHistory($order->getStatus(), Mage::helper('ideal')->__('Transaction Status Update: finished successfully.')); - } - } else if ($response->getTransactionStatus() == Mage_Ideal_Model_Api_Advanced::STATUS_CANCELLED) { - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), Mage::helper('ideal')->__('Transaction Status Update: canceled by the customer.')); - } else { - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), Mage::helper('ideal')->__('Transaction Status Update: rejected by iDEAL.')); - } - - $order->getPayment()->setIdealTransactionChecked(1); - $order->save(); - } - } - - /** - * @deprecated after 1.4.1.0 - * - * @return boolean - */ - public function getDebug() - { - return $this->getDebugFlag(); - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced.php b/app/code/core/Mage/Ideal/Model/Api/Advanced.php deleted file mode 100755 index 5301ff0405..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced.php +++ /dev/null @@ -1,507 +0,0 @@ - - */ - -class Mage_Ideal_Model_Api_Advanced extends Varien_Object -{ - /** - * Transaction status returned in Status Request - */ - const STATUS_OPEN = 'Open'; - const STATUS_EXPIRED = 'Expired'; - const STATUS_SUCCESS = 'Success'; - const STATUS_CANCELLED = 'Cancelled'; - const STATUS_FAILED = 'Failed'; - - /** - * @var Mage_Ideal_Model_Api_Advanced_Security - */ - protected $_security; - - /** - * array with configuration values - * - * @var array() - */ - protected $_conf; - - /** - * @var Varien_Http_Adapter_Curl - */ - protected $_http; - - public function __construct() - { - $this->_http = new Varien_Http_Adapter_Curl(); - $this->_security = new Mage_Ideal_Model_Api_Advanced_Security(); - - if ($this->getConfigData('test_flag') == 1) { - $acquirerUrl = 'https://idealtest.secure-ing.com/ideal/iDeal'; - } else { - $acquirerUrl = 'https://ideal.secure-ing.com/ideal/iDeal'; - } - - if (!($description = $this->getConfigData('description'))) { - $description = Mage::app()->getStore()->getFrontendName() . ' payment'; - } - - $this->_conf = array( - 'PRIVATEKEY' => $this->getConfigData('private_key'), - 'PRIVATEKEYPASS' => $this->getConfigData('private_keypass'), - 'PRIVATECERT' => $this->getConfigData('private_cert'), - 'AUTHENTICATIONTYPE' => 'SHA1_RSA', - 'CERTIFICATE0' => $this->getConfigData('certificate'), - 'ACQUIRERURL' => $acquirerUrl, - 'ACQUIRERTIMEOUT' => '10', - 'MERCHANTID' => $this->getConfigData('merchant_id'), - 'SUBID' => '0', - 'MERCHANTRETURNURL' => Mage::getUrl('ideal/advanced/result', array('_secure' => true)), - 'CURRENCY' => 'EUR', - 'EXPIRATIONPERIOD' => 'PT10M', - 'LANGUAGE' => 'nl', - 'DESCRIPTION' => $description, - 'ENTRANCECODE' => '' - ); - - if ((int)$this->getConfigData('expire_period') >= 1 && $this->getConfigData('expire_period') < 60) { - $this->_conf['EXPIRATIONPERIOD'] = 'PT' . $this->getConfigData('expire_period') . 'M'; - } else if ($this->getConfigData('description') == 60) { - $this->_conf['EXPIRATIONPERIOD'] = 'PT1H'; - } - } - - /** - * Getting config parametrs - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function getConfigData($key, $default=false) - { - if (!$this->hasData($key)) { - $value = Mage::getStoreConfig('payment/ideal_advanced/'.$key); - if (is_null($value) || false===$value) { - $value = $default; - } - $this->setData($key, $value); - } - return $this->getData($key); - } - - /** - * this method processes a request regardless of the type. - */ - - public function processRequest($requestType, $debug = false) - { - if($requestType instanceof Mage_Ideal_Model_Api_Advanced_DirectoryRequest) { - $response = $this->processDirRequest($requestType); - } else if($requestType instanceof Mage_Ideal_Model_Api_Advanced_AcquirerStatusRequest) { - $response = $this->processStatusRequest($requestType); - } else if($requestType instanceof Mage_Ideal_Model_Api_Advanced_AcquirerTrxRequest) { - $response = $this->processTrxRequest($requestType); - } - - if ($debug && $this->getPaymentModel()) { - - if ($response === false) { - $responseData = $this->getError(); - } else { - $responseData = $response->getData(); - } - - $this->getPaymentModel()->debugData(array( - 'request' => $requestType->getData(), - 'result' => $responseData - )); - } - - return $response; - } - - /** - * This method sends HTTP XML DirectoryRequest to the Acquirer system. - * Befor calling, all mandatory properties have to be set in the Request object - * by calling the associated setter methods. - * If the request was successful, the response Object is returned. - * @param Request Object filled with necessary data for the XML Request - * @return Response Object with the data of the XML response. - */ - public function processDirRequest($request) - { - if ($request->getMerchantId() == "") { - $request->setMerchantId($this->_conf["MERCHANTID"]); - } - - if ($request->getSubId() == "") { - $request->setSubId($this->_conf["SUBID"]); - } - - if ($request->getAuthentication() == "") { - $request->setAuthentication($this->_conf["AUTHENTICATIONTYPE"]); - } - - $res = new Mage_Ideal_Model_Api_Advanced_DirectoryResponse(); - - if (!$request->checkMandatory()) { - $res->setError(Mage::helper('ideal')->__('Required fields are missing.')); - return $res; - } - - // build concatenated string - $timestamp = $this->getGMTTimeMark(); - $token = ""; - $tokenCode = ""; - - if ("SHA1_RSA" == $request->getAuthentication()) { - $message = $timestamp . $request->getMerchantId() . $request->getSubId(); - $message = $this->_strip($message); - - //build fingerprint of your own certificate - $token = $this->_security->createCertFingerprint($this->_conf["PRIVATECERT"]); - - //sign the part of the message that need to be signed - $tokenCode = $this->_security->signMessage($this->_conf["PRIVATEKEY"], $this->_conf["PRIVATEKEYPASS"], $message); - - //encode with base64 - $tokenCode = base64_encode($tokenCode); - } - - $reqMsg = "\n" - . "\n" - . "" . utf8_encode( $timestamp ) . "\n" - . "\n" - . "" . utf8_encode( htmlspecialchars( $request->getMerchantId() ) ) . "\n" - . "" . utf8_encode( $request->getSubId() ) . "\n" - . "" . utf8_encode( $request->getAuthentication() ) . "\n" - . "" . utf8_encode( $token ) . "\n" - . "" . utf8_encode( $tokenCode ) . "\n" - . "\n" - . ""; - - $response = $this->_post($this->_conf["ACQUIRERURL"], $this->_conf["ACQUIRERTIMEOUT"], $reqMsg); - - if ($response === false) { - return false; - } - - $xml = new SimpleXMLElement($response); - - if(!$xml->Error) { - $res->setOk(true); - $res->setAcquirer($xml->Acquirer->acquirerID); - $issuerArray = array(); - foreach ($xml->Directory->Issuer as $issuer) { - $issuerArray[(string)$issuer->issuerID] = (string)$issuer->issuerName; - } - $res->setIssuerList($issuerArray); - return $res; - } else { - $this->setError($xml->Error->consumerMessage); - return false; - } - } - - /** - * This method sends HTTP XML AcquirerTrxRequest to the Acquirer system. - * Befor calling, all mandatory properties have to be set in the Request object - * by calling the associated setter methods. - * If the request was successful, the response Object is returned. - * @param Request Object filled with necessary data for the XML Request - * @return Response Object with the data of the XML response. - */ - public function processTrxRequest($request) { - - if ($request->getMerchantId() == "") - $request->setMerchantId($this->_conf["MERCHANTID"]); - if ($request->getSubId() == "") - $request->setSubId($this->_conf["SUBID"]); - if ($request->getAuthentication() == "") - $request->setAuthentication($this->_conf["AUTHENTICATIONTYPE"]); - if ($request->getMerchantReturnUrl() == "") - $request->setMerchantReturnUrl($this->_conf["MERCHANTRETURNURL"]); - if ($request->getCurrency() == "") - $request->setCurrency($this->_conf["CURRENCY"]); - if ($request->getExpirationPeriod() == "") - $request->setExpirationPeriod($this->_conf["EXPIRATIONPERIOD"]); - if ($request->getLanguage() == "") - $request->setLanguage($this->_conf["LANGUAGE"]); - if ($request->getEntranceCode() == "") - $request->setEntranceCode($this->_conf["ENTRANCECODE"]); - if ($request->getDescription() == "") - $request->setDescription($this->_conf["DESCRIPTION"]); - - $res = new Mage_Ideal_Model_Api_Advanced_AcquirerTrxResponse(); - - if (!$request->checkMandatory()) { - $res->setError(Mage::helper('ideal')->__('Required fields are missing.')); - return $res; - } - - // build concatenated string - $timestamp = $this->getGMTTimeMark(); - $token = ""; - $tokenCode = ""; - if ( "SHA1_RSA" == $request->getAuthentication() ) { - $message = $timestamp - . $request->getIssuerId() - . $request->getMerchantId() - . $request->getSubId() - . $request->getMerchantReturnUrl() - . $request->getPurchaseId() - . $request->getAmount() - . $request->getCurrency() - . $request->getLanguage() - . $request->getDescription() - . $request->getEntranceCode(); - $message = $this->_strip($message); - - //create fingerprint so the receiver knows what certificate to use - $token = $this->_security->createCertFingerprint($this->_conf["PRIVATECERT"]); - - //sign the message - $tokenCode = $this->_security->signMessage($this->_conf["PRIVATEKEY"], $this->_conf["PRIVATEKEYPASS"], $message); - //encode it with base64 - $tokenCode = base64_encode($tokenCode); - } - - $reqMsg = "\n" - . "\n" - . "" . utf8_encode($timestamp) . "\n" - . "" . "" . utf8_encode(htmlspecialchars($request->getIssuerId())) . "\n" - . "\n" - . "" . "" . utf8_encode(htmlspecialchars($request->getMerchantId())) . "\n" - . "" . utf8_encode($request->getSubId()) . "\n" - . "" . utf8_encode($request->getAuthentication()) . "\n" - . "" . utf8_encode($token) . "\n" - . "" . utf8_encode($tokenCode) . "\n" - . "" . utf8_encode(htmlspecialchars($request->getMerchantReturnUrl())) . "\n" - . "\n" - . "" . "" . utf8_encode(htmlspecialchars($request->getPurchaseId())) . "\n" - . "" . utf8_encode($request->getAmount()) . "\n" - . "" . utf8_encode($request->getCurrency()) . "\n" - . "" . utf8_encode($request->getExpirationPeriod()) . "\n" - . "" . utf8_encode($request->getLanguage()) . "\n" - . "" . utf8_encode(htmlspecialchars($request->getDescription())) . "\n" - . "" . utf8_encode(htmlspecialchars($request->getEntranceCode())) . "\n" - . "" . ""; - - $response = $this->_post($this->_conf["ACQUIRERURL"], $this->_conf["ACQUIRERTIMEOUT"], $reqMsg); - - if ($response === false) { - return false; - } - - $xml = new SimpleXMLElement($response); - - if(!$xml->Error) { - $issuerUrl = (string)$xml->Issuer->issuerAuthenticationURL; - $transactionId = (string)$xml->Transaction->transactionID; - $res->setIssuerAuthenticationUrl($issuerUrl); - $res->setTransactionId($transactionId); - $res->setOk(true); - return $res; - } else { - $this->setError($xml->Error->consumerMessage); - return false; - } - } - - /** - * This method sends HTTP XML AcquirerStatusRequest to the Acquirer system. - * Befor calling, all mandatory properties have to be set in the Request object - * by calling the associated setter methods. - * If the request was successful, the response Object is returned. - * @param Request Object filled with necessary data for the XML Request - * @return Response Object with the data of the XML response. - */ - public function processStatusRequest($request) - { - if ($request->getMerchantId() == "") - $request->setMerchantId($this->_conf["MERCHANTID"]); - if ($request->getSubId() == "") - $request->setSubId($this->_conf["SUBID"]); - if ($request->getAuthentication() == "") - $request->setAuthentication($this->_conf["AUTHENTICATIONTYPE"]); - - $res = new Mage_Ideal_Model_Api_Advanced_AcquirerStatusResponse(); - - if (!$request->checkMandatory()) { - $$request->setErrorMessage(Mage::helper('ideal')->__('Required fields are missing.')); - return $res; - } - - // build concatenated string - $timestamp = $this->getGMTTimeMark(); - $token = ""; - $tokenCode = ""; - if ("SHA1_RSA" == $request->getAuthentication()) { - $message = $timestamp . $request->getMerchantId() . $request->getSubId() . $request->getTransactionId(); - $message = $this->_strip($message); - - //create fingerprint of your own certificate - $token = $this->_security->createCertFingerprint($this->_conf["PRIVATECERT"]); - //sign the message - $tokenCode = $this->_security->signMessage( $this->_conf["PRIVATEKEY"], $this->_conf["PRIVATEKEYPASS"], $message ); - //encode with base64 - $tokenCode = base64_encode($tokenCode); - } - $reqMsg = "\n" - . "\n" - . "" . utf8_encode($timestamp) . "\n" - . "" . "" . utf8_encode(htmlspecialchars($request->getMerchantId())) . "\n" - . "" . utf8_encode($request->getSubId()) . "\n" - . "" . utf8_encode($request->getAuthentication()) . "\n" - . "" . utf8_encode($token) . "\n" - . "" . utf8_encode($tokenCode) . "\n" - . "\n" - . "" . "" . utf8_encode(htmlspecialchars($request->getTransactionId())) . "\n" - . "" . ""; - - $response = $this->_post($this->_conf["ACQUIRERURL"], $this->_conf["ACQUIRERTIMEOUT"], $reqMsg); - - if ($response === false) { - return false; - } - - //Process response - $xml = new SimpleXMLElement($response); - $status = (string)$xml->Transaction->status; - $creationTime = (string)$xml->createDateTimeStamp; - $transactionId = (string)$xml->Transaction->transactionID; - $consumerAccountNumber = (string)$xml->Transaction->consumerAccountNumber; - $consumerName = (string)$xml->Transaction->consumerName; - $consumerCity = (string)$xml->Transaction->consumerCity; - - //Check status - if ( strtoupper('Success') == strtoupper($status) ) { - $res->setAuthenticated(true); - } else { - $res->setAuthenticated(false); - } - - $res->setTransactionStatus($status); - $res->setTransactionId($transactionId); - $res->setConsumerAccountNumber($consumerAccountNumber); - $res->setConsumerName($consumerName); - $res->setConsumerCity($consumerCity); - $res->setCreationTime($creationTime); - - // now check the signature of the incoming message - //create signed message string - $message = $creationTime . $transactionId . $status . $consumerAccountNumber; - $message = trim( $message ); - - //now we want to check the signature that has been sent - $signature64 = (string)$xml->Signature->signatureValue; - - //decode the base64 encoded signature - $sig = base64_decode($signature64); - - //get the fingerprint out of the response - $fingerprint = (string)$xml->Signature->fingerprint; - - //search for the certificate file with the given fingerprint - $certfile = $this->_security->getCertificateName($fingerprint, $this->_conf); - - if($certfile == false) { - $res->setAuthenticated(false); - $res->setError('Fingerprint unknown.'); - return $res; - } - - //prepend directory - $valid = $this->_security->verifyMessage($certfile, $message, $sig); - - if( $valid != 1 ) { - $res->setAuthenticated(false); - $res->setError('Bad signature.'); - return $res; - } - - $res->setOk(true); - return $res; - } - - /** - * Return GMT Time mark - * - * @return string - */ - public function getGMTTimeMark() - { - return gmdate('Y') . '-' . gmdate('m') . '-' . gmdate('d') . 'T' - . gmdate('H') . ':' . gmdate('i') . ':' . gmdate('s') . '.000Z'; - } - - /** - * Post a request, note that for a HTTPS URL no port is required - * - * @param string $url - * @param string $path - * @param array $params - * @return mixed - */ - protected function _post($url, $timeout, $dataToSend) - { - $config = array('timeout' => 30); - $this->_http->setConfig($config); - $this->_http->write(Zend_Http_Client::POST, $url, '1.1', array(), $dataToSend); - $response = $this->_http->read(); - $response = preg_split('/^\r?$/m', $response, 2); - $response = trim($response[1]); - - if ($this->_http->getErrno()) { - $this->_http->close(); - $this->setError($this->_http->getErrno() . ':' . $this->_http->getError()); - return false; - } - $this->_http->close(); - return $response; - } - - /** - * stripping spaces - * - * @param string $message - * @return string - */ - protected function _strip($message) - { - $message = str_replace(' ', '', $message); - $message = str_replace("\t", '', $message); - $message = str_replace("\n", '', $message ); - return $message; - } -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusRequest.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusRequest.php deleted file mode 100755 index 76646a91cc..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusRequest.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_AcquirerStatusRequest extends Mage_Ideal_Model_Api_Advanced_Request -{ - /** - * rests all input data to empty strings - */ - function clear() - { - parent::clear(); - $this->unsTransactionId(); - } - - /** - * this method checks, wheather all mandatory properties were set. - * If done so, true is returned, otherwise false. - * @return If done so, true is returned, otherwise false. - */ - function checkMandatory() - { - if (parent::checkMandatory() && strlen($this->getTransactionId()) > 0) { - return true; - } else { - return false; - } - - } - -} - diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusResponse.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusResponse.php deleted file mode 100755 index a517dd93bf..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerStatusResponse.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_AcquirerStatusResponse extends Mage_Ideal_Model_Api_Advanced_Response -{ - /* available vars - var $authenticated - var $consumerName - var $consumerAccountNumber - var $consumerCity - var $transactionId - var $status - */ -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxRequest.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxRequest.php deleted file mode 100755 index 31def2e677..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxRequest.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_AcquirerTrxRequest extends Mage_Ideal_Model_Api_Advanced_Request -{ - /* fields for request xml message - var $issuerId (mandatory) - var $merchantReturnUrl (mandatory) - var $purchaseId (mandatory) - var $amount (mandatory) - var $currency (mandatory) - var $expirationPeriod (mandatory) - var $language (mandatory) - var $description (optional) - var $entranceCode (mandatory) - */ - - function clear() { - parent::clear(); - $this->unsIssuerId(); - $this->unsMerchantReturnUrl(); - $this->unsPurchaseId(); - $this->unsAmount(); - $this->unsCurrency(); - $this->unsExpirationPeriod(); - $this->unsLanguage(); - $this->unsDescription(); - $this->unsEntranceCode(); - } - - /** - * this method checks, whether all mandatory properties were set. - * If done so, true is returned, otherwise false. - * @return If done so, true is returned, otherwise false. - */ - function checkMandatory () { - if ((parent::checkMandatory() == true) - && (strlen($this->getIssuerId()) > 0) - && (strlen($this->getMerchantReturnUrl()) > 0) - && (strlen($this->getPurchaseID()) > 0) - && (strlen($this->getAmount()) > 0) - && (strlen($this->getCurrency()) > 0) - && (strlen($this->getExpirationPeriod()) > 0) - && (strlen($this->getLanguage()) > 0) - && (strlen($this->getEntranceCode()) > 0) - && (strlen($this->getDescription()) > 0) - ) { - return true; - } else { - return false; - } - } - -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxResponse.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxResponse.php deleted file mode 100755 index 627e2b2963..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/AcquirerTrxResponse.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_AcquirerTrxResponse extends Mage_Ideal_Model_Api_Advanced_Response -{ - /* - var $acquirerId; - var $issuerAuthenticationUrl; - var $transactionId; - */ -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryRequest.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryRequest.php deleted file mode 100755 index 349ce4df2a..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryRequest.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_DirectoryRequest extends Mage_Ideal_Model_Api_Advanced_Request{ - -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryResponse.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryResponse.php deleted file mode 100755 index 476b451705..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/DirectoryResponse.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_DirectoryResponse extends Mage_Ideal_Model_Api_Advanced_Response { - /* - var $acquirerId - var $issuerList - array of Issuer Objects - */ - - /** - * adds an Issuer to the IssuerList - */ - function addIssuer($issuer) { - if(is_a($issuer, "Mage_Ideal_Api_Advanced_Issuer")) { - $this->setIssuerList(array_merge((array)$this->getIssuerList(), (array)$issuer)); - } - } -} - -?> diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/Issuer.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/Issuer.php deleted file mode 100755 index fda1f072d9..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/Issuer.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_Issuer extends Varien_Object -{ - /* - var $issuerID - var $issuerName - var $issuerList ("Short", "Long") - */ -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/Request.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/Request.php deleted file mode 100755 index c4ef046672..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/Request.php +++ /dev/null @@ -1,80 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_Request extends Varien_Object -{ - /** - * clears all parameters - */ - public function clear() { - $this->unsMerchantId(); - $this->unsSubId(); - $this->unsAuthentication(); - } - - /** - * this method checks, whether all mandatory properties are set. - * @return true if all fields are valid, otherwise returns false - */ - function checkMandatory () { - if (strlen($this->getMerchantId()) > 0 - && strlen($this->getSubID()) > 0 - && strlen($this->getAuthentication()) > 0) { - return true; - } else { - return false; - } - } - - /** - * @param authentication The type of authentication to set. - * Currently only "RSA_SHA1" is implemented. (mandatory) - */ - function setAuthentication($authentication) { - $this->setData('authentication', trim($authentication)); - } - - /** - * @param merchantID The merchantID to set. (mandatory) - */ - function setMerchantId($merchantID) { - $this->setData('merchant_id', trim($merchantID)); - } - - /** - * @param subID The subID to set. (mandatory) - */ - function setSubId($subID) { - $this->setData('sub_id', trim($subID)); - } -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/Response.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/Response.php deleted file mode 100755 index 2f0d45e6f4..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/Response.php +++ /dev/null @@ -1,54 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_Response extends Varien_Object -{ - /* available vars - var $ok - var $errorMessage - var $errorCode - var $errorDetail - var $suggestedAction - var $suggestedExpirationPeriod - var $consumerMessage - */ - - /** - * @return true, if the request was processed successfully, otherwise false. If - * false, additional information can be received calling getErrorMessage() - */ - - function isOk() { - return $this->ok; - } -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Advanced/Security.php b/app/code/core/Mage/Ideal/Model/Api/Advanced/Security.php deleted file mode 100755 index ba5ee140b5..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Advanced/Security.php +++ /dev/null @@ -1,155 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Advanced_Security -{ - /** - * reads in a certificate file and creates a fingerprint - * @param Filename of the certificate - * @return fingerprint - */ - function createCertFingerprint($filename) - { - if(is_readable($filename)) { - $cert = file_get_contents($filename); - } else { - return false; - } - - $data = openssl_x509_read($cert); - - if(!openssl_x509_export($data, $data)) { - - return false; - } - - $data = str_replace("-----BEGIN CERTIFICATE-----", "", $data); - $data = str_replace("-----END CERTIFICATE-----", "", $data); - - $data = base64_decode($data); - - $fingerprint = sha1($data); - - $fingerprint = strtoupper( $fingerprint ); - - return $fingerprint; - } - - /** - * function to sign a message - * @param filename of the private key - * @param message to sign - * @return signature - */ - function signMessage($priv_keyfile, $key_pass, $data) - { - $data = preg_replace("/\s/","",$data); - if (is_readable($priv_keyfile)) { - $priv_key = file_get_contents($priv_keyfile); - - $params = array($priv_key, $key_pass); - $pkeyid = openssl_pkey_get_private($params); - - // compute signature - openssl_sign($data, $signature, $pkeyid); - - // free the key from memory - openssl_free_key($pkeyid); - - return $signature; - } else { - return false; - } - } - - /** - * function to verify a message - * @param filename of the public key to decrypt the signature - * @param message to verify - * @param sent signature - * @return signature - */ - function verifyMessage($certfile, $data, $signature) - { - // $data and $signature are assumed to contain the data and the signature - $ok = 0; - if (is_readable($certfile)) { - $cert = file_get_contents($certfile); - } else { - return false; - } - - $pubkeyid = openssl_get_publickey($cert); - - // state whether signature is okay or not - $ok = openssl_verify($data, $signature, $pubkeyid); - - // free the key from memory - openssl_free_key($pubkeyid); - - return $ok; - } - - /** - * @param fingerprint that's been sent - * @param the configuration file loaded in as an array - * @return the filename of the certificate with this fingerprint - */ - function getCertificateName($fingerprint, $config) - { - $count = 0; - - if (isset($config["CERTIFICATE" . $count])) { - $certFilename = $config["CERTIFICATE" . $count]; - } else { - return false; - } - - while( isset($certFilename) ) { - $buff = $this->createCertFingerprint($certFilename); - - if( $fingerprint == $buff ) { - return $certFilename; - } - - $count+=1; - if (isset($config["CERTIFICATE" . $count])) { - $certFilename = $config["CERTIFICATE" . $count]; - } else { - return false; - } - } - - return false; - } -} diff --git a/app/code/core/Mage/Ideal/Model/Api/Debug.php b/app/code/core/Mage/Ideal/Model/Api/Debug.php deleted file mode 100644 index e2a4c373ed..0000000000 --- a/app/code/core/Mage/Ideal/Model/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Ideal_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('ideal/api_debug'); - } -} diff --git a/app/code/core/Mage/Ideal/Model/Basic.php b/app/code/core/Mage/Ideal/Model/Basic.php deleted file mode 100755 index e54abc185b..0000000000 --- a/app/code/core/Mage/Ideal/Model/Basic.php +++ /dev/null @@ -1,220 +0,0 @@ - - */ - -class Mage_Ideal_Model_Basic extends Mage_Payment_Model_Method_Abstract -{ - protected $_code = 'ideal_basic'; - protected $_formBlockType = 'ideal/basic_form'; - protected $_allowCurrencyCode = array('EUR', 'GBP', 'USD', 'CAD', 'SHR', 'NOK', 'SEK', 'DKK'); - - protected $_isGateway = false; - protected $_canAuthorize = false; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = false; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = false; - - /** - * @deprecated after 1.4.1.0 - * - * @return boolean - */ - public function getDebug() - { - return $this->getDebugFlag(); - } - - /** - * validate the currency code is avaialable to use for iDEAL Basic or not - * - * @return bool - */ - public function validate() - { - parent::validate(); - $paymentInfo = $this->getInfoInstance(); - if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { - $currency_code = $paymentInfo->getOrder()->getBaseCurrencyCode(); - } else { - $currency_code = $paymentInfo->getQuote()->getBaseCurrencyCode(); - } - if (!in_array($currency_code, $this->_allowCurrencyCode)) { - Mage::throwException(Mage::helper('ideal')->__('Selected currency code (%s) is not compatible with iDEAL.', $currency_code)); - } - return $this; - } - - public function getOrderPlaceRedirectUrl() - { - return Mage::getUrl('ideal/basic/redirect', array('_secure' => true)); - } - - /** - * Return iDEAL Basic Api Url - * - * @return string Payment API URL - */ - public function getApiUrl() - { - if ($this->getConfigData('test_flag') == 1) { - if (($url = trim($this->getConfigData('api_test_url'))) == '') { - $url = "https://idealtest.secure-ing.com/ideal/mpiPayInitIng.do"; - } - } else { - if (($url = trim($this->getConfigData('api_url'))) == '') { - $url = "https://ideal.secure-ing.com/ideal/mpiPayInitIng.do"; - } - } - return $url; - } - - /** - * Generates array of fields for redirect form - * - * @return array - */ - public function getBasicCheckoutFormFields() - { - $order = $this->getInfoInstance()->getOrder(); - - $shippingAddress = $order->getShippingAddress(); - $currency_code = $order->getBaseCurrencyCode(); - - $fields = array( - 'merchantID' => $this->getConfigData('merchant_id'), - 'subID' => '0', - 'amount' => round($order->getBaseGrandTotal()*100), - 'purchaseID' => $order->getIncrementId(), - 'paymentType' => 'ideal', - 'validUntil' => date('Y-m-d\TH:i:s.000\Z', strtotime ('+1 week')) // plus 1 week - ); - - $i = 1; - foreach ($order->getItemsCollection() as $item) { - $fields = array_merge($fields, array( - "itemNumber".$i => $item->getSku(), - "itemDescription".$i => $item->getName(), - "itemQuantity".$i => $item->getQtyOrdered()*1, - "itemPrice".$i => round($item->getBasePrice()*100) - )); - $i++; - } - - if ($order->getBaseShippingAmount() > 0) { - $fields = array_merge($fields, array( - "itemNumber".$i => $order->getShippingMethod(), - "itemDescription".$i => $order->getShippingDescription(), - "itemQuantity".$i => 1, - "itemPrice".$i => round($order->getBaseShippingAmount()*100) - )); - $i++; - } - - if ($order->getBaseTaxAmount() > 0) { - $fields = array_merge($fields, array( - "itemNumber".$i => 'Tax', - "itemDescription".$i => '', - "itemQuantity".$i => 1, - "itemPrice".$i => round($order->getBaseTaxAmount()*100) - )); - $i++; - } - - if ($order->getBaseDiscountAmount() > 0) { - $fields = array_merge($fields, array( - "itemNumber".$i => 'Discount', - "itemDescription".$i => '', - "itemQuantity".$i => 1, - "itemPrice".$i => -round($order->getBaseDiscountAmount()*100) - )); - $i++; - } - - $fields = $this->appendHash($fields); - - $description = $this->getConfigData('description'); - if ($description == '') { - $description = Mage::app()->getStore()->getFrontendName() . ' ' . 'payment'; - } - - $fields = array_merge($fields, array( - 'language' => $this->getConfigData('language'), - 'currency' => $currency_code, - 'description' => $description, - 'urlCancel' => Mage::getUrl('ideal/basic/cancel', array('_secure' => true)), - 'urlSuccess' => Mage::getUrl('ideal/basic/success', array('_secure' => true)), - 'urlError' => Mage::getUrl('ideal/basic/failure', array('_secure' => true)) - )); - - $returnArray = array(); - foreach ($fields as $k=>$v) { - $returnArray[$k] = $v; - } - - $this->_debug(array('request' => $returnArray)); - - return $returnArray; - } - - /** - * Calculates and appends hash to form fields - * - * @param array $returnArray - * @return array - */ - public function appendHash($returnArray) - { - $merchantKey = $this->getConfigData('merchant_key'); - $hashString = $merchantKey.implode('', $returnArray); - $hashString = str_replace( - array(" ", "\t", "\n", "&", "<", ">", ""e;"), - array("", "", "", "&", "<", ">", "\""), - $hashString); - $hash = sha1($hashString); - return array_merge($returnArray, array('hash' => $hash)); - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug.php deleted file mode 100644 index 3191cc9b60..0000000000 --- a/app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - -class Mage_Ideal_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('ideal/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index abf52c128b..0000000000 --- a/app/code/core/Mage/Ideal/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Ideal_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('ideal/api_debug'); - } -} diff --git a/app/code/core/Mage/Ideal/Model/Mysql4/Setup.php b/app/code/core/Mage/Ideal/Model/Mysql4/Setup.php deleted file mode 100755 index da622e9a7e..0000000000 --- a/app/code/core/Mage/Ideal/Model/Mysql4/Setup.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class Mage_Ideal_Model_Observer -{ - /** - * Convert specific attributes from Quote Payment to Order Payment - * - * @param Varien_Object $observer - * @return Mage_Ideal_Model_Observer - */ - public function convertPayment($observer) - { - $orderPayment = $observer->getEvent()->getOrderPayment(); - $quotePayment = $observer->getEvent()->getQuotePayment(); - $orderPayment->setIdealIssuerId($quotePayment->getIdealIssuerId()); - - if ($quotePayment->getIdealIssuerId()) { - $issuerList = unserialize($quotePayment->getIdealIssuerList()); - if (isset($issuerList[$quotePayment->getIdealIssuerId()])) { - $orderPayment->setIdealIssuerTitle( - $issuerList[$quotePayment->getIdealIssuerId()] - ); - } - } - return $this; - } -} diff --git a/app/code/core/Mage/Ideal/Model/Source/Language.php b/app/code/core/Mage/Ideal/Model/Source/Language.php deleted file mode 100644 index 1c0c4682e1..0000000000 --- a/app/code/core/Mage/Ideal/Model/Source/Language.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ - -class Mage_Ideal_Model_Source_Language -{ - public function toOptionArray() - { - return array( - array('value' => 'en', 'label' => Mage::helper('ideal')->__('English')), - array('value' => 'nl', 'label' => Mage::helper('ideal')->__('Dutch')) - ); - } -} - - - diff --git a/app/code/core/Mage/Ideal/controllers/AdvancedController.php b/app/code/core/Mage/Ideal/controllers/AdvancedController.php deleted file mode 100755 index 5c269f9e3c..0000000000 --- a/app/code/core/Mage/Ideal/controllers/AdvancedController.php +++ /dev/null @@ -1,195 +0,0 @@ - - */ - -class Mage_Ideal_AdvancedController extends Mage_Core_Controller_Front_Action -{ - public function getCheckout() - { - return Mage::getSingleton('checkout/session'); - } - - /** - * When a customer chooses iDEAL Advanced on Checkout/Payment page - * - */ - public function redirectAction() - { - $order = Mage::getModel('sales/order'); - $order->load($this->getCheckout()->getLastOrderId()); - if($order->getId()){ - $advanced = $order->getPayment()->getMethodInstance(); - $issuerId = $order->getPayment()->getIdealIssuerId(); - - $response = $advanced->sendTransactionRequest($order, $issuerId); - - if ($response) { - $order->getPayment()->setTransactionId($response->getTransactionId()); - $order->getPayment()->setLastTransId($response->getTransactionId()); - $order->getPayment()->setIdealTransactionChecked(0); - - if ($response->getError()) { - $this->getCheckout()->setIdealErrorMessage($response->getError()); - $this->_redirect('*/*/failure'); - return; - } - - $this->getResponse()->setBody( - $this->getLayout()->createBlock('ideal/advanced_redirect') - ->setMessage($this->__('You will be redirected to bank in a few seconds.')) - ->setRedirectUrl($response->getIssuerAuthenticationUrl()) - ->toHtml() - ); - - $order->addStatusToHistory( - $order->getStatus(), - $this->__('The customer was redirected to iDEAL.') - ); - $order->save(); - - $this->getCheckout()->setIdealAdvancedQuoteId($this->getCheckout()->getQuoteId(true)); - $this->getCheckout()->setIdealAdvancedOrderId($this->getCheckout()->getLastOrderId(true)); - - - return; - } - } - - $this->getResponse()->setBody( - $this->getLayout()->createBlock('ideal/advanced_redirect') - ->setMessage($this->__('An error has occurred. You will be redirected back to store.')) - ->setRedirectUrl(Mage::getUrl('checkout/cart')) - ->toHtml() - ); - } - - /** - * When a customer cancels payment from iDEAL - */ - public function cancelAction() - { - $order = Mage::getModel('sales/order'); - $this->getCheckout()->setLastOrderId($this->getCheckout()->getIdealAdvancedOrderId(true)); - $order->load($this->getCheckout()->getLastOrderId()); - - if (!$order->getId()) { - $this->norouteAction(); - return; - } - - $order->addStatusToHistory( - $order->getStatus(), - $this->__('The customer canceled payment.') - ); - $order->cancel(); - $order->save(); - - $$this->getCheckout()->setQuoteId($$this->getCheckout()->setIdealAdvancedQuoteId(true)); - $this->_redirect('checkout/cart'); - } - - /** - * When customer return from iDEAL - */ - public function resultAction() - { - /** - * Decrypt Real Order Id that was sent encrypted - */ - $orderId = Mage::helper('ideal')->decrypt($this->getRequest()->getParam('ec')); - $transactionId = $this->getRequest()->getParam('trxid'); - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($orderId); - - if ($order->getId() > 0) { - $advanced = $order->getPayment()->getMethodInstance(); - $advanced->setTransactionId($transactionId); - $response = $advanced->getTransactionStatus($transactionId); - - $this->getCheckout()->setQuoteId($this->getCheckout()->getIdealAdvancedQuoteId(true)); - $this->getCheckout()->setLastOrderId($this->getCheckout()->getIdealAdvancedOrderId(true)); - - if ($response->getTransactionStatus() == Mage_Ideal_Model_Api_Advanced::STATUS_SUCCESS) { - $this->getCheckout()->getQuote()->setIsActive(false)->save(); - - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - - $order->addStatusToHistory($order->getStatus(), Mage::helper('ideal')->__('Customer has successfully returned from iDEAL.')); - } - - $order->sendNewOrderEmail(); - - $this->_redirect('checkout/onepage/success'); - } else if ($response->getTransactionStatus() == Mage_Ideal_Model_Api_Advanced::STATUS_CANCELLED) { - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), Mage::helper('ideal')->__('Customer has canceled payment.')); - - $this->_redirect('checkout/cart'); - } else { - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), Mage::helper('ideal')->__('Customer was rejected by iDEAL.')); - $this->getCheckout()->setIdealErrorMessage( - Mage::helper('ideal')->__('An error occurred while processing your iDEAL transaction. Please contact the web shop or try -again later. Transaction number is %s.', $order->getIncrementId()) - ); - - $this->_redirect('*/*/failure'); - } - $order->getPayment()->setIdealTransactionChecked(1); - $order->save(); - } else { - $this->_redirect('checkout/cart'); - } - } - - /** - * Redirected here when customer returns with error - */ - public function failureAction() - { - if (!$this->getCheckout()->getIdealErrorMessage()) { - $this->norouteAction(); - return; - } - - $this->loadLayout(); - $this->renderLayout(); - } -} diff --git a/app/code/core/Mage/Ideal/controllers/BasicController.php b/app/code/core/Mage/Ideal/controllers/BasicController.php deleted file mode 100755 index 761c13e9a4..0000000000 --- a/app/code/core/Mage/Ideal/controllers/BasicController.php +++ /dev/null @@ -1,247 +0,0 @@ - - */ -class Mage_Ideal_BasicController extends Mage_Core_Controller_Front_Action -{ - - /** - * Return order instance for last real order ID (stored in session) - * - * @return Mage_Sales_Model_Entity_Order object - */ - protected function _getOrder () - { - $order = Mage::getModel('sales/order'); - $order->load(Mage::getSingleton('checkout/session')->getLastOrderId()); - - if (!$order->getId()) { - return false; - } - - return $order; - } - - /** - * When a customer chooses iDEAL Basic on Checkout/Payment page - */ - public function redirectAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setIdealBasicQuoteId($session->getQuoteId()); - $session->setIdealBasicOrderId($session->getLastOrderId()); - - if (!($order = $this->_getOrder())) { - $this->norouteAction(); - return; - } - $order->addStatusToHistory( - $order->getStatus(), - $this->__('Customer was redirected to iDEAL. Please, check the status of the transaction via the ING iDEAL Dashboard before delivery of the goods purchased.') - ); - $order->save(); - - $this->getResponse()->setBody( - $this->getLayout()->createBlock('ideal/basic_redirect') - ->setOrder($order) - ->toHtml() - ); - $session->unsQuoteId(); - $session->unsLastOrderId(); - } - - /** - * Success response from iDEAL - */ - public function successAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setLastOrderId($session->getIdealBasicOrderId(true)); - - $order = $this->_getOrder(); - if (!$order->getId()) { - $this->norouteAction(); - return false; - } - - $session->setQuoteId($session->getIdealBasicQuoteId(true)); - - $order->addStatusToHistory( - $order->getStatus(), - $this->__('Customer has successfully returned from iDEAL.') - ); - - $order->sendNewOrderEmail(); - - $this->_saveInvoice($order); - - $order->save(); - - $this->_redirect('checkout/onepage/success'); - } - - /** - * Cancel response from iDEAL - */ - public function cancelAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setLastOrderId($session->getIdealBasicOrderId(true)); - - $order = $this->_getOrder(); - if (!$order->getId()) { - $this->norouteAction(); - return false; - } - - $order->cancel(); - - $history = $this->__('Payment was canceled by the customer.'); - - $order->addStatusToHistory( - $order->getStatus(), - $history - ); - - $order->save(); - - $session->setQuoteId($session->getIdealBasicQuoteId(true)); - - $this->_redirect('checkout/cart'); - } - - - /** - * Error response from iDEAL - */ - public function failureAction () - { - $session = Mage::getSingleton('checkout/session'); - $session->setLastOrderId($session->getIdealBasicOrderId(true)); - - $order = $this->_getOrder(); - - if (!$order->getId()) { - $this->norouteAction(); - return false; - } - - $order->cancel(); - - $history = $this->__('An error has occurred with the transaction #%s.', $order->getIncrementId()) . ' ' - . $this->__('The customer has returned from iDEAL.'); - - $order->addStatusToHistory( - $order->getStatus(), - $history - ); - - $order->save(); - - $session->setQuoteId($session->getIdealBasicQuoteId(true)); - $session->setIdealErrorMessage($this->__('An error occurred while processing your iDEAL transaction. Please contact the web shop or try again later. The transaction number is %s.', $order->getIncrementId())); - - $this->loadLayout(); - $this->renderLayout(); - - } - - /** - * Notification action that calling by iDEAL - * - */ - public function notifyAction() - { - if (isset($HTTP_RAW_POST_DATA)) { - $xmlResponse = $HTTP_RAW_POST_DATA; - } else { - $xmlResponse = file_get_contents("php://input"); - } - - if (!strlen($xmlResponse)) { - $this->norouteAction(); - return; - } - - $xmlObj = simplexml_load_string($xmlResponse); - $status = (string)$xmlObj->status; - - $order = Mage::getModel('sales/order') - ->loadByIncrementId((int)$xmlObj->purchaseID); - - if (!$order->getId()) { - return; - } - - if ($status == 'Success') { - if (!$order->hasInvoices()) { - $this->_saveInvoice($order); - $order->addStatusToHistory($order->getStatus(), - $this->__('Notification from iDEAL was received with status %s. The invoice was created. Please check the status of a transaction via the ING iDEAL Dashboard before delivery of the goods purchased.', $status) - ); - } else { - $order->addStatusToHistory($order->getStatus(), - $this->__('Notification from iDEAL was received with status %s.', $status) - ); - } - } else { - $order->addStatusToHistory($order->getStatus(), - $this->__('Notification from iDEAL was received with status %s.', $status) - ); - $order->cancel(); - } - - $order->save(); - } - - /** - * Save invoice for order - * - * @param Mage_Sales_Model_Order $order - * @return boolean Can save invoice or not - */ - protected function _saveInvoice(Mage_Sales_Model_Order $order) - { - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - return true; - } - return false; - } - -} diff --git a/app/code/core/Mage/Ideal/etc/config.xml b/app/code/core/Mage/Ideal/etc/config.xml deleted file mode 100755 index b102498ee1..0000000000 --- a/app/code/core/Mage/Ideal/etc/config.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - 0.1.0 - - - - - - Mage_Ideal_Model - ideal_mysql4 - - - Mage_Ideal_Model_Mysql4 - - ideal_api_debug
-
-
-
- - - - Mage_Ideal - Mage_Ideal_Model_Mysql4_Setup - - - - - Mage_Ideal_Block - -
- - - /ideal/advanced - /ideal/basic - - - - standard - - Mage_Ideal - ideal - - - - - - - - Mage_Ideal.csv - - - - - - - - ideal.xml - - - - - - - - ideal/observer - convertPayment - - - - - - - - - - - Mage_Ideal.csv - - - - - - - - - ideal/basic - iDEAL Basic - 0 - - - ideal/advanced - iDEAL Advanced - 0 - 10 - 1 - 1 - - - - - - - 0 */1 * * * - ideal/advanced::transactionStatusCheck - - - -
diff --git a/app/code/core/Mage/Ideal/etc/system.xml b/app/code/core/Mage/Ideal/etc/system.xml deleted file mode 100755 index 7a8027d568..0000000000 --- a/app/code/core/Mage/Ideal/etc/system.xml +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - text - 301 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 0 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>10</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - text - 20 - 1 - 1 - 0 - - - - text - 30 - 1 - 1 - 0 - - - - Leave empty for default value. - text - 30 - 1 - 1 - 0 - - - - Leave empty for default value. - text - 30 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 40 - 1 - 1 - 0 - - - - Store name will be used if left empty. - text - 50 - 1 - 1 - 0 - - - - select - ideal/source_language - 60 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 70 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 80 - 1 - 1 - 0 - - - - allowspecific - 90 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 100 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 110 - 1 - 1 - 0 - - - - - - text - 302 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 0 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>10</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - text - 20 - 1 - 1 - 0 - - - - Absolute path to private key file. - text - 30 - 1 - 1 - 0 - - - - text - 40 - 1 - 1 - 0 - - - - Absolute path to private certificate file. - text - 30 - 1 - 1 - 0 - - - - Absolute path to public payment provider certificate file. - text - 50 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 60 - 1 - 1 - 0 - - - - Store name will be used if left empty. - text - 70 - 1 - 1 - 0 - - - - In minutes. Minimum is 1 minute and maximum is 60. - text - 80 - 1 - 1 - 0 - - - - Begin to check transaction status if order was made {N} hours ago. - text - 90 - 1 - 1 - 0 - - - - Do not check transaction status if order older than {N} days. - text - 100 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 110 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 120 - 1 - 1 - 0 - - - - allowspecific - 130 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 140 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 150 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Ideal/sql/ideal_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Ideal/sql/ideal_setup/mysql4-install-0.1.0.php deleted file mode 100755 index 042f0a21fc..0000000000 --- a/app/code/core/Mage/Ideal/sql/ideal_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,51 +0,0 @@ -startSetup(); - -$installer->run(" -DROP TABLE IF EXISTS `{$this->getTable('ideal/api_debug')}`; -CREATE TABLE `{$this->getTable('ideal/api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -"); - -$installer->endSetup(); - -$installer->addAttribute('quote_payment', 'ideal_issuer_id', array()); -$installer->addAttribute('quote_payment', 'ideal_issuer_list', array('type' => 'text')); -$installer->addAttribute('order_payment', 'ideal_issuer_id', array()); -$installer->addAttribute('order_payment', 'ideal_issuer_title', array()); -$installer->addAttribute('order_payment', 'ideal_transaction_checked', array('type'=>'int')); diff --git a/app/code/core/Mage/Ogone/Block/Form.php b/app/code/core/Mage/Ogone/Block/Form.php deleted file mode 100644 index 9c492af7a1..0000000000 --- a/app/code/core/Mage/Ogone/Block/Form.php +++ /dev/null @@ -1,39 +0,0 @@ -setTemplate('ogone/form.phtml'); - } -} diff --git a/app/code/core/Mage/Ogone/Block/Info.php b/app/code/core/Mage/Ogone/Block/Info.php deleted file mode 100644 index f711049f88..0000000000 --- a/app/code/core/Mage/Ogone/Block/Info.php +++ /dev/null @@ -1,41 +0,0 @@ -setTemplate('ogone/info.phtml'); - } -} diff --git a/app/code/core/Mage/Ogone/Block/Paypage.php b/app/code/core/Mage/Ogone/Block/Paypage.php deleted file mode 100644 index d687e92c76..0000000000 --- a/app/code/core/Mage/Ogone/Block/Paypage.php +++ /dev/null @@ -1,41 +0,0 @@ -setTemplate('ogone/paypage.phtml'); - return $this; - } -} diff --git a/app/code/core/Mage/Ogone/Block/Placeform.php b/app/code/core/Mage/Ogone/Block/Placeform.php deleted file mode 100644 index 7def5e8f2c..0000000000 --- a/app/code/core/Mage/Ogone/Block/Placeform.php +++ /dev/null @@ -1,90 +0,0 @@ -getOrder()) { - $order = $this->getOrder(); - } else if ($this->getCheckout()->getLastRealOrderId()) { - $order = Mage::getModel('sales/order')->loadByIncrementId($this->getCheckout()->getLastRealOrderId()); - } else { - return null; - } - return $order; - } - - /** - * Get Form data by using ogone payment api - * - * @return array - */ - public function getFormData() - { - return $this->_getApi()->getFormFields($this->_getOrder()); - } - - /** - * Getting gateway url - * - * @return string - */ - public function getFormAction() - { - return $this->_getApi()->getConfig()->getGatewayPath(); - } -} diff --git a/app/code/core/Mage/Ogone/Helper/Data.php b/app/code/core/Mage/Ogone/Helper/Data.php deleted file mode 100644 index 18364408b2..0000000000 --- a/app/code/core/Mage/Ogone/Helper/Data.php +++ /dev/null @@ -1,70 +0,0 @@ -_config = Mage::getSingleton('ogone/config'); - return $this; - } - - /** - * Return ogone config instance - * - * @return Mage_Ogone_Model_Config - */ - public function getConfig() - { - return $this->_config; - } - - /** - * @deprecated after 1.4.1.0 - * - * @param int storeId - * @return bool - */ - public function getDebug($storeId=null) - { - return $this->getDebugFlag(); - } - - /** - * Flag witch prevent automatic invoice creation - * - * @return bool - */ - public function isInitializeNeeded() - { - return true; - } - - /** - * Redirect url to ogone submit form - * - * @return string - */ - public function getOrderPlaceRedirectUrl() - { - return Mage::getUrl('ogone/api/placeform', array('_secure' => true)); - } - - /** - * Return payment_action value from config area - * - * @return string - */ - public function getPaymentAction() - { - return $this->getConfig()->getConfigData('payment_action'); - } - - /** - * Rrepare params array to send it to gateway page via POST - * - * @param Mage_Sales_Model_Order - * @return array - */ - public function getFormFields($order) - { - if (empty($order)) { - if (!($order = $this->getOrder())) { - return array(); - } - } - $billingAddress = $order->getBillingAddress(); - $formFields = array(); - $formFields['PSPID'] = $this->getConfig()->getPSPID(); - $formFields['orderID'] = $order->getIncrementId(); - $formFields['amount'] = round($order->getBaseGrandTotal()*100); - $formFields['currency'] = Mage::app()->getStore()->getBaseCurrencyCode(); - $formFields['language'] = Mage::app()->getLocale()->getLocaleCode(); - - $formFields['CN'] = $this->_translate($billingAddress->getFirstname().' '.$billingAddress->getLastname()); - $formFields['EMAIL'] = $order->getCustomerEmail(); - $formFields['ownerZIP'] = $billingAddress->getPostcode(); - $formFields['ownercty'] = $billingAddress->getCountry(); - $formFields['ownertown']= $this->_translate($billingAddress->getCity()); - $formFields['COM'] = $this->_translate($this->_getOrderDescription($order)); - $formFields['ownertelno'] = $billingAddress->getTelephone(); - $formFields['owneraddress'] = $this->_translate(str_replace("\n", ' ',$billingAddress->getStreet(-1))); - - $paymentAction = $this->_getOgonePaymentOperation(); - if ($paymentAction ) { - $formFields['operation'] = $paymentAction; - } - - $secretCode = $this->getConfig()->getShaOutCode(); - $secretSet = $formFields['orderID'] . $formFields['amount'] . $formFields['currency'] . - $formFields['PSPID'] . $paymentAction . $secretCode; - - $formFields['SHASign'] = Mage::helper('ogone')->shaCrypt($secretSet); - - $formFields['homeurl'] = $this->getConfig()->getHomeUrl(); - $formFields['catalogurl'] = $this->getConfig()->getHomeUrl(); - $formFields['accepturl'] = $this->getConfig()->getAcceptUrl(); - $formFields['declineurl'] = $this->getConfig()->getDeclineUrl(); - $formFields['exceptionurl'] = $this->getConfig()->getExceptionUrl(); - $formFields['cancelurl'] = $this->getConfig()->getCancelUrl(); - - if ($this->getConfig()->getConfigData('template')=='ogone') { - $formFields['TP']= ''; - $formFields['PMListType'] = $this->getConfig()->getConfigData('pmlist'); - } else { - $formFields['TP']= $this->getConfig()->getPayPageTemplate(); - } - $formFields['TITLE'] = $this->_translate($this->getConfig()->getConfigData('html_title')); - $formFields['BGCOLOR'] = $this->getConfig()->getConfigData('bgcolor'); - $formFields['TXTCOLOR'] = $this->getConfig()->getConfigData('txtcolor'); - $formFields['TBLBGCOLOR'] = $this->getConfig()->getConfigData('tblbgcolor'); - $formFields['TBLTXTCOLOR'] = $this->getConfig()->getConfigData('tbltxtcolor'); - $formFields['BUTTONBGCOLOR'] = $this->getConfig()->getConfigData('buttonbgcolor'); - $formFields['BUTTONTXTCOLOR'] = $this->getConfig()->getConfigData('buttontxtcolor'); - $formFields['FONTTYPE'] = $this->getConfig()->getConfigData('fonttype'); - $formFields['LOGO'] = $this->getConfig()->getConfigData('logo'); - return $formFields; - } - - /** - * to translate UTF 8 to ISO 8859-1 - * Ogone system is only compatible with iso-8859-1 and does not (yet) fully support the utf-8 - */ - protected function _translate($text) - { - return htmlentities(iconv("UTF-8", "ISO-8859-1", $text)); - } - - /** - * Get Ogone Payment Action value - * - * @param string - * @return string - */ - protected function _getOgonePaymentOperation() - { - $value = $this->getPaymentAction(); - if ($value==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE) { - $value = Mage_Ogone_Model_Api::OGONE_AUTHORIZE_ACTION; - } elseif ($value==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) { - $value = Mage_Ogone_Model_Api::OGONE_AUTHORIZE_CAPTURE_ACTION; - } - return $value; - } - - /** - * get formated order description - * - * @param Mage_Sales_Model_Order - * @return string - */ - protected function _getOrderDescription($order) - { - $invoiceDesc = ''; - $lengs = 0; - foreach ($order->getAllItems() as $item) { - if ($item->getParentItem()) { - continue; - } - //COM filed can only handle max 100 - if (Mage::helper('core/string')->strlen($invoiceDesc.$item->getName()) > 100) { - break; - } - $invoiceDesc .= $item->getName() . ', '; - } - return Mage::helper('core/string')->substr($invoiceDesc, 0, -2); - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Ogone/Model/Api/Debug.php b/app/code/core/Mage/Ogone/Model/Api/Debug.php deleted file mode 100644 index fd08f2bd5d..0000000000 --- a/app/code/core/Mage/Ogone/Model/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ -_init('ogone/api_debug'); - } -} diff --git a/app/code/core/Mage/Ogone/Model/Config.php b/app/code/core/Mage/Ogone/Model/Config.php deleted file mode 100644 index dd69e2e099..0000000000 --- a/app/code/core/Mage/Ogone/Model/Config.php +++ /dev/null @@ -1,151 +0,0 @@ -decrypt($this->getConfigData('secret_key_in', $storeId)); - } - - /** - * Return SHA1-out crypt key from config. Setup on admin place. - * @param int $storeId - * @return string - */ - public function getShaOutCode($storeId=null) - { - return Mage::helper('core')->decrypt($this->getConfigData('secret_key_out', $storeId)); - } - - /** - * Return gateway path, get from confing. Setup on admin place. - * - * @param int $storeId - * @return string - */ - public function getGatewayPath($storeId=null) - { - return $this->getConfigData('ogone_gateway', $storeId); - } - - /** - * Get PSPID, affiliation name in ogone system - * - * @param int $storeId - * @return string - */ - public function getPSPID($storeId=null) - { - return $this->getConfigData('pspid', $storeId); - } - - /** - * Get paypage template for magento style templates using - * - * @return string - */ - public function getPayPageTemplate() - { - return Mage::getUrl('ogone/api/paypage'); - } - - /** - * Return url which ogone system will use as accept - * - * @return string - */ - public function getAcceptUrl() - { - return Mage::getUrl('ogone/api/accept'); - } - - /** - * Return url which ogone system will use as decline url - * - * @return string - */ - public function getDeclineUrl() - { - return Mage::getUrl('ogone/api/decline'); - } - - /** - * Return url which ogone system will use as exception url - * - * @return string - */ - public function getExceptionUrl() - { - return Mage::getUrl('ogone/api/exception'); - } - - /** - * Return url which ogone system will use as cancel url - * - * @return string - */ - public function getCancelUrl() - { - return Mage::getUrl('ogone/api/cancel'); - } - - /** - * Return url which ogone system will use as our magento home url on ogone success page - * - * @return string - */ - public function getHomeUrl() - { - return Mage::getUrl('checkout/cart'); - } -} diff --git a/app/code/core/Mage/Ogone/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Ogone/Model/Mysql4/Api/Debug.php deleted file mode 100644 index 0746e2005b..0000000000 --- a/app/code/core/Mage/Ogone/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ -_init('ogone/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php b/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php deleted file mode 100644 index 3756a75503..0000000000 --- a/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php +++ /dev/null @@ -1,45 +0,0 @@ - '', 'label' => Mage::helper('ogone')->__('Ogone Default Operation')), - array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE, 'label' => Mage::helper('ogone')->__('Authorization')), - array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE, 'label' => Mage::helper('ogone')->__('Direct Sale')), - ); - } -} diff --git a/app/code/core/Mage/Ogone/Model/Source/Pmlist.php b/app/code/core/Mage/Ogone/Model/Source/Pmlist.php deleted file mode 100644 index cac4135726..0000000000 --- a/app/code/core/Mage/Ogone/Model/Source/Pmlist.php +++ /dev/null @@ -1,45 +0,0 @@ - Mage_Ogone_Model_Api::PMLIST_HORISONTAL_LEFT, 'label' => Mage::helper('ogone')->__('Horizontally grouped logo with group name on left')), - array('value' => Mage_Ogone_Model_Api::PMLIST_HORISONTAL, 'label' => Mage::helper('ogone')->__('Horizontally grouped logo with no group name')), - array('value' => Mage_Ogone_Model_Api::PMLIST_VERTICAL, 'label' => Mage::helper('ogone')->__('Verical list')), - ); - } -} diff --git a/app/code/core/Mage/Ogone/Model/Source/Template.php b/app/code/core/Mage/Ogone/Model/Source/Template.php deleted file mode 100644 index 7b472cd6ab..0000000000 --- a/app/code/core/Mage/Ogone/Model/Source/Template.php +++ /dev/null @@ -1,44 +0,0 @@ - Mage_Ogone_Model_Api::TEMPLATE_OGONE, 'label' => Mage::helper('ogone')->__('Ogone')), - array('value' => Mage_Ogone_Model_Api::TEMPLATE_MAGENTO, 'label' => Mage::helper('ogone')->__('Magento')), - ); - } -} diff --git a/app/code/core/Mage/Ogone/controllers/ApiController.php b/app/code/core/Mage/Ogone/controllers/ApiController.php deleted file mode 100644 index b86d2dbdfa..0000000000 --- a/app/code/core/Mage/Ogone/controllers/ApiController.php +++ /dev/null @@ -1,482 +0,0 @@ -_order)) { - $orderId = $this->getRequest()->getParam('orderID'); - $this->_order = Mage::getModel('sales/order'); - $this->_order->loadByIncrementId($orderId); - } - return $this->_order; - } - - /** - * Validation of incoming Ogone data - * - * @return bool - */ - protected function _validateOgoneData() - { - $params = $this->getRequest()->getParams(); - - $this->_getApi()->debugData(array('result' => $params)); - - $secureKey = $this->_getApi()->getConfig()->getShaInCode(); - $secureSet = $this->_getSHAInSet($params, $secureKey); - - if (Mage::helper('ogone')->shaCryptValidation($secureSet, $params['SHASIGN'])!=true) { - $this->_getCheckout()->addError($this->__('The hash is not valid')); - return false; - } - - $order = $this->_getOrder(); - if (!$order->getId()){ - $this->_getCheckout()->addError($this->__('The order is not valid')); - return false; - } - - return true; - } - - /** - * Load place from layout to make POST on ogone - */ - public function placeformAction() - { - $lastIncrementId = $this->_getCheckout()->getLastRealOrderId(); - if ($lastIncrementId) { - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($lastIncrementId); - if ($order->getId()) { - $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage_Ogone_Model_Api::PENDING_OGONE_STATUS, Mage::helper('ogone')->__('Start Ogone Processing')); - $order->save(); - - $this->_getApi()->debugData(array('request' => $this->_getApi()->getFormFields($order))); - } - } - - $this->_getCheckout()->getQuote()->setIsActive(false)->save(); - $this->_getCheckout()->setOgoneQuoteId($this->_getCheckout()->getQuoteId()); - $this->_getCheckout()->setOgoneLastSuccessQuoteId($this->_getCheckout()->getLastSuccessQuoteId()); - $this->_getCheckout()->clear(); - - $this->loadLayout(); - $this->renderLayout(); - } - - /** - * Display our pay page, need to ogone payment with external pay page mode * - */ - public function paypageAction() - { - $this->loadLayout(); - $this->renderLayout(); - } - - /** - * Action to control postback data from ogone - * - */ - public function postBackAction() - { - if (!$this->_validateOgoneData()) { - $this->getResponse()->setHeader("Status", "404 Not Found"); - return false; - } - - $this->_ogoneProcess(); - } - - /** - * Action to process ogone offline data - * - */ - public function offlineProcessAction() - { - if (!$this->_validateOgoneData()) { - $this->getResponse()->setHeader("Status","404 Not Found"); - return false; - } - $this->_ogoneProcess(); - } - - /** - * Made offline ogone data processing, depending of incoming statuses - */ - protected function _ogoneProcess() - { - $status = $this->getRequest()->getParam('STATUS'); - switch ($status) { - case Mage_Ogone_Model_Api::OGONE_AUTHORIZED : - case Mage_Ogone_Model_Api::OGONE_AUTH_PROCESSING: - case Mage_Ogone_Model_Api::OGONE_PAYMENT_REQUESTED_STATUS : - $this->_acceptProcess(); - break; - case Mage_Ogone_Model_Api::OGONE_AUTH_REFUZED: - case Mage_Ogone_Model_Api::OGONE_PAYMENT_INCOMPLETE: - case Mage_Ogone_Model_Api::OGONE_TECH_PROBLEM: - $this->_declineProcess(); - break; - case Mage_Ogone_Model_Api::OGONE_AUTH_UKNKOWN_STATUS: - case Mage_Ogone_Model_Api::OGONE_PAYMENT_UNCERTAIN_STATUS: - $this->_exceptionProcess(); - break; - default: - //all unknown transaction will accept as exceptional - $this->_exceptionProcess(); - } - } - - /** - * when payment gateway accept the payment, it will land to here - * need to change order status as processed ogone - * update transaction id - * - */ - public function acceptAction() - { - if (!$this->_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_ogoneProcess(); - } - - /** - * Process success action by accept url - */ - protected function _acceptProcess() - { - $params = $this->getRequest()->getParams(); - $order = $this->_getOrder(); - - $this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId()); - - $this->_prepareCCInfo($order, $params); - $order->getPayment()->setTransactionId($params['PAYID']); - $order->getPayment()->setLastTransId($params['PAYID']); - - try{ - if ($this->_getApi()->getPaymentAction()==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) { - $this->_processDirectSale(); - } else { - $this->_processAuthorize(); - } - }catch(Exception $e) { - $this->_getCheckout()->addError(Mage::helper('ogone')->__('The order cannot be saved.')); - $this->_redirect('checkout/cart'); - return; - } - } - - /** - * Process Configured Payment Action: Direct Sale, create invoce if state is Pending - * - */ - protected function _processDirectSale() - { - $order = $this->_getOrder(); - $status = $this->getRequest()->getParam('STATUS'); - try{ - if ($status == Mage_Ogone_Model_Api::OGONE_AUTH_PROCESSING) { - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::WAITING_AUTHORIZATION, Mage::helper('ogone')->__('Authorization Waiting from Ogone')); - $order->save(); - }elseif ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) { - if ($status == Mage_Ogone_Model_Api::OGONE_AUTHORIZED) { - if ($order->getStatus() != Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) { - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSING_OGONE_STATUS, Mage::helper('ogone')->__('Processed by Ogone')); - } - } else { - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSED_OGONE_STATUS, Mage::helper('ogone')->__('Processed by Ogone')); - } - - if (!$order->getInvoiceCollection()->getSize()) { - $invoice = $order->prepareInvoice(); - $invoice->register(); - $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID); - $invoice->getOrder()->setIsInProcess(true); - - $transactionSave = Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - $order->sendNewOrderEmail(); - } - } else { - $order->save(); - } - $this->_redirect('checkout/onepage/success'); - return; - } catch (Exception $e) { - $this->_getCheckout()->addError(Mage::helper('ogone')->__('Order can\'t save')); - $this->_redirect('checkout/cart'); - return; - } - } - - /** - * Process Configured Payment Actions: Authorized, Default operation - * just place order - */ - protected function _processAuthorize() - { - $order = $this->_getOrder(); - $status = $this->getRequest()->getParam('STATUS'); - try { - if ($status == Mage_Ogone_Model_Api::OGONE_AUTH_PROCESSING) { - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::WAITING_AUTHORIZATION, Mage::helper('ogone')->__('Authorization Waiting from Ogone')); - } else { - //to send new order email only when state is pending payment - if ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) { - $order->sendNewOrderEmail(); - } - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSED_OGONE_STATUS, Mage::helper('ogone')->__('Processed by Ogone')); - } - $order->save(); - $this->_redirect('checkout/onepage/success'); - return; - } catch(Exception $e) { - $this->_getCheckout()->addError(Mage::helper('ogone')->__('Order can\'t save')); - $this->_redirect('checkout/cart'); - return; - } - } - - /** - * We get some CC info from ogone, so we must save it - * - * @param Mage_Sales_Model_Order $order - * @param array $ccInfo - * - * @return Mage_Ogone_ApiController - */ - protected function _prepareCCInfo($order, $ccInfo) - { - $order->getPayment()->setCcOwner($ccInfo['CN']); - $order->getPayment()->setCcNumberEnc($ccInfo['CARDNO']); - $order->getPayment()->setCcLast4(substr($ccInfo['CARDNO'], -4)); - $order->getPayment()->setCcExpMonth(substr($ccInfo['ED'], 0, 2)); - $order->getPayment()->setCcExpYear(substr($ccInfo['ED'], 2, 2)); - return $this; - } - - - /** - * the payment result is uncertain - * exception status can be 52 or 92 - * need to change order status as processing ogone - * update transaction id - * - */ - public function exceptionAction() - { - if (!$this->_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_exceptionProcess(); - } - - /** - * Process exception action by ogone exception url - */ - public function _exceptionProcess() - { - $params = $this->getRequest()->getParams(); - $order = $this->_getOrder(); - - $exception = ''; - switch($params['STATUS']) { - case Mage_Ogone_Model_Api::OGONE_PAYMENT_UNCERTAIN_STATUS : - $exception = Mage::helper('ogone')->__('Payment uncertain: A technical problem arose during payment process, giving unpredictable result'); - break; - case Mage_Ogone_Model_Api::OGONE_AUTH_UKNKOWN_STATUS : - $exception = Mage::helper('ogone')->__('Authorization not known: A technical problem arose during authorization process, giving unpredictable result'); - break; - default: - $exception = Mage::helper('ogone')->__('Unknown exception'); - } - - if (!empty($exception)) { - try{ - $this->_getCheckout()->setLastSuccessQuoteId($order->getQuoteId()); - $this->_prepareCCInfo($order, $params); - $order->getPayment()->setLastTransId($params['PAYID']); - //to send new order email only when state is pending payment - if ($order->getState()==Mage_Sales_Model_Order::STATE_PENDING_PAYMENT) { - $order->sendNewOrderEmail(); - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, Mage_Ogone_Model_Api::PROCESSING_OGONE_STATUS, $exception); - } else { - $order->addStatusToHistory(Mage_Ogone_Model_Api::PROCESSING_OGONE_STATUS, $exception); - } - $order->save(); - }catch(Exception $e) { - $this->_getCheckout()->addError(Mage::helper('ogone')->__('The order cannot be saved for a system reason.')); - } - } else { - $this->_getCheckout()->addError(Mage::helper('ogone')->__('Exception not defined')); - } - - $this->_redirect('checkout/onepage/success'); - } - - /** - * when payment got decline - * need to change order status to cancelled - * take the user back to shopping cart - * - */ - public function declineAction() - { - if (!$this->_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_getCheckout()->setQuoteId($this->_getCheckout()->getOgoneQuoteId()); - $this->_declineProcess(); - return $this; - } - - /** - * Process decline action by ogone decline url - */ - protected function _declineProcess() - { - $status = Mage_Ogone_Model_Api::DECLINE_OGONE_STATUS; - $comment = Mage::helper('ogone')->__('Declined Order on Ogone side.'); - $this->_getCheckout()->addError(Mage::helper('ogone')->__('Payment transaction has been declined.')); - $this->_cancelOrder($status, $comment); - } - - /** - * when user cancel the payment - * change order status to cancelled - * need to rediect user to shopping cart - * - * @return Mage_Ogone_ApiController - */ - public function cancelAction() - { - if (!$this->_validateOgoneData()) { - $this->_redirect('checkout/cart'); - return; - } - $this->_getCheckout()->setQuoteId($this->_getCheckout()->getOgoneQuoteId()); - $this->_cancelProcess(); - return $this; - } - - /** - * Process cancel action by cancel url - * - * @return Mage_Ogone_ApiController - */ - public function _cancelProcess() - { - $status = Mage_Ogone_Model_Api::CANCEL_OGONE_STATUS; - $comment = Mage::helper('ogone')->__('The order was canceled on ogone side.'); - $this->_cancelOrder($status, $comment); - return $this; - } - - /** - * Cancel action, used for decline and cancel processes - * - * @return Mage_Ogone_ApiController - */ - protected function _cancelOrder($status, $comment='') - { - $order = $this->_getOrder(); - try{ - $order->cancel(); - $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, $status, $comment); - $order->save(); - }catch(Exception $e) { - $this->_getCheckout()->addError(Mage::helper('ogone')->__('The order cannot be canceled for a system reason.')); - } - - $this->_redirect('checkout/cart'); - return $this; - } - - /** - * Return set of data which is ready for SHA crypt - * - * @param array $data - * @param string $key - * - * @return string - */ - protected function _getSHAInSet($params, $key) - { - return $this->getRequest()->getParam('orderID') . - $this->getRequest()->getParam('currency') . - $this->getRequest()->getParam('amount') . - $this->getRequest()->getParam('PM') . - $this->getRequest()->getParam('ACCEPTANCE') . - $this->getRequest()->getParam('STATUS') . - $this->getRequest()->getParam('CARDNO') . - $this->getRequest()->getParam('PAYID') . - $this->getRequest()->getParam('NCERROR') . - $this->getRequest()->getParam('BRAND') . $key; - } -} diff --git a/app/code/core/Mage/Ogone/etc/config.xml b/app/code/core/Mage/Ogone/etc/config.xml deleted file mode 100644 index e261ceb1f2..0000000000 --- a/app/code/core/Mage/Ogone/etc/config.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - 0.0.1 - - - - - - Mage_Ogone_Model - ogone_mysql4 - - - Mage_Ogone_Model_Mysql4 - - ogone_api_debug
-
-
-
- - - - Mage_Ogone - - - core_setup - - - - - core_write - - - - - core_read - - - - - - Mage_Ogone_Block - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - ogone.xml - - - - - /ogone/api - - - - standard - - Mage_Ogone - ogone - - - - - - - - - ogone/api - Ogone - - authorize - - https://secure.ogone.com/ncol/test/orderstandard.asp - pending_ogone - cancel_ogone - decline_ogone - processing_ogone - processed_ogone - waiting_authorozation - - - -
diff --git a/app/code/core/Mage/Ogone/etc/system.xml b/app/code/core/Mage/Ogone/etc/system.xml deleted file mode 100644 index 889b741ad0..0000000000 --- a/app/code/core/Mage/Ogone/etc/system.xml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - -
-
-


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
-
-]]>
- text - 800 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 2 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>3</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - text - PSPID is a case sensitive field. - 4 - 1 - 1 - 0 - - - - - Use in data checking by Ogone before the payment. - ]]> - adminhtml/system_config_backend_encrypted - obscure - 5 - 1 - 1 - 0 - - - - - Use in feedback data checking by Magento - ]]> - adminhtml/system_config_backend_encrypted - obscure - 6 - 1 - 1 - 0 - - - - text - For production, replace "test" with "prod". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp - 7 - 1 - 1 - 0 - - - - select - ogone/source_paymentAction - If you choose "No Operation", Ogone will use default payment procedure setup in Ogone configuration. - 8 - 1 - 1 - 0 - - - - - text - 11 - 1 - 1 - 1 - - - - text - - 12 - 1 - 1 - 1 - - - - text - - 13 - 1 - 1 - 1 - - - - text - - 14 - 1 - 1 - 1 - - - - text - - 15 - 1 - 1 - 1 - - - - text - 16 - 1 - 1 - 1 - - - - text - - 17 - 1 - 1 - 1 - - - - text - - 18 - 1 - 1 - 1 - - - - text - The URL must be absolute and stored on a secure server.]]> - 19 - 1 - 1 - 1 - - - - select - ogone/source_pmlist - You can arrange the layout/list of the payment methods on Ogone payment page. - 20 - 1 - 1 - 1 - - -
-
-
-
-
diff --git a/app/code/core/Mage/Ogone/sql/ogone_setup/mysql4-install-0.0.1.php b/app/code/core/Mage/Ogone/sql/ogone_setup/mysql4-install-0.0.1.php deleted file mode 100644 index 906138c049..0000000000 --- a/app/code/core/Mage/Ogone/sql/ogone_setup/mysql4-install-0.0.1.php +++ /dev/null @@ -1,46 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS `{$this->getTable('ogone/api_debug')}`; -CREATE TABLE `{$this->getTable('ogone/api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `dir` enum('in', 'out'), - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `url` varchar(255), - `data` text, - PRIMARY KEY (`debug_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import.php deleted file mode 100644 index 1bd54ea44f..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - -class Mage_Oscommerce_Block_Adminhtml_Import extends Mage_Adminhtml_Block_Widget_Grid_Container -{ - protected $_blockGroup = 'oscommerce'; - public function __construct() - { - $this->_controller = 'adminhtml_import'; - $this->_headerText = Mage::helper('adminhtml')->__('Manage osCommerce Profiles'); - $this->_addButtonLabel = Mage::helper('adminhtml')->__('Add New osCommerce Profile'); - parent::__construct(); - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit.php deleted file mode 100644 index cc5ee19e7f..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit.php +++ /dev/null @@ -1,68 +0,0 @@ - - */ - -class Mage_Oscommerce_Block_Adminhtml_Import_Edit extends Mage_Adminhtml_Block_Widget_Form_Container -{ - protected $_blockGroup = 'oscommerce'; - - public function __construct() - { - $this->_objectId = 'id'; - $this->_controller = 'adminhtml_import'; - $this->_updateButton('save', 'label', Mage::helper('oscommerce')->__('Save Profile')); - $this->_updateButton('delete', 'label', Mage::helper('oscommerce')->__('Delete Profile')); - $this->_addButton('save_and_edit_button', - array( - 'label' => Mage::helper('oscommerce')->__('Save and Continue Edit'), - 'onclick' => 'saveAndContinueEdit()', - 'class' => 'save' - ), 100 - - ); - $this->_formScripts[] = " - function saveAndContinueEdit(){ - editForm.submit($('edit_form').action+'continue/back/'); - } - "; - parent::__construct(); - } - - public function getHeaderText() - { - if (Mage::registry('oscommerce_adminhtml_import')->getId()) { // TOCHECK - return Mage::helper('oscommerce')->__('Edit osCommerce Profile :: %s', Mage::registry('oscommerce_adminhtml_import')->getName()); - } - else { - return Mage::helper('oscommerce')->__('New osCommerce Profile'); - } - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Form.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Form.php deleted file mode 100644 index f599b876ef..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Form.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ - -class Mage_Oscommerce_Block_Adminhtml_Import_Edit_Form extends Mage_Adminhtml_Block_Widget_Form -{ - protected function _prepareForm() - { - $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'POST')); - - $model = Mage::registry('oscommerce_adminhtml_import'); - - if ($model->getId()) { - $form->addField('import_id', 'hidden', array( - 'name' => 'import_id', - )); - $form->setValues($model->getData()); - } - - $form->setUseContainer(true); - $this->setForm($form); - return parent::_prepareForm(); - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/General.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/General.php deleted file mode 100644 index 97bcb182ba..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/General.php +++ /dev/null @@ -1,110 +0,0 @@ - - */ -class Mage_Oscommerce_Block_Adminhtml_Import_Edit_Tab_General extends Mage_Adminhtml_Block_Widget_Form -{ - - function initForm() - { - $model = Mage::registry('oscommerce_adminhtml_import'); - - - $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')); - - if ($model->getId()) { - $form->addField('import_id', 'hidden', array( - 'name' => 'import_id', - )); - } - $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('oscommerce')->__('General Information'))); - $fieldset->addField('name', 'text', array( - 'label' => $this->__('Name'), - 'title' => $this->__('Name'), - 'name' => 'name', - 'required' => true, - )); - - $fieldset->addField('host', 'text', array( - 'label' => $this->__('IP or Hostname'), - 'title' => $this->__('IP or Hostname'), - 'name' => 'host', - 'required' => true, - )); - -// $fieldset->addField('port', 'text', array( -// 'label' => $this->__('Port (Default as 3306)'), -// 'title' => $this->__('Port (Default as 3306)'), -// 'name' => 'port', -// 'required' => true, -// 'value' => $model->getData('port') ? $model->getData('port'): Mage_Oscommerce_Model_Oscommerce::DEFAULT_PORT -// )); - - $fieldset->addField('db_name', 'text', array( - 'label' => $this->__('DB Name'), - 'title' => $this->__('DB Name'), - 'name' => 'db_name', - 'required' => true, - )); - - $fieldset->addField('db_user', 'text', array( - 'label' => $this->__('DB Username'), - 'title' => $this->__('DB Username'), - 'name' => 'db_user', - 'required' => true, - )); - - $fieldset->addField('db_password', 'password', array( - 'label' => $this->__('DB Password'), - 'title' => $this->__('DB Password'), - 'name' => 'db_password', - )); - - $fieldset->addField('table_prefix', 'text', array( - 'label' => $this->__('Prefix'), - 'title' => $this->__('Prefix'), - 'name' => 'table_prefix', - )); - - $fieldset->addField('send_subscription', 'checkbox', array( - 'label' => $this->__('Send Subscription Notification to Customers'), - 'title' => $this->__('Send Subscription Notification to Customers'), - 'name' => 'send_subscription', - 'values' => $this->getData('send_subscription'), - 'checked' => $this->getData('send_subscription'), - )); - - $form->setValues($model->getData()); - - $this->setForm($form); - - return $this; - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/Run.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/Run.php deleted file mode 100644 index 4ae2add222..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tab/Run.php +++ /dev/null @@ -1,239 +0,0 @@ - - */ -class Mage_Oscommerce_Block_Adminhtml_Import_Edit_Tab_Run extends Mage_Adminhtml_Block_Template -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('oscommerce/convert/run.phtml'); - } - - /** - * Prepares layout of block - * - */ - protected function _prepareLayout() - { - $this->setChild('save_button', - $this->getLayout()->createBlock('adminhtml/widget_button') - ->setData(array( - 'label' => Mage::helper('oscommerce')->__('Start Running'), - 'class' => 'run', - 'id' => 'run_import' - )) - - ); - - $this->setChild('check_button', - $this->getLayout()->createBlock('adminhtml/widget_button') - ->setData(array( - 'label' => Mage::helper('oscommerce')->__('Check Requirements'), - 'class' => 'run', - 'id' => 'check_import' - )) - - ); - - } - - public function getImportId() - { - return Mage::registry('oscommerce_adminhtml_import')->getId(); - } - - /** - * Retrieve run url - * - * @return string - */ - public function getSubmitUrl() - { - return $this->getUrl('*/*/run/', array('id'=>$this->getOscId())); - } - - /** - * Retrive run button html - * - * @return string - */ - public function getSaveButtonHtml() - { - return $this->getChildHtml('save_button'); - } - - public function getCheckButtonHtml() - { - return $this->getChildHtml('check_button'); - } - - public function getWebsiteOptionHtml() - { - - $html = ''; - return $html; - } - - public function getTimezoneOptionHtml() - { - $html = ''; - return $html; - - } - - /** - * Get list available for mysql connection charsets - * - * @return array - */ - public function getConnectionCharsets() - { - $charsetList = array(); - $fileName = Mage::getModuleDir('etc','Mage_Oscommerce').DS.'charsets.xml'; - if (is_readable($fileName)) { - $xml = new Varien_Simplexml_Config(); - $xml->loadFile($fileName); - $charsets = $xml->getNode('charset'); - foreach($charsets as $charset) { - $attributes = $charset->attributes(); - $code = (string) $attributes['name']; - $charsetList[$code] = (string)$charset->family; - } - } - return $charsetList; - } - - /** - * Get list available for iconv function charsets - * - * @return array - */ - public function getDataCharsets() - { - $charsetList = array( - 'BIG-5' => Mage::helper('oscommerce')->__('Traditional Chinese'), - 'ISO-8859-2' => Mage::helper('oscommerce')->__('Central European'), - 'CP850' => Mage::helper('oscommerce')->__('Western'), - 'ISO-8859-1' => Mage::helper('oscommerce')->__('Western'), - 'HP-ROMAN8' => Mage::helper('oscommerce')->__('Western'), - 'KOI8-R' => Mage::helper('oscommerce')->__('Cyrillic'), - 'ASCII' => Mage::helper('oscommerce')->__('Western'), - 'EUC-JP' => Mage::helper('oscommerce')->__('Japanese'), - 'SHIFT-JIS' => Mage::helper('oscommerce')->__('Japanese'), - 'windows-1251' => Mage::helper('oscommerce')->__('Cyrillic'), - 'ISO-8859-8' => Mage::helper('oscommerce')->__('Hebrew'), - 'TIS-620' => Mage::helper('oscommerce')->__('Thai'), - 'EUC-KR' => Mage::helper('oscommerce')->__('Korean'), - 'ISO-8859-13' => Mage::helper('oscommerce')->__('Baltic'), - 'KOI8-U' => Mage::helper('oscommerce')->__('Cyrillic'), - 'CHINESE' => Mage::helper('oscommerce')->__('Simplified Chinese'), - 'ISO-8859-7' => Mage::helper('oscommerce')->__('Greek'), - 'WINDOWS-1250' => Mage::helper('oscommerce')->__('Central European'), - 'CP936' => Mage::helper('oscommerce')->__('East Asian'), - 'WINDOWS-1257' => Mage::helper('oscommerce')->__('Baltic'), - 'ISO-8859-9' => Mage::helper('oscommerce')->__('South Asian'), - 'ARMSCII-8' => Mage::helper('oscommerce')->__('South Asian'), - 'UTF-8' => Mage::helper('oscommerce')->__('Unicode'), - 'UCS-2' => Mage::helper('oscommerce')->__('Unicode'), - 'CP866' => Mage::helper('oscommerce')->__('Cyrillic'), - 'MACCENTRALEUROPE' => Mage::helper('oscommerce')->__('Central European'), - 'MAC' => Mage::helper('oscommerce')->__('Western'), - 'CP852' => Mage::helper('oscommerce')->__('Central European'), - 'CP1256' => Mage::helper('oscommerce')->__('Arabic'), - 'CP932' => Mage::helper('oscommerce')->__('Japanese'), - ); - return $charsetList; - } - - public function drowOptions($options = array()) - { - asort($options); - $html = ''; - foreach($options as $code => $name) { - $html.= ''; - } - - return $html; - } - - public function getDataCharsetOptionHtml() - { - - $html = ''; - return $html; - } - - public function getConnectionCharsetOptionHtml() - { - $html = ''; - return $html; - } - - /** - * Deprecated - * - * @return string - */ - public function getCharsetOption() - { - $options = ''; - $fileName = Mage::getModuleDir('etc','Mage_Oscommerce').DS.'charsets.xml'; - if (is_readable($fileName)) { - $xml = new Varien_Simplexml_Config(); - $xml->loadFile($fileName); - $charsets = $xml->getNode('charset'); - foreach($charsets as $charset) { - $attributes = $charset->attributes(); - $options .= ''; - } - } - return $options; - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tabs.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tabs.php deleted file mode 100644 index ec0c301ba7..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Edit/Tabs.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -class Mage_Oscommerce_Block_Adminhtml_Import_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs -{ - public function __construct() - { - parent::__construct(); - $this->setId('oscommerce_import_tabs'); - $this->setDestElementId('edit_form'); - $this->setTitle(Mage::helper('oscommerce')->__('osCommerce Profile')); - } - - protected function _beforeToHtml() - { - $model = Mage::registry('oscommerce_adminhtml_import'); - - $generalBlock = $this->getLayout()->createBlock('oscommerce/adminhtml_import_edit_tab_general'); - $generalBlock->addData($model->getData()); - - $new = !$model->getId(); - - $this->addTab('general', array( - 'label' => Mage::helper('oscommerce')->__('General Information'), - 'content' => $generalBlock->initForm()->toHtml(), - 'active' => true, - )); - - if (!$new) { - $this->addTab('run', array( - 'label' => Mage::helper('oscommerce')->__('Run Profile'), - 'content' => $this->getLayout()->createBlock('oscommerce/adminhtml_import_edit_tab_run')->toHtml(), - )); - } - - return parent::_beforeToHtml(); - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Grid.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Grid.php deleted file mode 100644 index bb229e6df2..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Grid.php +++ /dev/null @@ -1,94 +0,0 @@ - - */ - -class Mage_Oscommerce_Block_Adminhtml_Import_Grid extends Mage_Adminhtml_Block_Widget_Grid -{ - - public function __construct() - { - parent::__construct(); - $this->setId('convertOscGrid'); - $this->setDefaultSort('id'); - } - - protected function _prepareCollection() - { - $collection = Mage::getModel('oscommerce/oscommerce')->getCollection(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - protected function _prepareColumns() - { - $this->addColumn('id', array( - 'header' =>Mage::helper('oscommerce')->__('ID'), - 'width' =>'50px', - 'index' =>'import_id', - )); - $this->addColumn('name', array( - 'header' =>Mage::helper('oscommerce')->__('Adapter Name'), - 'index' =>'name', - )); - $this->addColumn('host', array( - 'header' =>Mage::helper('oscommerce')->__('IP or Hostname'), - 'index' =>'host', - 'width' =>'120px', - )); - - $this->addColumn('db_name', array( - 'header' =>Mage::helper('oscommerce')->__('DB Name'), - 'index' =>'db_name', - 'width' =>'120px', - )); - - $this->addColumn('created_at', array( - 'header' =>Mage::helper('oscommerce')->__('Created At'), - 'type' => 'date', - 'align' => 'center', - 'index' =>'created_at', - )); - $this->addColumn('updated_at', array( - 'header' =>Mage::helper('oscommerce')->__('Updated At'), - 'type' => 'date', - 'align' => 'center', - 'index' =>'updated_at', - )); - - return parent::_prepareColumns(); - } - - public function getRowUrl($row) - { - return $this->getUrl('*/*/edit', array('id'=>$row->getId())); - } - -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php deleted file mode 100644 index 50b97d6453..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Import/Run.php +++ /dev/null @@ -1,293 +0,0 @@ - - */ -class Mage_Oscommerce_Block_Adminhtml_Import_Run extends Mage_Adminhtml_Block_Abstract -{ - public function getImportModel() - { - return Mage::registry('oscommerce_adminhtml_import'); - } - - protected function _toHtml() - { - $importModel = $this->getImportModel(); - - echo ''; - - $headBlock = $this->getLayout()->createBlock('page/html_head'); - $headBlock->addJs('prototype/prototype.js'); - echo $headBlock->getCssJsHtml(); - - echo ' - '.($importModel->getId() ? $this->htmlEscape($importModel->getName()) : $this->__('No osCommerce profile')).' -'; - echo '
    '; - echo '
  • '; - if ($importModel->getId()) { - echo ''; - echo $this->__("Starting profile execution, please wait..."); - echo '
  • '; - echo '
  • '; - echo ''; - echo $this->__("Warning: Please do not close window during importing/exporting data."); - echo '
  • '; - } else { - echo ''; - echo $this->__("No osCommerce profile loaded..."); - } - echo ''; - echo '
'; - - if ($importModel->getId()) { - echo '
    '; - ob_implicit_flush(); - $showFinished = false; - $countItems = 0; - $batchConfig = array( - 'styles' => array( - 'error' => array( - 'icon' => Mage::getDesign()->getSkinUrl('images/error_msg_icon.gif'), - 'bg' => '#FDD' - ), - 'message' => array( - 'icon' => Mage::getDesign()->getSkinUrl('images/fam_bullet_success.gif'), - 'bg' => '#DDF' - ), - 'loader' => Mage::getDesign()->getSkinUrl('images/ajax-loader.gif') - ), - 'template' => '
  • ' - . '' - . '#{text}' - . '
  • ', - 'text' => $this->__('processed %s%% %s/%s records', '#{percent}', '#{updated}', '#{total}'), - 'successText' => $this->__('Total imported %s records (%s)', '#{updated}', '#{totalImported}') - ); - - - echo ''; - - - echo "
"; -echo ' - - -'; - -// echo '
    '; - - - if ($totalRecords = $importModel->getTotalRecords()) { - - $maxRows = $importModel->getResource()->getMaxRows(); - echo ''; - foreach($totalRecords as $importType => $totalRecord) { - echo ''; - $page = floor($totalRecord/$maxRows) + 1; - for ($i = 0; $i < $page; $i++) { - $data = array( - 'import_id' => $importModel->getId(), - 'import_type' => $importType, - 'from' => ($i > 0 ? $i * $maxRows:$i), - 'is_done' => ($i == $page - 1)?true:false - ); - echo ''; - } - -// if ($importType=='categories') { -// $data = array( -// 'import_id' => $importModel->getId(), -// 'import_type' => $importType, -// 'page' => 'all', -// 'is_done' => true -// ); -// echo ''; -// -// } else { -// $page = floor($totalRecord/$maxRows) + 1; -// for ($i = 0; $i < $page; $i++) { -// $data = array( -// 'import_id' => $importModel->getId(), -// 'import_type' => $importType, -// 'from' => ($i > 0 ? $i * $maxRows:$i), -// 'is_done' => ($i == $page - 1)?true:false -// ); -// echo ''; -// } -// } - } - echo ''; - - } - - } - echo ''; - exit; - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order.php deleted file mode 100644 index 67004bf888..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - -class Mage_Oscommerce_Block_Adminhtml_Order extends Mage_Adminhtml_Block_Widget_Grid_Container -{ - protected $_blockGroup = 'oscommerce'; - public function __construct() - { - $this->_controller = 'adminhtml_order'; - $this->_headerText = Mage::helper('adminhtml')->__('Manage osCommerce Orders'); - parent::__construct(); - $this->_removeButton('add'); - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/Grid.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/Grid.php deleted file mode 100644 index 0ac3d35ed5..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/Grid.php +++ /dev/null @@ -1,128 +0,0 @@ - - */ - -class Mage_Oscommerce_Block_Adminhtml_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid -{ - - public function __construct() - { - parent::__construct(); - $this->setId('oscommerceOrderGrid'); - $this->setDefaultSort('id'); - } - - protected function _prepareCollection() - { - $collection = Mage::getModel('oscommerce/oscommerce_order')->getCollection(); - $this->setCollection($collection); - return parent::_prepareCollection(); - } - - protected function _prepareColumns() - { - $this->addColumn('order_id', array( - 'header' =>Mage::helper('oscommerce')->__('Order #'), - 'width' =>'50px', - 'index' =>'osc_magento_id', - 'type' => 'number', - )); - - $this->addColumn('billing_name', array( - 'header' =>Mage::helper('oscommerce')->__('Billing to Name'), - 'index' =>'billing_name', - )); - - $this->addColumn('delivery_name', array( - 'header' =>Mage::helper('oscommerce')->__('Ship to Name'), - 'index' =>'delivery_name', - )); - - $this->addColumn('currency', array( - 'header' =>Mage::helper('oscommerce')->__('Currency'), - 'width' =>'50px', - 'index' =>'currency', - )); - - $this->addColumn('orders_total', array( - 'header' =>Mage::helper('oscommerce')->__('Order Total'), - 'width' =>'50px', - 'index' =>'orders_total', - 'type' => 'currency', - 'currency'=>'order_currency_code' - )); - - $this->addColumn('orders_status', array( - 'header' =>Mage::helper('oscommerce')->__('Order Status'), - 'width' =>'50px', - 'index' =>'orders_status', - )); - - $this->addColumn('date_purchased', array( - 'header' => Mage::helper('oscommerce')->__('Purchased Year'), - 'width' => '150px', - 'index' => 'date_purchased', - 'type' => 'datetime', - )); - -// $this->addColumn('purchased_year', array( -// 'header' =>Mage::helper('oscommerce')->__('Purchased Year'), -// 'width' =>'50px', -// 'index' =>'purchased_year', -// 'type' => 'currency', -// 'currency' => 'store_currency_code', -// )); -// -// $this->addColumn('purchased_month', array( -// 'header' =>Mage::helper('oscommerce')->__('Purchased Month'), -// 'width' =>'50px', -// 'index' =>'purchased_month', -// 'type' => 'currency', -// 'currency' => 'store_currency_code', -// )); -// -// $this->addColumn('purchased_day', array( -// 'header' =>Mage::helper('oscommerce')->__('Purchased Date'), -// 'width' =>'50px', -// 'index' =>'purchased_day', -// 'type' => 'currency', -// 'currency' => 'store_currency_code', -// )); - - return parent::_prepareColumns(); - } - - public function getRowUrl($row) - { - return $this->getUrl('*/*/view', array('order_id'=>$row->getId())); - } - -} diff --git a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/View.php b/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/View.php deleted file mode 100644 index 5444a20c8a..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Adminhtml/Order/View.php +++ /dev/null @@ -1,102 +0,0 @@ - - */ -class Mage_Oscommerce_Block_Adminhtml_Order_View extends Mage_Adminhtml_Block_Template -{ - - public function __construct() - { - parent::__construct(); - $this->setTemplate('oscommerce/order/view.phtml'); - - - } - - protected function _prepareLayout() - { - $this->setChild('backButton', - $this->getLayout()->createBlock('adminhtml/widget_button') - ->setData(array( - 'label' => Mage::helper('oscommerce')->__('Back'), - 'id' => 'back_button', - 'name' => 'back_button', - 'element_name' => 'back_button', - 'class' => 'scalable back', - 'onclick'=> "setLocation('".$this->getBackUrl()."')", - )) - ); - } - /** - * Retrieve order model object - * - * @return Mage_Sales_Model_Order - */ - public function getOrder() - { - return Mage::registry('current_oscommerce_order'); - } - - /** - * Retrieve Order Identifier - * - * @return int - */ - public function getOrderId() - { - return $this->getOrder()->getId(); - } - - public function getHeaderText() - { - $text = Mage::helper('oscommerce')->__('osCommerce Order # %s | Order Date %s', - $this->getOrder()->getOrdersId(), - $this->formatDate($this->getOrder()->getDatePurchased(), 'medium', true) - ); - return $text; - } - - public function getUrl($params='', $params2=array()) - { - $params2['order_id'] = $this->getOrderId(); - return parent::getUrl($params, $params2); - } - - - public function getBackButtonHtml() - { - return $this->getChildHtml('backButton'); - } - - public function getBackUrl() - { - return $this->getUrl("*/*/"); - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Order/List.php b/app/code/core/Mage/Oscommerce/Block/Order/List.php deleted file mode 100644 index a4af260470..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Order/List.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class Mage_Oscommerce_Block_Order_List extends Mage_Core_Block_Template -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('oscommerce/order/list.phtml'); - $customerId = Mage::getSingleton('customer/session')->getCustomerId(); - $websiteId = $websiteId = Mage::app()->getStore()->getWebsiteId(); - $osCommerce = Mage::getModel('oscommerce/oscommerce'); - $oscOrders = $osCommerce->loadOrders($customerId, $websiteId); - $this->setOsCommerceOrders($oscOrders); - } - - protected function _prepareLayout() - { - $orderInfo = $this->getOrder(); - $order = $orderInfo['order']; - if ($headBlock = $this->getLayout()->getBlock('head')) { - $headBlock->setTitle($this->__('Order # %s', $order['orders_id'])); - } - } - - public function getViewOscommerceUrl($order) - { - return $this->getUrl('oscommerce/order/view', array('order_id'=>$order['osc_magento_id'])); - } - - /** - * Retrieve current order model instance - * - * @return Mage_Sales_Model_Order - */ - public function getOrder() - { - return Mage::registry('current_oscommerce_order'); - } - - public function getBackUrl() - { - return Mage::getUrl('*/*/history'); - } -} diff --git a/app/code/core/Mage/Oscommerce/Block/Order/View.php b/app/code/core/Mage/Oscommerce/Block/Order/View.php deleted file mode 100644 index 57463941b9..0000000000 --- a/app/code/core/Mage/Oscommerce/Block/Order/View.php +++ /dev/null @@ -1,69 +0,0 @@ - - */ -class Mage_Oscommerce_Block_Order_View extends Mage_Core_Block_Template -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('oscommerce/order/view.phtml'); - } - - protected function _prepareLayout() - { - $orderInfo = $this->getOrder(); - $order = $orderInfo['order']; - if ($headBlock = $this->getLayout()->getBlock('head')) { - $headBlock->setTitle($this->__('Order # %s', $order['orders_id'])); - } - } - - public function getPaymentInfoHtml() - { - return $this->getChildHtml('payment_info'); - } - - /** - * Retrieve current order model instance - * - * @return Mage_Sales_Model_Order - */ - public function getOrder() - { - return Mage::registry('current_oscommerce_order'); - } - - public function getBackUrl() - { - return Mage::getUrl('sales/order/history'); - } - -} diff --git a/app/code/core/Mage/Oscommerce/Helper/Data.php b/app/code/core/Mage/Oscommerce/Helper/Data.php deleted file mode 100644 index ff5d0c794a..0000000000 --- a/app/code/core/Mage/Oscommerce/Helper/Data.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class Mage_Oscommerce_Helper_Data extends Mage_Core_Helper_Data -{ - -} diff --git a/app/code/core/Mage/Oscommerce/Model/Config.php b/app/code/core/Mage/Oscommerce/Model/Config.php deleted file mode 100644 index 2befc86076..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Config.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Config extends Mage_Core_Model_Config_Base -{ - public function __construct() - { - parent::__construct(Mage::getConfig()->getNode('global')); - } - - public function initForeignConnection($data) - { - $connectionNode = $this->getNode('resources/oscommerce_foreign/connection'); - if ($connectionNode) { - $connectionNode->addChild('host', isset($data['host']) ? $data['host'] : ''); - $connectionNode->addChild('username', isset($data['db_user']) ? $data['db_user'] : ''); - $connectionNode->addChild('password', isset($data['db_password']) ? $data['db_password'] : ''); - $connectionNode->addChild('dbname', isset($data['db_name']) ? $data['db_name'] : ''); - } - } -} diff --git a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce.php b/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce.php deleted file mode 100644 index de9ee9fc22..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce.php +++ /dev/null @@ -1,2113 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Mysql4_Oscommerce extends Mage_Core_Model_Mysql4_Abstract -{ - const DEFAULT_DISPLAY_MODE = 'PRODUCTS'; - const DEFAULT_IS_ANCHOR = '0'; - const DEFAULT_STORE = 'Default'; - const DEFAULT_PRODUCT_TYPE = 'Simple'; - const DEFAULT_ATTRIBUTE_SET = 'Default'; - const DEFAULT_VISIBILITY = 'Catalog, Search'; - const DEFAULT_LOCALE = 'en_US'; - const DEFAULT_MAGENTO_CHARSET = 'UTF-8'; - const DEFAULT_OSC_CHARSET = 'ISO-8859-1'; - const DEFAULT_FIELD_CHARSET = 'utf8'; - - protected $_currentWebsiteId; - protected $_currentWebsite; - - protected $_importType = array(); - protected $_countryIdToCode = array(); - protected $_countryNameToCode = array(); - protected $_regionCode = array(); - protected $_logData = array(); - protected $_languagesToStores = array(); - protected $_prefix = ''; - protected $_storeLocales = array(); - protected $_rootCategory = ''; - - protected $_websiteCode = ''; - protected $_isProductWithCategories = false; - protected $_setupConnection ; - protected $_customerIdPair = array(); - protected $_categoryIdPair = array(); - protected $_prefixPath = ''; - protected $_stores = array(); - protected $_productsToCategories = array(); - protected $_productsToStores = array(); - protected $_connectionCharset; - protected $_dataCharset; - protected $_maxRows; - protected $_oscStores; - protected $_oscDefaultLanguage; - protected $_oscStoreInformation; - protected $_categoryModel; - protected $_customerModel; - protected $_productModel; - protected $_productAdapterModel; - protected $_orderModel; - protected $_addressModel; - protected $_websiteModel; - protected $_storeGroupModel; - protected $_configModel; - protected $_customerGroupModel; - protected $_storeModel; - protected $_importCollection; - protected $_saveRows = 0; - protected $_errors = array(); - protected $_importModel; - protected $_lengthShortDescription; - protected $_currentUserId; - - protected $_oscTables = array( - 'products', 'customers', 'categories', 'orders', 'languages', - 'orders_products', 'orders_status_history', 'orders_total', - 'products_description', 'address_book', 'categories_description' - ); - - protected function _construct() - { - $this->_init('oscommerce/oscommerce', 'import_id'); - $this->_setupConnection = Mage::getSingleton('core/resource')->getConnection('oscommerce_setup'); - $this->_currentWebsite = Mage::app()->getWebsite(); - $this->_currentWebsiteId = $this->_currentWebsite->getId(); - $this->_maxRows = Mage::getStoreConfig('oscommerce/import/max_rows'); - $this->_lengthShortDescription = Mage::getStoreConfig('oscommerce/import/short_description_length'); - } - - /** - * Get paypal session namespace - * - * @return Mage_Paypal_Model_Session - */ - public function getSession() - { - return Mage::getSingleton('oscommerce/session'); - } - - /** - * Get website object - * - * @return Mage_Core_Model_Website - */ - public function getCurrentWebsite() - { - return $this->_currentWebsite; - } - - protected function _beforeSave(Mage_Core_Model_Abstract $object) - { - if (!$object->getCreatedAt()) { - $object->setCreatedAt($this->formatDate(time())); - } - $object->setUpdatedAt($this->formatDate(time())); - parent::_beforeSave($object); - } - - /** - * Getting external connection adapter - * - * @return object - */ - protected function _getForeignAdapter() - { - return $this->_getConnection('foreign'); - } - - /** - * Get store code by id - * - * @param integer $id - * @return string - */ - public function getStoreCodeById($id) - { - if (!$this->_stores) { - $stores = Mage::app()->getStores(); - foreach($stores as $store) { - $this->_stores[$store->getId()] = $store->getCode(); - } - } - if (isset($this->_stores[$id])) { - return $this->_stores[$id]; - } - return false; - } - - public function setWebsiteCode($code) - { - if (isset($code)) $this->_websiteCode = $code; - } - - /** - * Create new website or set current website as default website - * - * @param integer $websiteId - */ - public function createWebsite($websiteId = null) - { - $importModel = $this->getImportModel(); - $websiteModel = $this->getWebsiteModel(); - if (!is_null($websiteId)) { - $websiteModel->load($websiteId); - } - - if (!$websiteModel->getId()) { - $storeInfo = $this->getOscStoreInformation(); - if ($this->_websiteCode && !($websiteModel->load($this->_websiteCode)->getId())) { - $websiteModel->setName($storeInfo['STORE_NAME']); - $websiteModel->setCode($this->_websiteCode ? $this->_websiteCode : $this->_format($storeInfo['STORE_NAME'])); - $websiteModel->save(); - } - } - - - if ($websiteModel->getId()) { - $this->saveLogs(array( 0 => $websiteModel->getId()), 'website'); - } - - /** - * Create Root category - */ - $this->createRootCategory(); - - /** - * Create default store group - */ - $this->createStoreGroup(); - } - - public function createStoreGroup() - { - $importModel = $this->getImportModel(); - $storeInfo = $this->getOscStoreInformation(); - $websiteModel = $this->getWebsiteModel(); - if (!$websiteModel->getId()) { - $websiteModel->load($this->_currentWebsiteId); // NEED TO GET DEFAULT WEBSITE ID FROM CONFIG - } - $storeGroupModel = $this->getStoreGroupModel(); - $storeGroupModel->unsetData(); - $storeGroupModel->setOrigData(); - - $storeGroupName = Mage::helper('oscommerce')->__('%s Store', $websiteModel->getId() == $this->_currentWebsiteId ? $storeInfo['STORE_NAME'] : $websiteModel->getName()); - $storeGroupModel->setWebsiteId($websiteModel->getId()); - $storeGroupModel->setName($storeGroupName); - $storeGroupModel->setRootCategoryId($this->getRootCategory()->getId()); - - try { - $storeGroupModel->save(); - - $websiteModel->setDefaultGroupId($storeGroupModel->getId()); - $websiteModel->save(); - } - catch (Exception $e) { - - } - - $this->saveLogs(array(0 => $storeGroupModel->getId(), 'group')); - return $this; - } - - public function createRootCategory() - { - $importModel = $this->getImportModel(); - $categoryModel = $this->getCategoryModel(); - $categoryModel->unsetData(); - $categoryModel->setOrigData(); - - $websiteModel = $this->getWebsiteModel(); - if (!$websiteModel->getId()) { - $websiteModel->load($this->_currentWebsiteId); // NEED TO GET DEFAULT WEBSITE ID FROM CONFIG - } - - $storeInfo = $this->getOscStoreInformation(); - - $categoryName = Mage::helper('oscommerce')->__('Root Category for %s', $websiteModel->getName()); - - $categoryModel->setStoreId(0); - $categoryModel->setIsActive(1); - $categoryModel->setDisplayMode(self::DEFAULT_DISPLAY_MODE); - $categoryModel->setName($categoryName); - $categoryModel->setParentId(1); - $categoryModel->setPath('1'); - - try { - $categoryModel->save(); - $this->saveLogs(array(0 => $categoryModel->getId()), 'root_category'); - } - catch (Exception $e) { - - } - - $this->setRootCategory(clone $categoryModel); - - return $this; - } - - /** - * Importing store data from osCommerce to Magento - * - * @param Mage_Oscommerce_Model_Oscommerce $obj - */ - public function importStores() - { - $importModel = $this->getImportModel(); - $locales = $this->getStoreLocales(); - $defaultStore = ''; - $storeInformation = $this->getOscStoreInformation(); - $defaultStoreCode = $storeInformation['DEFAULT_LANGUAGE']; - $configModel = $this->getConfigModel(); - $storeModel = $this->getStoreModel(); - $storeGroupModel = $this->getStoreGroupModel(); - $storeGroupId = $storeGroupModel->getId(); - $websiteModel = $this->getWebsiteModel(); - $websiteId = $websiteModel->getId(); - $storePairs = array(); - if ($stores = $this->getOscStores()) { - foreach($stores as $store) { - try { - $oscStoreId = $store['id']; - unset($store['id']); - - $store['group_id'] = $storeGroupId; - $store['website_id'] = $websiteId; - $storeModel->unsetData(); - $storeModel->setOrigData(); - $storeModel->load($store['code']); - if ($storeModel->getId() && $storeModel->getCode() == $store['code']) { - $localeCode = $locales[$store['code']]; - unset($locales[$store['code']]); - $store['code'] = $store['code'].'_'.$websiteId.time(); // for unique store code - $locales[$store['code']] = $localeCode; - } - $store['name'] = $this->convert($store['name']); - $storeModel->unsetData(); - $storeModel->setOrigData(); - $storeModel->setData($store); - $storeModel->save(); - - $storePairs[$oscStoreId] = $storeModel->getId(); - - $storeLocale = isset($locales[$storeModel->getCode()])?$locales[$storeModel->getCode()]: $locales['default']; - - $configModel->unsetData(); - $configModel->setOrigData(); - $configModel->setScope('stores') - ->setScopeId($storeModel->getId()) - ->setPath('general/locale/code') - ->setValue($storeLocale) - ->save(); - if ($store['scode'] == $defaultStoreCode) { - $defaultStore = $storeModel->getId(); - } - Mage::dispatchEvent('store_add', array('store'=>$storeModel)); - } catch (Exception $e) { - //echo $e->getMessage(); - } - } - } - if (sizeof($storePairs) > 0) { - $this->saveLogs($storePairs, 'store'); - } - $this->setStoreLocales($locales); - - if ($defaultStore) { - $storeGroupModel->setDefaultStoreId($defaultStore); - $storeGroupModel->save(); - } - Mage::app()->reinitStores(); - unset($stores); - } - - /** - * Importing customer/address from osCommerce to Magento - * - * @param Mage_Oscommerce_Model_Oscommerce $obj - */ - public function importCustomers($startFrom = 0, $useStartFrom = false, $sendSubscription = true) - { - $this->_resetSaveRows(); - $this->_resetErrors(); - $totalCustomers = $this->getTotalCustomers(); - $maxRows = $this->getMaxRows(); - $pages = floor($totalCustomers / $maxRows) + 1; - - if (!$useStartFrom) { - for ($i = 0; $i < $pages; $i++) { - if ($customers = $this->getCustomers(array('from'=>($i * $maxRows),'max'=>$maxRows))) { - foreach ($customers as $customer) { - $customer['sendSubscription'] = $sendSubscription; - $this->_saveCustomer($customer); - } - } - } - } else { - if ($customers = $this->getCustomers(array('from'=> $startFrom ,'max'=>$maxRows))) { - foreach ($customers as $customer) { - $customer['sendSubscription'] = $sendSubscription; - $this->_saveCustomer($customer); - } - } - } - } - - /** - * Save customer data - * - * @param Mage_Oscommerce_Model_Oscommerce $obj - * @param array $data - */ - protected function _saveCustomer($data = null) { - $addressFieldMapping = array( - 'street' => 'entry_street_address', - 'firstname' => 'entry_firstname', - 'lastname' => 'entry_lastname', - 'city' => 'entry_city', - 'region' => 'entry_state' - ); - $importModel = $this->getImportModel(); - $timezone = $importModel->getTimezone(); - if (!is_null($data)) { - $customerAddresses = array(); - // Getting customer group data - $customerGroupId = Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID); - $customerGroupModel = $this->getCustomerGroupModel()->load($customerGroupId); - $websiteId = $this->getWebsiteModel()->getId(); - $customerModel = $this->getCustomerModel(); - $addressModel = $this->getAddressModel(); - $oscCustomerId = $data['id']; - $data['group_id'] = $customerGroupModel->getName(); - - $prepareCreated = explode(' ', $data['created_at']); - $dateFormat = 'YYYY-MM-dd HH:mm:ss'; - $dateCreated = new Zend_Date(); - $dateCreated->setTimezone($timezone); - $dateCreated->setDate($prepareCreated[0], 'YYYY-MM-dd'); - $dateCreated->setTime($prepareCreated[1], 'HH:mm:ss'); - $dateCreated->setTimezone('GMT'); - $data['created_at'] = $dateCreated->toString($dateFormat); - - foreach($data as $field => $value) { - if (in_array($field, array('firstname', 'lastname'))) { - $value = $this->convert($value); - } - $data[$field] = html_entity_decode($value, ENT_QUOTES, self::DEFAULT_MAGENTO_CHARSET); - - } - - - // Getting addresses - $addresses = $this->getAddresses($data['id']); - if ($addresses) { - foreach ($addresses as $address) { - foreach ($address as $field => $value) { - - if ($field == 'street1') { - $field = 'street'; - } - if ($field == 'country_id') { - $value = $this->getCountryCodeById($value); - $field = 'country'; - } - if ($field == 'region_id' - && in_array($address['country_id'], array(38, 223))) { - $field = 'region'; - } - - if (in_array($field, array_keys($addressFieldMapping))) { - $value = $this->convert($value); - } - - if (!in_array($field, array('customers_id'))) { - $address[$field] = $value; - } else { - unset($address[$field]); - } - } - $address['country_id'] = $address['country']; - unset($address['country']); - $customerAddresses[] = $address; - } - } - $defaultBilling = ''; - $defaultBilling = $data['default_billing']; - unset($data['default_billing']); - unset($data['id']); - - try { - $customerModel->setData($data); - $customerModel->setImportMode(true); - $customerModel->setWebsiteId($websiteId > 0 ? $websiteId: $this->getCurrentWebsite()->getId()); - $customerModel->save(); - $customerId = $customerModel->getId(); - - if ($customerAddresses) foreach ($customerAddresses as $customerAddress) { - $customerAddress['telephone'] = $data['telephone']; - $customerAddress['fax'] = $data['fax']; - $addressModel->unsetData(); - $addressModel->setData($customerAddress); - $addressModel->setCustomerId($customerId); - $addressModel->setId(null); - $addressModel->save(); - if ($defaultBilling == $customerAddress['id']) { - $addressId = $addressModel->getId(); - $customerModel->setDefaultBilling($addressId); - $customerModel->setDefaultShipping($addressId); - } - } - $customerModel->save(); - $this->saveLogs(array($oscCustomerId => $customerId), 'customer'); - $this->_saveRows++; - } catch (Exception $e) { - $this->_addErrors(Mage::helper('oscommerce')->__('Email %s cannot be saved because of %s.', $data['email'], $e->getMessage())); - } - } - } - - public function getCustomerIdPair() - { - if (!$this->_customerIdPair) { - $this->_customerIdPair = $this->getLogPairsByTypeCode('customer'); - } - return $this->_customerIdPair; - } - - public function setCustomerIdPair($data) - { - if (is_array($data)) { - $this->_customerIdPair = $data; - } - } - - public function importCategories($startFrom = 0, $useStartFrom = false) - { - $importModel = $this->getImportModel(); - $this->_logData['type_id'] = $this->getImportTypeIdByCode('category'); - $this->_logData['import_id'] = $importModel->getId(); - $categoryModel = $this->getCategoryModel(); - - $this->_resetSaveRows(); - $this->_resetErrors(); - $maxRows = $this->getMaxRows(); - $totalCategories = $this->getCategoriesCount(); - - $pages = floor($totalCategories / $maxRows) + 1; - if (!$useStartFrom) { - for ($i = 0; $i < $pages; $i++) { - if ($categories = $this->getCategories(array('from'=> $i * $maxRows,'max'=>$maxRows))) { - foreach ($categories as $category) { - $this->_saveCategory($category); - } - } - } - } else { - if ($categories = $this->getCategories(array('from'=> $startFrom ,'max'=>$maxRows))) { - foreach ($categories as $category) { - $this->_saveCategory($category); - } - } - } - } - - protected function _saveCategory($data) { - $importModel = $this->getImportModel(); - $categoryModel = $this->getCategoryModel(); - $oscCategoryId = $data['id']; - unset($data['id']); - try { - $data['store_id'] = 0; - $data['is_active'] = 1; - $data['display_mode'] = self::DEFAULT_DISPLAY_MODE; - $data['is_anchor'] = self::DEFAULT_IS_ANCHOR; - $data['attribute_set_id'] = $categoryModel->getDefaultAttributeSetId(); - $data['name'] = $this->convert($data['name']); - $data['meta_title'] = html_entity_decode($data['name'], ENT_QUOTES, self::DEFAULT_MAGENTO_CHARSET); - $categoryModel->setData($data); - $categoryModel->save(); - $categoryId = $categoryModel->getId(); - $this->saveLogs(array($oscCategoryId => $categoryId), 'category'); - - // saving data for different (encoding has been done in getCategoryToStores method) - $storeData = $data['stores']; - unset($data['stores']); - if (isset($storeData)) { - foreach($storeData as $storeId=>$catData) { - $categoryModel->setStoreId($storeId)->setName($catData['name'])->setMetaTitle($catData['name']) - ->save(); - } - } - $this->_saveRows++; - } catch (Exception $e) { - $this->_addErrors(Mage::helper('oscommerce')->__('Category %s cannot be saved because of %s.', $data['name'], $e->getMessage())); - } - } - - - - public function buildCategoryPath() - { - $categoryIdPair = $this->getCategoryIdPair(); - $importModel = $this->getImportModel(); - if ($categoryIdPair) foreach ($categoryIdPair as $oscommerceId => $magentoId) { - $path = $this->getRootCategory()->getPath().'/'.join('/',$this->getCategoryPath($oscommerceId)); - $this->_getWriteAdapter()->raw_query("UPDATE `{$this->getTable('catalog_category')}` SET `path`='{$path}' WHERE `entity_id`={$magentoId}"); - } - } - - public function getCategoryPath($categoryId) - { - $categoryIdPair = $this->getCategoryIdPair(); - $select = "SELECT `c`.`parent_id` FROM `{$this->getOscTable('categories')}` c "; - $select .= " WHERE `c`.`categories_id`={$categoryId}"; - if ($parentId = $this->_getForeignAdapter()->fetchOne($select)) { - if ($result = $this->getCategoryPath($parentId)) { - if (!isset($results)) { - $results = $result; - } else { - array_merge($results, $result); - } - } else { - $results[] = $categoryIdPair[$parentId]; - } - } - $results[] = $categoryIdPair[$categoryId]; - return $results; - } - - public function getCategoryIdPair() - { - if (!$this->_categoryIdPair) { - $this->_categoryIdPair = $this->getLogPairsByTypeCode('category'); - } - return $this->_categoryIdPair; - } - - public function setCategoryIdPair($data) - { - if (is_array($data)) { - $this->_categoryIdPair = $data; - } - } - - /** - * Import products - * - * @param Mage_Oscommerce_Model_Oscommerce $obj - */ - public function importProducts($startFrom = 0, $useStartFrom = false) - { - $importModel = $this->getImportModel(); - $productAdapterModel = Mage::getModel('catalog/convert_adapter_product'); - $productModel = $this->getProductModel(); - $taxCollections = $this->_getTaxCollections(); - $this->_resetSaveRows(); - $this->_resetErrors(); - $maxRows = $this->getMaxRows(); - $totalProducts = $this->getProductsCount(); - $pages = floor($totalProducts / $maxRows) + 1; - if (!$useStartFrom) { - for ($i = 0; $i < $pages; $i++) { - if ($products = $this->getProducts(array('from'=> $i * $maxRows,'max'=>$maxRows))) { - foreach ($products as $product) { - if (!empty($product['tax_class_id'])) { - $product['tax_class_id'] = $taxCollections[$product['tax_class_id']]; - } - $this->_saveProduct($product); - } - } - } - } else { - if ($products = $this->getProducts(array('from'=> $startFrom ,'max'=>$maxRows))) { - foreach ($products as $product) { - if (!empty($product['tax_class_id'])) { - $product['tax_class_id'] = $taxCollections[$product['tax_class_id']]; - } - $this->_saveProduct($product); - } - } - } - } - - /** - * Save products data - * - * @param Mage_Oscommerce_Model_Oscommerce $obj - * @param array $data - */ - protected function _saveProduct($data) { - $importModel = $this->getImportModel(); - $productAdapterModel = $this->getProductAdapterModel(); - $productModel = $this->getProductModel(); - $mageStores = $this->getLanguagesToStores(); - $storeInfo = $this->getOscStoreInformation(); - $storeName = $storeInfo['STORE_NAME']; - $oscProductId = $data['id']; - unset($data['id']); - if ($this->_isProductWithCategories) { - if ($categories = $this->getProductCategories($oscProductId)) - $data['category_ids'] = $categories; - } - - /** - * Checking product by using sku and website - */ - if (empty($data['sku'])) { - $data['sku'] = $storeName . ' - ' . $oscProductId; - } - $productModel->unsetData(); - $productId = $productModel->getIdBySku($data['sku']); - $productModel->load($productId); - if ($productModel->getId()) { - $websiteIds = $productModel->getWebsiteIds(); - - if ($websiteIds) foreach($websiteIds as $websiteId) { - if ($websiteId == $this->getWebsiteModel()->getId()) { - $this->_addErrors(Mage::helper('oscommerce')->__('SKU %s was not imported since it already exists in %s', - $data['sku'], - $this->getWebsiteModel()->getName())); - return ; - } - } - } - try { - if (isset($data['image'])) { - if (substr($data['image'], 0,1) != DS) { - $data['image'] = DS . $data['image']; - } - - if (!file_exists(Mage::getBaseDir('media'). DS . 'import' . $data['image'])) { - unset($data['image']); - } else { - $data['thumbnail'] = $data['small_image'] = $data['image']; - } - } - if ($stores = $this->getProductStores($oscProductId)) { - - foreach ($stores as $storeId => $store) { - if (!$storeCode = $this->getStoreCodeById($mageStores[$storeId])) { - $storeCode = $this->getCurrentWebsite()->getDefaultStore()->getCode(); - } - $data['store'] = $storeCode; - $data['name'] = html_entity_decode($this->convert($store['name']), ENT_QUOTES, self::DEFAULT_MAGENTO_CHARSET); - $data['description'] = html_entity_decode($this->convert($store['description']), ENT_QUOTES, self::DEFAULT_MAGENTO_CHARSET); - $data['short_description'] = $data['description']; - $productAdapterModel->saveRow($data); - } - } - - $productId = $productAdapterModel->getProductModel()->getId(); - $this->saveLogs(array($oscProductId => $productId), 'product'); - $this->_saveRows++; - } catch (Exception $e) { - $this->_addErrors(Mage::helper('oscommerce')->__('SKU %s cannot be saved because of %s.', $data['sku'], $e->getMessage())); - } - } - - public function importOrders($startFrom = 0, $useStartFrom = false) - { - $importModel = $this->getImportModel(); - $this->_resetSaveRows(); - $this->_resetErrors(); - // Get orders - - $totalOrders = $this->getOrdersCount(); - $maxRows = $this->getMaxRows(); - $pages = floor($totalOrders / $maxRows) + 1; - - if (!$useStartFrom) { - for ($i = 0; $i < $pages; $i++) { - $orders = $this->getOrders(array('from' => $i * $maxRows, 'max' => $maxRows)); - if ($orders) foreach($orders as $order) { - $this->_saveOrder($order); - } - } - } else { - $orders = $this->getOrders(array('from' => $startFrom, 'max' => $maxRows)); - if ($orders) foreach($orders as $order) { - $this->_saveOrder($order); - } - } - } - - public function createOrderTables() - { - $importModel = $this->getImportModel(); - $importId = $importModel->getId(); - $websiteId = $this->getWebsiteModel()->getId(); - - $tables = array( - 'orders' => "CREATE TABLE `{$this->getTable('oscommerce_order')}` ( - `osc_magento_id` int(11) NOT NULL auto_increment, - `orders_id` int(11) NOT NULL default '0', - `customers_id` int(11) NOT NULL default '0', - `magento_customers_id` int(11) NOT NULL default '0', - `import_id` int(11) NOT NULL default '0', - `website_id` int(11) NOT NULL default '0', - `customers_name` varchar(64) NOT NULL default '', - `customers_company` varchar(32) default NULL, - `customers_street_address` varchar(64) NOT NULL default '', - `customers_suburb` varchar(32) default NULL, - `customers_city` varchar(32) NOT NULL default '', - `customers_postcode` varchar(10) NOT NULL default '', - `customers_state` varchar(32) default NULL, - `customers_country` varchar(32) NOT NULL default '', - `customers_telephone` varchar(32) NOT NULL default '', - `customers_email_address` varchar(96) NOT NULL default '', - `customers_address_format_id` int(5) NOT NULL default '0', - `delivery_name` varchar(64) NOT NULL default '', - `delivery_company` varchar(32) default NULL, - `delivery_street_address` varchar(64) NOT NULL default '', - `delivery_suburb` varchar(32) default NULL, - `delivery_city` varchar(32) NOT NULL default '', - `delivery_postcode` varchar(10) NOT NULL default '', - `delivery_state` varchar(32) default NULL, - `delivery_country` varchar(32) NOT NULL default '', - `delivery_address_format_id` int(5) NOT NULL default '0', - `billing_name` varchar(64) NOT NULL default '', - `billing_company` varchar(32) default NULL, - `billing_street_address` varchar(64) NOT NULL default '', - `billing_suburb` varchar(32) default NULL, - `billing_city` varchar(32) NOT NULL default '', - `billing_postcode` varchar(10) NOT NULL default '', - `billing_state` varchar(32) default NULL, - `billing_country` varchar(32) NOT NULL default '', - `billing_address_format_id` int(5) NOT NULL default '0', - `payment_method` varchar(255) NOT NULL default '', - `cc_type` varchar(20) default NULL, - `cc_owner` varchar(64) default NULL, - `cc_number` varchar(32) default NULL, - `cc_expires` varchar(4) default NULL, - `last_modified` datetime default NULL, - `date_purchased` datetime default NULL, - `orders_status` varchar(32) default NULL, - `orders_date_finished` datetime default NULL, - `currency` varchar(3) default NULL, - `currency_value` decimal(14,6) default NULL, - `currency_symbol` varchar(3) default NULL, - `orders_total` decimal(14,6) default NULL, - PRIMARY KEY (`osc_magento_id`), - KEY `idx_orders_customers_id` (`customers_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8; - " - , 'orders_products' => "CREATE TABLE `{$this->getTable('oscommerce_order_products')}` ( - `orders_products_id` int(11) NOT NULL auto_increment, - `osc_magento_id` int(11) NOT NULL default '0', - `products_id` int(11) NOT NULL default '0', - `products_model` varchar(12) default NULL, - `products_name` varchar(64) NOT NULL default '', - `products_price` decimal(15,4) NOT NULL default '0.0000', - `final_price` decimal(15,4) NOT NULL default '0.0000', - `products_tax` decimal(7,4) NOT NULL default '0.0000', - `products_quantity` int(2) NOT NULL default '0', - PRIMARY KEY (`orders_products_id`), - KEY `idx_orders_products_osc_magento_id` (`osc_magento_id`), - KEY `idx_orders_products_products_id` (`products_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8; - " - - , 'orders_total' => "CREATE TABLE IF NOT EXISTS `{$this->getTable('oscommerce_order_total')}` ( - `orders_total_id` int(10) unsigned NOT NULL auto_increment, - `osc_magento_id` int(11) NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - `text` varchar(255) NOT NULL default '', - `value` decimal(15,4) NOT NULL default '0.0000', - `class` varchar(32) NOT NULL default '', - `sort_order` int(11) NOT NULL default '0', - PRIMARY KEY (`orders_total_id`), - KEY `idx_orders_total_osc_magento_id` (`osc_magento_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8;" - - , 'orders_status_history'=>"CREATE TABLE IF NOT EXISTS `{$this->getTable('oscommerce_order_history')}` ( - `orders_status_history_id` int(11) NOT NULL auto_increment, - `osc_magento_id` int(11) NOT NULL default '0', - `orders_status_id` int(5) NOT NULL default '0', - `date_added` datetime NOT NULL default '0000-00-00 00:00:00', - `customer_notified` int(1) default '0', - `comments` text, - `orders_status` varchar(32) default NULL, - PRIMARY KEY (`orders_status_history_id`), - KEY `idx_orders_status_history_osc_magento_id` (`osc_magento_id`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8;" - - ); - - $conn = $this->_setupConnection; - foreach ($tables as $table => $schema) { - $conn->beginTransaction(); - try { - $conn->query($schema); - $conn->commit(); - } catch (Exception $e) { -// $conn->rollBack(); - } - } - - $this->checkOrderField(); - } - - public function setTablePrefix($prefix) - { - if (isset($prefix)) $this->_prefix = $prefix; - } - - public function getTablePrefix() - { - return $this->_prefix; - } - - public function setIsProductWithCategories($yn) - { - if (is_bool($yn)) { - $this->_isProductWithCategories = $yn; - } - } - - /** - * Logging imported data to oscommerce_ref table - * - * @param array data - */ - public function log($data = array()) - { - if (isset($data)) { - $this->_getWriteAdapter()->beginTransaction(); - try { - $this->_getWriteAdapter()->insert($this->getTable('oscommerce_ref'), $data); - $this->_getWriteAdapter()->commit(); - } catch (Exception $e) { - $this->_getWriteAdapter()->rollBack(); - } - } - } - - public function getOscStoreInformation() - { - if (!$this->_oscStoreInformation) { - $select = "SELECT `configuration_key` `key`, `configuration_value` `value` FROM `{$this->getOscTable('configuration')}`"; - $select .= " WHERE `configuration_key` IN ('STORE_NAME', 'STORE_OWNER', 'STORE_OWNER_EMAIL', 'STORE_COUNTRY',' STORE_ZONE','DEFAULT_LANGUAGE')"; - if (!($result = $this->_getForeignAdapter()->fetchPairs($select))) { - $result = array(); - } - $this->_oscStoreInformation = $result; - } - return $this->_oscStoreInformation; - } - - /** - * Getting products data from osCommerce - * - */ - public function getProducts($limit = array()) - { - $defaultLanguage = $this->getOscDefaultLanguage(); - $defaultLanguageId = $defaultLanguage['id']; - $code = $this->getWebsiteModel()->getCode(); - $website = $code? $code: $this->getCurrentWebsite()->getCode(); - $connection = $this->_getForeignAdapter(); - $select = " SELECT `p`.`products_id` `id`, `p`.`products_quantity` `qty` "; - $select .= " , `p`.`products_model` `sku`, `p`.`products_price` `price`"; - $select .= " , `p`.`products_image` `image` "; - $select .= " , `p`.`products_weight` `weight`, IF(`p`.`products_status`,'Enabled','Disabled') `status` "; - $select .= " , IF(`p`.`products_status`,'1','0') `is_in_stock`"; - $select .= " , `pd`.`products_name` `name`, `pd`.`products_description` `description` "; -// $select .= " , `tc`.`tax_class_title` `tax_class_id`, IF(1,'".self::DEFAULT_VISIBILITY."','') `visibility` "; - $select .= " , `p`.`products_tax_class_id` `tax_class_id`, IF(1,'".self::DEFAULT_VISIBILITY."','') `visibility` "; - $select .= " , `sp`.`specials_new_products_price` `special_price` "; - $select .= " , `sp`.`specials_date_added` `special_from_date` "; - $select .= " , `sp`.`expires_date` `special_to_date` "; - $select .= " , IF(1,'".self::DEFAULT_ATTRIBUTE_SET."','') `attribute_set` "; - $select .= " , IF(1,'".self::DEFAULT_PRODUCT_TYPE ."','') `type` "; - //$select .= ", IF(1,'".self::DEFAULT_STORE."','') `store` "; - $select .= " , IF(1,'".$website."','') `website` "; - $select .= " FROM `{$this->getOscTable('products')}` p LEFT JOIN `{$this->getOscTable('products_description')}` pd "; - $select .= " ON `pd`.`products_id`=`p`.`products_id` AND `pd`.`language_id`={$defaultLanguageId} "; -// $select .= " LEFT JOIN `{$this->getOscTable('tax_class')}` tc ON `tc`.`tax_class_id`=`p`.`products_tax_class_id` "; - $select .= " LEFT JOIN `{$this->getOscTable('specials')}` sp ON `sp`.`products_id`=`p`.`products_id` "; - if ($limit && isset($limit['from']) && isset($limit['max'])) { - $select .= " LIMIT {$limit['from']}, {$limit['max']}"; - } - if (!($result = $this->_getForeignAdapter()->fetchAll($select))) { - $result = array(); - } - return $result; - } - - public function getProductsCount() - { - return $this->_getForeignAdapter()->fetchOne("SELECT count(*) FROM `{$this->getOscTable('products')}`"); - } - - public function getCategoriesCount() - { - return $this->_getForeignAdapter()->fetchOne("SELECT count(*) FROM `{$this->getOscTable('categories')}`"); - } - - public function getCustomersCount() - { - return $this->_getForeignAdapter()->fetchOne("SELECT count(*) FROM `{$this->getOscTable('customers')}`"); - } - - public function getOrdersCount() - { - return $this->_getForeignAdapter()->fetchOne("SELECT count(*) FROM `{$this->getOscTable('orders')}`"); - } - - public function getOrders($limit = array()) { - $defaultLanguage = $this->getOscDefaultLanguage(); - $defaultLanguageId = $defaultLanguage['id']; - $select = "SELECT `o`.`orders_id`, `o`.`customers_id`, `o`.`customers_name`"; - $select .= " ,`o`.`customers_company`,`o`.`customers_street_address`"; - $select .= " ,`o`.`customers_suburb`, `o`.`customers_city`"; - $select .= " ,`o`.`customers_postcode`, `o`.`customers_state`"; - $select .= " ,`o`.`customers_country`, `o`.`customers_telephone`"; - $select .= " ,`o`.`customers_email_address`, `o`.`customers_address_format_id`"; - $select .= " ,`o`.`delivery_name`, `o`.`delivery_company`"; - $select .= " ,`o`.`delivery_street_address`, `o`.`delivery_suburb`"; - $select .= " ,`o`.`delivery_city`, `o`.`delivery_postcode`, `o`.`delivery_state`"; - $select .= " ,`o`.`delivery_country`, `o`.`delivery_address_format_id`"; - $select .= " ,`o`.`billing_name`, `o`.`billing_company`"; - $select .= " ,`o`.`billing_street_address`, `o`.`billing_suburb`"; - $select .= " ,`o`.`billing_city`, `o`.`billing_postcode`, `o`.`billing_state`"; - $select .= " ,`o`.`billing_country`, `o`.`billing_address_format_id`"; - $select .= " ,`o`.`payment_method`, `o`.`cc_type`, `o`.`cc_owner`, `o`.`cc_number`"; - $select .= " ,`o`.`cc_expires`, `o`.`last_modified`, `o`.`date_purchased`"; - $select .= " ,`o`.`orders_status`, `o`.`orders_date_finished`, `o`.`currency`, `o`.`currency_value`"; - $select .= " ,`c`.`symbol_left` `currency_symbol`,`ot`.`value` `orders_total`"; - $select .= " ,`os`.`orders_status_name` FROM `{$this->getOscTable('orders')}` `o`"; - $select .= " LEFT JOIN `{$this->getOscTable('currencies')}` `c` ON `c`.`code`=`o`.`currency` "; - $select .= " LEFT JOIN `{$this->getOscTable('orders_total')}` `ot` ON `ot`.`orders_id`=`o`.`orders_id` "; - $select .= " AND `ot`.`class`='ot_total'"; - $select .= " LEFT JOIN `{$this->getOscTable('orders_status')}` os ON `os`.`orders_status_id`=`o`.`orders_status` "; - $select .= " AND `os`.`language_id`={$defaultLanguageId} "; - if (isset($limit) && isset($limit['from']) && isset($limit['max'])) { - $select .= " LIMIT {$limit['from']}, {$limit['max']} "; - } - if (!($result = $this->_getForeignAdapter()->fetchAll($select))) { - $result = array(); - } - return $result; - } - - protected function _saveOrder($data) - { - $fieldNoEnc = array( - 'customers_id', - 'orders_id', - 'date_purchased', - 'last_modified', - 'orders_date_finished', - 'orders_products_id', - 'osc_magento_id', - 'products_id' - ); - - $importModel = $this->getImportModel(); - $timezone = $importModel->getTimezone(); - $customerIdPair = $this->getCustomerIdPair(); - $importId = $importModel->getId(); - $websiteId = $this->getWebsiteModel()->getId(); - if ($data['customers_id'] > 0 && isset($this->_customerIdPair[$data['customers_id']])) { - foreach($data as $field => $value) { - if (!in_array($field, $fieldNoEnc)) { - $data[$field] = $this->convert($value); - } - } - - if ($data['date_purchased']) { - $preparePurchased = explode(' ', $data['date_purchased']); - $dateFormat = 'YYYY-MM-dd HH:mm:ss'; - $datePurchased = new Zend_Date(); - $datePurchased->setTimezone($timezone); - $datePurchased->setDate($preparePurchased[0], 'YYYY-MM-dd'); - $datePurchased->setTime($preparePurchased[1], 'HH:mm:ss'); - $datePurchased->setTimezone('GMT'); - $data['date_purchased'] = $datePurchased->toString($dateFormat); - } - - if ($data['last_modified']) { - $prepareModified = explode(' ', $data['last_modified']); - $dateModified = new Zend_Date(); - $dateModified->setTimezone($timezone); - $dateModified->setDate($prepareModified[0], 'YYYY-MM-dd'); - $dateModified->setTime($prepareModified[1], 'HH:mm:ss'); - $dateModified->setTimezone('GMT'); - $data['last_modified'] = $dateModified->toString($dateFormat); - } - - if ($data['orders_date_finished']) { - $prepareFinished = explode(' ', $data['orders_date_finished']); - $dateFinished = new Zend_Date(); - $dateFinished->setTimezone($timezone); - $dateFinished->setDate($prepareFinished[0], 'YYYY-MM-dd'); - $dateFinished->setTime($prepareFinished[1], 'HH:mm:ss'); - $dateFinished->setTimezone('GMT'); - $data['orders_date_finished'] = $dateFinished->toString($dateFormat); - } - - $data['magento_customers_id'] = $this->_customerIdPair[$data['customers_id']]; // get Magento CustomerId - $data['import_id'] = $importId; - $data['website_id'] = $websiteId; - $data['orders_status'] = $data['orders_status_name']; - unset($data['orders_status_name']); - $this->_getWriteAdapter()->insert($this->getTable('oscommerce_order'), $data); - $oscMagentoId = $this->_getWriteAdapter()->lastInsertId(); - $this->_saveRows++; - - // Get orders products - $select = "SELECT `orders_products_id`, `orders_id`, `products_id` "; - $select .= ", `products_model`, `products_name`, `products_price`, `final_price` "; - $select .= ", `products_tax`, `products_quantity` "; - $select .= " FROM `{$this->getOscTable('orders_products')}` WHERE `orders_id`={$data['orders_id']}"; - if ($orderProducts = $this->_getForeignAdapter()->fetchAll($select)) { - foreach ($orderProducts as $orderProduct) { - unset($orderProduct['orders_id']); - unset($orderProduct['orders_products_id']); - $orderProduct['osc_magento_id'] = $oscMagentoId; - foreach ($orderProduct as $field => $value) { - if (!in_array($field, $fieldNoEnc)) { - $orderProduct[$field] = $this->convert($value); - } - } - $this->_getWriteAdapter()->insert($this->getTable('oscommerce_order_products'), $orderProduct); - } - } - - // Get orders totals - $select = "SELECT `orders_total_id`, `orders_id`, `title`, `text`, `value`, `class`, `sort_order` "; - $select .= " FROM `{$this->getOscTable('orders_total')}` WHERE `orders_id`={$data['orders_id']} ORDER BY `sort_order`"; - - if ($orderTotals = $this->_getForeignAdapter()->fetchAll($select)) { - foreach ($orderTotals as $orderTotal) { - - unset($orderTotal['orders_id']); - unset($orderTotal['orders_total_id']); - $orderTotal['osc_magento_id'] = $oscMagentoId; - $orderTotal['title'] = $this->convert($orderTotal['title']); - $orderTotal['text'] = $this->convert($orderTotal['text']); - $this->_getWriteAdapter()->insert($this->getTable('oscommerce_order_total'), $orderTotal); - } - } - - $defaultLanguage = $this->getOscDefaultLanguage(); - $defaultLanguageId = $defaultLanguage['id']; - - // Get orders status history - $select = "SELECT `osh`.`orders_status_history_id`, `osh`.`orders_id`, `osh`.`orders_status_id` "; - $select .= ", `os`.`orders_status_name` `orders_status`, `osh`.`date_added`, `osh`.`customer_notified`, `osh`.`comments` "; - $select .= " FROM `{$this->getOscTable('orders_status_history')}` osh "; - $select .= " LEFT JOIN `{$this->getOscTable('orders_status')}` os ON `os`.`orders_status_id`=`osh`.`orders_status_id` "; - $select .= " AND `os`.`language_id`={$defaultLanguageId}"; - $select .= " WHERE `osh`.`orders_id`={$data['orders_id']}"; - if ($orderHistories = $this->_getForeignAdapter()->fetchAll($select)) { - foreach ($orderHistories as $orderHistory) { - unset($orderHistory['orders_id']); - unset($orderHistory['orders_status_history_id']); - $orderHistory['osc_magento_id'] = $oscMagentoId; - $prepareAdded = explode(' ', $orderHistory['date_added']); - $dateFormat = 'YYYY-MM-dd HH:mm:ss'; - $dateAdded = new Zend_Date(); - $dateAdded->setTimezone($timezone); - $dateAdded->setDate($prepareAdded[0], 'YYYY-MM-dd'); - $dateAdded->setTime($prepareAdded[1], 'HH:mm:ss'); - $dateAdded->setTimezone('GMT'); - $orderHistory['date_added'] = $dateAdded->toString($dateFormat); - $orderHistory['orders_status'] = $this->convert($orderHistory['orders_status']); - $orderHistory['comments'] = $this->convert($orderHistory['comments']); - $orderHistory['customer_notified'] = $this->convert($orderHistory['customer_notified']); - - $this->_getWriteAdapter()->insert($this->getTable('oscommerce_order_history'), $orderHistory); - } - } - } else { - $this->_addErrors(Mage::helper('oscommerce')->__('Order #%s failed to import because the customer ID #%s associated with this order could not be found.', $data['orders_id'], $data['customers_id'])); - } - } - - /** - * Getting product description for different stores - * - * @param integer $productId - * @return mix array/boolean - */ - public function getProductStores($productId) { - if (!$this->_productsToStores) { - $select = "SELECT `products_id`, `language_id` `store`, `products_name` `name`, `products_description` `description`"; - $select .= " FROM `{$this->getOscTable('products_description')}` "; - if ($results = $this->_getForeignAdapter()->fetchAll($select)) { - foreach ($results as $result) { - $this->_productsToStores[$result['products_id']][$result['store']] = array('name'=>$result['name'], 'description' => $result['description']); - } - } - } - if (isset($this->_productsToStores[$productId])) { - return $this->_productsToStores[$productId]; - } - return false; - } - - /** - * Getting new created categories recursively using products of osCommerce - * - * @param integer $productId - * @return string - */ - public function getProductCategories($productId) - { - $importModel = $this->getImportModel(); - if (!$this->_productsToCategories) { - $select = "SELECT `products_id`, `categories_id` FROM `{$this->getOscTable('products_to_categories')}`"; - - if ($results = $this->_getForeignAdapter()->fetchAll($select)) { - $categories = array(); - foreach ($results as $result) { - $categories[$result['products_id']] = $result['categories_id']; - if (isset($categories[$result['products_id']])) { - $categories[$result['products_id']] .= ','.$result['categories_id']; - } else { - $categories[$result['products_id']] = $result['categories_id']; - } - } - //$categories = join(',', array_values($results)); - - //$this->_getReadAdapter(); - $importId = $importModel->getId(); - $typeId = $this->getImportTypeIdByCode('category'); - - - if ($categories) foreach ($categories as $product => $category) { - $select = $this->_getReadAdapter()->select(); - $select->from(array('osc'=>$this->getTable('oscommerce_ref')), array('id'=>'id','ref_id'=>'ref_id')); - $select->where("`osc`.`import_id`='{$importId}' AND `osc`.`type_id`='{$typeId}' AND `osc`.`value` in (".$category.")"); - $resultCategories = $this->_getReadAdapter()->fetchPairs($select); - if ($resultCategories) { - $this->_productsToCategories[$product] = join(',',array_values($resultCategories)); - } - } - } - } - if (isset($this->_productsToCategories[$productId])) { - return $this->_productsToCategories[$productId]; - } - return false; - } - - public function getCategories($limit = array()) { - $importModel = $this->getImportModel(); - $defaultLanguage = $this->getOscDefaultLanguage(); - $defaultLanguageId = $defaultLanguage['id']; - $select = "SELECT `c`.`categories_id` as `id`, `c`.`parent_id`, `cd`.`categories_name` `name` FROM `{$this->getOscTable('categories')}` c ";// WHERE `c`.`parent_id`={$parentId}"; - $select .= " INNER JOIN `{$this->getOscTable('categories_description')}` cd on `cd`.`categories_id`=`c`.`categories_id`"; - $select .= " AND `cd`.`language_id`={$defaultLanguageId} "; - if ($limit && isset($limit['from']) && isset($limit['max'])) { - $select .= " LIMIT {$limit['from']}, {$limit['max']} "; - } - if (!$results = $this->_getForeignAdapter()->fetchAll($select)) { - $results = array(); - } else { - $stores = $this->getLanguagesToStores(); - foreach($results as $index => $result) { - if ($categoriesToStores = $this->getCategoriesToStores($result['id'])) { - foreach($categoriesToStores as $store => $categoriesName) { - $results[$index]['stores'][$stores[$store]] = array( - 'name'=>html_entity_decode($this->convert($categoriesName), ENT_QUOTES, self::DEFAULT_MAGENTO_CHARSET) - ); - } - } - } - } - return $results; - } - - /** - * Getting language to Magento store data - * - * @return array - */ - public function getLanguagesToStores() - { - $importModel = $this->getImportModel(); - $typeId = $this->getImportTypeIdByCode('store'); - $importId = $importModel->getId(); - if (!$this->_languagesToStores) { - //$this->_languagesToStores[1] = 1; - $select = $this->_getReadAdapter()->select(); - $select->from(array('ref'=>$this->getTable('oscommerce_ref')), array('value'=>'value', 'ref_id'=>'ref_id')); - $select->where("`ref`.`import_id`='{$importId}' AND `ref`.`type_id`='{$typeId}'"); - $this->_languagesToStores = $this->_getReadAdapter()->fetchPairs($select); - } - return $this->_languagesToStores; - } - - /** - * Getting categry description for different languages - * - * @param integer $categoryId - * @return mix array/boolean - */ - public function getCategoriesToStores($categoryId) - { - $select = "SELECT `language_id`, `categories_name` FROM `{$this->getOscTable('categories_description')}`"; - $select .= "WHERE `categories_id`='{$categoryId}'"; - if ($categoryId && $result = $this->_getForeignAdapter()->fetchPairs($select)) { - return $result; - } - return false; - } - - /** - * Getting store data of osCommerce - * - * @return array - */ - public function getOscStores() - { - if (!$this->_oscStores) { - $select = "SELECT `languages_id` `id`, `name`, `code` `scode`, "; - $select .= " `directory` `code`, 1 `is_active` FROM `{$this->getOscTable('languages')}`"; - $this->_oscStores = $this->_getForeignAdapter()->fetchAll($select); - } - return $this->_oscStores; - } - - - public function getOscDefaultLanguage() - { - if (!$this->_oscDefaultLanguage) { - $oscStoreInfo = $this->getOscStoreInformation(); - $languageCode = $oscStoreInfo['DEFAULT_LANGUAGE']; - if ($stores = $this->getOscStores()) foreach($stores as $store) { - if ($store['scode'] == $languageCode) { - $this->_oscDefaultLanguage = $store; - } - } - } - return $this->_oscDefaultLanguage; - } - - /** - * Getting customers from osCommerce - * - * @return array - */ - public function getCustomers($limit = array()) - { - $select = "SELECT `c`.`customers_id` `id`, `c`.`customers_firstname` `firstname` "; - $select .= " ,`c`.`customers_lastname` `lastname`, `c`.`customers_email_address` `email` "; - $select .= " ,`c`.`customers_telephone` `telephone`, `c`.`customers_fax` `fax` "; - $select .= " ,`c`.`customers_password` `password_hash`, `c`.`customers_newsletter` `is_subscribed` "; - $select .= " ,`ci`.`customers_info_date_account_created` `created_at` "; - $select .= " ,`c`.`customers_default_address_id` `default_billing` FROM `{$this->getOscTable('customers')}` c"; - $select .= " LEFT JOIN `customers_info` ci ON `ci`.`customers_info_id`=`c`.`customers_id` "; - if ($limit && isset($limit['from']) && isset($limit['max'])) { - $select .= " LIMIT {$limit['from']}, {$limit['max']}"; - } - - if (!($result = $this->_getForeignAdapter()->fetchAll($select))) { - $result = array(); - } - - return $result; - } - - public function getTotalCustomers() { - return $this->_getForeignAdapter()->fetchOne("SELECT count(*) FROM `{$this->getOscTable('customers')}`"); - } - - public function getCustomerName($name) - { - if (isset($name)) { - $n = explode(" ", $name); - if (sizeof($n) > 1) { - $newName['lastname'] = $n[(sizeof($n) - 1)]; - $newName['fistname'] = Mage::helper('core/string')->substr($name, 0, - Mage::helper('core/string')->strlen($name) - (Mage::helper('core/string')->strlen($newName['lastname'] + 1)) - ); - return $newName; - } else { - return array('firstname' => $n); - } - } - return false; - } - - - /** - * Getting customer address by CustomerId from osCommerce - * - * @param integer $customerId - * @return array - */ - public function getAddresses($customerId) - { - - $select = "SELECT `address_book_id` `id`, `customers_id`, `entry_firstname` `firstname`"; - $select .= ", `entry_lastname` `lastname`, `entry_street_address` `street1`"; - $select .= ", `entry_company` `company` "; - $select .= ", `entry_postcode` `postcode`, `entry_city` `city`"; - $select .= ", `entry_state` `region`, `entry_country_id` `country_id`"; - $select .= ", `entry_zone_id` `region_id` FROM `{$this->getOscTable('address_book')}` WHERE customers_id={$customerId}"; - if (!isset($customerId) || !($result = $this->_getForeignAdapter()->fetchAll($select))) { - $result = array(); - } - return $result; - } - - /** - * Get address from address book - * - * @param integer $address_id - * @return array - */ - public function getAddressById($addressId) - { - - $select = "SELECT `address_book_id` `id`, `customers_id`, `entry_firstname` `firstname`"; - $select .= ", `entry_lastname` `lastname`, `entry_street_address` `street1`"; - $select .= ", `entry_postcode` `postcode`, `entry_city` `city`"; - $select .= ", `entry_state` `region`, `entry_country_id` `country_id`"; - $select .= ", `entry_zone_id` `region_id` FROM `{$this->getOscTable('address_book')}` WHERE address_book_id={$addressId}"; - if (!isset($addressId) || !($result = $this->_getForeignAdapter()->fetchRow($select))) { - $result = array(); - } - return $result; - } - - /** - * Getting importing types for loging into oscommerce_ref - * - * @return array - */ - public function getImportTypes() - { - if (! $this->_importType) { - $connection = $this->_getReadAdapter(); - $select = $connection->select(); - $select->from($this->getTable('oscommerce_type'), array('*')); - $this->_importType = $connection->fetchAll($select); - } - return $this->_importType; - } - - /** - * Getting import_type_id by code - * - * @param integer $code - * @return string/boolean - */ - public function getImportTypeIdByCode($code = '') { - $types = $this->getImportTypes(); - if (isset($code) && $types) { - foreach ($types as $type) { - if ($type['type_code'] == $code) { - return $type['type_id']; - } - } - } - return false; - } - - public function getCountryCodeData() - { - $select = "SELECT * FROM `{$this->getOscTable('countries')}`"; - $countries = $this->_getForeignAdapter()->fetchAll($select); - if ($countries) foreach($countries as $country) { - $this->_countryIdToCode[$country['countries_id']] = $country['countries_iso_code_2']; - $this->_countryNameToCode[$country['countries_name']] = $country['countries_iso_code_2']; - } - } - - /** - * Getting country code by country id - * - * @param integer $id - * @return string/boolean - */ - public function getCountryCodeById($id) - { - if (!$this->_countryIdToCode) { - $this->getCountryCodeData(); - } - $countries = $this->_countryIdToCode; - if (isset($id) && isset($countries[$id])) { - return $countries[$id]; - } - return false; - } - - public function getCountryCodeByName($name) - { - if (!$this->_countryNameToCode) { - $this->getCountryCodeData(); - } - $countries = $this->_countryNameToCode; - if (isset($id) && isset($countries[$name])) { - return $countries[$name]; - } - return false; - } - - public function getCountryIdByCode($countryCode) - { - if (!$this->_countryIdToCode) { - $this->getCountryCodeData(); - } - if (isset($code)) { - foreach($this->_countryToCode as $id => $code) { - if ($code == $countryCode) { - return $id; - } - } - } - return false; - } - - - /** - * Getting regions from osCommerce - * - * @return array - */ - public function getRegions() - { - if (!$this->_regionCode) { - $select = "SELECT `zone_id`, `zone_name` FROM `{$this->getOscTable('zones')}`"; - $this->_regionCode = $this->_getForeignAdapter()->fetchPairs($select); - } - return $this->_regionCode; - } - - /** - * Getting region name by id - * - * @param integer $id - * @return string/boolean - */ - public function getRegionCode($id) - { - $regions = $this->getRegions(); - if (isset($id) && isset($regions[$id])) { - return $regions[$id]; - } - return false; - } - - public function setStoreLocales($locale) - { - if (isset($locale) && is_array($locale)) - $this->_storeLocales = $locale; - } - - public function getStoreLocales() - { - if ($this->_storeLocales) { - return $this->_storeLocales; - } else { - return array('default' => self::DEFAULT_LOCALE ); - } - } - - public function setRootCategory(Mage_Catalog_Model_Category $category) { - $this->_rootCategory = $category; - } - - public function getRootCategory() - { - if (!$this->_rootCategory) { - $this->_rootCategory = $this->getCategoryModel()->load($this->getCurrentWebsite()->getDefaultStoreGroup()->getRootCategoryId()); - } - return $this->_rootCategory; - } - - public function setWebsiteId($id) - { - $this->_websiteId = (int) ($id ? $id : 0); - } - - public function importTaxClasses() - { - $taxModel = Mage::getModel('tax/class'); - $storeInfo = $this->getOscStoreInformation(); - $storeName = $storeInfo['STORE_NAME']; - $taxPairs = array(); - if ($classes = $this->getTaxClasses()) { - $existedClasses = $taxCollections = Mage::getResourceModel('tax/class_collection') - ->addFieldToFilter('class_type', 'PRODUCT') - ->load() - ->toOptionHash(); - - foreach ($classes as $id => $name) { - $taxModel->unsData(); - $className = $name . '_' . $storeName; - if (in_array($className, $existedClasses)) { - $taxId = array_search($className, $existedClasses); - } else { - $taxModel->setId(null); - $taxModel->setClassType('PRODUCT'); - $taxModel->setClassName($name . '_' . $storeName); - $taxModel->save(); - $taxId = $taxModel->getId(); - } - $taxPairs[$id] = $taxId; - } - } - - if (sizeof($taxPairs) > 0) { - $this->saveLogs($taxPairs, 'taxclass'); - } - } - - protected function _getTaxCollections() - { - $taxPairs = $this->getLogPairsByTypeCode('taxclass'); - $flipTaxPairs = array_flip($taxPairs); - $newTaxPairs = array(); - $taxCollections = Mage::getResourceModel('tax/class_collection') - ->addFieldToFilter('class_type', 'PRODUCT') - ->load() - ->toOptionArray(); - if ($taxCollections) { - foreach ($taxCollections as $tax) { - if (isset($flipTaxPairs[$tax['value']])) { - $newTaxPairs[$flipTaxPairs[$tax['value']]] = $tax['label']; - } - } - } - return $newTaxPairs; - } - - public function saveLogs($data, $type = null) - { - $importId = $this->getImportModel()->getId(); - $typeId = $this->getImportTypeIdByCode($type); - $userId = $this->_getCurrentUserId(); - $createdAt = $this->formatDate(time()); - if (is_array($data) && $typeId > 0) { - foreach($data as $value => $refId) { - $log = array( - 'value' => $value, - 'ref_id' => $refId, - 'import_id' => $importId, - 'type_id' => $typeId, - 'user_id' => $userId, - 'created_at'=> $createdAt - ); - $this->_getWriteAdapter()->insert($this->getTable('oscommerce_ref'), $log); - } - } - } - - public function getLogPairsByTypeCode($code) - { - $typeId = $this->getImportTypeIdByCode($code); - $importId = $this->getImportModel()->getId(); - $result = array(); - if (!is_null($typeId)) { - $select = $this->_getReadAdapter()->select(); - $select->from($this->getTable('oscommerce_ref'), array('value','ref_id')) - ->where("import_id={$importId}") - ->where("type_id={$typeId}"); - $result = $this->_getReadAdapter()->fetchPairs($select); - } - return $result; - } - - public function getTaxClasses() - { - $select = "SELECT `tax_class_id` `id`, `tax_class_title` `title` FROM `{$this->getOscTable('tax_class')}`"; - if (!($results = $this->_getForeignAdapter()->fetchPairs($select))) { - $results = array(); - } - return $results; - } - - private function _format($str) - { - $str = preg_replace('#[^0-9a-z\/\.]+#i', '', $str); - $str = strtolower(str_replace('\\s','',$str)); - return $str; - } - - public function setPrefixPath($prefix) { - if ($prefix) { - $this->_prefixPath = $prefix; - } - } - - /** - * Load osCommerce orders - * - * @param integer $customerId - * @param integer $websiteId - * @return array - */ - public function loadOrders($customerId, $websiteId = '') - { - if (!isset($websiteId)) { - $webisteId = $this->_currentWebsiteId; - } - $result = array(); - if (!empty($customerId)) { - $select = $this->_getReadAdapter()->select() - ->from(array('order'=>$this->getTable('oscommerce_order'))) - ->join( - array('order_total'=>$this->getTable('oscommerce_order_total')), - "order_total.osc_magento_id=order.osc_magento_id AND order_total.class='ot_total'", - array('value')) - ->where("order.magento_customers_id={$customerId}") - ->where("order.website_id={$websiteId}"); - $result = $this->_getReadAdapter()->fetchAll($select); - } - return $result; - } - - /** - * Load osCommerce order - * - * @param integer $id - * @return array - */ - public function loadOrderById($id) - { - $result = array(); - if (!empty($id)) { - $select = "SELECT * FROM {$this->getTable('oscommerce_order')} WHERE osc_magento_id={$id}"; - $order = $this->_getReadAdapter()->fetchRow($select); - if ($order) { - $result['order'] = $order; - foreach (array('products','total','history') as $table) { - $select = "SELECT * FROM {$this->getTable('oscommerce_order_'.$table)} WHERE osc_magento_id={$id}"; - $result[$table] = $this->_getReadAdapter()->fetchAll($select); - - } - } - - } - return $result; - } - - // Fix for previous version - protected function checkOrderField() - { - $columnName = 'currency_symbol'; - try { - if (!($result = $this->_getReadAdapter()->fetchRow("SHOW `columns` FROM `{$this->getTable('oscommerce_order')}` WHERE field='{$columnName}'"))) { - $this->_setupConnection()->query("ALTER TABLE `{$this->getTable('oscommerce_order')}` ADD {$columnName} char(3) DEFAULT NULL"); - $this->_setupConnection()->commit(); - } - } catch (Exception $e) { - - } - } - - public function setMaxRows($rows) - { - if (is_integer($rows)) { - $this->_maxRows = $rows; - } - } - - public function getMaxRows() - { - if ($this->_maxRows <= 0) { - $this->_maxRows = Mage::getStoreConfig('oscommerce/import/max_rows'); - } - return $this->_maxRows; - } - - /** - * Retrieve website model cache - * - * @return Mage_Core_Model_Web - */ - public function getWebsiteModel() - { - if (is_null($this->_websiteModel)) { - $object = Mage::getModel('core/website'); - $this->_websiteModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_websiteModel); - } - - /** - * Retrieve store model cache - * - * @return Mage_Core_Model_Store - */ - public function getStoreModel() - { - if (is_null($this->_storeModel)) { - $object = Mage::getModel('core/store'); - $this->_storeModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_storeModel); - } - - /** - * Retrieve customer model cache - * - * @return Mage_Customer_Model_Customer - */ - public function getCustomerModel() - { - if (is_null($this->_customerModel)) { - $object = Mage::getModel('customer/customer'); - $this->_customerModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_customerModel); - } - - /** - * Retrieve customer model cache - * - * @return Mage_Customer_Model_Customer - */ - public function getCustomerGroupModel() - { - if (is_null($this->_customerGroupModel)) { - $object = Mage::getModel('customer/group'); - $this->_customerGroupModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_customerGroupModel); - } - - /** - * Retrieve address model cache - * - * @return Mage_Customer_Model_Address - */ - public function getAddressModel() - { - if (is_null($this->_addressModel)) { - $object = Mage::getModel('customer/address'); - $this->_addressModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_addressModel); - } - - - /** - * Retrieve category model cache - * - * @return Mage_Catalog_Model_Category - */ - public function getCategoryModel() - { - if (is_null($this->_categoryModel)) { - $object = Mage::getModel('catalog/category'); - $this->_categoryModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_categoryModel); - } - - /** - * Retrieve category model cache - * - * @return Mage_Catalog_Model_Category - */ - public function getProductModel() - { - if (is_null($this->_productModel)) { - $object = Mage::getModel('catalog/product'); - $this->_productModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_productModel); - } - - public function getProductAdapterModel() - { - if (is_null($this->_productAdapterModel)) { - $object = Mage::getModel('catalog/convert_adapter_product'); - $this->_productAdapterModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_productAdapterModel); - } - /** - * Retrieve store group model cache - * - * @return Mage_Core_Model_Store_Group - */ - public function getStoreGroupModel() - { - if (is_null($this->_storeGroupModel)) { - $object = Mage::getModel('core/store_group'); - $this->_storeGroupModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_storeGroupModel); - } - - public function getConfigModel() - { - if (is_null($this->_configModel)) { - $object = Mage::getModel('core/config_data'); - $this->_configModel = Varien_Object_Cache::singleton()->save($object); - } - return Varien_Object_Cache::singleton()->load($this->_configModel); - - } - - public function importCollection($importId = null) { - $importTypes = array('website', 'root_category', 'group'); - $result = array(); - if (!is_null($importId)) { - $select = $this->_getReadAdapter()->select() - ->from(array('ref'=>$this->getTable('oscommerce_ref'))) - ->join( - array('type'=>$this->getTable('oscommerce_type')), - "type.type_id=ref.type_id AND type.type_code in ('".join("','",$importTypes)."')", - array('type.type_code')) - ->where("ref.import_id={$importId}"); - if ($results = $this->_getReadAdapter()->fetchAll($select)) { - foreach ($results as $result) { - $this->_importCollection[$result['type_code']] = $result['ref_id']; - } - } - - } - return $this->_importCollection; - } - - public function setImportModel(Mage_Oscommerce_Model_Oscommerce $model) - { - $this->_importModel = $model; - } - - public function getImportModel() - { - if ($this->_importModel) { - return $this->_importModel; - } - } - - public function getCollections($code) - { - if ($this->_importCollection) { - return $this->_importCollection; - } - return; - } - - /** - * Deleting oscommerce reference records - * - * @param integer $id - */ - public function deleteRecords($id = null) - { - if (!is_null($id) && $id > 0) { - if ($result = $this->_getReadAdapter() - ->fetchRow('SELECT * FROM '.$this->getTable('oscommerce_ref').' WHERE import_id='.$id)) { - $this->_getWriteAdapter()->raw_query('DELETE FROM '.$this->getTable('oscommerce_ref').' WHERE import_id='.$id); - } - } - } - - /** - * Formatting string - * - * @param string $input - * @param integer $number - * @return string - */ - protected function _formatStringTruncate($data, $number) - { - if (str_word_count($data, 0)>$number) { - $wordKey = str_word_count($data, 1); - $posKey = str_word_count($data, 2); - reset($posKey); - foreach ($wordKey as $key => &$value) { - $value=key($posKey); - next($posKey); - } - return substr($data, 0, $wordKey[$number]); - } else { - return $data; - } - } - - /** - * Getting current user ID - * - * @return string - */ - protected function _getCurrentUserId() - { - if (!$this->_currentUserId) { - $this->_currentUserId = Mage::getSingleton('admin/session')->getUser()->getId(); - $this->_logData['user_id'] = $this->_currentUserId; - } - return $this->_currentUserId; - } - - /** - * Getting oscommerce table with prefix - * - * @param string $table - * @return string - */ - function getOscTable($table) - { - return $this->_prefix.$table; - } - - /** - * Setting connection charset - * - * @param string $charset - */ - public function setConnectionCharset($charset) - { - $this->_connectionCharset = $charset; - } - - /** - * Getting connection charset, set deafult as utf8 - * if there is no predefine charset - * - * @return string - */ - public function getConnectionCharset() - { - if (!$this->_connectionCharset) { - $this->_connectionCharset = self::DEFAULT_FIELD_CHARSET; - } - return $this->_connectionCharset; - } - - public function resetConnectionCharset() - { - $charset = $this->getConnectionCharset(); - $this->_getForeignAdapter()->query("SET NAMES '{$charset}'"); - } - - - /** - * Setting dataCharset by user defined encoding charset - * - * @param string $charset - */ - public function setDataCharset($charset) - { - if (!is_null($charset)) { - $this->_dataCharset = $charset; - } - } - - /** - * Getting dataCharset - * - * @return string - */ - public function getDataCharset() - { - return $this->_dataCharset; - } - - /** - * Converting encoded charsets - * - * @param mixed $data - * @param array $notIncludedFields - * @return mixed - */ - public function convert($data, array $notIncludedFields = array()) - { - $charset = $this->getDataCharset(); - if (!is_null($charset) || $charset != self::DEFAULT_FIELD_CHARSET) { - if (is_array($data)) { - foreach($data as $field => $value) { - if (!in_array($field, $notIncludedFields)) { - $newValue = @iconv($charset, self::DEFAULT_FIELD_CHARSET, $value); - if (strlen($newValue)) { - $data[$field] = $newValue; - } - } - } - } else { - $newValue = @iconv($charset, self::DEFAULT_MAGENTO_CHARSET, $data); - if (strlen($newValue)) { - $data = $newValue; - } - } - } - return $data; - } - - /** - * Getting saveRows - * - * @return integer - */ - public function getSaveRows() - { - return $this->_saveRows; - } - - /** - * Resetting saveRows as zero - * - */ - protected function _resetSaveRows() - { - $this->_saveRows = 0; - } - - /** - * Adding error messages - * - * @param string $error - */ - protected function _addErrors($error) - { - if (isset($error)) $this->_errors[] = $error; - } - - /** - * Getting all errors - * - * @return array - */ - public function getErrors() - { - if (sizeof($this->_errors) > 0) { - return $this->_errors; - } - } - - /** - * Resetting error as empty array - * - */ - protected function _resetErrors() - { - $this->_errors = array(); - } -} diff --git a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Collection.php b/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Collection.php deleted file mode 100755 index aea40caea4..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Collection.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Mysql4_Oscommerce_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('oscommerce/oscommerce'); - } -} diff --git a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order.php b/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order.php deleted file mode 100644 index c141394ce7..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Mysql4_Oscommerce_Order extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('oscommerce/oscommerce_order', 'osc_magento_id'); - } - - public function getProducts() - { - $order = Mage::registry('current_oscommerce_order'); - $result = array(); - if ($order && $order->getData() && $id = $order->getId()) - { - $select = $this->_getReadAdapter()->select(); - $select->from($this->getTable('oscommerce_order_products')) - ->where("osc_magento_id={$id}"); - $result = $this->_getReadAdapter()->fetchAll($select); - } - return $result; - } - - public function getTotal() - { - $order = Mage::registry('current_oscommerce_order'); - $result = array(); - if ($order && $order->getData() && $id = $order->getId()) - { - $select = $this->_getReadAdapter()->select(); - $select->from($this->getTable('oscommerce_order_total')) - ->where("osc_magento_id={$id}")->order('sort_order'); - $result = $this->_getReadAdapter()->fetchAll($select); - } - return $result; - } - - public function getComments() - { - $order = Mage::registry('current_oscommerce_order'); - $result = array(); - if ($order && $order->getData() && $id = $order->getId()) - { - $select = $this->_getReadAdapter()->select(); - $select->from($this->getTable('oscommerce_order_history')) - ->where("osc_magento_id={$id}"); - $result = $this->_getReadAdapter()->fetchAll($select); - } - return $result; - } -} - diff --git a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order/Collection.php b/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order/Collection.php deleted file mode 100644 index 04410dc499..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Mysql4/Oscommerce/Order/Collection.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Mysql4_Oscommerce_Order_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('oscommerce/oscommerce_order'); - } - - public function addOrderTotalField() - { - $this->_select - ->columns(array('orders_total'=>new Zend_Db_Expr('FORMAT(main_table.orders_total,2)'))); - return $this; - } - - public function load($printQuery=false, $logQuery=false) - { - if ($this->isLoaded()) { - return $this; - } - $this->addOrderTotalField(); - parent::load($printQuery, $logQuery); - return $this; - } -} diff --git a/app/code/core/Mage/Oscommerce/Model/Oscommerce.php b/app/code/core/Mage/Oscommerce/Model/Oscommerce.php deleted file mode 100755 index aa9079a214..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Oscommerce.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Oscommerce extends Mage_Core_Model_Abstract -{ - const DEFAULT_PORT = 3360; - const CONNECTION_TYPE = 'pdo_mysql'; - const CONNECTION_NAME = 'oscommerce_db'; - - protected function _construct() - { - $this->_init('oscommerce/oscommerce'); - } - - protected function _afterLoad() - { - parent::_afterLoad(); - Mage::getSingleton('oscommerce/config')->initForeignConnection($this->getData()); - -// if (Mage::app()->getRequest()->getActionName() == 'run') { -// $this->importStores(); -// } - - } - /** - * Get paypal session namespace - * - * @return Mage_Paypal_Model_Session - */ - public function getSession() - { - return Mage::getSingleton('oscommerce/session'); - } - - public function importStores() { - $this->getResource()->importStores($this); - } - - public function getImportTypeIdByCode($code = '') { - return $this->getResource()->getImportTypeIdByCode($code); - } - - public function loadOrders($customerId, $websiteId) - { - return $this->getResource()->loadOrders($customerId, $websiteId); - } - - public function loadOrderById($id) - { - return $this->getResource()->loadOrderById($id); - } - - public function deleteImportedRecords($id) - { - if (isset($id) && $id == $this->getId()) { - $this->getResource()->deleteRecords($id); - } - } -} diff --git a/app/code/core/Mage/Oscommerce/Model/Oscommerce/Order.php b/app/code/core/Mage/Oscommerce/Model/Oscommerce/Order.php deleted file mode 100644 index ca987d7769..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Oscommerce/Order.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Oscommerce_Order extends Mage_Core_Model_Abstract -{ - - protected function _construct() - { - $this->_init('oscommerce/oscommerce_order'); - } - - public function getProducts() - { - return $this->getResource()->getProducts(); - } - - public function getTotal() - { - return $this->getResource()->getTotal(); - } - - public function getComments() - { - return $this->getResource()->getComments(); - } - -} diff --git a/app/code/core/Mage/Oscommerce/Model/Session.php b/app/code/core/Mage/Oscommerce/Model/Session.php deleted file mode 100644 index 301d17cb38..0000000000 --- a/app/code/core/Mage/Oscommerce/Model/Session.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class Mage_Oscommerce_Model_Session extends Mage_Core_Model_Session_Abstract -{ - public function __construct() - { - $this->init('oscommerce'); - } -} diff --git a/app/code/core/Mage/Oscommerce/controllers/Adminhtml/ImportController.php b/app/code/core/Mage/Oscommerce/controllers/Adminhtml/ImportController.php deleted file mode 100644 index 4356d31571..0000000000 --- a/app/code/core/Mage/Oscommerce/controllers/Adminhtml/ImportController.php +++ /dev/null @@ -1,432 +0,0 @@ - - */ -class Mage_Oscommerce_Adminhtml_ImportController extends Mage_Adminhtml_Controller_Action -{ - /** - * Initailization action of importController - */ - protected function _initAction() - { - $this->loadLayout(); - $this->_setActiveMenu('system/convert'); - return $this; - } - - /** - * Initialization of importController - * - * @param idFieldnName string - * @return Mage_Oscommerce_Adminhtml_ImportController - */ - protected function _initImport($idFieldName = 'id') - { - $id = (int) $this->getRequest()->getParam($idFieldName); - $model = Mage::getModel('oscommerce/oscommerce'); - if ($id) { - $model->load($id); - } - - Mage::register('oscommerce_adminhtml_import', $model); - return $this; - } - - /** - * Index action of importController - */ - public function indexAction() - { - $this->_title($this->__('System')) - ->_title($this->__('Import and Export')) - ->_title($this->__('osCommerce Profiles')); - - $this->_initAction(); - $this->_addContent( - $this->getLayout()->createBlock('oscommerce/adminhtml_import') - ); - $this->renderLayout(); - } - - /** - * Edit action of importController - */ - public function editAction() - { - $this->_title($this->__('System')) - ->_title($this->__('Import and Export')) - ->_title($this->__('osCommerce Profiles')); - - $this->_initImport(); - $this->loadLayout(); - - $model = Mage::registry('oscommerce_adminhtml_import'); - $data = Mage::getSingleton('adminhtml/session')->getSystemConvertOscData(true); - - if (!empty($data)) { - $model->addData($data); - } - - $this->_title($model->getId() ? $model->getName() : $this->__('New Profile')); - - $this->_initAction(); - $this->_addBreadcrumb - (Mage::helper('oscommerce')->__('Edit osCommerce Profile'), - Mage::helper('oscommerce')->__('Edit osCommerce Profile')); - /** - * Append edit tabs to left block - */ - $this->_addLeft($this->getLayout()->createBlock('oscommerce/adminhtml_import_edit_tabs')); - - $this->_addContent($this->getLayout()->createBlock('oscommerce/adminhtml_import_edit')); - - $this->renderLayout(); - } - - /** - * Create new action of importController - */ - public function newAction() - { - $this->_forward('edit'); - } - - /** - * Save action of - */ - public function saveAction() - { - if ($data = $this->getRequest()->getPost()) { - if (isset($data['send_subscription'])) { - $data['send_subscription'] = 1; - } else { - $data['send_subscription'] = 0; - } - - $this->_initImport('import_id'); - $model = Mage::registry('oscommerce_adminhtml_import'); - - // Prepare saving data - if (isset($data)) { - $model->addData($data); - } - -// if (empty($data['port'])) -// $data['port'] = Mage_Oscommerce_Model_Oscommerce::DEFAULT_PORT; - - try { - $model->save(); - - Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('oscommerce')->__('The osCommerce profile has been saved.')); - } - catch (Exception $e){ - Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); - Mage::getSingleton('adminhtml/session')->setSystemConvertOscData($data); - $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('id'=>$model->getId()))); - return; - } - } - if ($this->getRequest()->getParam('continue')) { - $this->_redirect('*/*/edit', array('id'=>$model->getId())); - } else { - $this->_redirect('*/*'); - } - } - - public function batchRunAction() - { - @set_time_limit(0); - $this->_initImport('import_id'); - $importModel = Mage::registry('oscommerce_adminhtml_import'); - - if ($tablePrefix = $importModel->getTablePrefix()) { - $importModel->getResource()->setTablePrefix($tablePrefix); - } - - // Start setting data from sessions - if ($connCharset = $importModel->getSession()->getConnectionCharset()) { - $importModel->getResource()->setConnectionCharset($connCharset); - } - if ($dataCharset = $importModel->getSession()->getDataCharset()) { - $importModel->getResource()->setDataCharset($dataCharset); - } - if ($timezone = $importModel->getSession()->getTimezone()) { - $importModel->setTimezone($timezone); - } - if ($storeLocales = $importModel->getSession()->getStoreLocales()) { - $importModel->getResource()->setStoreLocales($storeLocales); - } - if ($isPoductWithCategories = $importModel->getSession()->getIsProductWithCategories()) { - $importModel->getResource()->setIsProductWithCategories($isPoductWithCategories); - } - // End setting data from sessions - - // Resetting connection charset - $importModel->getResource()->resetConnectionCharset(); - - $importModel->getResource()->setImportModel($importModel); - if ($collections = $importModel->getResource()->importCollection($importModel->getId())) { - if (isset($collections['website'])) { - $importModel->getResource()->getWebsiteModel()->load($collections['website']); - } - if (isset($collections['root_category'])) { - $importModel->getResource()->setRootCategory(clone $importModel->getResource()->getCategoryModel()->load($collections['root_category'])); - } - if (isset($collections['group'])) { - $importModel->getResource()->getStoreGroupModel()->load($collections['group']); - - } - } - - //$isUnderDefaultWebsite = $this->getRequest()->getParam('under_default_website') ? true: false; - $importType = $this->getRequest()->getParam('import_type'); - $importFrom = $this->getRequest()->getParam('from'); - $isImportDone = $this->getRequest()->getParam('is_done'); - switch($importType) { - case 'products': - $importModel->getResource()->importProducts($importFrom, true); - break; - case 'categories': - $importModel->getResource()->importCategories($importFrom, true); - if ($isImportDone == 'true') { - $importModel->getResource()->buildCategoryPath(); - } - break; - case 'customers': - $importModel->getResource()->importCustomers($importFrom, true, $importModel->getData('send_subscription')); - break; - case 'orders': - $importModel->getResource()->importOrders($importFrom, true); - break; - } - - $errors = $importModel->getResource()->getErrors(); - $result = array( - 'savedRows' => $importModel->getResource()->getSaveRows(), - 'errors' => ( $errors ? $errors: array()) - ); - $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); - } - - public function runAction() - { - @set_time_limit(0); - Mage::app()->cleanCache(); // Clean all cach - $this->_initImport(); - $importModel = Mage::registry('oscommerce_adminhtml_import'); - /** @var $importModel Mage_Oscommerce_Model_Oscommerce */ - $totalRecords = array(); - - // Start handling charsets - $connCharset = $this->getRequest()->getParam('connection_charset'); - if ($connCharset) { - $importModel->getSession()->setConnectionCharset($connCharset); - $importModel->getResource()->setConnectionCharset($connCharset); - } - $dataCharset = $this->getRequest()->getParam('data_charset'); - if ($dataCharset) { - $importModel->getSession()->setDataCharset($dataCharset); - $importModel->getResource()->setDataCharset($dataCharset); - } // End hanlding charsets - - $timezone = $this->getRequest()->getParam('timezone'); - $importModel->getSession()->setTimezone($timezone); - $importModel->getResource()->resetConnectionCharset(); - - if ($tablPrefix = $importModel->getTablePrefix()) { - $importModel->getResource()->setTablePrefix($tablPrefix); - } - - $importModel->getResource()->setImportModel($importModel); - $importModel->getResource()->importCollection($importModel->getId()); - - // Setting Locale for stores - $locales = explode("|",$this->getRequest()->getParam('store_locale')); - $storeLocales = array(); - if ($locales) foreach($locales as $locale) { - $localeCode = explode(':', $locale); - $storeLocales[$localeCode[0]] = $localeCode[1]; - } - - $importModel->getSession()->setStoreLocales($storeLocales); - $importModel->getResource()->setStoreLocales($storeLocales); - // End setting Locale for stores - - $websiteId = $this->getRequest()->getParam('website_id'); - $websiteCode = $this->getRequest()->getParam('website_code'); - $options = $this->getRequest()->getParam('import'); - - // Checking Website, StoreGroup and RootCategory - if (!$websiteId) { - $importModel->getResource()->setWebsiteCode($websiteCode); - $importModel->getResource()->createWebsite(); - } else { - $importModel->getResource()->createWebsite($websiteId); - } - // End checking Website, StoreGroup and RootCategory - - $importModel->getResource()->importStores(); - $importModel->getResource()->importTaxClasses(); - $importModel->getResource()->createOrderTables(); - - if (isset($options['categories'])) { - $importModel->getSession()->setIsProductWithCategories(true); - $totalRecords['categories'] = $importModel->getResource()->getCategoriesCount(); - } - if (isset($options['products'])) { - $totalRecords['products'] = $importModel->getResource()->getProductsCount(); - } - if (isset($options['customers'])) { - $totalRecords['customers'] = $importModel->getResource()->getCustomersCount(); - } - if (isset($options['customers']) && isset($options['orders'])) { - $totalRecords['orders'] = $importModel->getResource()->getOrdersCount(); - } - if ($totalRecords) { - $importModel->setTotalRecords($totalRecords); - Mage::unRegister('oscommerce_adminhtml_import'); - Mage::register('oscommerce_adminhtml_import', $importModel); - } - $this->getResponse()->setBody($this->getLayout()->createBlock('oscommerce/adminhtml_import_run')->toHtml()); - $this->getResponse()->sendResponse(); - } - - public function batchFinishAction() - { - if ($importId = $this->getRequest()->getParam('id')) { - $importModel = Mage::getModel('oscommerce/oscommerce')->load($importId); - /* @var $batchModel Mage_Dataflow_Model_Batch */ - - if ($importId = $importModel->getId()) { - $importModel->deleteImportedRecords($importId); -// $importModel->getSession()->unsStoreLocales(); -// $importModel->getSession()->unsIsProductWithCategories(); -// if ($importModel->getSession()->getTablePrefix()) { -// $importModel->getSession()->unsTablePrefix(); -// } - $importModel->getSession()->clear(); - } - } - } - - /** - * Delete osc action - */ - public function deleteAction() - { - $this->_initImport(); - $model = Mage::registry('oscommerce_adminhtml_import'); - if ($model->getId()) { - try { - $model->delete(); - Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('oscommerce')->__('The osCommerce profile has been deleted.')); - } - catch (Exception $e){ - Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); - } - } - $this->_redirect('*/*/'); - } - - /** - * Ajax checking store - * - */ - public function checkStoreAction() - { - $this->_initImport(); - $importModel = Mage::registry('oscommerce_adminhtml_import'); - $error = false; - if ($importModel->getId()) { - try { - $charset = $importModel->getResource()->getConnectionCharset(); - $defaultOscCharset = Mage_Oscommerce_Model_Mysql4_Oscommerce::DEFAULT_OSC_CHARSET; - $defaultMageCharset = Mage_Oscommerce_Model_Mysql4_Oscommerce::DEFAULT_MAGENTO_CHARSET; - - $stores = $importModel->getResource()->getOscStores(); - - $locales = Mage::app()->getLocale()->getOptionLocales(); - $options = ''; - foreach ($locales as $locale) { - $options .= ""; - } - $html = ''; - if ($stores) { - $html .= "\n"; - foreach ($stores as $store) { - $html .= " -
    " . $importModel->getResource()->convert($store['name']) . " Store"; - $html .= "oscommerce_import
    - - - oscommerce_import_type
    -
    - - oscommerce_ref
    -
    - - catalog_product_website
    -
    - - catalog_category_entity
    -
    - - oscommerce_orders
    -
    - - oscommerce_orders_products
    -
    - - oscommerce_orders_total
    -
    - - oscommerce_orders_status_history
    -
    - - - - - - Mage_Oscommerce_Block - - - - - - Mage_Oscommerce - - - - - pdo_mysql - mysql4 - 1 - - - - - - - - admin - - Mage_Oscommerce - oscommerce - - - - - - - - - - admin/observer - actionPreDispatchAdmin - - - - - - - - - - standard - - Mage_Oscommerce - oscommerce - - - - - - - oscommerce.xml - - - - - - - - - 10 - - - - diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-install-0.8.0.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-install-0.8.0.php deleted file mode 100755 index b43c33c868..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-install-0.8.0.php +++ /dev/null @@ -1,72 +0,0 @@ -startSetup(); - -$installer->run(" - --- DROP TABLE IF EXISTS `{$this->getTable('oscommerce_import')}`; - -CREATE TABLE `{$this->getTable('oscommerce_import')}` ( - `import_id` int(10) unsigned NOT NULL auto_increment, - `name` varchar(255) default NULL, - `created_at` datetime default NULL, - `updated_at` datetime default NULL, - `host` varchar(255) NOT NULL, - `port` int(5) NOT NULL, - `db_name` varchar(255) default NULL, - `db_user` varchar(255) default NULL, - `db_password` varchar(255) default NULL, - `db_type` varchar(32) default NULL, - PRIMARY KEY (`import_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `{$this->getTable('oscommerce_import_type')}` ( - `type_id` int(2) unsigned NOT NULL auto_increment, - `type_code` varchar(32) NOT NULL, - `type_name` varchar(255) NOT NULL, - PRIMARY KEY (`type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; - -insert into `{$this->getTable('oscommerce_import_type')}`(`type_id`,`type_code`,`type_name`) values (1,'store','Store'),(2,'category','Category'),(3,'product','Product'), (4,'customer','Customer'),(5,'order','Order'); - -CREATE TABLE `{$this->getTable('oscommerce_ref')}` ( - `id` int(10) unsigned NOT NULL auto_increment, - `import_id` int(10) NOT NULL, - `type_id` int(10) NOT NULL, - `value` int(10) NOT NULL, - `ref_id` int(10) NOT NULL, - `created_at` datetime default NULL, - `user_id` int(10) default NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.0-0.8.1.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.0-0.8.1.php deleted file mode 100755 index 1f67b26642..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.0-0.8.1.php +++ /dev/null @@ -1,47 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS `{$this->getTable('oscommerce_import_type')}`; - -CREATE TABLE `{$this->getTable('oscommerce_import_type')}` ( - `type_id` int(2) unsigned NOT NULL auto_increment, - `type_code` varchar(32) NOT NULL, - `type_name` varchar(255) NOT NULL, - PRIMARY KEY (`type_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -insert into `{$this->getTable('oscommerce_import_type')}`(`type_code`,`type_name`) values ('website', 'Website'),('store','Store'),('category','Category'),('product','Product'), ('customer','Customer'),('order','Order'); - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.2-0.8.3.php deleted file mode 100644 index f1e89dca0f..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ /dev/null @@ -1,125 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE IF NOT EXISTS `{$this->getTable('oscommerce_orders')}` ( - `osc_magento_id` int(11) NOT NULL auto_increment, - `orders_id` int(11) NOT NULL, - `customers_id` int(11) NOT NULL default '0', - `magento_customers_id` int(11) NOT NULL default '0', - `import_id` int(11) NOT NULL default '0', - `website_id` int(11) NOT NULL default '0', - `customers_name` varchar(64) NOT NULL default '', - `customers_company` varchar(32) default NULL, - `customers_street_address` varchar(64) NOT NULL default '', - `customers_suburb` varchar(32) default NULL, - `customers_city` varchar(32) NOT NULL default '', - `customers_postcode` varchar(10) NOT NULL default '', - `customers_state` varchar(32) default NULL, - `customers_country` varchar(32) NOT NULL default '', - `customers_telephone` varchar(32) NOT NULL default '', - `customers_email_address` varchar(96) NOT NULL default '', - `customers_address_format_id` int(5) NOT NULL default '0', - `delivery_name` varchar(64) NOT NULL default '', - `delivery_company` varchar(32) default NULL, - `delivery_street_address` varchar(64) NOT NULL default '', - `delivery_suburb` varchar(32) default NULL, - `delivery_city` varchar(32) NOT NULL default '', - `delivery_postcode` varchar(10) NOT NULL default '', - `delivery_state` varchar(32) default NULL, - `delivery_country` varchar(32) NOT NULL default '', - `delivery_address_format_id` int(5) NOT NULL default '0', - `billing_name` varchar(64) NOT NULL default '', - `billing_company` varchar(32) default NULL, - `billing_street_address` varchar(64) NOT NULL default '', - `billing_suburb` varchar(32) default NULL, - `billing_city` varchar(32) NOT NULL default '', - `billing_postcode` varchar(10) NOT NULL default '', - `billing_state` varchar(32) default NULL, - `billing_country` varchar(32) NOT NULL default '', - `billing_address_format_id` int(5) NOT NULL default '0', - `payment_method` varchar(255) NOT NULL default '', - `cc_type` varchar(20) default NULL, - `cc_owner` varchar(64) default NULL, - `cc_number` varchar(32) default NULL, - `cc_expires` varchar(4) default NULL, - `last_modified` datetime default NULL, - `date_purchased` datetime default NULL, - `orders_status` int(5) NOT NULL default '0', - `orders_date_finished` datetime default NULL, - `currency` char(3) default NULL, - `currency_value` decimal(14,6) default NULL, - `currency_symbol` char(3) default NULL, - PRIMARY KEY (`osc_magento_id`), - KEY `idx_orders_customers_id` (`customers_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `{$this->getTable('oscommerce_orders_products')}` ( - `orders_products_id` int(11) NOT NULL auto_increment, - `osc_magento_id` int(11) NOT NULL default '0', - `products_id` int(11) NOT NULL default '0', - `products_model` varchar(12) default NULL, - `products_name` varchar(64) NOT NULL default '', - `products_price` decimal(15,4) NOT NULL default '0.0000', - `final_price` decimal(15,4) NOT NULL default '0.0000', - `products_tax` decimal(7,4) NOT NULL default '0.0000', - `products_quantity` int(2) NOT NULL default '0', - PRIMARY KEY (`orders_products_id`), - KEY `idx_orders_products_osc_magento_id` (`osc_magento_id`), - KEY `idx_orders_products_products_id` (`products_id`) -) ENGINE=MyISAM CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `{$this->getTable('oscommerce_orders_total')}` ( - `orders_total_id` int(10) unsigned NOT NULL auto_increment, - `osc_magento_id` int(11) NOT NULL default '0', - `title` varchar(255) NOT NULL default '', - `text` varchar(255) NOT NULL default '', - `value` decimal(15,4) NOT NULL default '0.0000', - `class` varchar(32) NOT NULL default '', - `sort_order` int(11) NOT NULL default '0', - PRIMARY KEY (`orders_total_id`), - KEY `idx_orders_total_osc_magento_id` (`osc_magento_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -CREATE TABLE IF NOT EXISTS `{$this->getTable('oscommerce_orders_status_history')}`( - `orders_status_history_id` int(11) NOT NULL auto_increment, - `osc_magento_id` int(11) NOT NULL default '0', - `orders_status_id` int(5) NOT NULL default '0', - `date_added` datetime NOT NULL default '0000-00-00 00:00:00', - `customer_notified` int(1) default '0', - `comments` text, - PRIMARY KEY (`orders_status_history_id`), - KEY `idx_orders_status_history_osc_magento_id` (`osc_magento_id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.3-0.8.4.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.3-0.8.4.php deleted file mode 100644 index 6639af1efe..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.3-0.8.4.php +++ /dev/null @@ -1,36 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$this->getTable('oscommerce_orders')}` ADD orders_total decimal(14,6) default NULL; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.4-0.8.5.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.4-0.8.5.php deleted file mode 100644 index 29188c9b33..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.4-0.8.5.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->run(" - ALTER TABLE `{$this->getTable('oscommerce_orders')}` MODIFY orders_status varchar(32) default NULL; - ALTER TABLE `{$this->getTable('oscommerce_orders_status_history')}` ADD orders_status varchar(32) default NULL; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.5-0.8.6.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.5-0.8.6.php deleted file mode 100644 index 5175b7f889..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.5-0.8.6.php +++ /dev/null @@ -1,37 +0,0 @@ -startSetup(); - -$installer->run(" - -insert into `{$this->getTable('oscommerce_import_type')}`(`type_code`,`type_name`) values ('root_category', 'Root Category'); -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.6-0.8.7.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.6-0.8.7.php deleted file mode 100644 index 24aec0da69..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.6-0.8.7.php +++ /dev/null @@ -1,39 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE `{$this->getTable('oscommerce_orders')}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `{$this->getTable('oscommerce_orders_products')}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `{$this->getTable('oscommerce_orders_status_history')}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; -ALTER TABLE `{$this->getTable('oscommerce_orders_total')}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.7-0.8.8.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.7-0.8.8.php deleted file mode 100644 index 18240c18f4..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.7-0.8.8.php +++ /dev/null @@ -1,41 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE `{$this->getTable('oscommerce_orders')}` ADD purchased_year INT(4) DEFAULT NULL; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` ADD purchased_month INT(2) DEFAULT NULL; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` ADD purchased_day INT(2) DEFAULT NULL; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` ADD modified_year INT(4) DEFAULT NULL; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` ADD modified_month INT(2) DEFAULT NULL; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` ADD modified_day INT(2) DEFAULT NULL; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.8-0.8.9.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.8-0.8.9.php deleted file mode 100644 index f934eb6915..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.8-0.8.9.php +++ /dev/null @@ -1,41 +0,0 @@ -startSetup(); - -$installer->run(" -ALTER TABLE `{$this->getTable('oscommerce_orders')}` DROP COLUMN purchased_year; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` DROP COLUMN purchased_month; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` DROP COLUMN purchased_day; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` DROP COLUMN modified_year; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` DROP COLUMN modified_month; -ALTER TABLE `{$this->getTable('oscommerce_orders')}` DROP COLUMN modified_day; -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.9-0.8.10.php b/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.9-0.8.10.php deleted file mode 100644 index 05f085911b..0000000000 --- a/app/code/core/Mage/Oscommerce/sql/oscommerce_setup/mysql4-upgrade-0.8.9-0.8.10.php +++ /dev/null @@ -1,38 +0,0 @@ -startSetup(); - -$installer->run(" - -ALTER TABLE `{$this->getTable('oscommerce_import')}` ADD send_subscription BOOL NOT NULL DEFAULT '0'; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type.php b/app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type.php deleted file mode 100644 index dccf4f3c9e..0000000000 --- a/app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -class Mage_Paybox_Block_Adminhtml_Cart_Type extends Mage_Adminhtml_Block_System_Config_Form_Field -{ - protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) - { - $additional = Mage::getSingleton('core/layout')->createBlock('paybox/adminhtml_cart_type_select') - ->setTemplate('paybox/adminhtml/cart/type/select.phtml') - ->setDependHtmlId($element->getHtmlId()) - ->toHtml(); - - return parent::_getElementHtml($element).$additional; - } - -} diff --git a/app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type/Select.php b/app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type/Select.php deleted file mode 100644 index aedbcb5094..0000000000 --- a/app/code/core/Mage/Paybox/Block/Adminhtml/Cart/Type/Select.php +++ /dev/null @@ -1,56 +0,0 @@ - - */ -class Mage_Paybox_Block_Adminhtml_Cart_Type_Select extends Mage_Adminhtml_Block_Template -{ - /** - * Enter description here... - * - * @return Mage_Paybox_Model_System - */ - public function getModel() - { - return Mage::getModel('paybox/system'); - } - - public function getParentHtmlId() - { - return substr($this->getDependHtmlId(), 0, strrpos($this->getDependHtmlId(), 'typecarte')) . 'typepaiement'; - } - - public function getJsonCartTypes() - { - return $this->getModel()->getJsonCartTypes(); - } - -} diff --git a/app/code/core/Mage/Paybox/Block/Direct/Form.php b/app/code/core/Mage/Paybox/Block/Direct/Form.php deleted file mode 100644 index cb070ae20d..0000000000 --- a/app/code/core/Mage/Paybox/Block/Direct/Form.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Paybox_Block_Direct_Form extends Mage_Payment_Block_Form_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('paybox/direct/form.phtml'); - } - -} diff --git a/app/code/core/Mage/Paybox/Block/Direct/Info.php b/app/code/core/Mage/Paybox/Block/Direct/Info.php deleted file mode 100644 index c8673e86b7..0000000000 --- a/app/code/core/Mage/Paybox/Block/Direct/Info.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class Mage_Paybox_Block_Direct_Info extends Mage_Payment_Block_Info_Cc -{ - protected function _construct() - { - parent::_construct(); - $this->setTemplate('paybox/direct/info.phtml'); - } - - public function toPdf() - { - $this->setTemplate('paybox/direct/pdf/info.phtml'); - return $this->toHtml(); - } - -} diff --git a/app/code/core/Mage/Paybox/Block/System/Error.php b/app/code/core/Mage/Paybox/Block/System/Error.php deleted file mode 100644 index 7b45903951..0000000000 --- a/app/code/core/Mage/Paybox/Block/System/Error.php +++ /dev/null @@ -1,93 +0,0 @@ - - */ -class Mage_Paybox_Block_System_Error extends Mage_Core_Block_Template -{ - - /** - * Error messages desciptions - * - * @var array - */ - protected $_pbxErrorsDesc; - - /** - * Enter description here... - * - * @return Mage_Checkout_Model_Session - */ - public function getCheckout() - { - return Mage::getSingleton('checkout/session'); - } - - public function getErrorMessage() - { - if (empty($this->_pbxErrorsDesc)) { - $this->_pbxErrorsDesc = array( - '-1' => 'Error in reading the parameters via stdin (POST method) (error in http reception)', - '-2' => 'Error in memory allocation. Not enough memory available on the trader\'s server', - '-3' => 'Error in reading the parameters QUERY_STRING or CONTENT_LENGTH. (http error)', - '-4' => 'PBX_RETOUR, PBX_ANNULE, PBX_REFUSE or PBX_EFFECTUE are too long (<150 characters)', - '-5' => 'Error in opening the file (if PBX_MODE contains 3) : local file non-existent, not found or access error', - '-6' => 'Error in file format (if PBX_MODE contains 3) : local file badly formed, empty or lines are badly formatted', - '-7' => 'A compulsory variable is missing (PBX_SITE, PBX_RANG, PBX_IDENTIFIANT, PBX_TOTAL, PBX_CMD, etc.)', - '-8' => 'One of the numerical variables contains a non-numerical character (site, rank, identifier, amount, currency etc.)', - '-9' => 'PBX_SITE contains a site number which does not consist of exactly 7 characters', - '-10' => 'PBX_RANG contains a rank number which does not consist of exactly 2 characters', - '-11' => 'PBX_TOTAL has more than 10 or fewer than 3 numerical characters', - '-12' => 'PBX_LANGUE or PBX_DEVISE contains a code which does not contain exactly 3 characters', - '-13' => 'PBX_CMD is empty or contains a reference longer than 250 characters', - '-14' => '', - '-15' => '', - '-16' => 'PBX_PORTEUR does not contain a valid e-mail address', - '-17' => 'Error of coherence (multi-baskets) : Reserved Future Usage', - ); - } - $msg = Mage::helper('paybox')->__($this->_pbxErrorsDesc[$this->getCheckout()->getPayboxErrorNumber()]); - $this->getCheckout()->unsPayboxErrorNumber(); - return $msg; - } - - /** - * Get continue shopping url - * - * @return string - */ - public function getContinueShoppingUrl() - { - return Mage::getUrl('checkout/cart', array('_secure' => true)); - } - -} diff --git a/app/code/core/Mage/Paybox/Block/System/Failure.php b/app/code/core/Mage/Paybox/Block/System/Failure.php deleted file mode 100644 index 800a02e16c..0000000000 --- a/app/code/core/Mage/Paybox/Block/System/Failure.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class Mage_Paybox_Block_System_Failure extends Mage_Core_Block_Template -{ - /** - * Enter description here... - * - * @return Mage_Checkout_Model_Session - */ - public function getCheckout() - { - return Mage::getSingleton('checkout/session'); - } - - public function getErrorMessage() - { - $msg = Mage::helper('paybox')->__($this->getCheckout()->getPayboxErrorMessage()); - $this->getCheckout()->unsPayboxErrorMessage(); - return $msg; - } - - /** - * Get continue shopping url - */ - public function getContinueShoppingUrl() - { - return Mage::getUrl('checkout/cart', array('_secure' => true)); - } -} diff --git a/app/code/core/Mage/Paybox/Block/System/Form.php b/app/code/core/Mage/Paybox/Block/System/Form.php deleted file mode 100644 index 9bc040d16c..0000000000 --- a/app/code/core/Mage/Paybox/Block/System/Form.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Paybox_Block_System_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('paybox/system/form.phtml'); - parent::_construct(); - } -} diff --git a/app/code/core/Mage/Paybox/Block/System/Redirect.php b/app/code/core/Mage/Paybox/Block/System/Redirect.php deleted file mode 100644 index 23b13daef5..0000000000 --- a/app/code/core/Mage/Paybox/Block/System/Redirect.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -class Mage_Paybox_Block_System_Redirect extends Mage_Core_Block_Abstract -{ - protected function _toHtml() - { - $system = $this->getOrder()->getPayment()->getMethodInstance(); - - $form = new Varien_Data_Form(); - $form->setAction(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$system->getPayboxFile()) - ->setId('paybox_system_checkout') - ->setName('paybox_system_checkout') - ->setMethod('POST') - ->setUseContainer(true); - foreach ($system->getFormFields() as $field=>$value) { - $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value)); - } - $html = ''; - $html.= $this->__('You will be redirected to Paybox in a few seconds.'); - $html.= $form->toHtml(); - $html.= ''; - $html.= ''; - - return $html; - } -} diff --git a/app/code/core/Mage/Paybox/Helper/Data.php b/app/code/core/Mage/Paybox/Helper/Data.php deleted file mode 100644 index 1a3a962789..0000000000 --- a/app/code/core/Mage/Paybox/Helper/Data.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class Mage_Paybox_Helper_Data extends Mage_Core_Helper_Abstract -{ - -} diff --git a/app/code/core/Mage/Paybox/Model/Api/Debug.php b/app/code/core/Mage/Paybox/Model/Api/Debug.php deleted file mode 100644 index 7cd1dae547..0000000000 --- a/app/code/core/Mage/Paybox/Model/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Paybox_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('paybox/api_debug'); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Direct.php b/app/code/core/Mage/Paybox/Model/Direct.php deleted file mode 100644 index c67e934f6f..0000000000 --- a/app/code/core/Mage/Paybox/Model/Direct.php +++ /dev/null @@ -1,503 +0,0 @@ - - */ -class Mage_Paybox_Model_Direct extends Mage_Payment_Model_Method_Cc -{ - /** - * Paybox direct payment actions - */ - const PBX_PAYMENT_ACTION_ATHORIZE = '00001'; - const PBX_PAYMENT_ACTION_DEBIT = '00002'; - const PBX_PAYMENT_ACTION_ATHORIZE_CAPTURE = '00003'; - const PBX_PAYMENT_ACTION_CANCELLATION = '00005'; - const PBX_PAYMENT_ACTION_REFUND = '00004'; - - const PBX_VERSION = '00103'; - - /** - * ECL(Electronic Commerce Indicator). - * Type of ordering items. Need for some banks. - * 024 - request by internet - */ - const PBX_ACTIVITE_VALUE = '024'; - - protected $_code = 'paybox_direct'; - - protected $_isGateway = true; - protected $_canAuthorize = true; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = true; - protected $_canVoid = false; - protected $_canUseInternal = true; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = true; - protected $_canSaveCc = true; - - protected $_formBlockType = 'paybox/direct_form'; - protected $_infoBlockType = 'paybox/direct_info'; - - protected $_order; - protected $_currenciesNumbers; - protected $_questionNumberModel; - - /** - * Return paybox gateway url. - * If $recallNumber > 0 (primary url is not available) return url of backup gateway - * - * @param integer $recallNumber - * @return string - */ - public function getPayboxUrl($recallNumber) - { - $path = 'pbx_url'; - if ($recallNumber) { - $path = 'pbx_backupurl'; - } - return $this->getConfigData($path); - } - - /** - * Get Payment Action of Paybox Direct, - * changed to Paybox specification - * - * @return string - */ - public function getPaymentAction() - { - $paymentAction = $this->getConfigData('payment_action'); - switch ($paymentAction) { - case self::ACTION_AUTHORIZE: - return self::PBX_PAYMENT_ACTION_ATHORIZE; - break; - case self::ACTION_AUTHORIZE_CAPTURE: - return self::PBX_PAYMENT_ACTION_ATHORIZE_CAPTURE; - break; - default: - return self::PBX_PAYMENT_ACTION_ATHORIZE; - break; - } - } - - /** - * Return site number of account (TPE) - * - * @return string - */ - public function getSiteNumber() - { - return $this->getConfigData('pbx_site'); - } - - /** - * Return rang number of account - * - * @return string - */ - public function getRang() - { - return $this->getConfigData('pbx_rang'); - } - - /** - * Return Cle number of account - * - * @return string - */ - public function getCleNumber() - { - return $this->getConfigData('pbx_cle'); - } - - /** - * Return currency number in ISO4217 format - * - * @return string - */ - public function getCurrencyNumb() - { - $currencyCode = $this->getPayment()->getOrder()->getBaseCurrencyCode(); - if (!$this->_currenciesNumbers) { - $this->_currenciesNumbers = simplexml_load_file(Mage::getBaseDir().'/app/code/core/Mage/Paybox/etc/currency.xml'); - } - if ($this->_currenciesNumbers->$currencyCode) { - return (string)$this->_currenciesNumbers->$currencyCode; - } - } - - /** - * Return model of Question Number - * - * @return Mage_Paybox_Model_Question_Number - */ - public function getQuestionNumberModel() - { - if (!$this->_questionNumberModel) { - $accountHash = md5($this->getSiteNumber().$this->getRang()); - $this->_questionNumberModel = Mage::getModel('paybox/question_number')->load($accountHash, 'account_hash'); - } - return $this->_questionNumberModel; - } - - /** - * Return Debug Flag - * - * @return string - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } - - public function authorize(Varien_Object $payment, $amount) - { - parent::authorize($payment, $amount); - - $this->setAmount($amount) - ->setPayment($payment); - - if ($this->callDoDirectPayment()!==false) { - $payment->setStatus(self::STATUS_APPROVED) - ->setLastTransId($this->getTransactionId()) - ->setPayboxRequestNumber($this->getRequestNumber()) - ->setPayboxQuestionNumber($this->getQuestionNumber()); - } else { - $e = $this->getError(); - if (isset($e['message'])) { - $message = Mage::helper('paybox')->__('There has been an error processing your payment. ') . $e['message']; - } else { - $message = Mage::helper('paybox')->__('There has been an error processing your payment. Please try later or contact us for help.'); - } - Mage::throwException($message); - } - - return $this; - } - - public function capture(Varien_Object $payment, $amount) - { - parent::capture($payment, $amount); - - $this->setAmount($amount) - ->setPayment($payment); - - if ($payment->getLastTransId()) {//if after authorize - $result = $this->callDoDebitPayment()!==false; - } else {//authorize+capture (debit) - $result = $this->callDoDirectPayment()!==false; - } - - if ($result) { - $payment->setStatus(self::STATUS_APPROVED) - ->setLastTransId($this->getTransactionId()) - ->setPayboxRequestNumber($this->getRequestNumber()); - } else { - $e = $this->getError(); - if (isset($e['message'])) { - $message = Mage::helper('paybox')->__('There has been an error processing your payment. ') . $e['message']; - } else { - $message = Mage::helper('paybox')->__('There has been an error processing your payment. Please try later or contact us for help.'); - } - Mage::throwException($message); - } - - return $this; - } - - public function cancel(Varien_Object $payment) - { - $payment->setStatus(self::STATUS_DECLINED); - return $this; - } - - public function refund(Varien_Object $payment, $amount) - { - parent::refund($payment, $amount); - - $error = false; - if($payment->getRefundTransactionId() && $amount>0) { - $this->setTransactionId($payment->getRefundTransactionId()) - ->setPayment($payment) - ->setAmount($amount); - - if ($this->callDoRefund()!==false) { - $payment->setStatus(self::STATUS_SUCCESS) - ->setCcTransId($this->getTransactionId()); - } else { - $payment->setStatus(self::STATUS_ERROR); - $e = $this->getError(); - if (isset($e['message'])) { - $error = $e['message']; - } else { - $error = Mage::helper('paybox')->__('Error in refunding the payment'); - } - } - } else { - $payment->setStatus(self::STATUS_ERROR); - $error = Mage::helper('paybox')->__('Error in refunding the payment'); - } - if ($error !== false) { - Mage::throwException($error); - } - - return $this; - } - - /** - * Building array of params for direct payment - * - * @return bool | array - */ - public function callDoDirectPayment() - { - $payment = $this->getPayment(); - $requestStr = ''; - - $tmpArr = array( - 'VERSION' => self::PBX_VERSION, - 'DATEQ' => Mage::getModel('core/date')->date('dmYHis'), - 'TYPE' => $this->getPaymentAction(), - 'NUMQUESTION' => $this->getQuestionNumberModel()->getNextQuestionNumber(), - 'SITE' => $this->getSiteNumber(), - 'RANG' => $this->getRang(), - 'CLE' => $this->getCleNumber(), - 'IDENTIFIANT' => '', - 'MONTANT' => ($this->getAmount()*100), - 'DEVISE' => $this->getCurrencyNumb(), - 'REFERENCE' => base64_encode($payment->getOrder()->getRealOrderId()), - 'PORTEUR' => $payment->getCcNumber(), - 'DATEVAL' => Mage::getModel('core/date')->date('my', mktime(0,0,0,$payment->getCcExpMonth(),1,$payment->getCcExpYear())), - 'CVV' => $payment->getCcCid(), - 'ACTIVITE' => self::PBX_ACTIVITE_VALUE, - ); - - foreach ($tmpArr as $param=>$value) { - $requestStr .= $param . '=' . $value . '&'; - } - $requestStr = substr($requestStr, 0, -1); - - $resultArr = $this->call($requestStr); - - if ($resultArr === false) { - return false; - } - - $this->getQuestionNumberModel() - ->increaseQuestionNumber(); - - $this->setTransactionId($resultArr['NUMTRANS']); - $this->setRequestNumber($resultArr['NUMAPPEL']); - $this->setQuestionNumber($resultArr['NUMQUESTION']); - - return $resultArr; - } - - /** - * Building array of params for debit (after authorize) - * - * @return bool | array - */ - public function callDoDebitPayment() - { - $payment = $this->getPayment(); - $requestStr = ''; - - $tmpArr = array( - 'VERSION' => self::PBX_VERSION, - 'DATEQ' => Mage::getModel('core/date')->date('dmYHis'), - 'TYPE' => self::PBX_PAYMENT_ACTION_DEBIT, - 'NUMQUESTION' => $payment->getPayboxQuestionNumber(), - 'SITE' => $this->getSiteNumber(), - 'RANG' => $this->getRang(), - 'CLE' => $this->getCleNumber(), - 'MONTANT' => ($this->getAmount()*100), - 'DEVISE' => (string)$this->getCurrencyNumb(), - 'REFERENCE' => base64_encode($payment->getOrder()->getRealOrderId()), - 'NUMAPPEL' => $payment->getPayboxRequestNumber(), - 'NUMTRANS' => $payment->getLastTransId(), - ); - - foreach ($tmpArr as $param=>$value) { - $requestStr .= $param . '=' . $value . '&'; - } - $requestStr = substr($requestStr, 0, -1); - - $resultArr = $this->call($requestStr); - - if ($resultArr === false) { - return false; - } - - $this->setTransactionId($resultArr['NUMTRANS']); - - return $resultArr; - } - - /** - * Building array of params for refund - * - * @return bool | array - */ - public function callDoRefund() - { - $payment = $this->getPayment(); - $requestStr = ''; - - $tmpArr = array( - 'VERSION' => self::PBX_VERSION, - 'DATEQ' => Mage::getModel('core/date')->date('dmYHis'), - 'TYPE' => self::PBX_PAYMENT_ACTION_REFUND, - 'NUMQUESTION' => $this->getQuestionNumberModel()->getNextQuestionNumber(), - 'SITE' => $this->getSiteNumber(), - 'RANG' => $this->getRang(), - 'CLE' => $this->getCleNumber(), - 'MONTANT' => ($this->getAmount()*100), - 'DEVISE' => (string)$this->getCurrencyNumb(), - 'REFERENCE' => base64_encode($payment->getOrder()->getRealOrderId()), - 'PORTEUR' => $payment->getCcNumber(), - 'DATEVAL' => Mage::getModel('core/date')->date('my', mktime(0,0,0,$payment->getCcExpMonth(),1,$payment->getCcExpYear())), - 'NUMAPPEL' => '', - 'NUMTRANS' => '', - ); - - foreach ($tmpArr as $param=>$value) { - $requestStr .= $param . '=' . $value . '&'; - } - $requestStr = substr($requestStr, 0, -1); - - $resultArr = $this->call($requestStr); - - if ($resultArr === false) { - return false; - } - - $this->getQuestionNumberModel() - ->increaseQuestionNumber(); - - $this->setTransactionId($resultArr['NUMTRANS']); - - return $resultArr; - } - - /** - * Making a call to gateway - * - * @param string $requestStr - * @return bool | array - */ - public function call($requestStr) - { - $debugData = array('request' => $requestStr); - - $recall = true; - $recallCounter = 0; - while ($recall && $recallCounter < 3) { - $recall = false; - $this->unsError(); - - $http = new Varien_Http_Adapter_Curl(); - $config = array('timeout' => 30); - $http->setConfig($config); - $http->write(Zend_Http_Client::POST, $this->getPayboxUrl($recallCounter), '1.1', array(), $requestStr); - $response = $http->read(); - - $response = preg_split('/^\r?$/m', $response, 2); - $response = trim($response[1]); - - if ($http->getErrno()) { - $http->close(); - - $debugData['result'] = $response; - $this->_debug($debugData); - - $this->setError(array( - 'message' => $http->getError() - )); - return false; - } - $http->close(); - - $parsedResArr = $this->parseResponseStr($response); - - //primary gateway is down, need to recall to backup gateway - if ($parsedResArr['CODEREPONSE'] == '00001' || - $parsedResArr['CODEREPONSE'] == '00097' || - $parsedResArr['CODEREPONSE'] == '00098' - ) { - $recallCounter++; - $recall = true; - } - } - - $debugData['result'] = $response; - $this->_debug($debugData); - - //if backup gateway was down too - if ($recall) { - $this->setError(array( - 'message' => Mage::helper('paybox')->__('Paybox payment gateway is not available right now') - )); - return false; - } - - if ($parsedResArr['CODEREPONSE'] == '00000') { - return $parsedResArr; - } - - if (isset($parsedResArr['COMMENTAIRE'])) { - $this->setError(array( - 'message' => $parsedResArr['CODEREPONSE'] . ':' . $parsedResArr['COMMENTAIRE'] - )); - } - - return false; - } - - /** - * Parsing response string - * - * @param string $str - * @return array - */ - public function parseResponseStr($str) - { - $tmpResponseArr = explode('&', $str); - $responseArr = array(); - foreach ($tmpResponseArr as $response) { - $paramValue = explode('=', $response); - $responseArr[$paramValue[0]] = $paramValue[1]; - } - - return $responseArr; - } -} diff --git a/app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug.php deleted file mode 100644 index 1010087c21..0000000000 --- a/app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Paybox_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('paybox/api_debug', 'debug_id'); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index ca2bf8f10c..0000000000 --- a/app/code/core/Mage/Paybox/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Paybox_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('paybox/api_debug'); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Mysql4/Question/Number.php b/app/code/core/Mage/Paybox/Model/Mysql4/Question/Number.php deleted file mode 100644 index 0f594f7439..0000000000 --- a/app/code/core/Mage/Paybox/Model/Mysql4/Question/Number.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Paybox_Model_Mysql4_Question_Number extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('paybox/question_number', 'account_id'); - } - -} diff --git a/app/code/core/Mage/Paybox/Model/Mysql4/Setup.php b/app/code/core/Mage/Paybox/Model/Mysql4/Setup.php deleted file mode 100644 index fd6e167554..0000000000 --- a/app/code/core/Mage/Paybox/Model/Mysql4/Setup.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -class Mage_Paybox_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup -{ - -} diff --git a/app/code/core/Mage/Paybox/Model/Question/Number.php b/app/code/core/Mage/Paybox/Model/Question/Number.php deleted file mode 100644 index af183a89e5..0000000000 --- a/app/code/core/Mage/Paybox/Model/Question/Number.php +++ /dev/null @@ -1,95 +0,0 @@ - - */ -class Mage_Paybox_Model_Question_Number extends Mage_Core_Model_Abstract -{ - /** - * Max value of question number - */ - const MAX_QUESTION_NUMBER_VALUE = 2147483647; - - protected $_accountHash; - - protected function _construct() - { - $this->_init('paybox/question_number'); - } - - public function load($id, $field=null) - { - $this->_accountHash = $id; - return parent::load($id, $field); - } - - protected function _afterLoad() - { - //need to create new record (with default data) if it first time using of paybox direct - if (!$this->getAccountHash()) { - $this->setAccountHash($this->_accountHash); - $this->setIncrementValue(1); - $this->save(); - } - unset($this->_accountHash); - - //need to set default value of question number if it reach max value - if ($this->getIncrementValue() >= self::MAX_QUESTION_NUMBER_VALUE) { - $this->setResetDate('CURRENT_TIMESTAMP') - ->setIncrementValue(1); - } - - return parent::_afterLoad(); - } - - /** - * Return next number formated to paybox specification - * - * @return string - */ - public function getNextQuestionNumber() - { - $questionNumber = $this->getIncrementValue()+1; - return sprintf('%010d', $questionNumber); - } - - /** - * Increase question number and save it after successful transaction - * - * @return Mage_Paybox_Model_Question_Number - */ - public function increaseQuestionNumber() - { - $this->setIncrementValue($this->getIncrementValue()+1) - ->save(); - return $this; - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/CartType.php b/app/code/core/Mage/Paybox/Model/Source/CartType.php deleted file mode 100644 index 511129682d..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/CartType.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_CartType -{ - /** - * Enter description here... - * - * @return Mage_Paybox_Model_System - */ - public function getModel() - { - return Mage::getModel('paybox/system'); - } - - public function toOptionArray() - { - $cartTypesArr = array(); - $tmpArr = $this->getModel()->getCartTypesByPayment($this->getModel()->getPaymentType()); - - foreach ($tmpArr as $code => $name) { - $cartTypesArr[] = array( - 'value' => $code, - 'label' => $name - ); - } - - return $cartTypesArr; - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/Cctype.php b/app/code/core/Mage/Paybox/Model/Source/Cctype.php deleted file mode 100644 index 46597d3088..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/Cctype.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype -{ - public function getAllowedTypes() - { - return array('VI', 'MC', 'AE', 'OT'); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/Language.php b/app/code/core/Mage/Paybox/Model/Source/Language.php deleted file mode 100644 index cc5b3bb3e5..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/Language.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_Language -{ - public function toOptionArray() - { - return array( -// array('value' => Mage_Paypal_Model_Api_Abstract::PAYMENT_TYPE_AUTH, 'label' => Mage::helper('paypal')->__('Authorization')), - array('value' => 'FRA', 'label' => Mage::helper('paybox')->__('FRA (French)')), - array('value' => 'GBR', 'label' => Mage::helper('paybox')->__('GBR (English)')), - array('value' => 'ESP', 'label' => Mage::helper('paybox')->__('ESP (Spanish)')), - array('value' => 'ITA', 'label' => Mage::helper('paybox')->__('ITA (Italian)')), - array('value' => 'DEU', 'label' => Mage::helper('paybox')->__('DEU (German)')), - array('value' => 'NLD', 'label' => Mage::helper('paybox')->__('NLD (Dutch)')), - array('value' => 'SWE', 'label' => Mage::helper('paybox')->__('SWE (Swedish)')), - ); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/ManagementMode.php b/app/code/core/Mage/Paybox/Model/Source/ManagementMode.php deleted file mode 100644 index 36e4e57108..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/ManagementMode.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_ManagementMode -{ - public function toOptionArray() - { - return array( -// array('value' => Mage_Paypal_Model_Api_Abstract::PAYMENT_TYPE_AUTH, 'label' => Mage::helper('paypal')->__('Authorization')), - array('value' => 'A', 'label' => Mage::helper('paybox')->__('Mode A')), - array('value' => 'B', 'label' => Mage::helper('paybox')->__('Mode B')), - array('value' => 'C', 'label' => Mage::helper('paybox')->__('Mode C')), - array('value' => 'D', 'label' => Mage::helper('paybox')->__('Mode D')), - array('value' => 'E', 'label' => Mage::helper('paybox')->__('Mode E')), - ); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/MethodCall.php b/app/code/core/Mage/Paybox/Model/Source/MethodCall.php deleted file mode 100644 index 59a37b54aa..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/MethodCall.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_MethodCall -{ - public function toOptionArray() - { - return array( -// array('value' => Mage_Paypal_Model_Api_Abstract::PAYMENT_TYPE_AUTH, 'label' => Mage::helper('paypal')->__('Authorization')), - array('value' => 'GET', 'label' => Mage::helper('paybox')->__('GET')), - array('value' => 'POST', 'label' => Mage::helper('paybox')->__('POST')), - ); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/PaymentAction.php b/app/code/core/Mage/Paybox/Model/Source/PaymentAction.php deleted file mode 100644 index 12435a38ef..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/PaymentAction.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_PaymentAction -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE, 'label' => Mage::helper('paybox')->__('Authorization')), - array('value' => Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE, 'label' => Mage::helper('paybox')->__('Payment')), - ); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/PaymentMode.php b/app/code/core/Mage/Paybox/Model/Source/PaymentMode.php deleted file mode 100644 index 9474400562..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/PaymentMode.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_PaymentMode -{ - public function toOptionArray() - { - return array( -// array('value' => Mage_Paypal_Model_Api_Abstract::PAYMENT_TYPE_AUTH, 'label' => Mage::helper('paypal')->__('Authorization')), - array('value' => 1, 'label' => Mage::helper('paybox')->__('HTML Form')), - array('value' => 4, 'label' => Mage::helper('paybox')->__('Command Line Mode')), - ); - } -} diff --git a/app/code/core/Mage/Paybox/Model/Source/PaymentType.php b/app/code/core/Mage/Paybox/Model/Source/PaymentType.php deleted file mode 100644 index 5de3c38fac..0000000000 --- a/app/code/core/Mage/Paybox/Model/Source/PaymentType.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class Mage_Paybox_Model_Source_PaymentType -{ - public function toOptionArray() - { - return array( - array('value' => '', 'label' => Mage::helper('paybox')->__('--Please Select--')), - array('value' => Mage_Paybox_Model_System::PBX_PAYMENT_TYPE_CARTE, 'label' => Mage::helper('paybox')->__('CARTE')), - array('value' => Mage_Paybox_Model_System::PBX_PAYMENT_TYPE_SYMPASS, 'label' => Mage::helper('paybox')->__('SYMPASS')), - array('value' => Mage_Paybox_Model_System::PBX_PAYMENT_TYPE_PAYNOVA , 'label' => Mage::helper('paybox')->__('PAYNOVA')), - array('value' => Mage_Paybox_Model_System::PBX_PAYMENT_TYPE_TERMINEO, 'label' => Mage::helper('paybox')->__('TERMINEO')), - array('value' => Mage_Paybox_Model_System::PBX_PAYMENT_TYPE_PAYPAL, 'label' => Mage::helper('paybox')->__('PAYPAL')), - ); - } -} diff --git a/app/code/core/Mage/Paybox/Model/System.php b/app/code/core/Mage/Paybox/Model/System.php deleted file mode 100644 index e803ba7a25..0000000000 --- a/app/code/core/Mage/Paybox/Model/System.php +++ /dev/null @@ -1,517 +0,0 @@ - - */ -class Mage_Paybox_Model_System extends Mage_Payment_Model_Method_Abstract -{ - /** - * Paybox const variables - */ - const PBX_FORM_HTML_METHOD = 1; - const PBX_COMMAND_LINE_METHOD = 4; - - const PBX_METHOD_CALL = 'POST'; - - const PBX_PAYMENT_ACTION_ATHORIZE = 'O'; - const PBX_PAYMENT_ACTION_ATHORIZE_CAPTURE = 'N'; - - const PBX_PAYMENT_TYPE_CARTE = 'CARTE'; - const PBX_PAYMENT_TYPE_SYMPASS = 'SYMPASS'; - const PBX_PAYMENT_TYPE_PAYNOVA = 'PAYNOVA'; - const PBX_PAYMENT_TYPE_TERMINEO = 'TERMINEO'; - const PBX_PAYMENT_TYPE_PAYPAL = 'PAYPAL'; - - const PBX_CARTE_TYPE_CB = 'CB'; - const PBX_CARTE_TYPE_VISA = 'VISA'; - const PBX_CARTE_TYPE_EUROCARDMASTERCARD = 'EUROCARD_MASTERCARD'; - const PBX_CARTE_TYPE_ECARD = 'E_CARD'; - const PBX_CARTE_TYPE_AMEX = 'AMEX'; - const PBX_CARTE_TYPE_DINERS = 'DINERS'; - const PBX_CARTE_TYPE_JCB = 'JCB'; - const PBX_CARTE_TYPE_AURORE = 'AURORE'; - const PBX_CARTE_TYPE_PAYNOVA = 'PAYNOVA'; - const PBX_CARTE_TYPE_TERMINEO = 'TERMINEO'; - const PBX_CARTE_TYPE_PAYPAL = 'PAYPAL'; - - protected $_code = 'paybox_system'; - - protected $_isGateway = false; - protected $_canAuthorize = true; - protected $_canCapture = false; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = false; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = false; - - protected $_formBlockType = 'paybox/system_form'; - - protected $_order; - protected $_cartTypes; - protected $_currenciesNumbers; - - /** - * Get order model - * - * @return Mage_Sales_Model_Order - */ - public function getOrder() - { - if (!$this->_order) { - $paymentInfo = $this->getInfoInstance(); - $this->_order = Mage::getModel('sales/order') - ->loadByIncrementId($paymentInfo->getOrder()->getRealOrderId()); - } - return $this->_order; - } - - /** - * Set order - * - * @param Mage_Sales_Model_Order $order - */ - public function setOrder(Mage_Sales_Model_Order $order) - { - $this->_order = $order; - return $this; - } - - /** - * Get cart types for all payment types - * or for given payment type - * - * @param string $paymentType - * @return array - */ - protected function _getCartTypes($paymentType = null) - { - if (!$this->_cartTypes) { - $this->_cartTypes = array( - self::PBX_PAYMENT_TYPE_CARTE => array( - 'none' => Mage::helper('paybox')->__('Customer Choise'), - self::PBX_CARTE_TYPE_CB => Mage::helper('paybox')->__('CB'), - self::PBX_CARTE_TYPE_VISA => Mage::helper('paybox')->__('VISA'), - self::PBX_CARTE_TYPE_EUROCARDMASTERCARD => Mage::helper('paybox')->__('EUROCARD & MASTERCARD'), - self::PBX_CARTE_TYPE_ECARD => Mage::helper('paybox')->__('E CARD'), - self::PBX_CARTE_TYPE_AMEX => Mage::helper('paybox')->__('AMEX'), - self::PBX_CARTE_TYPE_DINERS => Mage::helper('paybox')->__('DINERS'), - self::PBX_CARTE_TYPE_JCB => Mage::helper('paybox')->__('JCB'), - self::PBX_CARTE_TYPE_AURORE => Mage::helper('paybox')->__('AURORE'), - ), - self::PBX_PAYMENT_TYPE_SYMPASS => array( - 'none' => Mage::helper('paybox')->__('Customer Choise'), - self::PBX_CARTE_TYPE_CB => Mage::helper('paybox')->__('CB'), - self::PBX_CARTE_TYPE_VISA => Mage::helper('paybox')->__('VISA'), - self::PBX_CARTE_TYPE_EUROCARDMASTERCARD => Mage::helper('paybox')->__('EUROCARD & MASTERCARD'), - self::PBX_CARTE_TYPE_ECARD => Mage::helper('paybox')->__('E CARD'), - self::PBX_CARTE_TYPE_AMEX => Mage::helper('paybox')->__('AMEX'), - self::PBX_CARTE_TYPE_DINERS => Mage::helper('paybox')->__('DINERS'), - self::PBX_CARTE_TYPE_JCB => Mage::helper('paybox')->__('JCB'), - self::PBX_CARTE_TYPE_AURORE => Mage::helper('paybox')->__('AURORE'), - ), - self::PBX_PAYMENT_TYPE_PAYNOVA => array( - self::PBX_CARTE_TYPE_PAYNOVA => Mage::helper('paybox')->__('PAYNOVA'), - ), - self::PBX_PAYMENT_TYPE_TERMINEO => array( - self::PBX_CARTE_TYPE_TERMINEO => Mage::helper('paybox')->__('TERMINEO'), - ), - self::PBX_PAYMENT_TYPE_PAYPAL => array( - self::PBX_CARTE_TYPE_PAYPAL => Mage::helper('paybox')->__('PAYPAL'), - ) - ); - } - - if (!is_null($paymentType)) { - if (isset($this->_cartTypes[$paymentType])) { - return $this->_cartTypes[$paymentType]; - } - } - - return $this->_cartTypes; - } - - /** - * Get cart types by given payment - * - * @param string $paymentType - * @return array - */ - public function getCartTypesByPayment($paymentType) - { - if ($paymentType == '') { - return array(); - } - return $this->_getCartTypes($paymentType); - } - - /** - * Get all cart types in JSON format - * - * @return string - */ - public function getJsonCartTypes() - { - return Mage::helper('core')->jsonEncode($this->_getCartTypes()); - } - - /** - * Get payment method - * - * @return string - */ - public function getPaymentMethod() - { - return $this->getConfigData('pbx_mode'); - } - - /** - * Get name of executable file - * - * @return string - */ - public function getPayboxFile() - { - return $this->getConfigData('pbx_file'); - } - - /** - * Get Payment type - * - * @return string - */ - public function getPaymentType() - { - return $this->getConfigData('pbx_typepaiement'); - } - - /** - * Get Payment Action of Paybox System changed to Paybox specification - * - * @return string - */ - public function getPaymentAction() - { - $paymentAction = $this->getConfigData('pbx_autoseule'); - switch ($paymentAction) { - case self::ACTION_AUTHORIZE: - return self::PBX_PAYMENT_ACTION_ATHORIZE; - break; - case self::ACTION_AUTHORIZE_CAPTURE: - return self::PBX_PAYMENT_ACTION_ATHORIZE_CAPTURE; - break; - default: - return self::PBX_PAYMENT_ACTION_ATHORIZE; - break; - } - } - - /** - * Get cart type - * - * @return string - */ - public function getCartType() - { - return $this->getConfigData('pbx_typecarte'); - } - - /** - * Get Site number (TPE) - * - * @return string - */ - public function getSiteNumber() - { - return $this->getConfigData('pbx_site'); - } - - /** - * Get Rang number - * - * @return string - */ - public function getRang() - { - return $this->getConfigData('pbx_rang'); - } - - /** - * Get Identifiant number - * - * @return string - */ - public function getIdentifiant() - { - return $this->getConfigData('pbx_identifiant'); - } - - /** - * Get currency number in ISO4217 format - * - * @return string - */ - public function getCurrencyNumber() - { - $currencyCode = $this->getOrder()->getBaseCurrencyCode(); - if (!$this->_currenciesNumbers) { - $this->_currenciesNumbers = simplexml_load_file(Mage::getBaseDir().'/app/code/core/Mage/Paybox/etc/currency.xml'); - } - if ($this->_currenciesNumbers->$currencyCode) { - return (string)$this->_currenciesNumbers->$currencyCode; - } - } - - /** - * Get language of interface of payment defined in config - * - * @return string - */ - public function getLanguage() - { - return $this->getConfigData('pbx_langue'); - } - - /** - * Get api urls if they defined in config - * - * @return unknown - */ - public function getApiUrls() - { - $fielldsArr = array(); - if (($primary = trim($this->getConfigData('pbx_paybox'))) != '') { - $fielldsArr['PBX_PAYBOX'] = $primary; - } - - if (($backup1 = trim($this->getConfigData('pbx_backup1'))) != '') { - $fielldsArr['PBX_BACKUP1'] = $backup1; - } - - if (($backup2 = trim($this->getConfigData('pbx_backup2'))) != '') { - $fielldsArr['PBX_BACKUP2'] = $backup2; - } - - if (($backup3 = trim($this->getConfigData('pbx_backup3'))) != '') { - $fielldsArr['PBX_BACKUP3'] = $backup3; - } - - return $fielldsArr; - } - - /** - * Get timeouts for api urls if timeouts diferent from default - * - * @return array - */ - public function getTimeouts() - { - $fielldsArr = array(); - if (($timeout = trim($this->getConfigData('pbx_timeout'))) != '') { - $fielldsArr['PBX_TIMEOUT'] = $timeout; - } - - if (($timeout1 = trim($this->getConfigData('pbx_timeout1'))) != '') { - $fielldsArr['PBX_TIMEOUT1'] = $timeout1; - } - - if (($timeout2 = trim($this->getConfigData('pbx_timeout2'))) != '') { - $fielldsArr['PBX_TIMEOUT2'] = $timeout2; - } - - if (($timeout3 = trim($this->getConfigData('pbx_timeout3'))) != '') { - $fielldsArr['PBX_TIMEOUT3'] = $timeout3; - } - - return $fielldsArr; - } - - /** - * Get params from config for HTML form mode - * - * @return array - */ - public function getManagementMode() - { - $fieldsArr = array(); - if (($text = trim($this->getConfigData('pbx_txt'))) != '') { - $fieldsArr['PBX_TXT'] = $text; - } - - if (($wait = trim($this->getConfigData('pbx_wait'))) != '') { - $fieldsArr['PBX_WAIT'] = $wait; - } - - if (($boutpi = trim($this->getConfigData('pbx_boutpi')))) { - $fieldsArr['PBX_BOUTPI'] = $boutpi; - } - - if (($bkgd = trim($this->getConfigData('pbx_bkgd'))) != '') { - $fieldsArr['PBX_BKGD'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'payment/paybox/bkgd/' . $bkgd; - } - - $fieldsArr['PBX_OUTPUT'] = $this->getConfigData('pbx_output'); - - return $fieldsArr; - } - - /** - * Get ping flag (commandline mode) - * - * @return unknown - */ - public function getPingFlag() - { - return $this->getConfigData('pbx_ping'); - } - - /** - * Get ping port (commandline mode) - * - * @return string - */ - public function getPingPort() - { - return $this->getConfigData('pbx_port'); - } - - /** - * Get debug flag - * - * @return string - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } - - public function getOrderPlaceRedirectUrl() - { - if ($this->getPaymentMethod() == self::PBX_FORM_HTML_METHOD) { - return Mage::getUrl('paybox/system/redirect', array('_secure' => true)); - } else { - return Mage::getUrl('paybox/system/commandline', array('_secure' => true)); - } - } - - /** - * Building array of params to send - * - * @return array - */ - public function getFormFields() - { - $fieldsArr = array(); - - $fieldsArr = array( - 'PBX_MODE' => $this->getPaymentMethod(), - 'PBX_SITE' => $this->getSiteNumber(),//'1999888', - 'PBX_RANG' => $this->getRang(),//'99', - 'PBX_IDENTIFIANT' => $this->getIdentifiant(),//'2', - 'PBX_TOTAL' => ($this->getOrder()->getBaseGrandTotal()*100), - 'PBX_DEVISE' => $this->getCurrencyNumber(), - 'PBX_CMD' => $this->getOrder()->getRealOrderId(), - 'PBX_PORTEUR' => $this->getOrder()->getCustomerEmail(), - 'PBX_RETOUR' => 'amount:M;ref:R;auto:A;trans:T;error:E', - 'PBX_EFFECTUE' => Mage::getUrl('paybox/system/success', array('_secure' => true)), - 'PBX_REFUSE' => Mage::getUrl('paybox/system/refuse', array('_secure' => true)), - 'PBX_ANNULE' => Mage::getUrl('paybox/system/decline', array('_secure' => true)), - 'PBX_AUTOSEULE' => $this->getPaymentAction(), - 'PBX_LANGUE' => $this->getLanguage(), - 'PBX_ERREUR' => Mage::getUrl('paybox/system/error', array('_secure' => true)), - 'PBX_TYPEPAIEMENT' => $this->getPaymentType(), - 'PBX_TYPECARTE' => $this->getCartType(), - 'PBX_RUF1' => self::PBX_METHOD_CALL, - ); - - if (count($apiUrls = $this->getApiUrls())) { - $fieldsArr = array_merge($fieldsArr, $this->getApiUrls()); - } - if (count($timeouts = $this->getTimeouts())) { - $fieldsArr = array_merge($fieldsArr, $this->getTimeouts()); - } - - if ($this->getPaymentMethod() == self::PBX_FORM_HTML_METHOD) { - $fieldsArr = array_merge($fieldsArr, $this->getManagementMode()); - } - - if ($this->getPaymentMethod() == self::PBX_COMMAND_LINE_METHOD && $this->getPingFlag()) { - $tmpFieldsArr['PBX_PING'] = '1'; - if (($pingPort = trim($this->getPingPort())) != '') { - $tmpFieldsArr['PING_PORT'] = $pingPort; - } - - $fieldsArr = array_merge($fieldsArr, $tmpFieldsArr); - } - - $this->_debug(array('request' => $fieldsArr)); - - return $fieldsArr; - } - - /** - * Checking response - * - * @param array $response - * @return bool - */ - public function checkResponse($response) - { - $this->_debug(array('result' => $response)); - - if (isset($response['error'], $response['amount'], $response['ref'], $response['trans'])) { - return true; - } - return false; - } - - public function capture(Varien_Object $payment, $amount) - { - $payment->setStatus(self::STATUS_APPROVED) - ->setLastTransId($this->getTransactionId()); - return $this; - } - - public function authorize(Varien_Object $payment, $amount) - { - $payment->setStatus(self::STATUS_APPROVED) - ->setLastTransId($this->getTransactionId()); - - return $this; - } - - public function cancel(Varien_Object $payment) - { - $payment->setStatus(self::STATUS_DECLINED); - return $this; - } -} diff --git a/app/code/core/Mage/Paybox/controllers/SystemController.php b/app/code/core/Mage/Paybox/controllers/SystemController.php deleted file mode 100644 index 2be3ff17a6..0000000000 --- a/app/code/core/Mage/Paybox/controllers/SystemController.php +++ /dev/null @@ -1,364 +0,0 @@ - - */ -class Mage_Paybox_SystemController extends Mage_Core_Controller_Front_Action -{ - protected $_payboxResponse = null; - - protected $_responseStatus = false; - - /** - * seting response after returning from paybox - * - * @param array $response - * @return object $this - */ - protected function setPayboxResponse($response) - { - if (count($response)) { - $this->_payboxResponse = $response; - } - return $this; - } - - /** - * Get System Model - * - * @return Mage_Paybox_Model_System - */ - public function getModel() - { - return Mage::getSingleton('paybox/system'); - } - - /** - * Get Checkout Singleton - * - * @return Mage_Checkout_Model_Session - */ - public function getCheckout() - { - return Mage::getSingleton('checkout/session'); - } - - /** - * Redirect action. Redirect customer to Paybox - * - */ - public function redirectAction() - { - $session = $this->getCheckout(); - $session->setPayboxQuoteId($session->getQuoteId()); - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($session->getLastRealOrderId()); - $order->addStatusToHistory($order->getStatus(), $this->__('The customer was redirected to Paybox')); - $order->save(); - - $session->setPayboxOrderId(Mage::helper('core')->encrypt($session->getLastRealOrderId())); - $session->setPayboxPaymentAction( - $order->getPayment()->getMethodInstance()->getPaymentAction() - ); - - $this->getResponse()->setBody( - $this->getLayout() - ->createBlock('paybox/system_redirect') - ->setOrder($order) - ->toHtml() - ); - - $session->unsQuoteId(); - } - - /** - * Customer returning to this action if payment was successe - */ - public function successAction() - { - $this->setPayboxResponse($this->getRequest()->getParams()); - if ($this->_checkResponse()) { - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($this->_payboxResponse['ref']); - - if (!$order->getId()) { - Mage::throwException($this->__('There are no orders.')); - } - - if (Mage::helper('core')->decrypt($this->getCheckout()->getPayboxOrderId()) != $this->_payboxResponse['ref']) { - Mage::throwException($this->__('Order does not match.')); - } - $this->getCheckout()->unsPayboxOrderId(); - - if (($order->getBaseGrandTotal()*100) != $this->_payboxResponse['amount']) { - Mage::throwException($this->__('Amount does not match.')); - } - - if ($this->_payboxResponse['error'] == '00000') { - $order->addStatusToHistory($order->getStatus(), $this->__('The customer has returned from Paybox.')); - - $redirectTo = 'checkout/onepage/success'; - if ($this->getCheckout()->getPayboxPaymentAction() == Mage_Paybox_Model_System::PBX_PAYMENT_ACTION_ATHORIZE_CAPTURE) { - $this->getCheckout()->unsPayboxPaymentAction(); - $order->getPayment() - ->getMethodInstance() - ->setTransactionId($this->_payboxResponse['trans']); - if ($this->_createInvoice($order)) { - $order->addStatusToHistory($order->getStatus(), $this->__('The invoice has been created.')); - } else { - $order->addStatusToHistory($order->getStatus(), $this->__('Cannot create the invoice.')); - $redirectTo = '*/*/failure'; - } - } - - $session = $this->getCheckout(); - $session->setQuoteId($session->getPayboxQuoteId(true)); - $session->getQuote()->setIsActive(false)->save(); - $session->unsPayboxQuoteId(); - } else { - $redirectTo = '*/*/failure'; - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), $this->__('The customer was rejected by Paybox.')); - } - - $order->sendNewOrderEmail(); - $order->save(); - - $this->_redirect($redirectTo); - } else { - $this->norouteAction(); - return; - } - } - - /** - * Action when payment was declined by Paybox - */ - public function refuseAction() - { - $this->setPayboxResponse($this->getRequest()->getParams()); - if ($this->_checkResponse()) { - $this->getCheckout()->unsPayboxQuoteId(); - $this->getCheckout()->setPayboxErrorMessage('Order was canceled by Paybox'); - - $order = Mage::getModel('sales/order') - ->loadByIncrementId($this->_payboxResponse['ref']); - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), $this->__('The customer was refused by Paybox.')); - $order->save(); - - $this->_redirect('*/*/failure'); - } else { - $this->norouteAction(); - return; - } - } - - /** - * Action when customer cancele payment or press button to back to shop - */ - public function declineAction() - { - $this->setPayboxResponse($this->getRequest()->getParams()); - if ($this->_checkResponse()) { - - $order = Mage::getModel('sales/order') - ->loadByIncrementId($this->_payboxResponse['ref']); - $order->cancel(); - $order->addStatusToHistory($order->getStatus(), $this->__('The order was canceled by the customer.')); - $order->save(); - - $session = $this->getCheckout(); - $session->setQuoteId($session->getPayboxQuoteId(true)); - $session->getQuote()->setIsActive(false)->save(); - $session->unsPayboxQuoteId(); - - $this->_redirect('checkout/cart'); - } else { - $this->norouteAction(); - return; - } - } - - /** - * Redirect action. Redirect to Paybox using commandline mode - * - */ - public function commandlineAction() - { - $session = $this->getCheckout(); - $session->setPayboxQuoteId($session->getQuoteId()); - - $order = Mage::getModel('sales/order') - ->loadByIncrementId($this->getCheckout()->getLastRealOrderId()); - $order->addStatusToHistory( - $order->getStatus(), $this->__('The customer was redirected to Paybox using \'command line\' mode.') - ); - $order->save(); - - $session->setPayboxOrderId(Mage::helper('core')->encrypt($session->getLastRealOrderId())); - $session->setPayboxPaymentAction( - $order->getPayment()->getMethodInstance()->getPaymentAction() - ); - - $session->unsQuoteId(); - - $payment = $order->getPayment()->getMethodInstance(); - $fieldsArr = $payment->getFormFields(); - $paramStr = ''; - foreach ($fieldsArr as $k => $v) { - $paramStr .= $k.'='.$v.' '; - } - - $paramStr = str_replace(';', '\;', $paramStr); - $result = shell_exec(Mage::getBaseDir().'/'.$this->getModel()->getPayboxFile().' '.$paramStr); - - if (isset($fieldsArr['PBX_PING']) && $fieldsArr['PBX_PING'] == '1') { - $fieldsArr['PBX_PING'] = '0'; - $fieldsArr['PBX_PAYBOX'] = trim(substr($result, strpos($result, 'http'))); - $paramStr = ''; - foreach ($fieldsArr as $k => $v) { - $paramStr .= $k.'='.$v.' '; - } - - $paramStr = str_replace(';', '\;', $paramStr); - $result = shell_exec(Mage::getBaseDir().'/'.$this->getModel()->getPayboxFile().' '.$paramStr); - } - - $this->loadLayout(false); - $this->getResponse()->setBody($result); - $this->renderLayout(); - } - - /** - * Error action. If request params to Paybox has mistakes - * - */ - public function errorAction() - { - if (!$this->getCheckout()->getPayboxQuoteId()) { - $this->norouteAction(); - return; - } - - $session = $this->getCheckout(); - $session->setQuoteId($session->getPayboxQuoteId(true)); - $session->getQuote()->setIsActive(false)->save(); - $session->unsPayboxQuoteId(); - - if (!$this->getRequest()->getParam('NUMERR')) { - $this->norouteAction(); - return; - } - - $this->loadLayout(); - - $this->getCheckout() - ->setPayboxErrorNumber( - $this->getRequest()->getParam('NUMERR') - ); - - $this->renderLayout(); - } - - /** - * Failure action. - * Displaying information if customer was redirecting to cancel or decline actions - * - */ - public function failureAction() - { - if (!$this->getCheckout()->getPayboxErrorMessage()) { - $this->norouteAction(); - return; - } - - $this->loadLayout(); - $this->renderLayout(); - } - - /** - * Checking response and Paybox session variables - * - * @return unknown - */ - protected function _checkResponse() - { - if (!$this->getCheckout()->getPayboxQuoteId()) { - $this->norouteAction(); - return; - } - - if (!$this->getCheckout()->getPayboxOrderId()) { - $this->norouteAction(); - return; - } - - if (!$this->getCheckout()->getPayboxPaymentAction()) { - $this->norouteAction(); - return; - } - - if (!$this->_payboxResponse) { - return false; - } - - //check for valid response - if ($this->getModel()->checkResponse($this->_payboxResponse)) { - return true; - } - - return true; - } - - /** - * Creating invoice - * - * @param Mage_Sales_Model_Order $order - * @return bool - */ - protected function _createInvoice(Mage_Sales_Model_Order $order) - { - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - return true; - } - return false; - } - -} diff --git a/app/code/core/Mage/Paybox/etc/config.xml b/app/code/core/Mage/Paybox/etc/config.xml deleted file mode 100644 index 9b68b1d03d..0000000000 --- a/app/code/core/Mage/Paybox/etc/config.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - 0.1.3 - - - - - - Mage_Paybox_Model - paybox_mysql4 - - - Mage_Paybox_Model_Mysql4 - - paybox_api_debug
    - paybox_question_number
    -
    -
    -
    - - - - Mage_Paybox - Mage_Paybox_Model_Mysql4_Setup - - - - - Mage_Paybox_Block - -
    - - - - standard - - Mage_Paybox - paybox - - - - - - - - Mage_Paybox.csv - - - - - - - - - - - Mage_Paybox.csv - - - - - - - - - 1 - - - - authorize - E - FRA - paybox/system - Paybox System - processing - 0 - - - - - - authorize - paybox/direct - Paybox Direct - 1 - processing - AE,VI,MC,DI - 0 - - - -
    diff --git a/app/code/core/Mage/Paybox/etc/currency.xml b/app/code/core/Mage/Paybox/etc/currency.xml deleted file mode 100644 index adb3a7abe8..0000000000 --- a/app/code/core/Mage/Paybox/etc/currency.xml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - 971 - 008 - 012 - 840 - 978 - 973 - 951 - 032 - 051 - 533 - 036 - 944 - 044 - 048 - 050 - 052 - 974 - 084 - 952 - 060 - 356 - 064 - 068 - 984 - 977 - 072 - 578 - 986 - 096 - 975 - 108 - 116 - 950 - 124 - 132 - 136 - 152 - 156 - 170 - 174 - 976 - 554 - 188 - 191 - 192 - 203 - 208 - 262 - 214 - 818 - 222 - 232 - 233 - 230 - 238 - 242 - 953 - 270 - 981 - 936 - 292 - 320 - 324 - 328 - 332 - 340 - 344 - 348 - 352 - 360 - 960 - 364 - 368 - 376 - 388 - 392 - 400 - 398 - 404 - 408 - 410 - 414 - 417 - 418 - 428 - 422 - 710 - 426 - 430 - 434 - 756 - 440 - 446 - 807 - 969 - 454 - 458 - 462 - 478 - 480 - 484 - 979 - 498 - 496 - 504 - 943 - 104 - 516 - 524 - 532 - 558 - 566 - 512 - 586 - 590 - 598 - 600 - 604 - 608 - 985 - 634 - 946 - 643 - 646 - 654 - 882 - 678 - 682 - 941 - 690 - 694 - 702 - 703 - 090 - 706 - 144 - 938 - 968 - 748 - 752 - 948 - 947 - 760 - 901 - 972 - 834 - 764 - 776 - 780 - 788 - 949 - 795 - 800 - 980 - 784 - 826 - 998 - 997 - 858 - 940 - 860 - 548 - 937 - 704 - 886 - 894 - 716 - 959 - 955 - 956 - 957 - 958 - 964 - 962 - 961 - Nil - Nil - 963 - 999 - diff --git a/app/code/core/Mage/Paybox/etc/system.xml b/app/code/core/Mage/Paybox/etc/system.xml deleted file mode 100644 index 4767413818..0000000000 --- a/app/code/core/Mage/Paybox/etc/system.xml +++ /dev/null @@ -1,459 +0,0 @@ - - - - - - - - - text - 101 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - - text - 5 - 1 - 1 - 0 - - - - select - paybox/source_paymentMode - 10 - 1 - 1 - 0 - - - - select - paybox/source_paymentAction - 15 - 1 - 1 - 0 - - - - obscure - adminhtml/system_config_backend_encrypted - 20 - 1 - 1 - 0 - - - - obscure - adminhtml/system_config_backend_encrypted - 30 - 1 - 1 - 0 - - - - obscure - adminhtml/system_config_backend_encrypted - 40 - 1 - 1 - 0 - - - - Only if the "HTML From" mode selected. - select - paybox/source_managementMode - 50 - 1 - 1 - 0 - - - - Only if the "HTML From" mode selected. - text - 60 - 1 - 1 - 0 - - - - Only if the "HTML From" mode selected. - text - 70 - 1 - 1 - 0 - - - - Only if the "HTML From" mode selected. - image - adminhtml/system_config_backend_image - payment/paybox/bkgd - payment/paybox/bkgd - 80 - 1 - 1 - 0 - - - - Only if the "HTML From" mode selected. - text - 90 - 1 - 1 - 0 - - - - select - paybox/source_language - 100 - 1 - 1 - 0 - - - - select - paybox/source_paymentType - 105 - 1 - 1 - 0 - - - - select - paybox/adminhtml_cart_type - paybox/source_cartType - 108 - 1 - 1 - 0 - - - - Specify the URL of the primary payment server if different from default. - text - 110 - 1 - 1 - 0 - - - - Time-out (in seconds) to check the avalaibility of the primary payment server (default 8 seconds). - text - 115 - 1 - 1 - 0 - - - - Specify the URL of the primary backup payment server if different from default. - text - 120 - 1 - 1 - 0 - - - - Time-out (in seconds) to check the avalaibility of the primary backup payment server (default 10 seconds). - text - 125 - 1 - 1 - 0 - - - - Specify the URL of the second backup payment server if different from default. - text - 130 - 1 - 1 - 0 - - - - Time-out (in seconds) to check the avalaibility of the second backup payment server (fefault 20 seconds). - text - 135 - 1 - 1 - 0 - - - - Specify the URL of the third backup payment server if different from default. - text - 140 - 1 - 1 - 0 - - - - Time-out (in seconds) to check the avalaibility of the third backup payment server (default 20 seconds). - text - 145 - 1 - 1 - 0 - - - - Only with "Command Line" mode. - select - adminhtml/system_config_source_yesno - 160 - 1 - 1 - 0 - - - - TCP port used to check the availability of a payment server if "Ping Flag" enabled (default port is 443). - text - 170 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 300 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>310</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - select - adminhtml/system_config_source_order_status_processing - 320 - 1 - 1 - 0 - - - - text - 500 - 1 - 1 - 0 - - - - allowspecific - 330 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 340 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - - - text - 101 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - - obscure - adminhtml/system_config_backend_encrypted - 20 - 1 - 1 - 0 - - - - obscure - adminhtml/system_config_backend_encrypted - 30 - 1 - 1 - 0 - - - - obscure - adminhtml/system_config_backend_encrypted - 40 - 1 - 1 - 0 - - - - text - 50 - 1 - 1 - 0 - - - - text - 60 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 70 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>80</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - select - adminhtml/system_config_source_order_status_processing - 90 - 1 - 1 - 0 - - - - select - paybox/source_paymentAction - 95 - 1 - 1 - 0 - - - - multiselect - paybox/source_cctype - 100 - 1 - 1 - 0 - - - - allowspecific - 110 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 120 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 500 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-install-0.1.0.php deleted file mode 100644 index e54f4e0009..0000000000 --- a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,47 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS `{$this->getTable('paybox/api_debug')}`; -CREATE TABLE `{$this->getTable('paybox/api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `real_order_id` varchar(50)NOT NULL default '', - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.0-0.1.1.php b/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.0-0.1.1.php deleted file mode 100644 index dce93d14da..0000000000 --- a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.0-0.1.1.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$installer->addAttribute('order_payment', 'paybox_request_number', array()); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.1-0.1.2.php b/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.1-0.1.2.php deleted file mode 100644 index d7e9e10b36..0000000000 --- a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.1-0.1.2.php +++ /dev/null @@ -1,44 +0,0 @@ -startSetup(); - -$installer->run(" - -DROP TABLE IF EXISTS `{$this->getTable('paybox/question_number')}`; -CREATE TABLE `{$this->getTable('paybox/question_number')}` ( - `account_id` int(10) unsigned NOT NULL auto_increment, - `account_hash` varchar(50) NOT NULL default '', - `increment_value` int(10) unsigned NOT NULL default 1, - `reset_date` timestamp NOT NULL default CURRENT_TIMESTAMP, - PRIMARY KEY (`account_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -"); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.2-0.1.3.php b/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.2-0.1.3.php deleted file mode 100644 index 6046a84868..0000000000 --- a/app/code/core/Mage/Paybox/sql/paybox_setup/mysql4-upgrade-0.1.2-0.1.3.php +++ /dev/null @@ -1,33 +0,0 @@ -startSetup(); - -$installer->addAttribute('order_payment', 'paybox_question_number', array()); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Payment/Helper/Data.php b/app/code/core/Mage/Payment/Helper/Data.php index 1c7d279ca3..cab2dfe6c9 100644 --- a/app/code/core/Mage/Payment/Helper/Data.php +++ b/app/code/core/Mage/Payment/Helper/Data.php @@ -69,6 +69,9 @@ public function getStoreMethods($store = null, $quote = null) continue; } $methodInstance = Mage::getModel($model); + if (!$methodInstance) { + continue; + } $methodInstance->setStore($store); if (!$methodInstance->isAvailable($quote)) { /* if the payment method cannot be used at this time */ diff --git a/app/code/core/Mage/Payment/Model/Billing/Agreement.php b/app/code/core/Mage/Payment/Model/Billing/Agreement.php index 2cd4a6e882..e0783b1a6f 100644 --- a/app/code/core/Mage/Payment/Model/Billing/Agreement.php +++ b/app/code/core/Mage/Payment/Model/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Cc.php b/app/code/core/Mage/Payment/Model/Method/Cc.php index ee6d97385c..8787c4ffd8 100644 --- a/app/code/core/Mage/Payment/Model/Method/Cc.php +++ b/app/code/core/Mage/Payment/Model/Method/Cc.php @@ -108,15 +108,16 @@ public function validate() $ccType = 'OT'; $ccTypeRegExpList = array( + //Solo, Switch or Maestro. International safe + 'SO' => '/(^(6334)[5-9](\d{11}$|\d{13,14}$))|(^(6767)(\d{12}$|\d{14,15}$))/', // Solo only + 'SM' => '/(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))/', + 'SS' => '/^((6759[0-9]{12})|(6334|6767[0-9]{12})|(6334|6767[0-9]{14,15})|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})|(633[34][0-9]{12})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$/', // Maestro / Solo 'VI' => '/^4[0-9]{12}([0-9]{3})?$/', // Visa 'MC' => '/^5[1-5][0-9]{14}$/', // Master Card 'AE' => '/^3[47][0-9]{13}$/', // American Express 'DI' => '/^6011[0-9]{12}$/', // Discovery 'JCB' => '/^(3[0-9]{15}|(2131|1800)[0-9]{11})$/', // JCB - // Solo, Switch or Maestro. International safe - 'SM' => '/(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))/', - 'SO' => '/(^(6334)[5-9](\d{11}$|\d{13,14}$))|(^(6767)(\d{12}$|\d{14,15}$))/', // Solo only ); foreach ($ccTypeRegExpList as $ccTypeMatch=>$ccTypeRegExp) { @@ -143,7 +144,7 @@ public function validate() } //validate credit card verification number - if ($errorMsg === false && $this->hasVerification() && $ccType != 'SS') { + if ($errorMsg === false && $this->hasVerification()) { $verifcationRegEx = $this->getVerificationRegEx(); $regExp = isset($verifcationRegEx[$info->getCcType()]) ? $verifcationRegEx[$info->getCcType()] : ''; if (!$info->getCcCid() || !$regExp || !preg_match($regExp ,$info->getCcCid())){ diff --git a/app/code/core/Mage/Paypal/Block/Express/Form.php b/app/code/core/Mage/Paypal/Block/Express/Form.php index 90d4902107..a9692facba 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Form.php +++ b/app/code/core/Mage/Paypal/Block/Express/Form.php @@ -41,7 +41,7 @@ class Mage_Paypal_Block_Express_Form extends Mage_Paypal_Block_Standard_Form protected function _construct() { $result = parent::_construct(); - $this->setRedirectMessage(Mage::helper('paypal')->__('You will be redirected to PayPal website.')); + $this->setRedirectMessage(Mage::helper('paypal')->__('You will be redirected to the PayPal website.')); return $result; } diff --git a/app/code/core/Mage/Paypal/Block/Standard/Form.php b/app/code/core/Mage/Paypal/Block/Standard/Form.php index 825c19b44d..88c626399d 100644 --- a/app/code/core/Mage/Paypal/Block/Standard/Form.php +++ b/app/code/core/Mage/Paypal/Block/Standard/Form.php @@ -57,7 +57,7 @@ protected function _construct() ; // known issue: code above will render only static mark image $this->setTemplate('paypal/payment/redirect.phtml') ->setRedirectMessage( - Mage::helper('paypal')->__('You will be redirected to PayPal website when you place an order.') + Mage::helper('paypal')->__('You will be redirected to the PayPal website when you place an order.') ) ->setMethodTitle('') // Output PayPal mark, omit title ->setMethodLabelAfterHtml($mark->toHtml()) diff --git a/app/code/core/Mage/Paypal/Block/Standard/Redirect.php b/app/code/core/Mage/Paypal/Block/Standard/Redirect.php index 567ae30a7b..2b6001bb80 100644 --- a/app/code/core/Mage/Paypal/Block/Standard/Redirect.php +++ b/app/code/core/Mage/Paypal/Block/Standard/Redirect.php @@ -39,7 +39,7 @@ protected function _toHtml() $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value)); } $html = ''; - $html.= $this->__('You will be redirected to PayPal in a few seconds.'); + $html.= $this->__('You will be redirected to the PayPal website in a few seconds.'); $html.= $form->toHtml(); $html.= ''; $html.= ''; diff --git a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php index 938348090c..ae23c9501d 100644 --- a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php +++ b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php @@ -61,12 +61,16 @@ public function startAction() try { $this->_initCheckout(); + $customer = Mage::getSingleton('customer/session')->getCustomer(); + if ($customer && $customer->getId()) { + $this->_checkout->setCustomer($customer); + } + // billing agreement $customerId = Mage::getSingleton('customer/session')->getCustomerId(); $isBARequested = (bool)$this->getRequest() ->getParam(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT); - if ($customerId) { - $this->_checkout->setCustomerId($customerId); + if ($customer && $customer->getId()) { $this->_checkout->setIsBillingAgreementRequested($isBARequested); } diff --git a/app/code/core/Mage/Paypal/Helper/Data.php b/app/code/core/Mage/Paypal/Helper/Data.php index a70d4de6cb..38939e384f 100644 --- a/app/code/core/Mage/Paypal/Helper/Data.php +++ b/app/code/core/Mage/Paypal/Helper/Data.php @@ -56,10 +56,21 @@ public function prepareLineItems(Mage_Core_Model_Abstract $salesEntity, $discoun $items[] = new Varien_Object($this->_prepareLineItemFields($salesEntity, $item)); } } - $discountAmount = 0; // this amount always includes the shipping discount + $additionalItems = new Varien_Object(array('items'=>array())); + Mage::dispatchEvent('paypal_prepare_line_items', array('sales_entity'=>$salesEntity, 'additional'=>$additionalItems)); + $additionalAmount = 0; + $discountAmount = 0; // this amount always includes the shipping discount + foreach ($additionalItems->getItems() as $item) { + if ($item['amount'] > 0) { + $additionalAmount += $item['amount']; + $items[] = $item; + } else { + $discountAmount += abs($item['amount']); + } + } $shippingDescription = ''; if ($salesEntity instanceof Mage_Sales_Model_Order) { - $discountAmount = abs(1 * $salesEntity->getBaseDiscountAmount()); + $discountAmount += abs($salesEntity->getBaseDiscountAmount()); $shippingDescription = $salesEntity->getShippingDescription(); $totals = array( 'subtotal' => $salesEntity->getBaseSubtotal() - $discountAmount, @@ -70,7 +81,7 @@ public function prepareLineItems(Mage_Core_Model_Abstract $salesEntity, $discoun ); } else { $address = $salesEntity->getIsVirtual() ? $salesEntity->getBillingAddress() : $salesEntity->getShippingAddress(); - $discountAmount = abs(1 * $address->getBaseDiscountAmount()); + $discountAmount += abs($address->getBaseDiscountAmount()); $shippingDescription = $address->getShippingDescription(); $totals = array ( 'subtotal' => $salesEntity->getBaseSubtotal() - $discountAmount, diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 7a3671057b..7bf370b5d2 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -212,6 +212,7 @@ public function setIsBillingAgreementRequested($flag) * * @param int $id * @return Mage_Paypal_Model_Express_Checkout + * @deprecated please use self::setCustomer */ public function setCustomerId($id) { @@ -219,6 +220,19 @@ public function setCustomerId($id) return $this; } + /** + * Setter for customer + * + * @param Mage_Customer_Model_Customer $customer + * @return Mage_Paypal_Model_Express_Checkout + */ + public function setCustomer($customer) + { + $this->_quote->assignCustomer($customer); + $this->_customerId = $customer->getId(); + return $this; + } + /** * Reserve order ID for specified quote and start checkout on PayPal * @return string diff --git a/app/code/core/Mage/Paypal/Model/Method/Agreement.php b/app/code/core/Mage/Paypal/Model/Method/Agreement.php index bddeb2f080..dfe638b412 100644 --- a/app/code/core/Mage/Paypal/Model/Method/Agreement.php +++ b/app/code/core/Mage/Paypal/Model/Method/Agreement.php @@ -321,6 +321,7 @@ protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount) ->setIsTransactionClosed(0); if ($api->getBillingAgreementId()) { + $order->addRelatedObject($billingAgreement); $billingAgreement->addOrderRelation($order->getId()); } diff --git a/app/code/core/Mage/Paypal/Model/Payflowpro.php b/app/code/core/Mage/Paypal/Model/Payflowpro.php index e50a0c747a..da45412704 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowpro.php +++ b/app/code/core/Mage/Paypal/Model/Payflowpro.php @@ -34,6 +34,9 @@ class Mage_Paypal_Model_Payflowpro extends Mage_Payment_Model_Method_Cc { + /** + * Transaction action codes + */ const TRXTYPE_AUTH_ONLY = 'A'; const TRXTYPE_SALE = 'S'; const TRXTYPE_CREDIT = 'C'; @@ -42,25 +45,28 @@ class Mage_Paypal_Model_Payflowpro extends Mage_Payment_Model_Method_Cc const TRXTYPE_DELAYED_VOICE = 'F'; const TRXTYPE_DELAYED_INQUIRY = 'I'; - const TENDER_AUTOMATED = 'A'; - const TENDER_CC = 'C'; - const TENDER_PINLESS_DEBIT = 'D'; - const TENDER_ECHEK = 'E'; - const TENDER_TELECHECK = 'K'; - const TENDER_PAYPAL = 'P'; - - const RESPONSE_DELIM_CHAR = ','; + /** + * Tender type codes + */ + const TENDER_CC = 'C'; - const TRANSACTION_URL = 'https://payflowpro.paypal.com/transaction'; + /** + * Gateway request URLs + */ + const TRANSACTION_URL = 'https://payflowpro.paypal.com/transaction'; const TRANSACTION_URL_TEST_MODE = 'https://pilot-payflowpro.paypal.com/transaction'; - protected $_clientTimeout = 45; - - const RESPONSE_CODE_APPROVED = 0; + /** + * Response codes + */ + const RESPONSE_CODE_APPROVED = 0; const RESPONSE_CODE_FRAUDSERVICE_FILTER = 126; - const RESPONSE_CODE_DECLINED = 12; - const RESPONSE_CODE_CAPTURE_ERROR = 111; + const RESPONSE_CODE_DECLINED = 12; + const RESPONSE_CODE_CAPTURE_ERROR = 111; + /** + * Payment method code + */ protected $_code = Mage_Paypal_Model_Config::METHOD_PAYFLOWPRO; /** @@ -70,7 +76,7 @@ class Mage_Paypal_Model_Payflowpro extends Mage_Payment_Model_Method_Cc protected $_canAuthorize = true; protected $_canCapture = true; protected $_canCapturePartial = false; - protected $_canRefund = false; + protected $_canRefund = true; protected $_canVoid = true; protected $_canUseInternal = true; protected $_canUseCheckout = true; @@ -79,19 +85,16 @@ class Mage_Paypal_Model_Payflowpro extends Mage_Payment_Model_Method_Cc protected $_isProxy = false; /** - * Fields that should be replaced in debug with '***' - * - * @var array + * Gateway request timeout */ - protected $_debugReplacePrivateDataKeys = array('user', 'pwd', 'acct', - 'expdate', 'cvv2'); + protected $_clientTimeout = 45; /** - * 3 = Authorisation approved - * 6 = Settlement pending (transaction is scheduled to be settled) - * 9 = Authorisation captured + * Fields that should be replaced in debug with '***' + * + * @var array */ - protected $_validVoidTransState = array(3,6,9); + protected $_debugReplacePrivateDataKeys = array('user', 'pwd', 'acct', 'expdate', 'cvv2'); /** * Centinel cardinal fields map @@ -99,15 +102,16 @@ class Mage_Paypal_Model_Payflowpro extends Mage_Payment_Model_Method_Cc * @var string */ protected $_centinelFieldMap = array( - 'centinel_mpivendor' => 'MPIVENDOR3DS', - 'centinel_authstatus' => 'AUTHSTATUS3DS', - 'centinel_cavv' => 'CAVV', - 'centinel_eci' => 'ECI', - 'centinel_xid' => 'XID', + 'centinel_mpivendor' => 'MPIVENDOR3DS', + 'centinel_authstatus' => 'AUTHSTATUS3DS', + 'centinel_cavv' => 'CAVV', + 'centinel_eci' => 'ECI', + 'centinel_xid' => 'XID', ); /** * Check whether payment method can be used + * * @param Mage_Sales_Model_Quote * @return bool */ @@ -121,42 +125,6 @@ public function isAvailable($quote = null) return false; } - /** - * Custom getter for payment configuration - * - * @param string $field - * @param int $storeId - * @return mixed - */ - public function getConfigData($field, $storeId = null) - { - $value = null; - switch ($field) - { - case 'url': - $value = $this->getTransactionUrl(); - break; - default: - $value = parent::getConfigData($field, $storeId); - } - return $value; - } - - /** - * Getter for URL to perform Payflow requests, based on test mode by default - * - * @param bool $testMode Ability to specify test mode using - * @return string - */ - public function getTransactionUrl($testMode = null) - { - $testMode = is_null($testMode) ? $this->getConfigData('sandbox_flag') : (bool)$testMode; - if ($testMode) { - return self::TRANSACTION_URL_TEST_MODE; - } - return self::TRANSACTION_URL; - } - /** * Payment action getter compatible with payment model * @@ -173,219 +141,149 @@ public function getConfigPaymentAction() } } + /** + * Authorize payment + * + * @param Mage_Sales_Model_Order_Payment $payment + * @return Mage_Paypal_Model_Payflowpro + */ public function authorize(Varien_Object $payment, $amount) { - $error = false; - if($amount>0){ - $payment->setTrxtype(self::TRXTYPE_AUTH_ONLY); - $payment->setAmount($amount); - - $request = $this->_buildRequest($payment); - $result = $this->_postRequest($request); - $payment->setCcTransId($result->getPnref()) - ->setTransactionId($result->getPnref()) - ->setIsTransactionClosed(0); - - switch ($result->getResultCode()){ - case self::RESPONSE_CODE_APPROVED: - $payment->setStatus(self::STATUS_APPROVED); - break; - - case self::RESPONSE_CODE_FRAUDSERVICE_FILTER: - $payment->setIsTransactionPending(true); - break; - - default: - if ($result->getRespmsg()) { - $error = $result->getRespmsg(); - } - else { - $error = Mage::helper('paypal')->__('Error in authorizing the payment.'); - } - break; - } - }else{ - $error = Mage::helper('paypal')->__('Invalid amount for authorization.'); - } + $request = $this->_buildPlaceRequest($payment, $amount); + $request->setTrxtype(self::TRXTYPE_AUTH_ONLY); + $response = $this->_postRequest($request); + $this->_processErrors($response); - if ($error !== false) { - Mage::throwException($error); + switch ($response->getResultCode()){ + case self::RESPONSE_CODE_APPROVED: + $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); + break; + case self::RESPONSE_CODE_FRAUDSERVICE_FILTER: + $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); + $payment->setIsTransactionPending(true); + $payment->setIsFraudDetected(true); + break; } return $this; } + /** + * Capture payment + * + * @param Mage_Sales_Model_Order_Payment $payment + * @return Mage_Paypal_Model_Payflowpro + */ public function capture(Varien_Object $payment, $amount) { - $error = false; - if ($payment->getCcTransId()) { - /* - for payment already captured, we need to send the transaction type as sale - */ - if ($payment->getOrder()->getTotalPaid()>0) { - $payment->setTrxtype(self::TRXTYPE_SALE); - } else { - $payment->setTrxtype(self::TRXTYPE_DELAYED_CAPTURE); - } - $payment->setTransactionId($payment->getCcTransId()); + if ($payment->getParentTransactionId()) { $request = $this->_buildBasicRequest($payment); + $request->setTrxtype(self::TRXTYPE_DELAYED_CAPTURE); + $request->setOrigid($payment->getParentTransactionId()); } else { - $payment->setTrxtype(self::TRXTYPE_SALE); - $payment->setAmount($amount); - $request = $this->_buildRequest($payment); + $request = $this->_buildPlaceRequest($payment, $amount); + $request->setTrxtype(self::TRXTYPE_SALE); } - $result = $this->_postRequest($request); - switch ($result->getResultCode()){ - case self::RESPONSE_CODE_APPROVED: - $payment->setStatus(self::STATUS_APPROVED); - //$payment->setCcTransId($result->getPnref()); - $payment->setLastTransId($result->getPnref()); - $payment->setTransactionId($result->getPnref()); - break; + $response = $this->_postRequest($request); + $this->_processErrors($response); + switch ($response->getResultCode()){ + case self::RESPONSE_CODE_APPROVED: + $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); + break; case self::RESPONSE_CODE_FRAUDSERVICE_FILTER: + $payment->setTransactionId($response->getPnref())->setIsTransactionClosed(0); $payment->setIsTransactionPending(true); + $payment->setIsFraudDetected(true); break; - - default: - if ($result->getRespmsg()) { - $error = $result->getRespmsg(); - } else { - $error = Mage::helper('paypal')->__('Error in capturing the payment.'); - } - break; - } - if ($error !== false) { - Mage::throwException($error); } return $this; } /** - * canVoid - * - * @access public - * @param string $payment Varien_Object object - * @return Mage_Payment_Model_Abstract - * @desc checking the transaction id is valid or not and transction id was not settled - */ - public function canVoid(Varien_Object $payment) + * Void payment + * + * @param Mage_Sales_Model_Order_Payment $payment + * @return Mage_Paypal_Model_Payflowpro + */ + public function void(Varien_Object $payment) { - if($payment->getCcTransId()){ - $payment->setTrxtype(self::TRXTYPE_DELAYED_INQUIRY); - $payment->setTransactionId($payment->getCcTransId()); - $request=$this->_buildBasicRequest($payment); - $result = $this->_postRequest($request); - - if($result->getResultCode()==self::RESPONSE_CODE_APPROVED){ - if($result->getTransstate()>1000){ - $payment->setStatus(self::STATUS_ERROR); - $payment->setStatusDescription(Mage::helper('paypal')->__('Voided transaction.')); - }elseif(in_array($result->getTransstate(),$this->_validVoidTransState)){ - $payment->setStatus(self::STATUS_VOID); - } - }else{ - $payment->setStatus(self::STATUS_ERROR); - $payment->setStatusDescription($result->getRespmsg()? - $result->getRespmsg(): - Mage::helper('paypal')->__('Error in retrieving the transaction.')); - } - }else{ - $payment->setStatus(self::STATUS_ERROR); - $payment->setStatusDescription(Mage::helper('paypal')->__('Invalid transaction ID.')); + $request = $this->_buildBasicRequest($payment); + $request->setTrxtype(self::TRXTYPE_DELAYED_VOID); + $request->setOrigid($payment->getParentTransactionId()); + $response = $this->_postRequest($request); + $this->_processErrors($response); + + if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED){ + $payment->setTransactionId($response->getPnref()) + ->setIsTransactionClosed(1) + ->setShouldCloseParentTransaction(1); } return $this; } - /** - * void - * - * @access public - * @param string $payment Varien_Object object - * @return Mage_Payment_Model_Abstract - */ - public function void(Varien_Object $payment) + /** + * Attempt to void the authorization on cancelling + * + * @param Varien_Object $payment + * @return Mage_Paypal_Model_Payflowpro + */ + public function cancel(Varien_Object $payment) { - $error = false; - if($payment->getParentTransactionId()){ - $payment->setTrxtype(self::TRXTYPE_DELAYED_VOID); - $payment->setTransactionId($payment->getParentTransactionId()); - $request=$this->_buildBasicRequest($payment); - $result = $this->_postRequest($request); - - if($result->getResultCode()==self::RESPONSE_CODE_APPROVED){ - $payment->setStatus(self::STATUS_SUCCESS); - $payment->setCcTransId($result->getPnref()); - $payment->setTransactionId($result->getPnref()); - }else{ - $payment->setStatus(self::STATUS_ERROR); - $error = $result->getRespmsg(); - } - }else{ - $payment->setStatus(self::STATUS_ERROR); - $error = Mage::helper('paypal')->__('Invalid transaction ID.'); - } - - if ($error !== false) { - Mage::throwException($error); - } - - return $this; - + return $this->void($payment); } - - /** - * refund the amount with transaction id - * - * @access public - * @param string $payment Varien_Object object - * @return Mage_Payment_Model_Abstract - */ + /** + * Refund capture + * + * @param Mage_Sales_Model_Order_Payment $payment + * @return Mage_Paypal_Model_Payflowpro + */ public function refund(Varien_Object $payment, $amount) { - $error = false; - if(($payment->getRefundTransactionId() && $amount>0)){ - $payment->setTransactionId($payment->getRefundTransactionId()); - $payment->setTrxtype(self::TRXTYPE_CREDIT); - - $request=$this->_buildBasicRequest($payment); - - $request->setAmt(round($amount,2)); - $result = $this->_postRequest($request); - - if($result->getResultCode()==self::RESPONSE_CODE_APPROVED){ - $payment->setStatus(self::STATUS_SUCCESS); - $payment->setCcTransId($result->getPnref()); - }else{ - $error = ($result->getRespmsg()? - $result->getRespmsg(): - Mage::helper('paypal')->__('Error in refunding the payment.')); - - } - }else{ - $error = Mage::helper('paypal')->__('Error in refunding the payment.'); - } - - if ($error !== false) { - Mage::throwException($error); + $request = $this->_buildBasicRequest($payment); + $request->setTrxtype(self::TRXTYPE_CREDIT); + $request->setOrigid($payment->getParentTransactionId()); + $response = $this->_postRequest($request); + $this->_processErrors($response); + + if ($response->getResultCode() == self::RESPONSE_CODE_APPROVED){ + $payment->setTransactionId($response->getPnref()) + ->setIsTransactionClosed(1); } return $this; + } + /** + * Getter for URL to perform Payflow requests, based on test mode by default + * + * @param bool $testMode Ability to specify test mode using + * @return string + */ + protected function _getTransactionUrl($testMode = null) + { + $testMode = is_null($testMode) ? $this->getConfigData('sandbox_flag') : (bool)$testMode; + if ($testMode) { + return self::TRANSACTION_URL_TEST_MODE; + } + return self::TRANSACTION_URL; } + /** + * Post request to gateway and return response + * + * @param Varien_Object $request + * @return Varien_Object + */ protected function _postRequest(Varien_Object $request) { $debugData = array('request' => $request->getData()); $client = new Varien_Http_Client(); - $result = $this->_getResultObject(); + $result = new Varien_Object(); - $_config = array( - 'maxredirects'=>5, - 'timeout'=>30, - ); + $_config = array('maxredirects'=>5, 'timeout'=>30); $_isProxy = $this->getConfigData('use_proxy', false); if($_isProxy){ @@ -394,8 +292,7 @@ protected function _postRequest(Varien_Object $request) $_config['proxytype'] = CURLPROXY_HTTP; } - $uri = $this->getConfigData('url'); - $client->setUri($uri) + $client->setUri($this->_getTransactionUrl()) ->setConfig($_config) ->setMethod(Zend_Http_Client::POST) ->setParameterPost($request->getData()) @@ -439,25 +336,21 @@ protected function _postRequest(Varien_Object $request) return $result; } - protected function _buildRequest(Varien_Object $payment) + /** + * Return request object with information for 'authorization' or 'sale' action + * + * @param Mage_Sales_Model_Order_Payment $payment + * @param float $amount + * @return Varien_Object + */ + protected function _buildPlaceRequest(Varien_Object $payment, $amount) { - if( !$payment->getTrxtype() ) { - $payment->setTrxtype(self::TRXTYPE_AUTH_ONLY); - } - - if( !$payment->getTender() ) { - $payment->setTender(self::TENDER_CC); - } - - $request = $this->_getRequestObject() - ->setUser($this->getConfigData('user')) - ->setVendor($this->getConfigData('vendor')) - ->setPartner($this->getConfigData('partner')) - ->setPwd($this->getConfigData('pwd')) - ->setTender($payment->getTender()) - ->setTrxtype($payment->getTrxtype()) - ->setVerbosity($this->getConfigData('verbosity')) - ->setRequestId($this->_generateRequestId()); + $request = $this->_buildBasicRequest($payment); + $request->setAmt(round($amount,2)); + $request->setCurrency($payment->getOrder()->getBaseCurrencyCode()); + $request->setAcct($payment->getCcNumber()); + $request->setExpdate(sprintf('%02d',$payment->getCcExpMonth()) . substr($payment->getCcExpYear(),-2,2)); + $request->setCvv2($payment->getCcCid()); if ($this->getIsCentinelValidationEnabled()){ $params = array(); @@ -465,23 +358,6 @@ protected function _buildRequest(Varien_Object $payment) $request = Varien_Object_Mapper::accumulateByMap($params, $request, $this->_centinelFieldMap); } - if($payment->getAmount()){ - $request->setAmt(round($payment->getAmount(),2)); - $request->setCurrency($payment->getOrder()->getBaseCurrencyCode()); - } - - switch ($request->getTender()) { - case self::TENDER_CC: - if($payment->getCcNumber()){ - $request - //->setComment1($payment->getCcOwner()) - ->setAcct($payment->getCcNumber()) - ->setExpdate(sprintf('%02d',$payment->getCcExpMonth()).substr($payment->getCcExpYear(),-2,2)) - ->setCvv2($payment->getCcCid()); - } - break; - } - $order = $payment->getOrder(); if(!empty($order)){ $billing = $order->getBillingAddress(); @@ -490,7 +366,7 @@ protected function _buildRequest(Varien_Object $payment) ->setLastname($billing->getLastname()) ->setStreet($billing->getStreet(1)) ->setCity($billing->getCity()) - ->setState($billing->getRegion()) + ->setState($billing->getRegionCode()) ->setZip($billing->getPostcode()) ->setCountry($billing->getCountry()) ->setEmail($payment->getOrder()->getCustomerEmail()); @@ -501,7 +377,7 @@ protected function _buildRequest(Varien_Object $payment) ->setShiptolastname($shipping->getLastname()) ->setShiptostreet($shipping->getStreet(1)) ->setShiptocity($shipping->getCity()) - ->setShiptostate($shipping->getRegion()) + ->setShiptostate($shipping->getRegionCode()) ->setShiptozip($shipping->getPostcode()) ->setShiptocountry($shipping->getCountry()); } @@ -509,55 +385,46 @@ protected function _buildRequest(Varien_Object $payment) return $request; } - protected function _generateRequestId() - { - return Mage::helper('core')->uniqHash(); - } - /** - * Prepare base request + * Return request object with basic information for gateway request * - * @access public - * @return object which was set with all basic required information + * @param Mage_Sales_Model_Order_Payment $payment + * @return Varien_Object */ protected function _buildBasicRequest(Varien_Object $payment) { - if( !$payment->getTender() ) { - $payment->setTender(self::TENDER_CC); - } - - $request = $this->_getRequestObject() + $request = new Varien_Object(); + $request ->setUser($this->getConfigData('user')) ->setVendor($this->getConfigData('vendor')) ->setPartner($this->getConfigData('partner')) ->setPwd($this->getConfigData('pwd')) - ->setTender($payment->getTender()) - ->setTrxtype($payment->getTrxtype()) ->setVerbosity($this->getConfigData('verbosity')) - ->setRequestId($this->_generateRequestId()) - ->setOrigid($payment->getTransactionId()); + ->setTender(self::TENDER_CC) + ->setRequestId($this->_generateRequestId()); return $request; } /** - * Return generic object instance for API requests + * Return unique value for request * - * @return Varien_Object + * @return string */ - protected function _getRequestObject() + protected function _generateRequestId() { - $request = new Varien_Object(); - return $request; + return Mage::helper('core')->uniqHash(); } /** - * Return wrapper object instance for API response results + * If response is failed throw exception * - * @return Varien_Object + * @throws Mage_Core_Exception */ - protected function _getResultObject() + protected function _processErrors(Varien_Object $response) { - $result = new Varien_Object(); - return $result; + if ($response->getResultCode() != self::RESPONSE_CODE_APPROVED + && $response->getResultCode() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER) { + Mage::throwException($response->getRespmsg()); + } } } diff --git a/app/code/core/Mage/Paypal/etc/system.xml b/app/code/core/Mage/Paypal/etc/system.xml index 3f24d8d8ae..677cbfe49e 100644 --- a/app/code/core/Mage/Paypal/etc/system.xml +++ b/app/code/core/Mage/Paypal/etc/system.xml @@ -558,8 +558,9 @@ 1 1 - + + http://www.paypal.com/amexupdate.]]> payment/paypal_direct/cctypes multiselect paypal/config::getWppCcTypesAsOptionArray @@ -1077,8 +1078,9 @@ 1 1 - + + http://www.paypal.com/amexupdate.]]> payment/verisign/cctypes multiselect paypal/config::getPayflowproCcTypesAsOptionArray diff --git a/app/code/core/Mage/PaypalUk/Model/Direct.php b/app/code/core/Mage/PaypalUk/Model/Direct.php index 6e8f1e49ab..5d8fabcf66 100644 --- a/app/code/core/Mage/PaypalUk/Model/Direct.php +++ b/app/code/core/Mage/PaypalUk/Model/Direct.php @@ -77,7 +77,7 @@ protected function _importResultToPayment($api, $payment) ->setIsTransactionPending($api->getIsPaymentPending()) ->setTransactionAdditionalInfo(Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId()) ; - $payment->setPreparedMessage(Mage::helper('paypaluk')->__('Payflow PPREF: #%s.', $api->getTransactionId())); + $payment->setPreparedMessage(Mage::helper('paypaluk')->__('Payflow PNREF: #%s.', $api->getTransactionId())); $this->_pro->importPaymentInfo($api, $payment); } diff --git a/app/code/core/Mage/PaypalUk/Model/Express.php b/app/code/core/Mage/PaypalUk/Model/Express.php index 51d64c3296..27bc796dc0 100644 --- a/app/code/core/Mage/PaypalUk/Model/Express.php +++ b/app/code/core/Mage/PaypalUk/Model/Express.php @@ -83,7 +83,7 @@ protected function _importToPayment($api, $payment) ->setIsTransactionPending($api->getIsPaymentPending()) ->setTransactionAdditionalInfo(Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId()) ; - $payment->setPreparedMessage(Mage::helper('paypaluk')->__('Payflow PPREF: #%s.', $api->getTransactionId())); + $payment->setPreparedMessage(Mage::helper('paypaluk')->__('Payflow PNREF: #%s.', $api->getTransactionId())); Mage::getModel('paypal/info')->importToPayment($api, $payment); } diff --git a/app/code/core/Mage/Protx/Block/Standard/Failure.php b/app/code/core/Mage/Protx/Block/Standard/Failure.php deleted file mode 100644 index 3116d652a0..0000000000 --- a/app/code/core/Mage/Protx/Block/Standard/Failure.php +++ /dev/null @@ -1,56 +0,0 @@ - - */ - -class Mage_Protx_Block_Standard_Failure extends Mage_Core_Block_Template -{ - /** - * Return StatusDetail field value from Response - * - * @return string - */ - public function getErrorMessage () - { - $error = Mage::getSingleton('checkout/session')->getErrorMessage(); - Mage::getSingleton('checkout/session')->unsErrorMessage(); - return $error; - } - - /** - * Get continue shopping url - */ - public function getContinueShoppingUrl() - { - return Mage::getUrl('checkout/cart'); - } -} diff --git a/app/code/core/Mage/Protx/Block/Standard/Form.php b/app/code/core/Mage/Protx/Block/Standard/Form.php deleted file mode 100644 index a5f40c0507..0000000000 --- a/app/code/core/Mage/Protx/Block/Standard/Form.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - -class Mage_Protx_Block_Standard_Form extends Mage_Payment_Block_Form -{ - protected function _construct() - { - $this->setTemplate('protx/standard/form.phtml'); - parent::_construct(); - } -} diff --git a/app/code/core/Mage/Protx/Block/Standard/Redirect.php b/app/code/core/Mage/Protx/Block/Standard/Redirect.php deleted file mode 100644 index 08a42fee4c..0000000000 --- a/app/code/core/Mage/Protx/Block/Standard/Redirect.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ - -class Mage_Protx_Block_Standard_Redirect extends Mage_Core_Block_Abstract -{ - protected function _toHtml() - { - $standard = Mage::getModel('protx/standard'); - $form = new Varien_Data_Form(); - $form->setAction($standard->getProtxUrl()) - ->setId('protx_standard_checkout') - ->setName('protx_standard_checkout') - ->setMethod('POST') - ->setUseContainer(true); - foreach ($standard->setOrder($this->getOrder())->getStandardCheckoutFormFields() as $field => $value) { - $form->addField($field, 'hidden', array('name' => $field, 'value' => $value)); - } - $html = ''; - $html.= $this->__('You will be redirected to protx in a few seconds.'); - $html.= $form->toHtml(); - $html.= ''; - $html.= ''; - - return $html; - } -} diff --git a/app/code/core/Mage/Protx/Helper/Data.php b/app/code/core/Mage/Protx/Helper/Data.php deleted file mode 100644 index dbfcbbe300..0000000000 --- a/app/code/core/Mage/Protx/Helper/Data.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class Mage_Protx_Helper_Data extends Mage_Core_Helper_Abstract -{ - -} diff --git a/app/code/core/Mage/Protx/Model/Api/Debug.php b/app/code/core/Mage/Protx/Model/Api/Debug.php deleted file mode 100644 index 1cab4969b7..0000000000 --- a/app/code/core/Mage/Protx/Model/Api/Debug.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Protx_Model_Api_Debug extends Mage_Core_Model_Abstract -{ - protected function _construct() - { - $this->_init('protx/api_debug'); - } -} diff --git a/app/code/core/Mage/Protx/Model/Config.php b/app/code/core/Mage/Protx/Model/Config.php deleted file mode 100644 index cafb36131f..0000000000 --- a/app/code/core/Mage/Protx/Model/Config.php +++ /dev/null @@ -1,179 +0,0 @@ - - */ - -class Mage_Protx_Model_Config extends Varien_Object -{ - const MODE_SIMULATOR = 'SIMULATOR'; - const MODE_TEST = 'TEST'; - const MODE_LIVE = 'LIVE'; - - const PAYMENT_TYPE_PAYMENT = 'PAYMENT'; - const PAYMENT_TYPE_DEFERRED = 'DEFERRED'; - const PAYMENT_TYPE_AUTHENTICATE = 'AUTHENTICATE'; - const PAYMENT_TYPE_AUTHORISE = 'AUTHORISE'; - - - /** - * Return config var - * - * @param string Var key - * @param string Default value for non-existing key - * @return mixed - */ - public function getConfigData($key, $default=false) - { - if (!$this->hasData($key)) { - $value = Mage::getStoreConfig('payment/protx_standard/'.$key); - if (is_null($value) || false===$value) { - $value = $default; - } - $this->setData($key, $value); - } - return $this->getData($key); - } - - /** - * Return Protocol version - * - * @return string Protocol version - */ - public function getVersion () - { - return '2.22'; - } - - /** - * Return Store description sent to Protx - * - * @return string Description - */ - public function getDescription () - { - return $this->getConfigData('description'); - } - - /** - * Return Protx registered merchant account name - * - * @return string Merchant account name - */ - public function getVendorName () - { - return $this->getConfigData('vendor_name'); - } - - /** - * Return Protx merchant password - * - * @return string Merchant password - */ - public function getVendorPassword () - { - return $this->getConfigData('vendor_password'); - } - - /** - * Return preferred payment type (see SELF::PAYMENT_TYPE_* constants) - * - * @return string payment type - */ - public function getPaymentType () - { - return $this->getConfigData('payment_action'); - } - - /** - * Return working mode (see SELF::MODE_* constants) - * - * @return string Working mode - */ - public function getMode () - { - return $this->getConfigData('mode'); - } - - /** - * Return new order status - * - * @return string New order status - */ - public function getNewOrderStatus () - { - return $this->getConfigData('order_status'); - } - - /** - * Return debug flag - * - * @return boolean Debug flag (0/1) - */ - public function getDebug () - { - return $this->getConfigData('debug_flag'); - } - - /** - * Return key for simple XOR crypt, using Vendor encrypted password by Protx - * - * @return string Key for simple XOR crypt - */ - public function getCryptKey () - { - return $this->getVendorPassword(); - } - - /** - * Returns status of vendore notification - * - * @return bool - */ - public function getVendorNotification() - { - return $this->getConfigData('vendor_notification'); - } - - /** - * Returns status of vendore email - * - * @return bool - */ - public function getVendorEmail() - { - if ($email = $this->getConfigData('vendor_email')) { - return $email; - } else { - return Mage::getStoreConfig('trans_email/ident_general/email'); - } - } -} diff --git a/app/code/core/Mage/Protx/Model/Mysql4/Api/Debug.php b/app/code/core/Mage/Protx/Model/Mysql4/Api/Debug.php deleted file mode 100644 index 7a11706de6..0000000000 --- a/app/code/core/Mage/Protx/Model/Mysql4/Api/Debug.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - -class Mage_Protx_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('protx/api_debug', 'transaction_id'); - } -} diff --git a/app/code/core/Mage/Protx/Model/Mysql4/Api/Debug/Collection.php b/app/code/core/Mage/Protx/Model/Mysql4/Api/Debug/Collection.php deleted file mode 100644 index e8ab637450..0000000000 --- a/app/code/core/Mage/Protx/Model/Mysql4/Api/Debug/Collection.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class Mage_Protx_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('protx/api_debug'); - } -} diff --git a/app/code/core/Mage/Protx/Model/Mysql4/Setup.php b/app/code/core/Mage/Protx/Model/Mysql4/Setup.php deleted file mode 100644 index 48cafa2669..0000000000 --- a/app/code/core/Mage/Protx/Model/Mysql4/Setup.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - -class Mage_Protx_Model_Mysql4_Setup extends Mage_Sales_Model_Mysql4_Setup -{ - -} diff --git a/app/code/core/Mage/Protx/Model/Session.php b/app/code/core/Mage/Protx/Model/Session.php deleted file mode 100644 index 89a5f1ca73..0000000000 --- a/app/code/core/Mage/Protx/Model/Session.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - -class Mage_Protx_Model_Session extends Mage_Core_Model_Session_Abstract -{ - public function __construct() - { - $this->init('protx'); - } -} diff --git a/app/code/core/Mage/Protx/Model/Source/ModeAction.php b/app/code/core/Mage/Protx/Model/Source/ModeAction.php deleted file mode 100644 index 3177836d8c..0000000000 --- a/app/code/core/Mage/Protx/Model/Source/ModeAction.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ - -class Mage_Protx_Model_Source_ModeAction -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Protx_Model_Config::MODE_SIMULATOR, 'label' => Mage::helper('protx')->__('Simulator')), - array('value' => Mage_Protx_Model_Config::MODE_TEST, 'label' => Mage::helper('protx')->__('Test')), - array('value' => Mage_Protx_Model_Config::MODE_LIVE, 'label' => Mage::helper('protx')->__('Live')), - ); - } -} - - - diff --git a/app/code/core/Mage/Protx/Model/Source/PaymentAction.php b/app/code/core/Mage/Protx/Model/Source/PaymentAction.php deleted file mode 100644 index f9709f621f..0000000000 --- a/app/code/core/Mage/Protx/Model/Source/PaymentAction.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ - -class Mage_Protx_Model_Source_PaymentAction -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Protx_Model_Config::PAYMENT_TYPE_PAYMENT, 'label' => Mage::helper('protx')->__('PAYMENT')), - array('value' => Mage_Protx_Model_Config::PAYMENT_TYPE_DEFERRED, 'label' => Mage::helper('protx')->__('DEFERRED')), - array('value' => Mage_Protx_Model_Config::PAYMENT_TYPE_AUTHENTICATE, 'label' => Mage::helper('protx')->__('AUTHENTICATE')), - ); - } -} diff --git a/app/code/core/Mage/Protx/Model/Standard.php b/app/code/core/Mage/Protx/Model/Standard.php deleted file mode 100644 index 5aa634faec..0000000000 --- a/app/code/core/Mage/Protx/Model/Standard.php +++ /dev/null @@ -1,462 +0,0 @@ - - */ -class Mage_Protx_Model_Standard extends Mage_Payment_Model_Method_Abstract -{ - protected $_code = 'protx_standard'; - protected $_formBlockType = 'protx/standard_form'; - - protected $_isGateway = false; - protected $_canAuthorize = true; - protected $_canCapture = true; - protected $_canCapturePartial = false; - protected $_canRefund = false; - protected $_canVoid = false; - protected $_canUseInternal = false; - protected $_canUseCheckout = true; - protected $_canUseForMultishipping = false; - - protected $_order = null; - - - /** - * Get Config model - * - * @return object Mage_Protx_Model_Config - */ - public function getConfig() - { - return Mage::getSingleton('protx/config'); - } - - /** - * @deprecated after 1.4.1.0 - * - * @return boolean - */ - public function getDebug () - { - return $this->getDebugFlag(); - } - - /** - * Returns Target URL - * - * @return string Target URL - */ - public function getProtxUrl () - { - switch ($this->getConfig()->getMode()) { - case Mage_Protx_Model_Config::MODE_LIVE: - $url = 'https://ukvps.protx.com/vspgateway/service/vspform-register.vsp'; - break; - case Mage_Protx_Model_Config::MODE_TEST: - $url = 'https://ukvpstest.protx.com/vspgateway/service/vspform-register.vsp'; - break; - default: // simulator mode - $url = 'https://ukvpstest.protx.com/VSPSimulator/VSPFormGateway.asp'; - break; - } - return $url; - } - - /** - * Return URL for Protx success response - * - * @return string URL - */ - protected function getSuccessURL () - { - return Mage::getUrl('protx/standard/successresponse'); - } - - /** - * Return URL for Protx failure response - * - * @return string URL - */ - protected function getFailureURL () - { - return Mage::getUrl('protx/standard/failureresponse'); - } - - /** - * Transaction unique ID sent to Protx and sent back by Protx for order restore - * Using created order ID - * - * @return string Transaction unique number - */ - protected function getVendorTxCode () - { - return $this->getOrder()->getRealOrderId(); - } - - /** - * Returns cart formatted - * String format: - * Number of lines:Name1:Quantity1:CostNoTax1:Tax1:CostTax1:Total1:Name2:Quantity2:CostNoTax2... - * - * @return string Formatted cart items - */ - protected function getFormattedCart () - { - $items = $this->getOrder()->getAllItems(); - $resultParts = array(); - $totalLines = 0; - if ($items) { - foreach($items as $item) { - if ($item->getParentItem()) { - continue; - } - $quantity = $item->getQtyOrdered(); - - $cost = sprintf('%.2f', $item->getBasePrice() - $item->getBaseDiscountAmount()); - $tax = sprintf('%.2f', $item->getBaseTaxAmount()); - $costPlusTax = sprintf('%.2f', $cost + $tax/$quantity); - - $totalCostPlusTax = sprintf('%.2f', $quantity * $cost + $tax); - - $resultParts[] = str_replace(':', ' ', $item->getName()); - $resultParts[] = $quantity; - $resultParts[] = $cost; - $resultParts[] = $tax; - $resultParts[] = $costPlusTax; - $resultParts[] = $totalCostPlusTax; - $totalLines++; //counting actual formatted items - } - } - - // add delivery - $shipping = $this->getOrder()->getBaseShippingAmount(); - if ((int)$shipping > 0) { - $totalLines++; - $resultParts = array_merge($resultParts, array('Shipping','','','','',sprintf('%.2f', $shipping))); - } - - $result = $totalLines . ':' . implode(':', $resultParts); - return $result; - } - - /** - * Format Crypted string with all order data for request to Protx - * - * @return string Crypted string - */ - protected function getCrypted () - { - $order = $this->getOrder(); - if (!($order instanceof Mage_Sales_Model_Order)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve order object')); - } - - $shipping = $order->getShippingAddress(); - $billing = $order->getBillingAddress(); - - $amount = $order->getBaseGrandTotal(); - - $currency = $order->getBaseCurrencyCode(); - - $queryPairs = array(); - - $transactionId = $this->getVendorTxCode(); - $queryPairs['VendorTxCode'] = $transactionId; - - - $queryPairs['Amount'] = sprintf('%.2f', $amount); - $queryPairs['Currency'] = $currency; - - // Up to 100 chars of free format description - $description = $this->getConfig()->getDescription() != '' - ? $this->getConfig()->getDescription() - : Mage::app()->getStore()->getFrontendName() . ' ' . ' payment'; - $queryPairs['Description'] = $description; - - $queryPairs['SuccessURL'] = $this->getSuccessURL(); - $queryPairs['FailureURL'] = $this->getFailureURL(); - - $queryPairs['CustomerName'] = $billing->getFirstname().' '.$billing->getLastname(); - $queryPairs['CustomerEMail'] = $order->getCustomerEmail(); - $queryPairs['ContactNumber'] = $billing->getTelephone(); - $queryPairs['ContactFax'] = $billing->getFax(); - - if ($this->getConfig()->getVendorNotification()) { - $queryPairs['VendorEMail'] = $this->getConfig()->getVendorEmail(); - } else { - $queryPairs['VendorEMail'] = ''; - } - - $queryPairs['eMailMessage'] = ''; - - $queryPairs['BillingAddress'] = $billing->format('oneline'); - $queryPairs['BillingPostCode'] = $billing->getPostcode(); - - if ($shipping) { - $queryPairs['DeliveryAddress'] = $shipping->getFormated(); - $queryPairs['DeliveryPostCode'] = $shipping->getPostcode(); - } else { - $queryPairs['DeliveryAddress'] = ''; - $queryPairs['DeliveryPostCode'] = ''; - } - - $queryPairs['Basket'] = $this->getFormattedCart(); - - // For charities registered for Gift Aid - $queryPairs['AllowGiftAid'] = '0'; - - /** - * Allow fine control over AVS/CV2 checks and rules by changing this value. 0 is Default - * It can be changed dynamically, per transaction, if you wish. See the VSP Server Protocol document - */ - if ($this->getConfig()->getPaymentType() !== Mage_Protx_Model_Config::PAYMENT_TYPE_AUTHENTICATE) { - $queryPairs['ApplyAVSCV2'] = '0'; - } - - /** - * Allow fine control over 3D-Secure checks and rules by changing this value. 0 is Default - * It can be changed dynamically, per transaction, if you wish. See the VSP Server Protocol document - */ - $queryPairs['Apply3DSecure'] = '0'; - - $this->_debug(array('request' => $queryPairs)); - - // Encrypt the plaintext string for inclusion in the hidden field - $result = $this->arrayToCrypt($queryPairs); - return $result; - } - - /** - * Form block description - * - * @return object - */ - public function createFormBlock($name) - { - $block = $this->getLayout()->createBlock('protx/form_standard', $name); - $block->setMethod($this->_code); - $block->setPayment($this->getPayment()); - return $block; - } - - /** - * Return Order Place Redirect URL - * - * @return string Order Redirect URL - */ - public function getOrderPlaceRedirectUrl() - { - return Mage::getUrl('protx/standard/redirect'); - } - - /** - * Return encrypted string with simple XOR algorithm - * - * @param string String to be encrypted - * @return string Encrypted string - */ - protected function simpleXOR ($string) - { - $result = ''; - $cryptKey = $this->getConfig()->getCryptKey(); - - if (!$cryptKey) { - return $string; - } - - // Initialise key array - $keyList = array(); - - // Convert $cryptKey into array of ASCII values - for($i = 0; $i < strlen($cryptKey); $i++){ - $keyList[$i] = ord(substr($cryptKey, $i, 1)); - } - - // Step through string a character at a time - for($i = 0; $i < strlen($string); $i++) { - /** - * Get ASCII code from string, get ASCII code from key (loop through with MOD), - * XOR the two, get the character from the result - * % is MOD (modulus), ^ is XOR - */ - $result .= chr(ord(substr($string, $i, 1)) ^ ($keyList[$i % strlen($cryptKey)])); - } - return $result; - } - - /** - * Extract possible response values into array from query string - * - * @param string Query string i.e. var1=value1&var2=value3... - * @return array - */ - protected function getToken($queryString) { - - // List the possible tokens - $Tokens = array( - "Status", - "StatusDetail", - "VendorTxCode", - "VPSTxId", - "TxAuthNo", - "Amount", - "AVSCV2", - "AddressResult", - "PostCodeResult", - "CV2Result", - "GiftAid", - "3DSecureStatus", - "CAVV" - ); - - // Initialise arrays - $output = array(); - $resultArray = array(); - - // Get the next token in the sequence - $c = count($Tokens); - for ($i = $c - 1; $i >= 0 ; $i--){ - // Find the position in the string - $start = strpos($queryString, $Tokens[$i]); - // If it's present - if ($start !== false){ - // Record position and token name - $resultArray[$i]['start'] = $start; - $resultArray[$i]['token'] = $Tokens[$i]; - } - } - - // Sort in order of position - sort($resultArray); - - // Go through the result array, getting the token values - $c = count($resultArray); - for ($i = 0; $i < $c; $i++){ - // Get the start point of the value - $valueStart = $resultArray[$i]['start'] + strlen($resultArray[$i]['token']) + 1; - // Get the length of the value - if ($i == $c-1) { - $output[$resultArray[$i]['token']] = substr($queryString, $valueStart); - } else { - $valueLength = $resultArray[$i+1]['start'] - $resultArray[$i]['start'] - strlen($resultArray[$i]['token']) - 2; - $output[$resultArray[$i]['token']] = substr($queryString, $valueStart, $valueLength); - } - - } - - return $output; - } - - /** - * Convert array (key => value, key => value, ...) to crypt string - * - * @param array Array to be converted - * @return string Crypt string - */ - public function arrayToCrypt ($array) - { - $parts = array(); - if (is_array($array)) { - foreach ($array as $k => $v) { - $parts[] = $k . '=' . $v; - } - } - $result = implode('&', $parts); - $result = $this->simpleXOR($result); - $result = $this->base64Encode($result); - return $result; - } - - /** - * Reverse arrayToCrypt - * - * @param string Crypt string - * @return array - */ - public function cryptToArray ($crypted) - { - $decoded = $this->base64Decode($crypted); - $uncrypted = $this->simpleXOR($decoded); - $tokens = $this->getToken($uncrypted); - return $tokens; - } - - /** - * Custom base64_encode() - * - * @param String - * @return String - */ - protected function base64Encode($plain) - { - return base64_encode($plain); - } - - /** - * Custom base64_decode() - * - * @param String - * @return String - */ - protected function base64Decode($scrambled) - { - // Fix plus to space conversion issue - $scrambled = str_replace(" ","+",$scrambled); - return base64_decode($scrambled); - } - - /** - * Return Standard Checkout Form Fields for request to Protx - * - * @return array Array of hidden form fields - */ - public function getStandardCheckoutFormFields () - { - $fields = array( - 'VPSProtocol' => $this->getConfig()->getVersion(), - 'TxType' => $this->getConfig()->getPaymentType(), - 'Vendor' => $this->getConfig()->getVendorName(), - 'Crypt' => $this->getCrypted() - ); - return $fields; - } - - /** - * Define if debugging is enabled - * - * @return bool - */ - public function getDebugFlag() - { - return $this->getConfigData('debug_flag'); - } -} diff --git a/app/code/core/Mage/Protx/controllers/StandardController.php b/app/code/core/Mage/Protx/controllers/StandardController.php deleted file mode 100644 index 297b9a305f..0000000000 --- a/app/code/core/Mage/Protx/controllers/StandardController.php +++ /dev/null @@ -1,271 +0,0 @@ - - */ -class Mage_Protx_StandardController extends Mage_Core_Controller_Front_Action -{ - public $isValidResponse = false; - - /** - * Get singleton with protx strandard - * - * @return object Mage_Protx_Model_Standard - */ - public function getStandard() - { - return Mage::getSingleton('protx/standard'); - } - - /** - * Get Config model - * - * @return object Mage_Protx_Model_Config - */ - public function getConfig() - { - return $this->getStandard()->getConfig(); - } - - /** - * @deprecated after 1.4.1.0 - * - * @return boolean - */ - public function getDebug() - { - return $this->getStandard()->getDebugFlag(); - } - - /** - * When a customer chooses Protx on Checkout/Payment page - * - */ - public function redirectAction() - { - $session = Mage::getSingleton('checkout/session'); - $session->setProtxStandardQuoteId($session->getQuoteId()); - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($session->getLastRealOrderId()); - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('protx')->__('Customer was redirected to Protx') - ); - $order->save(); - - $this->getResponse() - ->setBody($this->getLayout() - ->createBlock('protx/standard_redirect') - ->setOrder($order) - ->toHtml()); - - $session->unsQuoteId(); - } - - /** - * Success response from Protx - */ - public function successResponseAction() - { - $this->preResponse(); - - if (!$this->isValidResponse) { - $this->_redirect(''); - return ; - } - - $transactionId = $this->responseArr['VendorTxCode']; - - $this->getStandard()->debugData(array('result' => $this->responseArr)); - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($transactionId); - - if (!$order->getId()) { - /* - * need to have logic when there is no order with the order id from protx - */ - return false; - } - - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('protx')->__('The customer has returned from Protx.') - ); - - $order->sendNewOrderEmail(); - - $this->responseArr['Amount'] = str_replace(',', '', $this->responseArr['Amount']); - - if (sprintf('%.2f', $this->responseArr['Amount']) != sprintf('%.2f', $order->getBaseGrandTotal())) { - // cancel order - $order->cancel(); - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('protx')->__('Order total amount does not match protx gross total amount') - ); - } else { - $order->getPayment()->setTransactionId($this->responseArr['VPSTxId']); - - if ($this->getConfig()->getPaymentType() == Mage_Protx_Model_Config::PAYMENT_TYPE_PAYMENT) { - if ($this->saveInvoice($order)) { - $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true); - } else { - $newOrderStatus = $this->getConfig()->getNewOrderStatus() ? - $this->getConfig()->getNewOrderStatus() : Mage_Sales_Model_Order::STATE_NEW; - } - } else { - $order->addStatusToHistory( - $order->getStatus(), - Mage::helper('protx')->__($this->responseArr['StatusDetail']) - ); - } - } - - $order->save(); - - $session = Mage::getSingleton('checkout/session'); - $session->setQuoteId($session->getProtxStandardQuoteId(true)); - Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save(); - $this->_redirect('checkout/onepage/success'); - } - - /** - * Save invoice for order - * - * @param Mage_Sales_Model_Order $order - * @return boolean Can save invoice or not - */ - protected function saveInvoice (Mage_Sales_Model_Order $order) - { - if ($order->canInvoice()) { - $invoice = $order->prepareInvoice(); - - $invoice->register()->capture(); - Mage::getModel('core/resource_transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()) - ->save(); - return true; - } - - return false; - } - - /** - * Failure response from Protx - */ - public function failureResponseAction () - { - $this->preResponse(); - - if (!$this->isValidResponse) { - $this->_redirect(''); - return ; - } - - $transactionId = $this->responseArr['VendorTxCode']; - - $this->getStandard()->debugData(array('result' => $this->responseArr)); - - $order = Mage::getModel('sales/order'); - $order->loadByIncrementId($transactionId); - - if (!$order->getId()) { - /** - * need to have logic when there is no order with the order id from protx - */ - return false; - } - - // cancel order in anyway - $order->cancel(); - - $session = Mage::getSingleton('checkout/session'); - $session->setQuoteId($session->getProtxStandardQuoteId(true)); - - // Customer clicked CANCEL Butoon - if ($this->responseArr['Status'] == 'ABORT') { - $history = Mage::helper('protx')->__('The order %s was canceled by the customer.', $order->getId()); - $redirectTo = 'checkout/cart'; - } else { - $history = Mage::helper('protx')->__($this->responseArr['StatusDetail']); - $session->setErrorMessage($this->responseArr['StatusDetail']); - $redirectTo = 'protx/standard/failure'; - } - - $history = Mage::helper('protx')->__('The customer has returned from Protx.') . ' ' . $history; - $order->addStatusToHistory($order->getStatus(), $history); - $order->save(); - - $this->_redirect($redirectTo); - } - - /** - * Expected GET HTTP Method - */ - protected function preResponse () - { - $responseCryptString = $this->getRequest()->crypt; - - if ($responseCryptString != '') { - $rArr = $this->getStandard()->cryptToArray($responseCryptString); - $ok = is_array($rArr) - && isset($rArr['Status']) && $rArr['Status'] != '' - && isset($rArr['VendorTxCode']) && $rArr['VendorTxCode'] != '' - && isset($rArr['Amount']) && $rArr['Amount'] != ''; - - if ($ok) { - $this->responseArr = $rArr; - $this->isValidResponse = true; - } - } - } - - /** - * Failure Action - */ - public function failureAction () - { - $session = Mage::getSingleton('checkout/session'); - - if (!$session->getErrorMessage()) { - $this->_redirect('checkout/cart'); - return; - } - - $this->loadLayout(); - $this->_initLayoutMessages('protx/session'); - $this->renderLayout(); - } -} diff --git a/app/code/core/Mage/Protx/etc/config.xml b/app/code/core/Mage/Protx/etc/config.xml deleted file mode 100644 index 430a306cb3..0000000000 --- a/app/code/core/Mage/Protx/etc/config.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - 0.1.0 - - - - - - Mage_Protx_Model - protx_mysql4 - - - Mage_Protx_Model_Mysql4 - - protx_api_debug
    -
    -
    -
    - - - - Mage_Protx - - - - - Mage_Protx_Block - -
    - - - /protx/standard - - - - standard - - Mage_Protx - protx - - - - - - - - Mage_Protx.csv - - - - - - - - protx.xml - - - - - - - - - - Mage_Protx.csv - - - - - - - - - Payment - protx/standard - Protx Standard - 0 - - - -
    diff --git a/app/code/core/Mage/Protx/etc/system.xml b/app/code/core/Mage/Protx/etc/system.xml deleted file mode 100644 index 56a311ff03..0000000000 --- a/app/code/core/Mage/Protx/etc/system.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - text - 101 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 1 - 0 - - - - select - protx/source_paymentAction - 2 - 1 - 1 - 0 - - - <label>Title</label> - <frontend_type>text</frontend_type> - <sort_order>3</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - <show_in_store>1</show_in_store> - - - - Store name will be used if left empty. - text - 3 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_order_status_processing - 4 - 1 - 1 - 0 - - - - text - 5 - 1 - 1 - 0 - - - - text - 6 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 7 - 1 - 1 - 0 - - - - General contact email will be used if left empty. - text - 8 - 1 - 1 - 0 - - - - select - protx/source_modeAction - 9 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_yesno - 10 - 1 - 1 - 0 - - - - allowspecific - 50 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 0 - - - - multiselect - 51 - adminhtml/system_config_source_country - 1 - 1 - 0 - - - - text - 100 - 1 - 1 - 0 - - - - - - - diff --git a/app/code/core/Mage/Protx/sql/protx_setup/mysql4-install-0.1.0.php b/app/code/core/Mage/Protx/sql/protx_setup/mysql4-install-0.1.0.php deleted file mode 100644 index 4da3e5c7d0..0000000000 --- a/app/code/core/Mage/Protx/sql/protx_setup/mysql4-install-0.1.0.php +++ /dev/null @@ -1,46 +0,0 @@ -startSetup(); - -$installer->run(" -CREATE TABLE `{$this->getTable('protx_api_debug')}` ( - `debug_id` int(10) unsigned NOT NULL auto_increment, - `transaction_id` varchar(255) NOT NULL default '', - `debug_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `request_body` text, - `response_body` text, - PRIMARY KEY (`debug_id`), - KEY `debug_at` (`debug_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Rss/Block/Order/Status.php b/app/code/core/Mage/Rss/Block/Order/Status.php index 06ba250511..e52104163c 100644 --- a/app/code/core/Mage/Rss/Block/Order/Status.php +++ b/app/code/core/Mage/Rss/Block/Order/Status.php @@ -56,16 +56,14 @@ protected function _toHtml() $rssObj->_addHeader($data); $resourceModel = Mage::getResourceModel('rss/order'); $results = $resourceModel->getAllCommentCollection($order->getId()); - $entityTypes = $resourceModel->getEntityTypeIdsToTypes(); - $incrementIds = $resourceModel->getEntityIdsToIncrementIds(); if($results){ foreach($results as $result){ $urlAppend = 'view'; - $type = $entityTypes[$result['entity_type_id']]; + $type = $result['entity_type_code']; if($type && $type!='order'){ $urlAppend = $type; } - $title = Mage::helper('rss')->__('Details for %s #%s', ucwords($type), $incrementIds[$result['parent_id']]); + $title = Mage::helper('rss')->__('Details for %s #%s', ucwords($type), $result['increment_id']); $description = '

    '. Mage::helper('rss')->__('Notified Date: %s
    ',$this->formatDate($result['created_at'])). diff --git a/app/code/core/Mage/Rss/Model/Mysql4/Order.php b/app/code/core/Mage/Rss/Model/Mysql4/Order.php index d9765cc683..b19fb33138 100644 --- a/app/code/core/Mage/Rss/Model/Mysql4/Order.php +++ b/app/code/core/Mage/Rss/Model/Mysql4/Order.php @@ -23,8 +23,9 @@ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + /** - * Order Rss + * Order Rss Resource Model * * @category Mage * @package Mage_Rss @@ -32,190 +33,129 @@ */ class Mage_Rss_Model_Mysql4_Order { - protected $_entityTypeIdsToTypes; - protected $_entityIdsToIncrementIds; - - public function __construct() - { - $this->_entityTypeIdsToTypes = array(); - $this->_entityIdsToIncrementIds = array(); - } - + /** + * @var array + * @deprecated after 1.4.1.0 + */ + protected $_entityTypeIdsToTypes = array(); + + /** + * @var array + * @deprecated after 1.4.1.0 + */ + protected $_entityIdsToIncrementIds = array(); + + /** + * @return array + * @deprecated after 1.4.1.0 + */ public function getEntityTypeIdsToTypes() { return $this->_entityTypeIdsToTypes; } + /** + * @return array + * @deprecated after 1.4.1.0 + */ public function getEntityIdsToIncrementIds() { return $this->_entityIdsToIncrementIds; } - public function getCoreResource() - { - return Mage::getSingleton('core/resource'); - } - + /** + * @return array + * @deprecated after 1.4.1.0 + */ public function getAllOrderEntityTypeIds() { - $orderEntityTypes = array(); - $etypeIds = array(); - $oattrIds = array(); - $eav = Mage::getSingleton('eav/config'); - $oTable = ''; - foreach (array( - 'invoice'=>'sales/order_invoice', - 'shipment'=>'sales/order_shipment', - 'creditmemo'=>'sales/order_creditmemo' - ) as $entityTypeCode=>$entityModel) { - $entityType = $eav->getEntityType($entityTypeCode); - $entity = Mage::getResourceSingleton($entityModel); - $orderAttr = $eav->getAttribute($entityType, 'order_id'); - if (!$oTable) { - $orderAttr->setEntity($entity); - $oTable = $orderAttr->getBackend()->getTable(); - } - $this->_entityTypeIdsToTypes[$entityType->getId()] = $entityTypeCode; - $etypeIds[$entityType->getId()] = $entityTypeCode; - $oattrIds[] = $orderAttr->getId(); - } - $orderEntityTypes = array( - 'entityTypeIds' => $etypeIds, - 'orderAttrIds' => $oattrIds, - 'order_table' => $oTable); - return $orderEntityTypes; + return array(); } - public function getAllOrderEntityIds($oid, $orderEntityTypes) + /** + * @return array + * @deprecated after 1.4.1.0 + */ + public function getAllOrderEntityIds($orderId, $orderEntityTypes) { - $etypeIdsArr = array_keys($orderEntityTypes['entityTypeIds']); - $res = $this->getCoreResource(); - $read = $res->getConnection('core_read'); - $select = $read->select() - ->from(array('order' => $res->getTableName('sales/order')), array('entity_id')) - ->join($orderEntityTypes['order_table'],"{$orderEntityTypes['order_table']}.entity_id=order.entity_id - and {$orderEntityTypes['order_table']}.attribute_id in (".implode(',',$orderEntityTypes['orderAttrIds']).") - and {$orderEntityTypes['order_table']}.entity_type_id in (".implode(',', $etypeIdsArr).") and {$orderEntityTypes['order_table']}.value={$oid}" - ,array("{$orderEntityTypes['order_table']}.value")); - - $results = $read->fetchAll($select); - $eIds = array($oid); - foreach($results as $result){ - $eIds[] = $result['entity_id']; - } - return $eIds; + return array(); } + /** + * @return array + * @deprecated after 1.4.1.0 + */ public function getAllEntityIds($entityIds = array()) { - $res = $this->getCoreResource(); - $read = $res->getConnection('core_read'); - $entityIdStr = implode(',', $entityIds); - $select = $read->select() - ->from($res->getTableName('sales/order'), array('entity_id','increment_id')) - ->where('parent_id in (' .$entityIdStr.')') - ->orWhere('entity_id in (' .$entityIdStr.')'); - $results = $read->fetchAll($select); - $eIds = array(); - foreach($results as $result){ - if($result['increment_id']) { - $this->_entityIdsToIncrementIds[$result['entity_id']] = $result['increment_id']; - } - $eIds[] = $result['entity_id']; - } - return $eIds; + return array(); } + /** + * @return array + * @deprecated after 1.4.1.0 + */ public function getAllEntityTypeCommentIds() { - $entityTypes = array(); - $eav = Mage::getSingleton('eav/config'); - $etypeIds = array(); - $cattrIds = array(); - $nattrIds = array(); - $cTable = ''; - $nTable = ''; - foreach (array( - 'order_status_history'=>array('model' => 'sales/order_status_history', 'type' => 'order'), - 'invoice_comment'=>array('model' => 'sales/order_invoice_comment', 'type' => 'invoice'), - 'shipment_comment'=>array('model' => 'sales/order_shipment_comment', 'type' => 'shipment'), - 'creditmemo_comment'=>array('model' => 'sales/order_creditmemo_comment', 'type' => 'creditmemo') - ) as $entityTypeCode=>$entityArr) { - - $entityType = $eav->getEntityType($entityTypeCode); - $entity = Mage::getResourceSingleton($entityArr['model']); - $commentAttr = $eav->getAttribute($entityType, 'comment'); - $notifiedAttr = $eav->getAttribute($entityType, 'is_customer_notified'); - $statusAttr = $eav->getAttribute($entityType, 'status'); -#$statusAttr->setEntity($entity); -#echo "****".$statusAttr->getBackend()->getTable()."****".$statusAttr->getId(); - if (!$cTable) { - $commentAttr->setEntity($entity); - $cTable = $commentAttr->getBackend()->getTable(); - } - if (!$nTable) { - $notifiedAttr->setEntity($entity); - $nTable = $notifiedAttr->getBackend()->getTable(); - } - $etypeIds[] = $entityType->getId(); - $cattrIds[] = $commentAttr->getId(); - $nattrIds[] = $notifiedAttr->getId(); - $this->_entityTypeIdsToTypes[$entityType->getId()] = $entityArr['type']; - /* - $entityTypes[$entityType->getId()] = array( - 'table'=>$entityType->getEntityTable(), - 'alias' => $entityTypeCode, - 'comment_attribute_id'=>$commentAttr->getId(), - 'notified_attribute_id'=>$notifiedAttr->getId(), - ); - */ - } - $entityTypes = array( - 'entityTypeIds' => $etypeIds, - 'commentAttrIds' => $cattrIds, - 'notifiedAttrIds' => $nattrIds, - 'comment_table' => $cTable, - 'notified_table' => $nTable); - return $entityTypes; + return array(); } - /* - entity_type_id IN (order_status_history, invoice_comment, shipment_comment, creditmemo_comment) - entity_id IN(order_id, credimemo_ids, invoice_ids, shipment_ids) - attribute_id IN(order_status/comment_text, ....) - */ - public function getAllCommentCollection($oid) + /** + * Retrieve core resource model + * + * @return Mage_Core_Model_Resource + */ + public function getCoreResource() { - $orderEntityTypes = $this->getAllOrderEntityTypeIds(); - $entityIds = $this->getAllOrderEntityIds($oid, $orderEntityTypes); - $allEntityIds = $this->getAllEntityIds($entityIds); - - $eTypes = $this->getAllEntityTypeCommentIds(); - $etypeIds = implode(',',$eTypes['entityTypeIds']); - - /*foreach($entityTypeIds as $eid=>$result){ - $etIds[] = $eid; - $attributeIds[] = $result['comment_attribute_id']; - $attributeIds[] = $result['notified_attribute_id']; - }*/ + return Mage::getSingleton('core/resource'); + } + /** + * Retrieve order comments + * + * @param int $orderId + * @return array + */ + public function getAllCommentCollection($orderId) + { $res = $this->getCoreResource(); $read = $res->getConnection('core_read'); + + $fields = array( + 'notified' => 'is_customer_notified', + 'comment', + 'created_at', + ); + $commentSelects = array(); + foreach (array('invoice', 'shipment', 'creditmemo') as $entityTypeCode) { + $mainTable = $res->getTableName('sales/' . $entityTypeCode); + $slaveTable = $res->getTableName('sales/' . $entityTypeCode . '_comment'); + $select = $read->select() + ->from(array('main' => $mainTable), array( + 'entity_id' => 'order_id', + 'entity_type_code' => new Zend_Db_Expr("'$entityTypeCode'") + )) + ->join(array('slave' => $slaveTable), 'main.entity_id = slave.parent_id', $fields) + ->where('main.order_id = ?', $orderId); + $commentSelects[] = '(' . $select . ')'; + } $select = $read->select() - ->from(array('order' => $res->getTableName('sales/order')), array('entity_id','created_at','entity_type_id','parent_id')) - ->where('order.entity_id in ('.implode(",", $allEntityIds).')') - ->join($eTypes['comment_table'],"{$eTypes['comment_table']}.entity_id=order.entity_id - and {$eTypes['comment_table']}.attribute_id in (".implode(',',$eTypes['commentAttrIds']).") - and {$eTypes['comment_table']}.entity_type_id in (".$etypeIds.")" - ,array('comment' => "{$eTypes['comment_table']}.value")) - ->join($eTypes['notified_table'],"{$eTypes['notified_table']}.entity_id=order.entity_id - and {$eTypes['notified_table']}.attribute_id in (".implode(',',$eTypes['notifiedAttrIds']).") - and {$eTypes['notified_table']}.entity_type_id in (".$etypeIds.") and {$eTypes['notified_table']}.value=1" - ,array('notified' =>"{$eTypes['notified_table']}.value")) - ->order('created_at desc') - ; - return $read->fetchAll($select); + ->from($res->getTableName('sales/order_status_history'), array( + 'entity_id' => 'parent_id', + 'entity_type_code' => new Zend_Db_Expr("'order'") + ) + $fields) + ->where('parent_id = ?', $orderId) + ->where('is_visible_on_front > 0'); + $commentSelects[] = '(' . $select . ')'; + + $commentSelect = $read->select() + ->union($commentSelects) + ->order('created_at desc'); + + $select = $read->select() + ->from(array('order' => $res->getTableName('sales/order')), array('increment_id')) + ->join(array('t' => $commentSelect), 't.entity_id = order.entity_id'); + return $read->fetchAll($select); } } diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index 8d5e9181bd..17302b8e4e 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -268,9 +268,27 @@ public function setJsFormObject($form) return $this; } + /** + * Get conditions, if current prefix is undefined use 'conditions' key + * + * @return array + */ public function getConditions() { - return $this->getData($this->getPrefix()); + $key = $this->getPrefix() ? $this->getPrefix() : 'conditions'; + return $this->getData($key); + } + + /** + * Set conditions, if current prefix is undefined use 'conditions' key + * + * @param array $conditions + * @return Mage_Rule_Model_Condition_Combine + */ + public function setConditions($conditions) + { + $key = $this->getPrefix() ? $this->getPrefix() : 'conditions'; + return $this->setData($key, $conditions); } /** diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php index 613461bb76..c0a45fb8b9 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php @@ -49,7 +49,7 @@ protected function _construct() */ public function getTabLabel() { - return $this->__('Genereal Information'); + return $this->__('General Information'); } /** @@ -59,7 +59,7 @@ public function getTabLabel() */ public function getTabTitle() { - return $this->__('Genereal Information'); + return $this->__('General Information'); } /** diff --git a/app/code/core/Mage/Sales/Model/Billing/Agreement.php b/app/code/core/Mage/Sales/Model/Billing/Agreement.php index 49bb1ee306..8522427879 100644 --- a/app/code/core/Mage/Sales/Model/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Model/Billing/Agreement.php @@ -34,6 +34,13 @@ class Mage_Sales_Model_Billing_Agreement extends Mage_Payment_Model_Billing_Agre const STATUS_ACTIVE = 'active'; const STATUS_CANCELED = 'canceled'; + /** + * Related agreement orders + * + * @var array + */ + protected $_relatedOrders = array(); + /** * Init model * @@ -59,6 +66,19 @@ protected function _beforeSave() return parent::_beforeSave(); } + /** + * Save agreement order relations + * + * @return Mage_Core_Model_Abstract + */ + protected function _afterSave() + { + if (!empty($this->_relatedOrders)) { + $this->_saveOrderRelations(); + } + return parent::_afterSave(); + } + /** * Retrieve billing agreement status label * @@ -231,8 +251,18 @@ public function needToCreateForCustomer($customerId) */ public function addOrderRelation($orderId) { - $this->getResource()->addOrderRelation($this->getId(), $orderId); + $this->_relatedOrders[] = $orderId; return $this; } + /** + * Save related orders + */ + protected function _saveOrderRelations() + { + foreach ($this->_relatedOrders as $orderId) { + $this->getResource()->addOrderRelation($this->getId(), $orderId); + } + } + } diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order.php b/app/code/core/Mage/Sales/Model/Mysql4/Order.php index b0db5226a7..cc593a1393 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order.php @@ -89,4 +89,18 @@ public function aggregateProductsByTypes($orderId, $productTypeIds = array(), $i } return $this->getReadConnection()->fetchPairs($select); } + + /** + * Retrieve order_increment_id by order_id + * + * @param int $orderId + * @return string + */ + public function getIncrementId($orderId) + { + $select = $this->getReadConnection()->select() + ->from($this->getMainTable(), array("increment_id")) + ->where('entity_id = ?', $orderId); + return $this->getReadConnection()->fetchOne($select); + } } diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php index 90320d39ae..3408fed3fa 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Collection.php @@ -36,6 +36,10 @@ class Mage_Sales_Model_Mysql4_Order_Collection extends Mage_Sales_Model_Mysql4_C protected function _construct() { $this->_init('sales/order'); + $this + ->addFilterToMap('entity_id', 'main_table.entity_id') + ->addFilterToMap('customer_id', 'main_table.customer_id') + ->addFilterToMap('quote_address_id', 'main_table.quote_address_id'); } /** @@ -83,8 +87,8 @@ protected function _getAllIdsSelect($limit = null, $offset = null) /** - * Joins table sales_flat_order_address to select for billing and shipping orders addresses. - * Creates corillation map + * Join table sales_flat_order_address to select for billing and shipping order addresses. + * Create corillation map * * @return Mage_Sales_Model_Mysql4_Collection_Abstract */ @@ -94,17 +98,16 @@ protected function _addAddressFields() $shippingAliasName = 'shipping_o_a'; $joinTable = $this->getTable('sales/order_address'); - $this->_map = array('fields' => array( - 'billing_firstname' => $billingAliasName . '.firstname', - 'billing_lastname' => $billingAliasName . '.lastname', - 'billing_telephone' => $billingAliasName . '.telephone', - 'billing_postcode' => $billingAliasName . '.postcode', + $this + ->addFilterToMap('billing_firstname', $billingAliasName . '.firstname') + ->addFilterToMap('billing_lastname', $billingAliasName . '.lastname') + ->addFilterToMap('billing_telephone', $billingAliasName . '.telephone') + ->addFilterToMap('billing_postcode', $billingAliasName . '.postcode') - 'shipping_firstname' => $shippingAliasName . '.firstname', - 'shipping_lastname' => $shippingAliasName . '.lastname', - 'shipping_telephone' => $shippingAliasName . '.telephone', - 'shipping_postcode' => $shippingAliasName . '.postcode' - )); + ->addFilterToMap('shipping_firstname', $shippingAliasName . '.firstname') + ->addFilterToMap('shipping_lastname', $shippingAliasName . '.lastname') + ->addFilterToMap('shipping_telephone', $shippingAliasName . '.telephone') + ->addFilterToMap('shipping_postcode', $shippingAliasName . '.postcode'); $this ->getSelect() @@ -132,6 +135,31 @@ protected function _addAddressFields() return $this; } + /** + * Add addresses information to select + * + * @return Mage_Sales_Model_Mysql4_Collection_Abstract + */ + public function addAddressFields() + { + return $this->_addAddressFields(); + } + + /** + * Add field search filter to collection as OR condition + * + * @see self::_getConditionSql for $condition + * @param string $field + * @param null|string|array $condition + * @return Mage_Eav_Model_Entity_Collection_Abstract + */ + public function addFieldToSearchFilter($field, $condition = null) + { + $field = $this->_getMappedField($field); + $this->_select->orWhere($this->_getConditionSql($field, $condition)); + return $this; + } + /** * Specify collection select filter by attribute value * @@ -139,19 +167,18 @@ protected function _addAddressFields() * @param array|integer|string|null $condition * @return Mage_Sales_Model_Mysql4_Collection_Abstract */ - public function addAttributeToFilter($attributes, $condition = null) + public function addAttributeToSearchFilter($attributes, $condition = null) { - if (is_array($attributes)){ - if (!empty($attributes)){ - $this->_addAddressFields(); + if (is_array($attributes) && !empty($attributes)){ + $this->_addAddressFields(); - foreach ($attributes as $attribute) { - parent::addAttributeToFilter($attribute['attribute'], $attribute); - } + $toFilterData = array(); + foreach ($attributes as $attribute) { + $this->addFieldToSearchFilter($this->_attributeToField($attribute['attribute']), $attribute); } } else { - return parent::addAttributeToFilter($attributes, $condition); + $this->addAttributeToFilter($attributes, $condition); } return $this; diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php index 44198b4bfd..081c073682 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php @@ -32,13 +32,13 @@ class Mage_Sales_Model_Mysql4_Order_Item_Collection extends Mage_Sales_Model_Mys { protected $_eventPrefix = 'sales_order_item_collection'; protected $_eventObject = 'order_item_collection'; - + /** - * Order field for setOrderFilter - * - * @var string - */ - protected $_orderField = 'order_id'; + * Order field for setOrderFilter + * + * @var string + */ + protected $_orderField = 'order_id'; protected function _construct() { diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php index b33a9f603a..5e8a00ee76 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Payment/Transaction/Collection.php @@ -100,6 +100,7 @@ protected function _construct() public function addOrderInformation(array $keys) { $this->_addOrderInformation = array_merge($this->_addOrderInformation, $keys); + $this->addFilterToMap('created_at', 'main_table.created_at'); return $this; } diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php index 81c2ab8b99..479bf3e542 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Shipment/Track/Collection.php @@ -32,14 +32,14 @@ class Mage_Sales_Model_Mysql4_Order_Shipment_Track_Collection extends Mage_Sales { protected $_eventPrefix = 'sales_order_shipment_track_collection'; protected $_eventObject = 'order_shipment_track_collection'; - + /** - * Order field for setOrderFilter - * - * @var string - */ - protected $_orderField = 'order_id'; - + * Order field for setOrderFilter + * + * @var string + */ + protected $_orderField = 'order_id'; + protected function _construct() { $this->_init('sales/order_shipment_track'); diff --git a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php index 4dd907a773..386714a8f6 100644 --- a/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Mysql4/Order/Status/History.php @@ -36,4 +36,4 @@ protected function _construct() { $this->_init('sales/order_status_history', 'entity_id'); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Sales/Model/Order.php b/app/code/core/Mage/Sales/Model/Order.php index 9ad6778b78..9901456a43 100644 --- a/app/code/core/Mage/Sales/Model/Order.php +++ b/app/code/core/Mage/Sales/Model/Order.php @@ -1807,7 +1807,7 @@ public function prepareInvoice($qtys = array()) */ public function prepareShipment($qtys = array()) { - $shipment = Mage::getModel('sales/service_order', $this)->prepareInvoice($qtys); + $shipment = Mage::getModel('sales/service_order', $this)->prepareShipment($qtys); return $shipment; } diff --git a/app/code/core/Mage/Sales/Model/Order/Api.php b/app/code/core/Mage/Sales/Model/Order/Api.php index 0bcc36f58a..28a5f0c4fb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Api.php @@ -71,20 +71,35 @@ protected function _initOrder($orderIncrementId) public function items($filters = null) { //TODO: add full name logic - $collection = Mage::getResourceModel('sales/order_collection') + $billingAliasName = 'billing_o_a'; + $shippingAliasName = 'shipping_o_a'; + + $collection = Mage::getModel("sales/order")->getCollection() ->addAttributeToSelect('*') - ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left') - ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left') - ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left') - ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left') - ->addExpressionAttributeToSelect('billing_name', - 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})', - array('billing_firstname', 'billing_lastname')) - ->addExpressionAttributeToSelect('shipping_name', - 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', - array('shipping_firstname', 'shipping_lastname')); - - + ->addAddressFields() + ->addExpressionFieldToSelect( + 'billing_firstname', "{{billing_firstname}}", array('billing_firstname'=>"$billingAliasName.firstname") + ) + ->addExpressionFieldToSelect( + 'billing_lastname', "{{billing_lastname}}", array('billing_lastname'=>"$billingAliasName.lastname") + ) + ->addExpressionFieldToSelect( + 'shipping_firstname', "{{shipping_firstname}}", array('shipping_firstname'=>"$shippingAliasName.firstname") + ) + ->addExpressionFieldToSelect( + 'shipping_lastname', "{{shipping_lastname}}", array('shipping_lastname'=>"$shippingAliasName.lastname") + ) + ->addExpressionFieldToSelect( + 'billing_name', + "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})", + array('billing_firstname'=>"$billingAliasName.firstname", 'billing_lastname'=>"$billingAliasName.lastname") + ) + ->addExpressionFieldToSelect( + 'shipping_name', + 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', + array('shipping_firstname'=>"$shippingAliasName.firstname", 'shipping_lastname'=>"$shippingAliasName.lastname") + ); + if (is_array($filters)) { try { foreach ($filters as $field => $value) { diff --git a/app/code/core/Mage/Sales/Model/Order/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Api/V2.php index e794d65dc4..e8a7c33416 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Api/V2.php @@ -42,18 +42,34 @@ class Mage_Sales_Model_Order_Api_V2 extends Mage_Sales_Model_Order_Api public function items($filters = null) { //TODO: add full name logic - $collection = Mage::getResourceModel('sales/order_collection') + $billingAliasName = 'billing_o_a'; + $shippingAliasName = 'shipping_o_a'; + + $collection = Mage::getModel("sales/order")->getCollection() ->addAttributeToSelect('*') - ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left') - ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left') - ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left') - ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left') - ->addExpressionAttributeToSelect('billing_name', - 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})', - array('billing_firstname', 'billing_lastname')) - ->addExpressionAttributeToSelect('shipping_name', - 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', - array('shipping_firstname', 'shipping_lastname')); + ->addAddressFields() + ->addExpressionFieldToSelect( + 'billing_firstname', "{{billing_firstname}}", array('billing_firstname'=>"$billingAliasName.firstname") + ) + ->addExpressionFieldToSelect( + 'billing_lastname', "{{billing_lastname}}", array('billing_lastname'=>"$billingAliasName.lastname") + ) + ->addExpressionFieldToSelect( + 'shipping_firstname', "{{shipping_firstname}}", array('shipping_firstname'=>"$shippingAliasName.firstname") + ) + ->addExpressionFieldToSelect( + 'shipping_lastname', "{{shipping_lastname}}", array('shipping_lastname'=>"$shippingAliasName.lastname") + ) + ->addExpressionFieldToSelect( + 'billing_name', + "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})", + array('billing_firstname'=>"$billingAliasName.firstname", 'billing_lastname'=>"$billingAliasName.lastname") + ) + ->addExpressionFieldToSelect( + 'shipping_name', + 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})', + array('shipping_firstname'=>"$shippingAliasName.firstname", 'shipping_lastname'=>"$shippingAliasName.lastname") + ); $preparedFilters = array(); if (isset($filters->filter)) { diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php index 6b24ce8ea2..f3e9db96a3 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php @@ -52,14 +52,16 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) */ if ($creditmemo->hasBaseShippingAmount()) { $baseShippingAmount = Mage::app()->getStore()->roundPrice($creditmemo->getBaseShippingAmount()); - if ($isShippingInclTax) { + if ($isShippingInclTax && $baseShippingInclTax != 0) { $part = $baseShippingAmount/$baseShippingInclTax; $shippingInclTax = Mage::app()->getStore()->roundPrice($shippingInclTax*$part); $baseShippingInclTax= $baseShippingAmount; - $baseShippingAmount = Mage::app()->getStore()->roundPrice($baseShipping*$part);; + $baseShippingAmount = Mage::app()->getStore()->roundPrice($baseShipping*$part); } if ($baseShippingAmount<= $baseAllowedAmount) { - $shipping = $shipping*$baseShippingAmount/$baseShipping; + if ($baseShipping != 0) { + $shipping = $shipping*$baseShippingAmount/$baseShipping; + } $shipping = Mage::app()->getStore()->roundPrice($shipping); $baseShipping = $baseShippingAmount; } else { @@ -69,8 +71,10 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) ); } } else { - $shippingInclTax = Mage::app()->getStore()->roundPrice($shippingInclTax * $allowedAmount/$shipping); - $baseShippingInclTax= Mage::app()->getStore()->roundPrice($baseShippingInclTax * $baseAllowedAmount/$baseShipping); + if ($baseShipping != 0) { + $shippingInclTax = Mage::app()->getStore()->roundPrice($shippingInclTax * $allowedAmount/$shipping); + $baseShippingInclTax= Mage::app()->getStore()->roundPrice($baseShippingInclTax * $baseAllowedAmount/$baseShipping); + } $shipping = $allowedAmount; $baseShipping = $baseAllowedAmount; } diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Invoice.php index 0383256d92..d1ecdf2cfb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice.php @@ -153,6 +153,16 @@ public function getOrder() return $this->_order; } + /** + * Retrieve the increment_id of the order + * + * @return string + */ + public function getOrderIncrementId() + { + return Mage::getModel('sales/order')->getResource()->getIncrementId($this->getOrderId()); + } + /** * Retrieve billing address * diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php index 0063962f30..b7d80da7bd 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php @@ -102,14 +102,15 @@ public function info($invoiceIncrementId) { $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($invoiceIncrementId); - /* @var $invoice Mage_Sales_Model_Order_Invoice */ + /* @var Mage_Sales_Model_Order_Invoice $invoice */ if (!$invoice->getId()) { $this->_fault('not_exists'); } $result = $this->_getAttributes($invoice, 'invoice'); - + $result['order_increment_id'] = $invoice->getOrderIncrementId(); + $result['items'] = array(); foreach ($invoice->getAllItems() as $item) { $result['items'][] = $this->_getAttributes($item, 'invoice_item'); @@ -119,7 +120,7 @@ public function info($invoiceIncrementId) foreach ($invoice->getCommentsCollection() as $comment) { $result['comments'][] = $this->_getAttributes($comment, 'invoice_comment'); } - + return $result; } diff --git a/app/code/core/Mage/Sales/Model/Order/Payment.php b/app/code/core/Mage/Sales/Model/Order/Payment.php index ce4cffebf3..3ef6df424e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment.php @@ -914,12 +914,18 @@ protected function _addTransaction($type, $salesDocument = null, $failsafe = fal $transactionId = $this->getTransactionId(); if (null !== $transactionId) { // set transaction parameters - $transaction = Mage::getModel('sales/order_payment_transaction') + $transaction = false; + if ($this->getOrder()->getId()) { + $transaction = $this->_lookupTransaction($transactionId); + } + if (!$transaction) { + $transaction = Mage::getModel('sales/order_payment_transaction')->setTxnId($transactionId); + } + $transaction ->setOrderPaymentObject($this) ->setTxnType($type) - ->setTxnId($transactionId) - ->isFailsafe($failsafe) - ; + ->isFailsafe($failsafe); + if ($this->hasIsTransactionClosed()) { $transaction->setIsClosed((int)$this->getIsTransactionClosed()); } @@ -1041,13 +1047,7 @@ protected function _isTransactionExists($txnId = null) if (null === $txnId) { $txnId = $this->getTransactionId(); } - if ($txnId) { - $transaction = Mage::getModel('sales/order_payment_transaction') - ->setOrderPaymentObject($this) - ->loadByTxnId($txnId); - return (bool)$transaction->getId(); - } - return false; + return $txnId && $this->_lookupTransaction($txnId); } /** diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Shipment.php index bed41c036c..346b23ac71 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment.php @@ -265,6 +265,13 @@ public function addTrack(Mage_Sales_Model_Order_Shipment_Track $track) if (!$track->getId()) { $this->getTracksCollection()->addItem($track); } + + /** + * Track saving is implemented in _afterSave() + * This enforces Mage_Core_Model_Abstract::save() not to skip _afterSave() + */ + $this->_hasDataChanges = true; + return $this; } diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php index 0473f1ee1c..255ffb5ecc 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php @@ -206,6 +206,7 @@ public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber) try { $shipment->save(); + $track->save(); } catch (Mage_Core_Exception $e) { $this->_fault('data_invalid', $e->getMessage()); } diff --git a/app/code/core/Mage/Sales/Model/Service/Quote.php b/app/code/core/Mage/Sales/Model/Service/Quote.php index 6ef71713b2..94fd6a6274 100644 --- a/app/code/core/Mage/Sales/Model/Service/Quote.php +++ b/app/code/core/Mage/Sales/Model/Service/Quote.php @@ -64,6 +64,13 @@ class Mage_Sales_Model_Service_Quote */ protected $_order = null; + /** + * If it is true, quote will be inactivate after submitting order or nominal items + * + * @var bool + */ + protected $_shouldInactivateQuote = true; + /** * Class constructor * @@ -160,7 +167,6 @@ public function submitOrder() } $order->addItem($orderItem); } - $quote->setIsActive(false); $transaction->addObject($order); $transaction->addCommitCallback(array($order, 'place')); @@ -173,6 +179,7 @@ public function submitOrder() Mage::dispatchEvent('sales_model_service_quote_submit_before', array('order'=>$order, 'quote'=>$quote)); try { $transaction->save(); + $this->_inactivateQuote(); Mage::dispatchEvent('sales_model_service_quote_submit_success', array('order'=>$order, 'quote'=>$quote)); } catch (Exception $e) { Mage::dispatchEvent('sales_model_service_quote_submit_failure', array('order'=>$order, 'quote'=>$quote)); @@ -192,6 +199,7 @@ public function submitNominalItems() { $this->_validate(); $this->_submitRecurringPaymentProfiles(); + $this->_inactivateQuote(); $this->_deleteNominalItems(); } @@ -201,9 +209,19 @@ public function submitNominalItems() */ public function submitAll() { - $this->submitNominalItems(); + // don't allow submitNominalItems() to inactivate quote + $shouldInactivateQuoteOld = $this->_shouldInactivateQuote; + $this->_shouldInactivateQuote = false; + try { + $this->submitNominalItems(); + $this->_shouldInactivateQuote = $shouldInactivateQuoteOld; + } catch (Exception $e) { + $this->_shouldInactivateQuote = $shouldInactivateQuoteOld; + throw $e; + } // no need to submit the order if there are no normal items remained if (!$this->_quote->getAllVisibleItems()) { + $this->_inactivateQuote(); return; } $this->submitOrder(); @@ -229,6 +247,19 @@ public function getOrder() return $this->_order; } + /** + * Inactivate quote + * + * @return Mage_Sales_Model_Service_Quote + */ + protected function _inactivateQuote() + { + if ($this->_shouldInactivateQuote) { + $this->_quote->setIsActive(false); + } + return $this; + } + /** * Validate quote data before converting to order * diff --git a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php index 87fa51b90d..6c59a2995e 100644 --- a/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Mysql4/Rule/Collection.php @@ -104,4 +104,23 @@ public function _initSelect() ); return $this; } + + /** + * Find product attribute in conditions or actions + * + * @param string $attributeCode + * @return Mage_CatalogRule_Model_Mysql4_Rule_Collection + */ + public function addAttributeInConditionFilter($attributeCode) + { + $match = sprintf('%%%s%%', substr(serialize(array('attribute' => $attributeCode)), 5, -1)); + $field = $this->_getMappedField('conditions_serialized'); + $cCond = $this->_getConditionSql($field, array('like' => $match)); + $field = $this->_getMappedField('actions_serialized'); + $aCond = $this->_getConditionSql($field, array('like' => $match)); + + $this->getSelect()->where(sprintf('(%s OR %s)', $cCond, $aCond)); + + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Observer.php b/app/code/core/Mage/SalesRule/Model/Observer.php index 668e286a10..487d757d0a 100644 --- a/app/code/core/Mage/SalesRule/Model/Observer.php +++ b/app/code/core/Mage/SalesRule/Model/Observer.php @@ -129,5 +129,62 @@ public function aggregateSalesReportCouponsData($schedule) Mage::app()->getLocale()->revert(); return $this; } + + + /** + * After delete attribute check rules that contains deleted attribute + * If rules was found they will seted to inactive and added notice to admin session + * + * @param Varien_Event_Observer $observer + * @return Mage_CatalogRule_Model_Observer + */ + public function catalogAttributeDeleteAfter(Varien_Event_Observer $observer) + { + $attribute = $observer->getEvent()->getAttribute(); + $attributeCode = $attribute->getAttributeCode(); + if ($attribute->getIsUsedForPromoRules()) { + /* @var $collection Mage_CatalogRule_Model_Mysql4_Rule_Collection */ + $collection = Mage::getResourceModel('salesrule/rule_collection') + ->addAttributeInConditionFilter($attributeCode); + $hasRule = false; + foreach ($collection as $rule) { + /* @var $rule Mage_CatalogRule_Model_Rule */ + $rule->setIsActive(0); + $this->_removeAttributeFromConditions($rule->getConditions(), $attributeCode); + $this->_removeAttributeFromConditions($rule->getActions(), $attributeCode); + $rule->save(); + $hasRule = true; + } + + if ($hasRule) { + Mage::getSingleton('adminhtml/session')->addWarning( + Mage::helper('salesrule')->__('Shopping Cart Price Rules based on deleted attribute "%s" has been disabled.', $attributeCode)); + } + } + + return $this; + } + + /** + * Remove catalog attribute condition by attribute code from rule conditions + * + * @param Mage_Rule_Model_Condition_Combine $combine + * @param string $attributeCode + */ + protected function _removeAttributeFromConditions($combine, $attributeCode) + { + $conditions = $combine->getConditions(); + foreach ($conditions as $conditionId => $condition) { + if ($condition instanceof Mage_Rule_Model_Condition_Combine) { + $this->_removeAttributeFromConditions($condition, $attributeCode); + } + if ($condition instanceof Mage_SalesRule_Model_Rule_Condition_Product) { + if ($condition->getAttribute() == $attributeCode) { + unset($conditions[$conditionId]); + } + } + } + $combine->setConditions($conditions); + } } diff --git a/app/code/core/Mage/SalesRule/etc/config.xml b/app/code/core/Mage/SalesRule/etc/config.xml index c3b64c0033..bef9cb4417 100644 --- a/app/code/core/Mage/SalesRule/etc/config.xml +++ b/app/code/core/Mage/SalesRule/etc/config.xml @@ -117,6 +117,16 @@ + + + + + salesrule/observer + catalogAttributeDeleteAfter + + + + diff --git a/app/code/core/Mage/Shipping/Model/Shipping.php b/app/code/core/Mage/Shipping/Model/Shipping.php index 530ff5a096..5c7445fa51 100644 --- a/app/code/core/Mage/Shipping/Model/Shipping.php +++ b/app/code/core/Mage/Shipping/Model/Shipping.php @@ -139,6 +139,9 @@ public function collectCarrierRates($carrierCode, $request) if (false !== $result){ if (!$result instanceof Mage_Shipping_Model_Rate_Result_Error) { $result = $carrier->collectRates($request); + if (!$result) { + return $this; + } } if ($carrier->getConfigData('showmethod') == 0 && $result->getError()) { return $this; diff --git a/app/code/core/Mage/Strikeiron/Helper/Data.php b/app/code/core/Mage/Strikeiron/Helper/Data.php deleted file mode 100644 index 432328fd20..0000000000 --- a/app/code/core/Mage/Strikeiron/Helper/Data.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Currency_Import_Strikeiron extends Mage_Directory_Model_Currency_Import_Abstract -{ - protected $_messages = array(); - - public function fetchRates() - { - $data = array(); - $currencies = $this->_getCurrencyCodes(); - $defaultCurrencies = $this->_getDefaultCurrencyCodes(); - try { - $strikeironModel = Mage::getModel('strikeiron/strikeiron'); - foreach ($defaultCurrencies as $currencyFrom) { - $currenciesToArr = array(); - if (!isset($data[$currencyFrom])) { - $data[$currencyFrom] = array(); - } - foreach ($currencies as $currencyTo) { - if ($currencyFrom == $currencyTo) { - $data[$currencyFrom][$currencyTo] = $this->_numberFormat(1); - } - else { - $currenciesToArr[] = $currencyTo; - } - } - if ($currenciesToArr) { - $result = $strikeironModel->fetchExchangeRate($currencyFrom , $currenciesToArr); - if ($result) { - $data = array_merge_recursive($result, $data); - $convertedCurrencies = array(); - foreach ($result[$currencyFrom] as $k => $r) { - $convertedCurrencies[] = $k; - } - $currenciesNotConverted = array_diff($currenciesToArr, $convertedCurrencies); - if ($currenciesNotConverted) { - foreach ($currenciesNotConverted as $_currencyNconvert) { - $this->_messages[] = Mage::helper('strikeiron')->__('%s is not a supported currency.', $_currencyNconvert); - $data[$currencyFrom][$_currencyNconvert] = $this->_numberFormat(null); - } - } - } else { - $this->_messages[] = Mage::helper('strikeiron')->__('Cannot retrieve rate from Strikeiron.'); - } - } - ksort($data[$currencyFrom]); - } - } catch (Exception $e) { - $this->_messages[] = $e->getMessage(); - } - return $data; - } - - protected function _convert($currencyFrom, $currencyTo, $retry=0) - { - - try { - $strikeironModel = Mage::getModel('strikeiron/strikeiron'); - $result = $strikeironModel->fetchExchangeRate($currencyFrom , array($currencyTo)); - return $result; - } - catch (Exception $e) { - if( $retry == 0 ) { - $this->_convert($currencyFrom, $currencyTo, 1); - } else { - $this->_messages[] = Mage::helper('strikeiron')->__('Cannot retrieve rate from %s to %s.', $currencyFrom, $currencyTo); - } - } - - } - - -} diff --git a/app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate.php b/app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate.php deleted file mode 100644 index 6cef79cca7..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate.php +++ /dev/null @@ -1,106 +0,0 @@ - - */ - -class Mage_Strikeiron_Model_Mysql4_Taxrate extends Mage_Core_Model_Mysql4_Abstract -{ - protected function _construct() - { - $this->_init('strikeiron/tax_rate', 'tax_rate_id'); - } - - /** - * Initialize unique fields - * - * @return Mage_Core_Model_Mysql4_Abstract - */ - protected function _initUniqueFields() - { - $this->_uniqueFields = array(array( - 'field' => array('tax_country_id', 'tax_region_id', 'tax_postcode'), - 'title' => Mage::helper('strikeiron')->__('Country/Region/Postal Code Combination'), - )); - return $this; - } - - protected function _checkUnique(Mage_Core_Model_Abstract $object) - { - $existent = array(); - $rateValueArray = array(); - if (!empty($this->_uniqueFields)) { - if (!is_array($this->_uniqueFields)) { - $this->_uniqueFields = array( - array( - 'field' => $this->_uniqueFields, - 'title' => $this->_uniqueFields - )); - } - - $data = new Varien_Object($this->_prepareDataForSave($object)); - $select = $this->_getWriteAdapter()->select() - ->from($this->getMainTable()); - - foreach ($this->_uniqueFields as $unique) { - $select->reset(Zend_Db_Select::WHERE); - - if (is_array($unique['field'])) { - foreach ($unique['field'] as $field) { - $select->where($field.'=?', $data->getData($field)); - $rateValueArray[] = $this->_getWriteAdapter()->quoteInto($field.'=?', $data->getData($field)); - } - } - else { - $select->where( $unique['field'] . ' = ?', $data->getData($unique['field']) ); - $rateValueArray[] = $this->_getWriteAdapter()->quoteInto( $unique['field'] . ' = ?', $data->getData($unique['field']) ); - } - - if ($object->getId()) { - $select->where($this->getIdFieldName().' != ?', $object->getId()); - } - - if ( $test = $this->_getWriteAdapter()->fetchRow($select) ) { - $existent[] = $test['tax_rate_id']; - } - } - } - if (!empty($existent)) { - $this->_getWriteAdapter()->delete($this->getMainTable(), $rateValueArray); - } - - } - - public function deleteAllRates() - { - $this->_getWriteAdapter()->delete($this->getMainTable()); - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate/Collection.php b/app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate/Collection.php deleted file mode 100644 index 99cb620695..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Mysql4/Taxrate/Collection.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ - -class Mage_Strikeiron_Model_Mysql4_Taxrate_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected function _construct() - { - $this->_init('strikeiron/taxrate'); - } - - public function addRateFilter($rateId) - { - if (is_int($rateId) && $rateId > 0) { - return $this->_select->where('main_table.tax_rate_id=?', $rateId); - } - else { - return $this; - } - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/AddressVerification.php b/app/code/core/Mage/Strikeiron/Model/Service/AddressVerification.php deleted file mode 100644 index 55b514fe1a..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/AddressVerification.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Service_AddressVerification extends Mage_Strikeiron_Model_Service_Base -{ - const ADDRESS_ERROR_ACCEPT = 'Accept'; - const ADDRESS_ERROR_REJECT = 'Reject'; - const ADDRESS_ERROR_CONFIRM = 'Confirm'; - - /** - * Configuration options - * @param array - */ - protected $_options = array('username' => null, - 'password' => null, - 'client' => null, - 'options' => null, - 'headers' => null, - 'wsdl' => 'aHR0cDovL3dzLnN0cmlrZWlyb24uY29tL3Zhcmllbi5TdHJpa2VJcm9uL1VTQWRkcmVzc1ZlcmlmaWNhdGlvbjRfMD9XU0RM'); -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/Base.php b/app/code/core/Mage/Strikeiron/Model/Service/Base.php deleted file mode 100644 index 35a7b16f67..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/Base.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -require_once 'Zend/Service/StrikeIron/Base.php'; - -class Mage_Strikeiron_Model_Service_Base extends Zend_Service_StrikeIron_Base -{ - public function __construct($options = array()) - { - $this->_options['wsdl'] = $this->_wsdlDecode(); - parent::__construct($options); - } - - public function _wsdlDecode() - { - return base64_decode($this->_options['wsdl']); - } - - public function getOptionData($key) - { - if( isset($this->_options[$key]) ){ - return $this->_options[$key]; - } else { - return null; - } - } - - public function getOptions() - { - return $this->_options; - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/EmailVerification.php b/app/code/core/Mage/Strikeiron/Model/Service/EmailVerification.php deleted file mode 100644 index ca3dcd802c..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/EmailVerification.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Service_EmailVerification extends Mage_Strikeiron_Model_Service_Base -{ - const EMAIL_UNDETERMINED_ACCEPT = 'Accept'; - const EMAIL_UNDETERMINED_REJECT = 'Reject'; - const EMAIL_UNDETERMINED_CONFIRM = 'Confirm'; - /** - * Configuration options - * @param array - */ - protected $_options = array('username' => null, - 'password' => null, - 'client' => null, - 'options' => null, - 'headers' => null, - 'wsdl' => 'aHR0cDovL3dzLnN0cmlrZWlyb24uY29tL3Zhcmllbi5TdHJpa2VJcm9uL2VtYWlsdmVyaWZ5XzNfMD9XU0RM'); -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/ForeignExchangeRates.php b/app/code/core/Mage/Strikeiron/Model/Service/ForeignExchangeRates.php deleted file mode 100644 index 7987c40a62..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/ForeignExchangeRates.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Service_ForeignExchangeRates extends Mage_Strikeiron_Model_Service_Base -{ - /** - * Configuration options - * @param array - */ - protected $_options = array('username' => null, - 'password' => null, - 'client' => null, - 'options' => null, - 'headers' => null, - 'wsdl' => 'aHR0cDovL3dzLnN0cmlrZWlyb24uY29tL3Zhcmllbi5TdHJpa2VJcm9uL0ZvcmVpZ25FeGNoYW5nZVJhdGU/V1NETA=='); -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTax.php b/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTax.php deleted file mode 100644 index bae11c48a3..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTax.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Service_SalesUseTax extends Mage_Strikeiron_Model_Service_Base -{ - const SALETAX_TYPE_BASIC = 'B'; - const SALETAX_TYPE_COMPLETE = 'C'; - - const SALETAX_COMPLETE_MIN = 'MIN'; - const SALETAX_COMPLETE_MAX = 'MAX'; -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxBasic.php b/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxBasic.php deleted file mode 100644 index 747cb66f95..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxBasic.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Service_SalesUseTaxBasic extends Mage_Strikeiron_Model_Service_SalesUseTax -{ - /** - * Configuration options - * @param array - */ - protected $_options = array('username' => null, - 'password' => null, - 'client' => null, - 'options' => null, - 'headers' => null, - 'wsdl' => 'aHR0cDovL3dzLnN0cmlrZWlyb24uY29tL3Zhcmllbi5TdHJpa2VJcm9uL1RheERhdGFCYXNpYzQ/V1NETA=='); -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxComplete.php b/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxComplete.php deleted file mode 100644 index cdd7553535..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/SalesUseTaxComplete.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Service_SalesUseTaxComplete extends Mage_Strikeiron_Model_Service_SalesUseTax -{ - /** - * Configuration options - * @param array - */ - protected $_options = array('username' => null, - 'password' => null, - 'client' => null, - 'options' => null, - 'headers' => null, - 'wsdl' => 'aHR0cDovL3dzLnN0cmlrZWlyb24uY29tL3Zhcmllbi5TdHJpa2VJcm9uL1RheERhdGFDb21wbGV0ZTQ/V1NETA=='); -} diff --git a/app/code/core/Mage/Strikeiron/Model/Service/UsAddressVerification.php b/app/code/core/Mage/Strikeiron/Model/Service/UsAddressVerification.php deleted file mode 100644 index 8af046184d..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Service/UsAddressVerification.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Service_UsAddressVerification extends Mage_Strikeiron_Model_Service_AddressVerification -{ - /** - * Configuration options - * @param array - */ - protected $_options = array('username' => null, - 'password' => null, - 'client' => null, - 'options' => null, - 'headers' => null, - 'wsdl' => 'aHR0cDovL3dzLnN0cmlrZWlyb24uY29tL3Zhcmllbi5TdHJpa2VJcm9uL1VTQWRkcmVzc1ZlcmlmaWNhdGlvbjRfMD9XU0RM'); -} diff --git a/app/code/core/Mage/Strikeiron/Model/Session.php b/app/code/core/Mage/Strikeiron/Model/Session.php deleted file mode 100644 index ae7e9fbb06..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Session.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Session extends Mage_Core_Model_Session_Abstract -{ - public function __construct() - { - $this->init('strikeiron'); - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Source/ErrorAddressAction.php b/app/code/core/Mage/Strikeiron/Model/Source/ErrorAddressAction.php deleted file mode 100644 index 577784957e..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Source/ErrorAddressAction.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Source_ErrorAddressAction -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Strikeiron_Model_Service_AddressVerification::ADDRESS_ERROR_ACCEPT, 'label' => Mage::helper('strikeiron')->__('Accept')), - array('value' => Mage_Strikeiron_Model_Service_AddressVerification::ADDRESS_ERROR_REJECT, 'label' => Mage::helper('strikeiron')->__('Reject')), - array('value' => Mage_Strikeiron_Model_Service_AddressVerification::ADDRESS_ERROR_CONFIRM, 'label' => Mage::helper('strikeiron')->__('Pop up warning and accept')), - ); - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Source/SalesTaxType.php b/app/code/core/Mage/Strikeiron/Model/Source/SalesTaxType.php deleted file mode 100644 index 7539627d00..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Source/SalesTaxType.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Source_SalesTaxType -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Strikeiron_Model_Service_SalesUseTax::SALETAX_TYPE_BASIC, 'label' => Mage::helper('strikeiron')->__('Basic')), - array('value' => Mage_Strikeiron_Model_Service_SalesUseTax::SALETAX_TYPE_COMPLETE, 'label' => Mage::helper('strikeiron')->__('Complete')), - - ); - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Source/Salestaxminmax.php b/app/code/core/Mage/Strikeiron/Model/Source/Salestaxminmax.php deleted file mode 100644 index 5c9c6a7fa6..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Source/Salestaxminmax.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Source_Salestaxminmax -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Strikeiron_Model_Service_SalesUseTax::SALETAX_COMPLETE_MIN, 'label' => Mage::helper('strikeiron')->__('Minimum Tax Rate')), - array('value' => Mage_Strikeiron_Model_Service_SalesUseTax::SALETAX_COMPLETE_MAX , 'label' => Mage::helper('strikeiron')->__('Maximum Tax Rate')), - - ); - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Source/UndeterminedEmailAction.php b/app/code/core/Mage/Strikeiron/Model/Source/UndeterminedEmailAction.php deleted file mode 100644 index 1d4652276c..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Source/UndeterminedEmailAction.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Source_UndeterminedEmailAction -{ - public function toOptionArray() - { - return array( - array('value' => Mage_Strikeiron_Model_Service_EmailVerification::EMAIL_UNDETERMINED_ACCEPT, 'label' => Mage::helper('strikeiron')->__('Accept')), - array('value' => Mage_Strikeiron_Model_Service_EmailVerification::EMAIL_UNDETERMINED_REJECT, 'label' => Mage::helper('strikeiron')->__('Reject')), - array('value' => Mage_Strikeiron_Model_Service_EmailVerification::EMAIL_UNDETERMINED_CONFIRM, 'label' => Mage::helper('strikeiron')->__('Pop up warning and accept')), - ); - } -} diff --git a/app/code/core/Mage/Strikeiron/Model/Strikeiron.php b/app/code/core/Mage/Strikeiron/Model/Strikeiron.php deleted file mode 100644 index 09a099cb5b..0000000000 --- a/app/code/core/Mage/Strikeiron/Model/Strikeiron.php +++ /dev/null @@ -1,391 +0,0 @@ - - */ -class Mage_Strikeiron_Model_Strikeiron extends Mage_Core_Model_Abstract -{ - public function getApi($service, $options = array()) - { - return Mage::getSingleton('strikeiron/service_'.$service, array_merge($this->getConfiguration(),$options)); - } - - protected function getConfiguration() - { - return array('username'=> $this->getConfigData('config', 'user') , 'password'=> $this->getConfigData('config', 'password')); - } - - public function getConfigData($code, $field) - { - $path = 'strikeiron/'.$code.'/'.$field; - return Mage::getStoreConfig($path); - } - -/*********************** EMAIL VERIFICATION***************************/ - /* - verify email address is valid or not - wsdl = http://ws.strikeiron.com/varien.StrikeIron/emailverify_3_0?WSDL - */ - public function emailVerify($email) - { - if ($email && $this->getConfigData('email_verification', 'active')) { - $_session = Mage::getSingleton('strikeiron/session'); - /* - * following flag will set if the email is undetermined for the first time - * for second time, we just need to return true - */ - if ($_session->getStrikeironUndertermined()==$email) { - $_session->unsStrikeironUndertermined(); - return true; - } - - $emailApi = $this->getApi('emailVerification'); - - $checkAllServer = $this->getConfigData('email_verification', 'check_allservers'); - $emailArr = array( - 'email' => $email, - 'checkAllServers' => ($checkAllServer ? 'True' : 'False') - ); - $result = ''; - - try { - $subscriptionInfo = $emailApi->getSubscriptionInfo(); - if ($subscriptionInfo && $subscriptionInfo->remainingHits>0) { - $result = $emailApi->validateEmail($emailArr); - if ($result) { - switch ($result->IsValid) { - case 'INVALID': - Mage::throwException(Mage::helper('strikeiron')->__('Invalid email address.')); - break; - case 'UNDETERMINED': - switch($this->getConfigData('email_verification', 'undetermined_action')) { - case Mage_Strikeiron_Model_Service_EmailVerification::EMAIL_UNDETERMINED_REJECT: - Mage::throwException(Mage::helper('strikeiron')->__('Invalid email address.')); - break; - case Mage_Strikeiron_Model_Service_EmailVerification::EMAIL_UNDETERMINED_CONFIRM: - $_session->setStrikeironUndertermined($email); - Mage::throwException(Mage::helper('strikeiron')->__('The email address cannot be verified. Please check again and make sure your email address is entered correctly.')); - break; - } - break; - } - } else { - Mage::throwException(Mage::helper('strikeiron')->__('There is an error in verifying an email. Please contact us.')); - } - - } else { - /* - * when there is no more remaining hits for service - * we will send email to email recipient for exception - */ - /* @var $mailTemplate Mage_Core_Model_Email_Template */ - $receipient = $this->getConfigData('email_verification', 'error_email'); - if ($receipient) { - $translate = Mage::getSingleton('core/translate'); - /* @var $translate Mage_Core_Model_Translate */ - $translate->setTranslateInline(false); - - $mailTemplate = Mage::getModel('core/email_template'); - $mailTemplate->setDesignConfig( - array( - 'area' => 'frontend', - ) - ) - ->sendTransactional( - $this->getConfigData('email_verification', 'error_email_template'), - $this->getConfigData('email_verification', 'error_email_identity'), - $receipient, - null, - array( - 'email' => $email, - 'warnings' => $e->getMessage(), - ) - ); - - $translate->setTranslateInline(true); - } - - } - } catch (Zend_Service_StrikeIron_Exception $e) { - Mage::throwException(Mage::helper('strikeiron')->__('There is an error in verifying an email. Please contact us.')); - } - } - return true; - } - -/*********************** FOREIGN CURRENCY EXCHANGE***************************/ - - public function _getAllSupportedCurrencies($exchangeApi) - { - $result = $exchangeApi->GetSupportedCurrencies(); - $data = array(); - if ($result && $result->ServiceStatus && $result->ServiceStatus->StatusNbr == 210) { - $listings = $result->ServiceResult->Listings; - if ($listings && $listings->CurrencyListing) { - foreach($listings->CurrencyListing as $listing){ - $data[] = $listing->Symbol; - } - } - } - return $data; - } - - /* - retrieving foreign exchange rate for the currency - wsdl = http://ws.strikeiron.com/varien.StrikeIron/ForeignExchangeRate?WSDL - */ - public function fetchExchangeRate ($defaultCurrency, $currencies=array()) - { - if(!$this->getConfigData('currency', 'foreigh_xrate')){ - Mage::throwException(Mage::helper('strikeiron')->__('Strikeiron foreign exchange rate is disabled.')); - } - - $data = array(); - $exchangeApi = $this->getApi('foreignExchangeRates'); - $result = ''; - try { - $subscriptionInfo = $exchangeApi->getSubscriptionInfo(); - if ($subscriptionInfo && $subscriptionInfo->remainingHits>0) { - $supportedCurrencies = $this->_getAllSupportedCurrencies($exchangeApi); - if($supportedCurrencies) { - $availableCurrencies = array_intersect($currencies, $supportedCurrencies); - if($availableCurrencies && in_array($defaultCurrency,$supportedCurrencies)){ - $currenciesStr = implode(', ' , $availableCurrencies); - $reqArr = array( - 'CommaSeparatedListOfCurrenciesFrom' => $currenciesStr, - 'SingleCurrencyTo' => $defaultCurrency - ); - $result = $exchangeApi->GetLatestRates($reqArr); - if ($result) { - /* - 212 = Currency rate data Found - */ - if ($result->ServiceStatus && $result->ServiceStatus->StatusNbr == 212) { - $listings = $result->ServiceResult->Listings; - if($listings && $listings->ExchangeRateListing) { - foreach ($listings->ExchangeRateListing as $listing) { - $data[$listing->PerCurrency][$listing->Currency] = $listing->Value; - } - } - } else { - Mage::throwException($result->ServiceStatus->StatusDescription); - } - } else { - Mage::throwException(Mage::helper('strikeiron')->__('There is no response back from Strikeiron server.')); - } - } - } - } else { - Mage::throwException(Mage::helper('strikeiron')->__('There are no more hits remaining for the foreign Exchange Rate Service.')); - } - } catch (Zend_Service_StrikeIron_Exception $e) { - Mage::throwException(Mage::helper('strikeiron')->__('There is no response back from Strikeiron server.')); - } - return $data; - } - - public function customerSaveBeforeObserver($observer) - { - $customer = $observer->getEvent()->getCustomer(); - $isAdmin = Mage::getDesign()->getArea()==='adminhtml'; - $email = $customer->getEmail(); - $host = Mage::app()->getStore()->getConfig(Mage_Customer_Model_Customer::XML_PATH_DEFAULT_EMAIL_DOMAIN); - $fakeEmail = $customer->getIncrementId().'@'. $host; - if ($email && $email != $fakeEmail && $customer->dataHasChangedFor('email') && - (!$isAdmin || ($isAdmin && $this->getConfigData('email_verification', 'check_admin'))) - ) { - $this->emailVerify($email); - } - } - -/*********************** ADDRESS VERIFICATION***************************/ - - public function addressSaveBeforeObserver($observer) - { - $address = $observer->getEvent()->getCustomerAddress(); - $us = $address->getCountryId() == 'US'; - $addressDataChange = sizeof($address) == 1 && ( $address->dataHasChangedFor('street') || $address->dataHasChangedFor('city') || - $address->dataHasChangedFor('postcode') || $address->dataHasChangedFor('country_id') || $address->dataHasChangedFor('region_id') || - $address->dataHasChangedFor('region')) - ; - if ($addressDataChange) { - if ($us) { - $this->UsAddressVerify($address); - } - } - - } - - /* - verify US address is valid or not - wsdl = http://ws.strikeiron.com/varien.StrikeIron/USAddressVerification4_0?WSDL - $subscription = $taxBasic->getSubscriptionInfo(); - echo $subscription->remainingHits; - - */ - public function UsAddressVerify($address) - { -//echo "

    ";
    -//print_r($address);
    -return;
    -$_session = Mage::getSingleton('strikeiron/session');
    -        $usAddressApi = $this->getApi('usAddressVerification');
    -        $cityStateZip = $address->getCity()." ".$address->getRegionCode()." ".$address->getPostcode();
    -        $reqArr = array(
    -                    'firm' => $address->getCompany(),
    -                    'addressLine1' => $address->getStreet(1),
    -                    'addressLine2' => $address->getStreet(2),
    -                    'city_state_zip' => $cityStateZip )
    -        ;
    -        $result = '';
    -        try {
    -            $subscriptionInfo = $usAddressApi->getSubscriptionInfo();
    -            if ($subscriptionInfo && $subscriptionInfo->remainingHits>0) {
    -                $result = $usAddressApi->verifyAddressUSA($reqArr);
    -//$result = $_session->getUsAddressVerify();
    -//$_session->setUsAddressVerify($result);
    -//print_r($reqArr);
    -//print_r($result);
    -            } else {
    -
    -            }
    -
    -        } catch (Zend_Service_StrikeIron_Exception $e) {
    -               Mage::throwException(Mage::helper('strikeiron')->__('There is no response back from Strikeiron server.'));
    -        }
    -        return true;
    -    }
    -
    -/*********************** SALES AND TAX RATE***************************/
    -    /*
    -    retrieveing the sale tax rate by zip code for US and by province by canada
    -    wsdl = http://ws.strikeiron.com/varien.StrikeIron/TaxDataBasic4?WSDL
    -    wsdl = http://ws.strikeiron.com/varien.StrikeIron/TaxDataComplete4?WSDL
    -    this method is called by event handler
    -    event is added in Mage_Tax_Model_Rate_Data
    -    */
    -    public function getTaxRate($observer)
    -    {
    -        $data = $observer->getEvent()->getRequest();
    -//        $data = new Varien_Object();
    -//        $data->setProductClassId(2)
    -//             ->setCustomerClassId(3)
    -//             ->setCountryId('CN')
    -//             ->setRegionId('74')
    -//             ->setPostcode('95618');
    -
    -        $tax_rate = 0;
    -        $customerTaxClass = array();
    -        $customerTaxClass = explode(',' ,$this->getConfigData('sales_tax', 'customer_tax_class'));
    -        $productTaxClass = array();
    -        $productTaxClass = explode(',' , $this->getConfigData('sales_tax', 'product_tax_class'));
    -        if ($this->getConfigData('sales_tax', 'active')
    -            && in_array($data->getCustomerClassId(), $customerTaxClass)
    -            && in_array($data->getProductClassId(), $productTaxClass)
    -            && ($data->getCountryId()=='US' || $data->getCountryId()=='CN')
    -            ) {
    -            $type = $this->getConfigData('sales_tax', 'type');
    -            $isBasic = false;
    -            if($type == 'B') {
    -                $isBasic = true;
    -            }
    -
    -            $saleTaxApi = $this->getApi('salesUseTax'.($isBasic ? 'Basic' : 'Complete'));
    -            try {
    -                $subscriptionInfo = $saleTaxApi->getSubscriptionInfo();
    -                if ($subscriptionInfo && $subscriptionInfo->remainingHits>0) {
    -                    if ($data->getCountryId()=='US') {
    -                        if ($isBasic) {
    -                            $requestArr = array('zip_code' => $data->getPostcode());
    -                            $result = $saleTaxApi->GetTaxRateUS($requestArr);
    -                            if ($result) {
    -                                $tax_rate = $result->total_sales_tax;
    -                            }
    -                        } else {
    -                            $requestArr = array('zipCode' => $data->getPostcode());
    -
    -                            $result = $saleTaxApi->GetUSATaxRatesByZipCode($requestArr);
    -                            if ($result && $result->USATaxRate) {
    -                                $tax_rate = $this->parseTaxRateComplete($result);
    -                            }
    -                        }
    -                    } else {
    -                        $region_code = Mage::getSingleton('directory/region')->load($data->getRegionId())->getCode();
    -                        $requestArr = array('province' => $region_code);
    -                        if ($isBasic) {
    -                            $result = $saleTaxApi->GetTaxRateCanada($requestArr);
    -                            if ($result) {
    -                                $tax_rate = $result->total;
    -                            }
    -                        } else {
    -                            $result = $saleTaxApi->GetCanadaTaxRatesByProvince($requestArr);
    -                            if ($result && $result->CanadaTaxRate) {
    -                                $tax_rate = $result->CanadaTaxRate->Total;
    -                            }
    -                        }
    -                    }
    -                }
    -            } catch (Zend_Service_StrikeIron_Exception $e) {
    -                //we won't throw exception
    -                //since the method is calling via event handler
    -               //Mage::throwException(Mage::helper('strikeiron')->__('There is an error in retrieving the tax rate. Please contact us.'));
    -            }
    -        }
    -
    -        if ($tax_rate>0) {
    -            $tax_rate = $tax_rate * 100;
    -            $dbObj = Mage::getSingleton('strikeiron/taxrate')
    -                ->setTaxCountryId($data->getCountryId())
    -                ->setTaxRegionId($data->getRegionId())
    -                ->setTaxPostcode($data->getPostcode())
    -                ->setRateValue($tax_rate)
    -                ->save();
    -            $data->setRateValue($tax_rate);
    -            $data->setRateTitle(Mage::helper('strikeiron')->__('Tax'));
    -            $data->setRateId('strikeiron_tax');
    -        }
    -        return $this;
    -
    -    }
    -
    -    protected function parseTaxRateComplete($result)
    -    {
    -        $tax_array = array();
    -        foreach ($result->USATaxRate as $rate) {
    -            if($rate->TotalSalesTax>0) {
    -                $tax_array[] = $rate->TotalSalesTax;
    -            }
    -        }
    -        $minMax = strtolower($this->getConfigData('sales_tax', 'min_max'));
    -        return $minMax($tax_array);
    -    }
    -}
    diff --git a/app/code/core/Mage/Strikeiron/Model/Taxrate.php b/app/code/core/Mage/Strikeiron/Model/Taxrate.php
    deleted file mode 100644
    index faf98e2871..0000000000
    --- a/app/code/core/Mage/Strikeiron/Model/Taxrate.php
    +++ /dev/null
    @@ -1,37 +0,0 @@
    -
    - */
    -class Mage_Strikeiron_Model_Taxrate extends Mage_Core_Model_Abstract
    -{
    -    protected function _construct()
    -    {
    -        $this->_init('strikeiron/taxrate');
    -    }
    -}
    diff --git a/app/code/core/Mage/Strikeiron/controllers/TestController.php b/app/code/core/Mage/Strikeiron/controllers/TestController.php
    deleted file mode 100644
    index c801668aa3..0000000000
    --- a/app/code/core/Mage/Strikeiron/controllers/TestController.php
    +++ /dev/null
    @@ -1,42 +0,0 @@
    -
    - */
    -
    -class Mage_Strikeiron_TestController extends Mage_Core_Controller_Front_Action
    -{
    -    public function indexAction()
    -    {
    -        $model = Mage::getModel('strikeiron/strikeiron');
    -        $model->getTaxRate();
    -    }
    -}
    diff --git a/app/code/core/Mage/Strikeiron/etc/adminhtml.xml b/app/code/core/Mage/Strikeiron/etc/adminhtml.xml
    deleted file mode 100644
    index 64da5213e2..0000000000
    --- a/app/code/core/Mage/Strikeiron/etc/adminhtml.xml
    +++ /dev/null
    @@ -1,49 +0,0 @@
    -
    -
    -
    -    
    -        
    -            
    -                
    -                    
    -                        
    -                            
    -                                
    -                                    
    -                                        Strikeiron Section
    -                                        75
    -                                    
    -                                
    -                            
    -                        
    -                    
    -                
    -            
    -        
    -    
    -
    diff --git a/app/code/core/Mage/Strikeiron/etc/config.xml b/app/code/core/Mage/Strikeiron/etc/config.xml
    deleted file mode 100644
    index 5c5515e2f2..0000000000
    --- a/app/code/core/Mage/Strikeiron/etc/config.xml
    +++ /dev/null
    @@ -1,140 +0,0 @@
    -
    -
    -
    -    
    -        
    -            0.9.1
    -        
    -    
    -    
    -        
    -            
    -                
    -                    
    -                        StrikeIron
    -                        strikeiron/currency_import_strikeiron
    -                    
    -                
    -            
    -        
    -        
    -            
    -                Mage_Strikeiron_Model
    -                strikeiron_mysql4
    -            
    -             
    -                Mage_Strikeiron_Model_Mysql4
    -                
    -                    
    -                        strikeiron_tax_rate
    -
    -
    -
    -
    - - - - Mage_Strikeiron - - - - - - - - strikeiron/strikeiron - customerSaveBeforeObserver - - - - - - - strikeiron/strikeiron - addressSaveBeforeObserver - - - - - - - strikeiron/strikeiron - getTaxRate - - - - - -
    - - - - - - - - accept - strikeiron_customer_error_email_template - - - B - MAX - - - - - - - - - Mage_Strikeiron.csv - - - - - - - - - standard - - Mage_Strikeiron - strikeiron - - - - -
    diff --git a/app/code/core/Mage/Strikeiron/etc/system.xml b/app/code/core/Mage/Strikeiron/etc/system.xml deleted file mode 100644 index 997d271244..0000000000 --- a/app/code/core/Mage/Strikeiron/etc/system.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - service - text - 100 - 1 - 1 - 1 - - - - text - 1 - 1 - 1 - 1 - - - - obscure - adminhtml/system_config_backend_encrypted - 1 - 1 - 1 - 1 - - - - obscure - adminhtml/system_config_backend_encrypted - 2 - 1 - 1 - 0 - - - - - - text - 2 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_enabledisable - 1 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 2 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 3 - 1 - 1 - 1 - - - - select - strikeiron/source_undeterminedEmailAction - 4 - 1 - 1 - 1 - - - - text - 5 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_email_identity - 6 - 1 - 1 - 0 - - - - select - adminhtml/system_config_source_email_template - 7 - 1 - 1 - 0 - - - - - - text - 3 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_enabledisable - 10 - 1 - 1 - 1 - - - - - - text - 4 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_enabledisable - 1 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 2 - 1 - 1 - 1 - - - - select - strikeiron/source_errorAddressAction - 4 - 1 - 1 - 1 - - - - - - text - 5 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_enabledisable - 1 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_yesno - 2 - 1 - 1 - 1 - - - - select - strikeiron/source_errorAddressAction - 4 - 1 - 1 - 1 - - - - - - text - 6 - 1 - 1 - 1 - - - - select - adminhtml/system_config_source_enabledisable - 1 - 1 - 1 - 1 - - - - select - strikeiron/source_salesTaxType - 3 - 1 - 1 - 1 - - - - If type is complete and zip code belongs to multiple tax rates, choose to charge minimum tax rate or maximum tax rate. - select - strikeiron/source_salestaxminmax - 4 - 1 - 1 - 1 - - - - multiselect - tax/class_source_customer - 5 - 1 - 1 - 1 - 1 - - - - multiselect - tax/class_source_product - 6 - 1 - 1 - 1 - 1 - - - - - - - diff --git a/app/code/core/Mage/Strikeiron/sql/strikeiron_setup/mysql4-install-0.9.1.php b/app/code/core/Mage/Strikeiron/sql/strikeiron_setup/mysql4-install-0.9.1.php deleted file mode 100644 index 1dd2e2cce2..0000000000 --- a/app/code/core/Mage/Strikeiron/sql/strikeiron_setup/mysql4-install-0.9.1.php +++ /dev/null @@ -1,48 +0,0 @@ -startSetup(); - -$installer->run(" -/*Table structure for table `strikeiron_tax_rate` */ - -DROP TABLE IF EXISTS {$this->getTable('strikeiron_tax_rate')}; - -CREATE TABLE {$this->getTable('strikeiron_tax_rate')} ( - `tax_rate_id` tinyint(4) NOT NULL auto_increment, - `tax_country_id` varchar(6) default NULL, - `tax_region_id` mediumint(9) unsigned default NULL, - `tax_postcode` varchar(12) default NULL, - `rate_value` decimal(12,4) NOT NULL default '0.0000', - PRIMARY KEY (`tax_rate_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Strikeiron tax rates'; - - "); - -$installer->endSetup(); diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php index 837765239e..49a7af6369 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php @@ -278,13 +278,16 @@ protected function _calcUnitTaxAmount(Mage_Sales_Model_Quote_Item_Abstract $item break; case Mage_Tax_Model_Calculation::CALC_TAX_AFTER_DISCOUNT_ON_EXCL: case Mage_Tax_Model_Calculation::CALC_TAX_AFTER_DISCOUNT_ON_INCL: - $discountAmount = $item->getDiscountAmount(); - $baseDiscountAmount = $item->getBaseDiscountAmount(); - $unitTax = $this->_calculator->calcTaxAmount($price-$discountAmount/$qty, $rate, $inclTax); - $baseUnitTax = $this->_calculator->calcTaxAmount($basePrice-$baseDiscountAmount/$qty, $rate, $inclTax); + $discountAmount = $item->getDiscountAmount() / $qty; + $baseDiscountAmount = $item->getBaseDiscountAmount() / $qty; + $unitTax = $this->_calculator->calcTaxAmount(max($price-$discountAmount, 0), $rate, $inclTax); + $baseUnitTax = $this->_calculator->calcTaxAmount(max($basePrice-$baseDiscountAmount, 0), $rate, $inclTax); if ($inclTax && $discountAmount>0) { - $hiddenTax = $price - $unitTax - $item->getOriginalPrice(); + $hiddenTax = $price - $unitTax - $item->getConvertedPrice(); $baseHiddenTax = $basePrice - $unitTax - $item->getBasePrice(); + } elseif ($discountAmount > $price) { // case with 100% discount on price incl. tax + $hiddenTax = $discountAmount - $price; + $baseHiddenTax = $baseDiscountAmount - $basePrice; } break; } diff --git a/app/code/core/Mage/Usa/etc/config.xml b/app/code/core/Mage/Usa/etc/config.xml index 761620d9ba..68e3864e88 100644 --- a/app/code/core/Mage/Usa/etc/config.xml +++ b/app/code/core/Mage/Usa/etc/config.xml @@ -166,6 +166,7 @@ O 0 1 + UPS diff --git a/app/design/adminhtml/default/default/layout/main.xml b/app/design/adminhtml/default/default/layout/main.xml index efc0f38bb4..68bcecc850 100644 --- a/app/design/adminhtml/default/default/layout/main.xml +++ b/app/design/adminhtml/default/default/layout/main.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/template/chronopay/form.phtml b/app/design/adminhtml/default/default/template/chronopay/form.phtml deleted file mode 100644 index aa4f95515e..0000000000 --- a/app/design/adminhtml/default/default/template/chronopay/form.phtml +++ /dev/null @@ -1,81 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/design/adminhtml/default/default/template/chronopay/info.phtml b/app/design/adminhtml/default/default/template/chronopay/info.phtml deleted file mode 100644 index 8926383789..0000000000 --- a/app/design/adminhtml/default/default/template/chronopay/info.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -getMethod()->getTitle() ?>
    -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?>
    -__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?> diff --git a/app/design/adminhtml/default/default/template/chronopay/pdf/info.phtml b/app/design/adminhtml/default/default/template/chronopay/pdf/info.phtml deleted file mode 100644 index 60e09927a0..0000000000 --- a/app/design/adminhtml/default/default/template/chronopay/pdf/info.phtml +++ /dev/null @@ -1,33 +0,0 @@ - -getMethod()->getTitle() ?> - {{pdf_row_separator}} -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?> - {{pdf_row_separator}} -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?> - {{pdf_row_separator}} -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> diff --git a/app/design/adminhtml/default/default/template/cms/browser/js.phtml b/app/design/adminhtml/default/default/template/cms/browser/js.phtml index 4fd4ae2e12..d3b4a81ca0 100644 --- a/app/design/adminhtml/default/default/template/cms/browser/js.phtml +++ b/app/design/adminhtml/default/default/template/cms/browser/js.phtml @@ -36,4 +36,4 @@ MediabrowserInstance = new Mediabrowser(getFilebrowserSetupObject() ?>); MediabrowserInstance.storeId = 'getStoreId() ?>'; //]]> - \ No newline at end of file + diff --git a/app/design/adminhtml/default/default/template/cybersource/form.phtml b/app/design/adminhtml/default/default/template/cybersource/form.phtml deleted file mode 100644 index 5df713ac86..0000000000 --- a/app/design/adminhtml/default/default/template/cybersource/form.phtml +++ /dev/null @@ -1,162 +0,0 @@ - - getMethodCode(); ?> - - - diff --git a/app/design/adminhtml/default/default/template/cybersource/info.phtml b/app/design/adminhtml/default/default/template/cybersource/info.phtml deleted file mode 100644 index ba8d4afe61..0000000000 --- a/app/design/adminhtml/default/default/template/cybersource/info.phtml +++ /dev/null @@ -1,39 +0,0 @@ - -getInfo()): ?> -getMethod()->getTitle() ?>
    - -__('Credit Card Type: %s', $this->getCcTypeName()) ?>
    -__('Credit Card Number: xxxx-%s', $this->getInfo()->getCcLast4()) ?>
    -__('Expiration Date: %s/%s', $this->getCcExpMonth(), $this->getInfo()->getCcExpYear()) ?>
    -getInfo()->getCcSsIssue()): ?> -__("Switch/Solo/Maestro(UK Domestic) card issue number: %s", $this->getInfo()->getCcSsIssue()) ?>
    - -getInfo()->getCcSsStartYear()): ?> -__('Switch/Solo/Maestro(UK Domestic) card start Date: %s/%s', $this->getCcStartMonth(), $this->getInfo()->getCcSsStartYear()) ?> - - diff --git a/app/design/adminhtml/default/default/template/cybersource/pdf/info.phtml b/app/design/adminhtml/default/default/template/cybersource/pdf/info.phtml deleted file mode 100644 index 586fccabf9..0000000000 --- a/app/design/adminhtml/default/default/template/cybersource/pdf/info.phtml +++ /dev/null @@ -1,43 +0,0 @@ - -getInfo()): ?> - getMethod()->getTitle() ?> - {{pdf_row_separator}} - __('Name on the Card: %s', $this->getInfo()->getCcOwner()) ?> - {{pdf_row_separator}} - __('Credit Card Type: %s', $this->getCcTypeName()) ?> - {{pdf_row_separator}} - __('Credit Card Number: xxxx-%s', $this->getInfo()->getCcLast4()) ?> - {{pdf_row_separator}} - getInfo()->getCcSsIssue()): ?> - __("Switch/Solo card issue number: %s", $this->getInfo()->getCcSsIssue()) ?> - {{pdf_row_separator}} - - getInfo()->getCcSsStartYear()): ?> - __('Switch/Solo card start Date: %s/%s', $this->getCcStartMonth(), $this->getInfo()->getCcSsStartYear()) ?> - - diff --git a/app/design/adminhtml/default/default/template/eway/form.phtml b/app/design/adminhtml/default/default/template/eway/form.phtml deleted file mode 100644 index f3cdd34fc3..0000000000 --- a/app/design/adminhtml/default/default/template/eway/form.phtml +++ /dev/null @@ -1,82 +0,0 @@ - -getMethodCode() ?> - - diff --git a/app/design/adminhtml/default/default/template/eway/info.phtml b/app/design/adminhtml/default/default/template/eway/info.phtml deleted file mode 100644 index 81f0380258..0000000000 --- a/app/design/adminhtml/default/default/template/eway/info.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?>
    -__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?> diff --git a/app/design/adminhtml/default/default/template/eway/pdf/info.phtml b/app/design/adminhtml/default/default/template/eway/pdf/info.phtml deleted file mode 100644 index 0368811732..0000000000 --- a/app/design/adminhtml/default/default/template/eway/pdf/info.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?> - {{pdf_row_separator}} -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?> - {{pdf_row_separator}} -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> diff --git a/app/design/adminhtml/default/default/template/flo2cash/form.phtml b/app/design/adminhtml/default/default/template/flo2cash/form.phtml deleted file mode 100644 index f3cdd34fc3..0000000000 --- a/app/design/adminhtml/default/default/template/flo2cash/form.phtml +++ /dev/null @@ -1,82 +0,0 @@ - -getMethodCode() ?> - - diff --git a/app/design/adminhtml/default/default/template/flo2cash/info.phtml b/app/design/adminhtml/default/default/template/flo2cash/info.phtml deleted file mode 100644 index 8926383789..0000000000 --- a/app/design/adminhtml/default/default/template/flo2cash/info.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -getMethod()->getTitle() ?>
    -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?>
    -__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?> diff --git a/app/design/adminhtml/default/default/template/flo2cash/pdf/info.phtml b/app/design/adminhtml/default/default/template/flo2cash/pdf/info.phtml deleted file mode 100644 index 60e09927a0..0000000000 --- a/app/design/adminhtml/default/default/template/flo2cash/pdf/info.phtml +++ /dev/null @@ -1,33 +0,0 @@ - -getMethod()->getTitle() ?> - {{pdf_row_separator}} -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?> - {{pdf_row_separator}} -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?> - {{pdf_row_separator}} -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> diff --git a/app/design/adminhtml/default/default/template/ideal/advanced/info.phtml b/app/design/adminhtml/default/default/template/ideal/advanced/info.phtml deleted file mode 100644 index c9391593ca..0000000000 --- a/app/design/adminhtml/default/default/template/ideal/advanced/info.phtml +++ /dev/null @@ -1,33 +0,0 @@ - -getInfo()): ?> -getMethod()->getTitle() ?> -
    -__('Issuer: %s', $this->getIssuerTitle()) ?> - - - diff --git a/app/design/adminhtml/default/default/template/ideal/advanced/pdf/info.phtml b/app/design/adminhtml/default/default/template/ideal/advanced/pdf/info.phtml deleted file mode 100644 index b7d6a108c0..0000000000 --- a/app/design/adminhtml/default/default/template/ideal/advanced/pdf/info.phtml +++ /dev/null @@ -1,29 +0,0 @@ - -getMethod()->getTitle() ?> - {{pdf_row_separator}} -__('Ideal: %s', $this->htmlEscape($this->getInfo()->getIdealIssuerTitle())) ?> diff --git a/app/design/adminhtml/default/default/template/ogone/info.phtml b/app/design/adminhtml/default/default/template/ogone/info.phtml deleted file mode 100644 index adf531cf7f..0000000000 --- a/app/design/adminhtml/default/default/template/ogone/info.phtml +++ /dev/null @@ -1,29 +0,0 @@ - - -htmlEscape($this->getMethod()->getTitle()) ?>
    -__('Payment ID: %s', $this->htmlEscape($this->getInfo()->getLastTransId())) ?>
    diff --git a/app/design/adminhtml/default/default/template/oscommerce/convert/run.phtml b/app/design/adminhtml/default/default/template/oscommerce/convert/run.phtml deleted file mode 100755 index 91de4bd7c1..0000000000 --- a/app/design/adminhtml/default/default/template/oscommerce/convert/run.phtml +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - -getCheckButtonHtml() ?> -getSaveButtonHtml() ?> - - - diff --git a/app/design/adminhtml/default/default/template/oscommerce/order/view.phtml b/app/design/adminhtml/default/default/template/oscommerce/order/view.phtml deleted file mode 100644 index 2d4b74936c..0000000000 --- a/app/design/adminhtml/default/default/template/oscommerce/order/view.phtml +++ /dev/null @@ -1,241 +0,0 @@ - -getOrder(); -$_products = $_order->getProducts(); -$_totals = $_order->getTotal(); -$_comments = $_order->getComments(); -$currency = $_order->getCurrencySymbol()?$_order->getCurrencySymbol():$_order->getCurrency(); -?> -
    - - - - -
    -

    getHeaderText() ?>

    -

    - getBackButtonHtml() ?> -

    -
    -
    -
    - -
    -
    - __('Order # %s', $_order->getOrdersId()) ?> -
    -
    - - - - - -
    formatDate($_order->getDatePurchased(), 'medium', true) ?>
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - - - - - - - - -
    htmlEscape($_order->getCustomersName()) ?>
    getCustomersEmailAddress() ?>
    -
    -
    -
    -
    - -
    - -
    -
    -

    __('Billing Address') ?>

    -
    -
    - getBillingName() ?>
    -
    - getBillingStreetAddress() ?>
    - getBillingCity() ?>, getBillingState() ?> getBillingPostcode() ?>
    - getBillingCountry() ?>
    -
    -
    -
    -
    - -
    - -
    -
    -

    __('Delivery Address') ?>

    -
    -
    - getDeliveryName() ?>
    -
    - getDeliveryStreetAddress() ?>
    - getDeliveryCity() ?>, getDeliveryState() ?> getDeliveryPostcode() ?>
    - getDeliveryCountry() ?>
    -
    -
    -
    -
    -
    - -
    - -
    -
    -

    __('Payment Information') ?>

    -
    -
    - getPaymentMethod(); ?> -
    -
    -
    -
    - -
    -
    -

    __('Shipping & Handling Information') ?>

    -
    -
    - - - - - - - - - -
    -
    -
    -
    - -
    -
    -

    __('Items Ordered') ?>

    -
    -
    -
    -
    - - - - - - - - - - - - - $_product) :?> - - - - - - - - - - -
    __('Product') ?>__('SKU') ?>__('Price') ?>__('Qty') ?>__('Final Price') ?>
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -

    __('Comments History') ?>

    -
    -
    -
    -
      - - -
    • - formatDate($_comment['date_added'], 'medium', true)?> - |
      - - - -
    • - - -
    -
    -
    -
    -
    - -
    -

    __('Order Totals') ?>

    -
    - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    - diff --git a/app/design/adminhtml/default/default/template/paybox/adminhtml/cart/type/select.phtml b/app/design/adminhtml/default/default/template/paybox/adminhtml/cart/type/select.phtml deleted file mode 100644 index 6d3c16fa89..0000000000 --- a/app/design/adminhtml/default/default/template/paybox/adminhtml/cart/type/select.phtml +++ /dev/null @@ -1,45 +0,0 @@ - - diff --git a/app/design/adminhtml/default/default/template/paybox/direct/form.phtml b/app/design/adminhtml/default/default/template/paybox/direct/form.phtml deleted file mode 100644 index f3cdd34fc3..0000000000 --- a/app/design/adminhtml/default/default/template/paybox/direct/form.phtml +++ /dev/null @@ -1,82 +0,0 @@ - -getMethodCode() ?> - - diff --git a/app/design/adminhtml/default/default/template/paybox/direct/info.phtml b/app/design/adminhtml/default/default/template/paybox/direct/info.phtml deleted file mode 100644 index c5d2aa591a..0000000000 --- a/app/design/adminhtml/default/default/template/paybox/direct/info.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -htmlEscape($this->getMethod()->getTitle()) ?>
    -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?>
    -__('Expiration Date: %s/%s', $this->htmlEscape($this->getCcExpMonth()), $this->htmlEscape($this->getInfo()->getCcExpYear())) ?> diff --git a/app/design/adminhtml/default/default/template/paybox/direct/pdf/info.phtml b/app/design/adminhtml/default/default/template/paybox/direct/pdf/info.phtml deleted file mode 100644 index 3502b4202a..0000000000 --- a/app/design/adminhtml/default/default/template/paybox/direct/pdf/info.phtml +++ /dev/null @@ -1,33 +0,0 @@ - -htmlEscape($this->getMethod()->getTitle()) ?> - {{pdf_row_separator}} -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?> - {{pdf_row_separator}} -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?> - {{pdf_row_separator}} -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> diff --git a/app/design/adminhtml/default/default/template/paypal/system/config/fieldset/global.phtml b/app/design/adminhtml/default/default/template/paypal/system/config/fieldset/global.phtml index f781e43da0..8659967cd4 100644 --- a/app/design/adminhtml/default/default/template/paypal/system/config/fieldset/global.phtml +++ b/app/design/adminhtml/default/default/template/paypal/system/config/fieldset/global.phtml @@ -429,4 +429,4 @@ PaypalConfig.prototype = { }.bind(this)); } } - \ No newline at end of file + diff --git a/app/design/adminhtml/default/default/template/system/variable/form/renderer/fieldset/element.phtml b/app/design/adminhtml/default/default/template/system/variable/form/renderer/fieldset/element.phtml index f572237207..f761719570 100644 --- a/app/design/adminhtml/default/default/template/system/variable/form/renderer/fieldset/element.phtml +++ b/app/design/adminhtml/default/default/template/system/variable/form/renderer/fieldset/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/adminhtml/default/default/template/tag/edit/serializer.phtml b/app/design/adminhtml/default/default/template/tag/edit/serializer.phtml index 7768569035..cb513ed18b 100644 --- a/app/design/adminhtml/default/default/template/tag/edit/serializer.phtml +++ b/app/design/adminhtml/default/default/template/tag/edit/serializer.phtml @@ -18,10 +18,10 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category design - * @package default_default - * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * @category design + * @package default_default + * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/base/default/layout/chronopay.xml b/app/design/frontend/base/default/layout/chronopay.xml deleted file mode 100644 index 2e1baaae1a..0000000000 --- a/app/design/frontend/base/default/layout/chronopay.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/cybermut.xml b/app/design/frontend/base/default/layout/cybermut.xml deleted file mode 100644 index 70faa1d200..0000000000 --- a/app/design/frontend/base/default/layout/cybermut.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/eway.xml b/app/design/frontend/base/default/layout/eway.xml deleted file mode 100644 index 620138cb0b..0000000000 --- a/app/design/frontend/base/default/layout/eway.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/ideal.xml b/app/design/frontend/base/default/layout/ideal.xml deleted file mode 100644 index 139f8d720e..0000000000 --- a/app/design/frontend/base/default/layout/ideal.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/ogone.xml b/app/design/frontend/base/default/layout/ogone.xml deleted file mode 100644 index 17d89dd791..0000000000 --- a/app/design/frontend/base/default/layout/ogone.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/oscommerce.xml b/app/design/frontend/base/default/layout/oscommerce.xml deleted file mode 100644 index 2269f74d8b..0000000000 --- a/app/design/frontend/base/default/layout/oscommerce.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/paybox.xml b/app/design/frontend/base/default/layout/paybox.xml deleted file mode 100644 index cccda122b4..0000000000 --- a/app/design/frontend/base/default/layout/paybox.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/protx.xml b/app/design/frontend/base/default/layout/protx.xml deleted file mode 100644 index f215c080a9..0000000000 --- a/app/design/frontend/base/default/layout/protx.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/design/frontend/base/default/layout/wishlist.xml b/app/design/frontend/base/default/layout/wishlist.xml index 594d90c177..e5c75767b7 100644 --- a/app/design/frontend/base/default/layout/wishlist.xml +++ b/app/design/frontend/base/default/layout/wishlist.xml @@ -1,107 +1,107 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - wishlistwishlist/ - - - - - - - - - wishlist - - - - - - - - - - - - - - wishlist_customer_sidebar - - - - - - - - - - - - wishlist_customer_sidebar - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + wishlistwishlist/ + + + + + + + + + wishlist + + + + + + + + + + + + + + wishlist_customer_sidebar + + + + + + + + + + + + wishlist_customer_sidebar + + + + + + + + + + + diff --git a/app/design/frontend/base/default/template/ideal/advanced/info.phtml b/app/design/frontend/base/default/template/cataloginventory/qtyincrements.phtml similarity index 75% rename from app/design/frontend/base/default/template/ideal/advanced/info.phtml rename to app/design/frontend/base/default/template/cataloginventory/qtyincrements.phtml index 0964dea103..5fd0f156b7 100644 --- a/app/design/frontend/base/default/template/ideal/advanced/info.phtml +++ b/app/design/frontend/base/default/template/cataloginventory/qtyincrements.phtml @@ -23,11 +23,13 @@ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -?> -getInfo()): ?> -getMethod()->getTitle() ?> -
    - __('Issuer'). ': ' . $this->getIssuerTitle() ?> - - +/** + * @see Mage_CatalogInventory_Block_Qtyincrements + */ +?> +getProductQtyIncrements()) : ?> +
    + __('%s is available for purchase in increments of %s', $this->getProductName(), $this->getProductQtyIncrements()) ?> +
    + diff --git a/app/design/frontend/base/default/template/cataloginventory/stockqty/composite.phtml b/app/design/frontend/base/default/template/cataloginventory/stockqty/composite.phtml index 2697f166bc..c0a6703485 100644 --- a/app/design/frontend/base/default/template/cataloginventory/stockqty/composite.phtml +++ b/app/design/frontend/base/default/template/cataloginventory/stockqty/composite.phtml @@ -1,62 +1,62 @@ - -isMsgVisible()): ?> - - __('Only %s left', $this->getStockQty()) ?> - - - - - - - - - - getChildProducts() as $childProduct) : ?> - getProductStockQty($childProduct); ?> - 0) : ?> - - - - - - - -
    __('Product Name') ?>__('Qty') ?>
    getName() ?>
    - - + +isMsgVisible()): ?> + + __('Only %s left', $this->getStockQty()) ?> + + + + + + + + + + getChildProducts() as $childProduct) : ?> + getProductStockQty($childProduct); ?> + 0) : ?> + + + + + + + +
    __('Product Name') ?>__('Qty') ?>
    getName() ?>
    + + diff --git a/app/design/frontend/base/default/template/cataloginventory/stockqty/default.phtml b/app/design/frontend/base/default/template/cataloginventory/stockqty/default.phtml index 2a1c295229..9bc88ae00d 100644 --- a/app/design/frontend/base/default/template/cataloginventory/stockqty/default.phtml +++ b/app/design/frontend/base/default/template/cataloginventory/stockqty/default.phtml @@ -1,35 +1,35 @@ - -isMsgVisible()) : ?> - - __('Only %s left', $this->getStockQty()) ?> - - + +isMsgVisible()) : ?> + + __('Only %s left', $this->getStockQty()) ?> + + diff --git a/app/design/frontend/base/default/template/checkout/cart/sidebar.phtml b/app/design/frontend/base/default/template/checkout/cart/sidebar.phtml index cf67a2e30c..7ed6e07119 100644 --- a/app/design/frontend/base/default/template/checkout/cart/sidebar.phtml +++ b/app/design/frontend/base/default/template/checkout/cart/sidebar.phtml @@ -73,4 +73,4 @@ - \ No newline at end of file + diff --git a/app/design/frontend/base/default/template/chronopay/form.phtml b/app/design/frontend/base/default/template/chronopay/form.phtml deleted file mode 100644 index 8a62a7f26b..0000000000 --- a/app/design/frontend/base/default/template/chronopay/form.phtml +++ /dev/null @@ -1,90 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/chronopay/info.phtml b/app/design/frontend/base/default/template/chronopay/info.phtml deleted file mode 100644 index 2bf7df8bc1..0000000000 --- a/app/design/frontend/base/default/template/chronopay/info.phtml +++ /dev/null @@ -1,34 +0,0 @@ - -getInfo()): ?> -getMethod()->getTitle() ?>
    -__('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    -__('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    -__('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> - - - diff --git a/app/design/frontend/base/default/template/chronopay/standard/failure.phtml b/app/design/frontend/base/default/template/chronopay/standard/failure.phtml deleted file mode 100644 index 0f219d4b19..0000000000 --- a/app/design/frontend/base/default/template/chronopay/standard/failure.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -
    -

    __('An error has occurred') ?>

    -
    -

    __('An error occurred during paying process.') ?>

    diff --git a/app/design/frontend/base/default/template/chronopay/standard/form.phtml b/app/design/frontend/base/default/template/chronopay/standard/form.phtml deleted file mode 100644 index a6c490eb08..0000000000 --- a/app/design/frontend/base/default/template/chronopay/standard/form.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/cybermut/error.phtml b/app/design/frontend/base/default/template/cybermut/error.phtml deleted file mode 100644 index 8922c9369a..0000000000 --- a/app/design/frontend/base/default/template/cybermut/error.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -
    -

    __('An error has occured') ?>

    -
    -

    __('An error occurred during the payment process.') ?>

    diff --git a/app/design/frontend/base/default/template/cybermut/form.phtml b/app/design/frontend/base/default/template/cybermut/form.phtml deleted file mode 100644 index 5175b38b85..0000000000 --- a/app/design/frontend/base/default/template/cybermut/form.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/cybersource/form.phtml b/app/design/frontend/base/default/template/cybersource/form.phtml deleted file mode 100644 index f53916c773..0000000000 --- a/app/design/frontend/base/default/template/cybersource/form.phtml +++ /dev/null @@ -1,190 +0,0 @@ - -getMethodCode() ?> - - - diff --git a/app/design/frontend/base/default/template/cybersource/info.phtml b/app/design/frontend/base/default/template/cybersource/info.phtml deleted file mode 100644 index 43f3e78f61..0000000000 --- a/app/design/frontend/base/default/template/cybersource/info.phtml +++ /dev/null @@ -1,38 +0,0 @@ - -getInfo()): ?> -getMethod()->getTitle() ?>
    - -__('Credit Card Type: %s', $this->getCcTypeName()) ?>
    -__('Credit Card Number: xxxx-%s', $this->getInfo()->getCcLast4()) ?>
    -getInfo()->getCcSsIssue()): ?> -__("Switch/Solo/Maestro(UK Domestic) card issue number: %s", $this->getInfo()->getCcSsIssue()) ?>
    - -getInfo()->getCcSsStartYear()): ?> -__('Switch/Solo/Maestro(UK Domestic) card start Date: %s/%s', $this->getCcStartMonth(), $this->getInfo()->getCcSsStartYear()) ?> - - diff --git a/app/design/frontend/base/default/template/email/order/items.phtml b/app/design/frontend/base/default/template/email/order/items.phtml index 21e8a44531..5f2e77e01c 100644 --- a/app/design/frontend/base/default/template/email/order/items.phtml +++ b/app/design/frontend/base/default/template/email/order/items.phtml @@ -67,4 +67,4 @@
    \ No newline at end of file + diff --git a/app/design/frontend/base/default/template/eway/form.phtml b/app/design/frontend/base/default/template/eway/form.phtml deleted file mode 100644 index c645f80144..0000000000 --- a/app/design/frontend/base/default/template/eway/form.phtml +++ /dev/null @@ -1,91 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/eway/info.phtml b/app/design/frontend/base/default/template/eway/info.phtml deleted file mode 100644 index f01938d6d8..0000000000 --- a/app/design/frontend/base/default/template/eway/info.phtml +++ /dev/null @@ -1,33 +0,0 @@ - -getInfo()): ?> - __('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    - __('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    - __('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> - - - diff --git a/app/design/frontend/base/default/template/eway/secure/failure.phtml b/app/design/frontend/base/default/template/eway/secure/failure.phtml deleted file mode 100644 index eb02b99b98..0000000000 --- a/app/design/frontend/base/default/template/eway/secure/failure.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -
    -

    __('An error has occurred') ?>

    -
    -

    getErrorMessage() ?>.

    -

    __('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    diff --git a/app/design/frontend/base/default/template/eway/secure/form.phtml b/app/design/frontend/base/default/template/eway/secure/form.phtml deleted file mode 100644 index 85227083ed..0000000000 --- a/app/design/frontend/base/default/template/eway/secure/form.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/eway/shared/failure.phtml b/app/design/frontend/base/default/template/eway/shared/failure.phtml deleted file mode 100644 index eb02b99b98..0000000000 --- a/app/design/frontend/base/default/template/eway/shared/failure.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -
    -

    __('An error has occurred') ?>

    -
    -

    getErrorMessage() ?>.

    -

    __('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    diff --git a/app/design/frontend/base/default/template/eway/shared/form.phtml b/app/design/frontend/base/default/template/eway/shared/form.phtml deleted file mode 100644 index bb6ad2a181..0000000000 --- a/app/design/frontend/base/default/template/eway/shared/form.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/flo2cash/form.phtml b/app/design/frontend/base/default/template/flo2cash/form.phtml deleted file mode 100644 index 9153488742..0000000000 --- a/app/design/frontend/base/default/template/flo2cash/form.phtml +++ /dev/null @@ -1,90 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/flo2cash/info.phtml b/app/design/frontend/base/default/template/flo2cash/info.phtml deleted file mode 100644 index 6c28f2359a..0000000000 --- a/app/design/frontend/base/default/template/flo2cash/info.phtml +++ /dev/null @@ -1,34 +0,0 @@ - -getInfo()): ?> -getMethod()->getTitle() ?>
    - __('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    - __('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    - __('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> - - - diff --git a/app/design/frontend/base/default/template/ideal/advanced/failure.phtml b/app/design/frontend/base/default/template/ideal/advanced/failure.phtml deleted file mode 100644 index ff4b5b8a98..0000000000 --- a/app/design/frontend/base/default/template/ideal/advanced/failure.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -
    -

    __('An error has occurred') ?>

    -
    -

    getErrorMessage() ?>

    -

    __('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    diff --git a/app/design/frontend/base/default/template/ideal/advanced/form.phtml b/app/design/frontend/base/default/template/ideal/advanced/form.phtml deleted file mode 100755 index 01ab3b2c8d..0000000000 --- a/app/design/frontend/base/default/template/ideal/advanced/form.phtml +++ /dev/null @@ -1,42 +0,0 @@ - -getMethodCode() ?> -getIssuerList()):?> - - diff --git a/app/design/frontend/base/default/template/ideal/basic/failure.phtml b/app/design/frontend/base/default/template/ideal/basic/failure.phtml deleted file mode 100644 index ff4b5b8a98..0000000000 --- a/app/design/frontend/base/default/template/ideal/basic/failure.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -
    -

    __('An error has occurred') ?>

    -
    -

    getErrorMessage() ?>

    -

    __('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    diff --git a/app/design/frontend/base/default/template/ideal/basic/form.phtml b/app/design/frontend/base/default/template/ideal/basic/form.phtml deleted file mode 100755 index dde99610ff..0000000000 --- a/app/design/frontend/base/default/template/ideal/basic/form.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/ogone/form.phtml b/app/design/frontend/base/default/template/ogone/form.phtml deleted file mode 100644 index 4b747d41cb..0000000000 --- a/app/design/frontend/base/default/template/ogone/form.phtml +++ /dev/null @@ -1,33 +0,0 @@ - - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/ogone/info.phtml b/app/design/frontend/base/default/template/ogone/info.phtml deleted file mode 100644 index 6f0f37fb78..0000000000 --- a/app/design/frontend/base/default/template/ogone/info.phtml +++ /dev/null @@ -1,27 +0,0 @@ - -

    htmlEscape($this->getMethod()->getTitle()) ?>

    diff --git a/app/design/frontend/base/default/template/ogone/paypage.phtml b/app/design/frontend/base/default/template/ogone/paypage.phtml deleted file mode 100644 index 1e3141bf37..0000000000 --- a/app/design/frontend/base/default/template/ogone/paypage.phtml +++ /dev/null @@ -1,28 +0,0 @@ - - -$$$PAYMENT ZONE$$$ diff --git a/app/design/frontend/base/default/template/ogone/placeform.phtml b/app/design/frontend/base/default/template/ogone/placeform.phtml deleted file mode 100644 index 0170a04408..0000000000 --- a/app/design/frontend/base/default/template/ogone/placeform.phtml +++ /dev/null @@ -1,45 +0,0 @@ - - -

    __('Please, wait a moment. This page will transfer your data to Ogone payment gateway in a few seconds.'); ?>

    -
    - getFormData())): ?> -
    - getFormData() as $name => $value) { ?> - - -
    - -
    - diff --git a/app/design/frontend/base/default/template/oscommerce/order/list.phtml b/app/design/frontend/base/default/template/oscommerce/order/list.phtml deleted file mode 100644 index 8a743e726f..0000000000 --- a/app/design/frontend/base/default/template/oscommerce/order/list.phtml +++ /dev/null @@ -1,56 +0,0 @@ - -getOsCommerceOrders(); ?> - -
    -

    __('My Previous Orders') ?>

    -
    - - - - - - - - - - - - - - - - - - - - - - -
    __('Order #') ?>__('Date') ?>__('Ship To') ?>__('Order Total') ?> 
    formatDate($_oscOrder['date_purchased'], 'medium', true) ?>htmlEscape($_oscOrder['delivery_street_address']) ?>__('View Order') ?> -
    - diff --git a/app/design/frontend/base/default/template/oscommerce/order/view.phtml b/app/design/frontend/base/default/template/oscommerce/order/view.phtml deleted file mode 100644 index ceb62cf0ac..0000000000 --- a/app/design/frontend/base/default/template/oscommerce/order/view.phtml +++ /dev/null @@ -1,141 +0,0 @@ - -getOrder() ?> - - - -
    -

    __('Order') ?> #

    -
    -

    __('Order Date:')?> formatDate($_order['date_purchased'], 'medium', false) ?>

    - -
    -
    -

    __('Shipping Address') ?>

    -
    -
    -
    - -
    -
    -T: - -
    -
    - - -
    -

    __('Shipping Method') ?>

    - -
    - -
    - - -
    -
    -

    __('Billing Address') ?>

    -
    -
    -
    - -
    -
    -T: - -
    -
    -
    -

    Payment Method

    - -
    -
    - -

    __('Items Ordered') ?>

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    __('Product Name') ?>__('SKU') ?>__('Price') ?>__('Qty Ordered') ?>__('Subtotal') ?>
    - - - -

    __('About Your Order') ?>

    -
    - -
    formatDate($_historyItem['date_added'], 'medium', true) ?> |
    -
    - -
    - - diff --git a/app/design/frontend/base/default/template/paybox/direct/form.phtml b/app/design/frontend/base/default/template/paybox/direct/form.phtml deleted file mode 100644 index 3d8e65b363..0000000000 --- a/app/design/frontend/base/default/template/paybox/direct/form.phtml +++ /dev/null @@ -1,92 +0,0 @@ - - - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/paybox/direct/info.phtml b/app/design/frontend/base/default/template/paybox/direct/info.phtml deleted file mode 100644 index c6def64523..0000000000 --- a/app/design/frontend/base/default/template/paybox/direct/info.phtml +++ /dev/null @@ -1,34 +0,0 @@ - -getInfo()): ?> - getMethod()->getTitle() ?>
    - __('Name on the Card: %s', $this->htmlEscape($this->getInfo()->getCcOwner())) ?>
    - __('Credit Card Type: %s', $this->htmlEscape($this->getCcTypeName())) ?>
    - __('Credit Card Number: xxxx-%s', $this->htmlEscape($this->getInfo()->getCcLast4())) ?> - - - diff --git a/app/design/frontend/base/default/template/paybox/system/error.phtml b/app/design/frontend/base/default/template/paybox/system/error.phtml deleted file mode 100644 index eb02b99b98..0000000000 --- a/app/design/frontend/base/default/template/paybox/system/error.phtml +++ /dev/null @@ -1,31 +0,0 @@ - -
    -

    __('An error has occurred') ?>

    -
    -

    getErrorMessage() ?>.

    -

    __('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

    diff --git a/app/design/frontend/base/default/template/paybox/system/form.phtml b/app/design/frontend/base/default/template/paybox/system/form.phtml deleted file mode 100644 index 55d6509d0b..0000000000 --- a/app/design/frontend/base/default/template/paybox/system/form.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -getMethodCode() ?> - diff --git a/app/design/frontend/base/default/template/payment/form/cc.phtml b/app/design/frontend/base/default/template/payment/form/cc.phtml index ea821a93a2..2d53395976 100644 --- a/app/design/frontend/base/default/template/payment/form/cc.phtml +++ b/app/design/frontend/base/default/template/payment/form/cc.phtml @@ -96,7 +96,7 @@ - +
  • @@ -117,29 +117,21 @@
  •  
  • -
+

- +

diff --git a/app/etc/modules/Mage_Chronopay.xml b/app/etc/modules/Mage_Chronopay.xml deleted file mode 100644 index 961ef564f7..0000000000 --- a/app/etc/modules/Mage_Chronopay.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Cybermut.xml b/app/etc/modules/Mage_Cybermut.xml deleted file mode 100644 index e6691f1aeb..0000000000 --- a/app/etc/modules/Mage_Cybermut.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Cybersource.xml b/app/etc/modules/Mage_Cybersource.xml deleted file mode 100644 index c2d0d817bd..0000000000 --- a/app/etc/modules/Mage_Cybersource.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Eway.xml b/app/etc/modules/Mage_Eway.xml deleted file mode 100644 index 1545c14366..0000000000 --- a/app/etc/modules/Mage_Eway.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Flo2Cash.xml b/app/etc/modules/Mage_Flo2Cash.xml deleted file mode 100644 index f058529645..0000000000 --- a/app/etc/modules/Mage_Flo2Cash.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Ideal.xml b/app/etc/modules/Mage_Ideal.xml deleted file mode 100644 index 639dece0ae..0000000000 --- a/app/etc/modules/Mage_Ideal.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Ogone.xml b/app/etc/modules/Mage_Ogone.xml deleted file mode 100644 index 530764a112..0000000000 --- a/app/etc/modules/Mage_Ogone.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - true - core - - - - - - - diff --git a/app/etc/modules/Mage_Oscommerce.xml b/app/etc/modules/Mage_Oscommerce.xml deleted file mode 100644 index 447054cf81..0000000000 --- a/app/etc/modules/Mage_Oscommerce.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - true - core - - - - - - - - - diff --git a/app/etc/modules/Mage_Paybox.xml b/app/etc/modules/Mage_Paybox.xml deleted file mode 100644 index 183ba2a8c0..0000000000 --- a/app/etc/modules/Mage_Paybox.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Protx.xml b/app/etc/modules/Mage_Protx.xml deleted file mode 100644 index b70906be3d..0000000000 --- a/app/etc/modules/Mage_Protx.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/etc/modules/Mage_Strikeiron.xml b/app/etc/modules/Mage_Strikeiron.xml deleted file mode 100644 index 86a76beea6..0000000000 --- a/app/etc/modules/Mage_Strikeiron.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv index ea811eb15e..d6f01554a2 100644 --- a/app/locale/en_US/Mage_Adminhtml.csv +++ b/app/locale/en_US/Mage_Adminhtml.csv @@ -565,6 +565,7 @@ "No search modules were registered","No search modules were registered" "None","None" "Note:","Note:" +"Notes","Notes" "Notifications","Notifications" "Number of Orders","Number of Orders" "Number of Uses","Number of Uses" @@ -722,6 +723,9 @@ "Refresh Now*","Refresh Now*" "Refresh Statistics","Refresh Statistics" "Region/State","Region/State" +"Release","Release" +"Release Stability","Release Stability" +"Release Version","Release Version" "Remote FTP","Remote FTP" "Remove","Remove" "Reports","Reports" diff --git a/app/locale/en_US/Mage_CatalogRule.csv b/app/locale/en_US/Mage_CatalogRule.csv index ff63e6ecf6..c6253d25dd 100644 --- a/app/locale/en_US/Mage_CatalogRule.csv +++ b/app/locale/en_US/Mage_CatalogRule.csv @@ -8,6 +8,7 @@ "Catalog","Catalog" "Catalog Price Rule","Catalog Price Rule" "Catalog Price Rules","Catalog Price Rules" +"Catalog Price Rules based on deleted attribute ""%s"" has been disabled.","Catalog Price Rules based on deleted attribute ""%s"" has been disabled." "Category","Category" "Conditions","Conditions" "Conditions (leave blank for all products)","Conditions (leave blank for all products)" diff --git a/app/locale/en_US/Mage_Chronopay.csv b/app/locale/en_US/Mage_Chronopay.csv deleted file mode 100644 index 25649b0891..0000000000 --- a/app/locale/en_US/Mage_Chronopay.csv +++ /dev/null @@ -1,49 +0,0 @@ -"Accepted Currency","Accepted Currency" -"An error has occurred","An error has occurred" -"An error occurred during paying process.","An error occurred during paying process." -"An error occurred during the paying process.","An error occurred during the paying process." -"Authorize Only","Authorize Only" -"Authorize and Capture","Authorize and Capture" -"CGI URL","CGI URL" -"Card Verification Number","Card Verification Number" -"ChronoPay Gateway","ChronoPay Gateway" -"ChronoPay Standard","ChronoPay Standard" -"Credit Card Number","Credit Card Number" -"Credit Card Number: xxxx-%s","Credit Card Number: xxxx-%s" -"Credit Card Type","Credit Card Type" -"Credit Card Type: %s","Credit Card Type: %s" -"Credit Card Types","Credit Card Types" -"Customer Interface Language","Customer Interface Language" -"Debug","Debug" -"Dutch","Dutch" -"Enabled","Enabled" -"English","English" -"Expiration Date","Expiration Date" -"Gateway request error: %s","Gateway request error: %s" -"German","German" -"Invalid operation code.","Invalid operation code." -"Invalid response format.","Invalid response format." -"Name on Card","Name on Card" -"Name on the Card: %s","Name on the Card: %s" -"New Order Status","New Order Status" -"Order #%s","Order #%s" -"Order number will be used if left empty.","Order number will be used if left empty." -"Payment Action","Payment Action" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Please Select","Please Select" -"Product ID","Product ID" -"Russian","Russian" -"Shared Secret","Shared Secret" -"Site ID","Site ID" -"Sort Order","Sort Order" -"Specify access URL: {STORE_URL}/chronopay/standard/success in the ChronoPay client admin.","Specify access URL: {STORE_URL}/chronopay/standard/success in the ChronoPay client admin." -"The customer has successfully returned from Chronopay.","The customer has successfully returned from Chronopay." -"The customer was redirected to Chronopay.","The customer was redirected to Chronopay." -"The selected currency code (%s) is not compatible with ChronoPay.","The selected currency code (%s) is not compatible with ChronoPay." -"The transaction ID is invalid.","The transaction ID is invalid." -"Title","Title" -"Transaction Description","Transaction Description" -"What is this?","What is this?" -"You will be redirected to ChronoPay in a few seconds.","You will be redirected to ChronoPay in a few seconds." -"You will be redirected to Chronopay website when you place an order.","You will be redirected to Chronopay website when you place an order." diff --git a/app/locale/en_US/Mage_Cybermut.csv b/app/locale/en_US/Mage_Cybermut.csv deleted file mode 100644 index 7ed4ad3d8b..0000000000 --- a/app/locale/en_US/Mage_Cybermut.csv +++ /dev/null @@ -1,35 +0,0 @@ -" There was an error occurred during paying process."," There was an error occurred during paying process." -"An error has occured","An error has occured" -"An error occurred during the payment process.","An error occurred during the payment process." -"Bank","Bank" -"Credit Mutuel","Credit Mutuel" -"Customer Interface language","Customer Interface language" -"Customer has returned from Cybermut.","Customer has returned from Cybermut." -"Customer was redirected to Cybermut","Customer was redirected to Cybermut" -"Debug","Debug" -"Dutch","Dutch" -"Enabled","Enabled" -"English","English" -"French","French" -"German","German" -"Groupe CIC","Groupe CIC" -"Italian","Italian" -"Key","Key" -"New Order Status","New Order Status" -"OBC","OBC" -"Order #%s","Order #%s" -"Order number will be used if left empty.","Order number will be used if left empty." -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Returned MAC is invalid. Order cancelled.","Returned MAC is invalid. Order cancelled." -"SHA Key","SHA Key" -"Site Code","Site Code" -"Sort Order","Sort Order" -"Spain","Spain" -"TPE Number","TPE Number" -"Test Mode","Test Mode" -"The customer successfully returned from Cybermut.","The customer successfully returned from Cybermut." -"Title","Title" -"Transaction Description","Transaction Description" -"You will be redirected to Cybermut in a few seconds.","You will be redirected to Cybermut in a few seconds." -"You will be redirected to Cybermut website when you place an order.","You will be redirected to Cybermut website when you place an order." diff --git a/app/locale/en_US/Mage_Cybersource.csv b/app/locale/en_US/Mage_Cybersource.csv deleted file mode 100644 index 81f035511a..0000000000 --- a/app/locale/en_US/Mage_Cybersource.csv +++ /dev/null @@ -1,41 +0,0 @@ -"Authorization","Authorization" -"Card Verification Number","Card Verification Number" -"Credit Card Number","Credit Card Number" -"Credit Card Number: xxxx-%s","Credit Card Number: xxxx-%s" -"Credit Card Type","Credit Card Type" -"Credit Card Type: %s","Credit Card Type: %s" -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Cybersource (SOAP Toolkit)","Cybersource (SOAP Toolkit)" -"Debug","Debug" -"Enabled","Enabled" -"Error in refunding the payment.","Error in refunding the payment." -"Expiration Date","Expiration Date" -"Gateway request error: %s","Gateway request error: %s" -"Invalid transaction id or token","Invalid transaction id or token" -"Issue Number","Issue Number" -"JCB","JCB" -"Laser","Laser" -"Maestro (International)","Maestro (International)" -"Maestro/Solo(UK Domestic)","Maestro/Solo(UK Domestic)" -"Merchant ID","Merchant ID" -"Name on Card","Name on Card" -"Name on the Card: %s","Name on the Card: %s" -"New Order Status","New Order Status" -"Payment Action","Payment Action" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"SOAP extension is not enabled. Please contact us.","SOAP extension is not enabled. Please contact us." -"Sale","Sale" -"Security Key","Security Key" -"Sort Order","Sort Order" -"Start Date","Start Date" -"Switch/Solo/Maestro(UK Domestic) Only","Switch/Solo/Maestro(UK Domestic) Only" -"Switch/Solo/Maestro(UK Domestic) card issue number: %s","Switch/Solo/Maestro(UK Domestic) card issue number: %s" -"Switch/Solo/Maestro(UK Domestic) card start Date: %s/%s","Switch/Solo/Maestro(UK Domestic) card start Date: %s/%s" -"Test Mode","Test Mode" -"There is an error in processing the payment. Please try again or contact us.","There is an error in processing the payment. Please try again or contact us." -"Title","Title" -"UATP","UATP" -"What is this?","What is this?" -"Year","Year" diff --git a/app/locale/en_US/Mage_Eway.csv b/app/locale/en_US/Mage_Eway.csv deleted file mode 100644 index e7ca20b3d8..0000000000 --- a/app/locale/en_US/Mage_Eway.csv +++ /dev/null @@ -1,38 +0,0 @@ -"API Gateway URL","API Gateway URL" -"Accepted Currency","Accepted Currency" -"An error has occurred","An error has occurred" -"Card Verification Number","Card Verification Number" -"Click here to continue shopping.","Click here to continue shopping." -"Credit Card Number","Credit Card Number" -"Credit Card Number: xxxx-%s","Credit Card Number: xxxx-%s" -"Credit Card Type","Credit Card Type" -"Credit Card Type: %s","Credit Card Type: %s" -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Customer ID","Customer ID" -"Customer was redirected to eWAY.","Customer was redirected to eWAY." -"Debug Flag","Debug Flag" -"Enabled","Enabled" -"Expiration Date","Expiration Date" -"Name on Card","Name on Card" -"Name on the Card: %s","Name on the Card: %s" -"New Order Status","New Order Status" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Please Select","Please Select" -"Selected currency code (%s) is not compatible with eWAY.","Selected currency code (%s) is not compatible with eWAY." -"Sort Order","Sort Order" -"The customer has successfully returned from eWAY.","The customer has successfully returned from eWAY." -"The customer was rejected by eWAY.","The customer was rejected by eWAY." -"There has been an error processing your payment.","There has been an error processing your payment." -"There has been an error processing your payment. Please try later or contact us for help.","There has been an error processing your payment. Please try later or contact us for help." -"Title","Title" -"Use Beagle Anti-Fraud","Use Beagle Anti-Fraud" -"What is this?","What is this?" -"You will be redirected to eWAY 3D-Secure in a few seconds.","You will be redirected to eWAY 3D-Secure in a few seconds." -"You will be redirected to eWAY 3D-Secure website when you place an order.","You will be redirected to eWAY 3D-Secure website when you place an order." -"You will be redirected to eWAY in a few seconds.","You will be redirected to eWAY in a few seconds." -"You will be redirected to eWAY website when you place an order.","You will be redirected to eWAY website when you place an order." -"eWAY 3D-Secure","eWAY 3D-Secure" -"eWAY Direct","eWAY Direct" -"eWAY Shared","eWAY Shared" diff --git a/app/locale/en_US/Mage_Flo2Cash.csv b/app/locale/en_US/Mage_Flo2Cash.csv deleted file mode 100644 index 59fa4c7258..0000000000 --- a/app/locale/en_US/Mage_Flo2Cash.csv +++ /dev/null @@ -1,27 +0,0 @@ -"Account Number","Account Number" -"Card Verification Number","Card Verification Number" -"Credit Card Number","Credit Card Number" -"Credit Card Number: xxxx-%s","Credit Card Number: xxxx-%s" -"Credit Card Type","Credit Card Type" -"Credit Card Type: %s","Credit Card Type: %s" -"Credit Card Types","Credit Card Types" -"Credit Card Verification","Credit Card Verification" -"Debug Flag","Debug Flag" -"Demo Mode","Demo Mode" -"Enabled","Enabled" -"Expiration Date","Expiration Date" -"Flo2Cash Payment Web Service","Flo2Cash Payment Web Service" -"For ""Authorize"" or ""Capture"" transactions only.","For ""Authorize"" or ""Capture"" transactions only." -"For ""Purchase"" transactions only.","For ""Purchase"" transactions only." -"Name on Card","Name on Card" -"Name on the Card: %s","Name on the Card: %s" -"New Order Status","New Order Status" -"Password","Password" -"Payment Action","Payment Action" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Please Select","Please Select" -"Sort Order","Sort Order" -"Title","Title" -"Username","Username" -"What is this?","What is this?" diff --git a/app/locale/en_US/Mage_Ideal.csv b/app/locale/en_US/Mage_Ideal.csv deleted file mode 100644 index 18b5468256..0000000000 --- a/app/locale/en_US/Mage_Ideal.csv +++ /dev/null @@ -1,60 +0,0 @@ -"Absolute path to private certificate file.","Absolute path to private certificate file." -"Absolute path to private key file.","Absolute path to private key file." -"Absolute path to public payment provider certificate file.","Absolute path to public payment provider certificate file." -"An error has occurred","An error has occurred" -"An error has occurred with the transaction #%s.","An error has occurred with the transaction #%s." -"An error has occurred. You will be redirected back to store.","An error has occurred. You will be redirected back to store." -"An error occurred while processing your iDEAL transaction. Please contact the web shop or try again later. The transaction number is %s.","An error occurred while processing your iDEAL transaction. Please contact the web shop or try again later. The transaction number is %s." -"Begin to check transaction status if order was made {N} hours ago.","Begin to check transaction status if order was made {N} hours ago." -"Check Begin","Check Begin" -"Check End","Check End" -"Click here to continue shopping.","Click here to continue shopping." -"Customer has canceled payment.","Customer has canceled payment." -"Customer has successfully returned from iDEAL.","Customer has successfully returned from iDEAL." -"Customer was redirected to iDEAL. Please, check the status of the transaction via the ING iDEAL Dashboard before delivery of the goods purchased.","Customer was redirected to iDEAL. Please, check the status of the transaction via the ING iDEAL Dashboard before delivery of the goods purchased." -"Customer was rejected by iDEAL.","Customer was rejected by iDEAL." -"Debug","Debug" -"Do not check transaction status if order older than {N} days.","Do not check transaction status if order older than {N} days." -"Dutch","Dutch" -"Enabled","Enabled" -"English","English" -"Ideal: %s","Ideal: %s" -"In minutes. Minimum is 1 minute and maximum is 60.","In minutes. Minimum is 1 minute and maximum is 60." -"Issuer","Issuer" -"Issuer: %s","Issuer: %s" -"Language","Language" -"Leave empty for default value.","Leave empty for default value." -"Merchant ID","Merchant ID" -"Merchant Key","Merchant Key" -"New Order Status","New Order Status" -"Notification from iDEAL was received with status %s.","Notification from iDEAL was received with status %s." -"Notification from iDEAL was received with status %s. The invoice was created. Please check the status of a transaction via the ING iDEAL Dashboard before delivery of the goods purchased.","Notification from iDEAL was received with status %s. The invoice was created. Please check the status of a transaction via the ING iDEAL Dashboard before delivery of the goods purchased." -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Payment was canceled by the customer.","Payment was canceled by the customer." -"Please Select","Please Select" -"Private Certificate","Private Certificate" -"Private Key","Private Key" -"Private Key Password","Private Key Password" -"Required fields are missing.","Required fields are missing." -"Secure URL (production)","Secure URL (production)" -"Secure URL (test mode)","Secure URL (test mode)" -"Selected currency code (%s) is not compatible with iDEAL.","Selected currency code (%s) is not compatible with iDEAL." -"Sort Order","Sort Order" -"Store name will be used if left empty.","Store name will be used if left empty." -"Test Mode","Test Mode" -"The customer canceled payment.","The customer canceled payment." -"The customer has returned from iDEAL.","The customer has returned from iDEAL." -"The customer was redirected to iDEAL.","The customer was redirected to iDEAL." -"Title","Title" -"Transaction Description","Transaction Description" -"Transaction Expire Period","Transaction Expire Period" -"Transaction Status Update: canceled by the customer.","Transaction Status Update: canceled by the customer." -"Transaction Status Update: finished successfully.","Transaction Status Update: finished successfully." -"Transaction Status Update: rejected by iDEAL.","Transaction Status Update: rejected by iDEAL." -"You will be redirected to bank in a few seconds.","You will be redirected to bank in a few seconds." -"You will be redirected to iDEAL in a few seconds.","You will be redirected to iDEAL in a few seconds." -"You will be redirected to the website of your bank when you place an order.","You will be redirected to the website of your bank when you place an order." -"iDEAL Advanced","iDEAL Advanced" -"iDEAL Basic","iDEAL Basic" -"iDEAL Certificate","iDEAL Certificate" diff --git a/app/locale/en_US/Mage_Ogone.csv b/app/locale/en_US/Mage_Ogone.csv deleted file mode 100644 index 2dc2a4f8f0..0000000000 --- a/app/locale/en_US/Mage_Ogone.csv +++ /dev/null @@ -1,73 +0,0 @@ -" - Use in posting data from Magento to Ogone.
- Use in data checking by Ogone before the payment. - "," - Use in posting data from Magento to Ogone.
- Use in data checking by Ogone before the payment. - " -" - Use in posting data from Ogone to Magento.
- Use in feedback data checking by Magento - "," - Use in posting data from Ogone to Magento.
- Use in feedback data checking by Magento - " -"Authorization","Authorization" -"Authorization Waiting from Ogone","Authorization Waiting from Ogone" -"Authorization not known: A technical problem arose during authorization process, giving unpredictable result","Authorization not known: A technical problem arose during authorization process, giving unpredictable result" -"Background Color of Ogone Template","Background Color of Ogone Template" -"Button Background Color of the Ogone Template","Button Background Color of the Ogone Template" -"Button Text Color of the Ogone Template","Button Text Color of the Ogone Template" -"Cancelled Ogone","Cancelled Ogone" -"Debug","Debug" -"Declined Ogone","Declined Ogone" -"Declined Order on Ogone side.","Declined Order on Ogone side." -"Direct Sale","Direct Sale" -"E.g: ""Verdana"".","E.g: ""Verdana""." -"E.g: ""black"".","E.g: ""black""." -"E.g: ""white"".","E.g: ""white""." -"Enabled","Enabled" -"Exception not defined","Exception not defined" -"Font Family of the Ogone Template","Font Family of the Ogone Template" -"For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp","For production, replace ""test"" with ""prod"". Example: https://secure.ogone.com/ncol/prod/orderstandard.asp" -"Gateway URL","Gateway URL" -"Horizontally grouped logo with group name on left","Horizontally grouped logo with group name on left" -"Horizontally grouped logo with no group name","Horizontally grouped logo with no group name" -"If you choose ""No Operation"", Ogone will use default payment procedure setup in Ogone configuration.","If you choose ""No Operation"", Ogone will use default payment procedure setup in Ogone configuration." -"If you choose ""Ogone Template"", you will need to fill in all the following fields.","If you choose ""Ogone Template"", you will need to fill in all the following fields." -"Layout of Payment Methods","Layout of Payment Methods" -"Logo of the Ogone Template","Logo of the Ogone Template" -"Magento","Magento" -"Ogone","Ogone" -"Ogone Default Operation","Ogone Default Operation" -"Order can\'t save","Order can\'t save" -"PSPID","PSPID" -"Payment Action","Payment Action" -"Payment Template","Payment Template" -"Payment transaction has been declined.","Payment transaction has been declined." -"Payment uncertain: A technical problem arose during payment process, giving unpredictable result","Payment uncertain: A technical problem arose during payment process, giving unpredictable result" -"Pending Ogone","Pending Ogone" -"Please, wait a moment. This page will transfer your data to Ogone payment gateway in a few seconds.","Please, wait a moment. This page will transfer your data to Ogone payment gateway in a few seconds." -"Processed Ogone Payment","Processed Ogone Payment" -"Processed by Ogone","Processed by Ogone" -"Processing Ogone Payment","Processing Ogone Payment" -"SHA-1- OUT Signature","SHA-1- OUT Signature" -"SHA-1-IN Signature","SHA-1-IN Signature" -"Start Ogone Processing","Start Ogone Processing" -"Table Background Color of the Ogone Template","Table Background Color of the Ogone Template" -"Table Text Color of the Ogone Template","Table Text Color of the Ogone Template" -"Text Color of the Ogone Template","Text Color of the Ogone Template" -"The hash is not valid","The hash is not valid" -"The order cannot be canceled for a system reason.","The order cannot be canceled for a system reason." -"The order cannot be saved for a system reason.","The order cannot be saved for a system reason." -"The order cannot be saved.","The order cannot be saved." -"The order is not valid","The order is not valid" -"The order was canceled on ogone side.","The order was canceled on ogone side." -"Title","Title" -"Title of the Ogone Template","Title of the Ogone Template" -"URL/filename of the logo.
The URL must be absolute and stored on a secure server.","URL/filename of the logo.
The URL must be absolute and stored on a secure server." -"Unknown exception","Unknown exception" -"Verical list","Verical list" -"Waiting Authorization","Waiting Authorization" -"You can arrange the layout/list of the payment methods on Ogone payment page.","You can arrange the layout/list of the payment methods on Ogone payment page." -"You will be redirected to Ogone website when you place an order.","You will be redirected to Ogone website when you place an order." diff --git a/app/locale/en_US/Mage_Oscommerce.csv b/app/locale/en_US/Mage_Oscommerce.csv deleted file mode 100644 index 1db2261505..0000000000 --- a/app/locale/en_US/Mage_Oscommerce.csv +++ /dev/null @@ -1,128 +0,0 @@ -"%s Store","%s Store" -"About Your Order","About Your Order" -"Account Information","Account Information" -"Adapter Name","Adapter Name" -"Arabic","Arabic" -"Back","Back" -"Back to My Orders","Back to My Orders" -"Baltic","Baltic" -"Billing Address","Billing Address" -"Billing to Name","Billing to Name" -"Categories","Categories" -"Category %s cannot be saved because of %s.","Category %s cannot be saved because of %s." -"Central European","Central European" -"Check Requirements","Check Requirements" -"Comments History","Comments History" -"Create under default website","Create under default website" -"Created At","Created At" -"Currency","Currency" -"Customer Name","Customer Name" -"Customers","Customers" -"Cyrillic","Cyrillic" -"DB Name","DB Name" -"DB Password","DB Password" -"DB Username","DB Username" -"Database Connection Charset","Database Connection Charset" -"Database Data Charset","Database Data Charset" -"Date","Date" -"Delete Profile","Delete Profile" -"Delivery Address","Delivery Address" -"East Asian","East Asian" -"Edit osCommerce Profile","Edit osCommerce Profile" -"Edit osCommerce Profile :: %s","Edit osCommerce Profile :: %s" -"Email","Email" -"Email %s cannot be saved because of %s.","Email %s cannot be saved because of %s." -"Error for checking store locale!","Error for checking store locale!" -"Final Price","Final Price" -"Finished profile execution.","Finished profile execution." -"General Information","General Information" -"Greek","Greek" -"Hebrew","Hebrew" -"ID","ID" -"IP or Hostname","IP or Hostname" -"Import Options","Import Options" -"Import and Export","Import and Export" -"Importing...","Importing..." -"Items Ordered","Items Ordered" -"Japanese","Japanese" -"Korean","Korean" -"Languages table error ","Languages table error " -"Locale Selection","Locale Selection" -"My Previous Orders","My Previous Orders" -"Name","Name" -"Need to check Customers for Orders","Need to check Customers for Orders" -"New Profile","New Profile" -"New osCommerce Profile","New osCommerce Profile" -"No osCommerce profile","No osCommerce profile" -"No osCommerce profile loaded...","No osCommerce profile loaded..." -"Notice: Please place all images under MAGENTO_ROOT/media/import/ with writable permission to all files including sub folders.","Notice: Please place all images under MAGENTO_ROOT/media/import/ with writable permission to all files including sub folders." -"Order","Order" -"Order #","Order #" -"Order # %s","Order # %s" -"Order #%s failed to import because the customer ID #%s associated with this order could not be found.","Order #%s failed to import because the customer ID #%s associated with this order could not be found." -"Order Date","Order Date" -"Order Date:","Order Date:" -"Order Status","Order Status" -"Order Total","Order Total" -"Order Totals","Order Totals" -"Orders","Orders" -"Payment Information","Payment Information" -"Please check at least an option in Import Options\n","Please check at least an option in Import Options\n" -"Please check default website or input website code in General Information\n","Please check default website or input website code in General Information\n" -"Please select a timezone\n","Please select a timezone\n" -"Port (Default as 3306)","Port (Default as 3306)" -"Prefix","Prefix" -"Price","Price" -"Product","Product" -"Product Name","Product Name" -"Products","Products" -"Purchased Date","Purchased Date" -"Purchased Month","Purchased Month" -"Purchased Year","Purchased Year" -"Qty","Qty" -"Qty Ordered","Qty Ordered" -"Root Category for %s","Root Category for %s" -"Run Profile","Run Profile" -"SKU","SKU" -"SKU %s cannot be saved because of %s.","SKU %s cannot be saved because of %s." -"Sales","Sales" -"Save Profile","Save Profile" -"Save and Continue Edit","Save and Continue Edit" -"Select a Connection Charset","Select a Connection Charset" -"Select a Data Charset","Select a Data Charset" -"Select a timezone","Select a timezone" -"Select a website","Select a website" -"Send Subscription Notification to Customers","Send Subscription Notification to Customers" -"Ship To","Ship To" -"Ship to Name","Ship to Name" -"Shipping & Handling Information","Shipping & Handling Information" -"Shipping Address","Shipping Address" -"Shipping Method","Shipping Method" -"Simplified Chinese","Simplified Chinese" -"South Asian","South Asian" -"Start Running","Start Running" -"Starting profile execution, please wait...","Starting profile execution, please wait..." -"Subtotal","Subtotal" -"System","System" -"Thai","Thai" -"The data has been imported.","The data has been imported." -"The osCommerce profile has been deleted.","The osCommerce profile has been deleted." -"The osCommerce profile has been saved.","The osCommerce profile has been saved." -"This order no longer exists.","This order no longer exists." -"Timezone","Timezone" -"To import orders, Magento requires that customers also be imported.","To import orders, Magento requires that customers also be imported." -"Total imported %s records (%s)","Total imported %s records (%s)" -"Traditional Chinese","Traditional Chinese" -"Unicode","Unicode" -"Updated At","Updated At" -"View #%s","View #%s" -"View Order","View Order" -"Warning: Please do not close window during importing/exporting data.","Warning: Please do not close window during importing/exporting data." -"Website Code","Website Code" -"Western","Western" -"osCommerce","osCommerce" -"osCommerce Orders","osCommerce Orders" -"osCommerce Profile","osCommerce Profile" -"osCommerce Profiles","osCommerce Profiles" -"processed %s%% %s/%s records","processed %s%% %s/%s records" -"records","records" diff --git a/app/locale/en_US/Mage_Paybox.csv b/app/locale/en_US/Mage_Paybox.csv deleted file mode 100644 index ad178beb14..0000000000 --- a/app/locale/en_US/Mage_Paybox.csv +++ /dev/null @@ -1,106 +0,0 @@ -"--Please Select--","--Please Select--" -"AMEX","AMEX" -"AURORE","AURORE" -"Activated Key","Activated Key" -"Amount does not match.","Amount does not match." -"An error has occurred","An error has occurred" -"Authorization","Authorization" -"CARTE","CARTE" -"CB","CB" -"Cannot create the invoice.","Cannot create the invoice." -"Card Verification Number","Card Verification Number" -"Cart Type","Cart Type" -"Click here to continue shopping.","Click here to continue shopping." -"Command Line Mode","Command Line Mode" -"Credit Card Number","Credit Card Number" -"Credit Card Number: xxxx-%s","Credit Card Number: xxxx-%s" -"Credit Card Type","Credit Card Type" -"Credit Card Type: %s","Credit Card Type: %s" -"Credit Card Types","Credit Card Types" -"Customer Choise","Customer Choise" -"DEU (German)","DEU (German)" -"DINERS","DINERS" -"Debug Flag","Debug Flag" -"Delay in Displaying the Intermediary Page (in msec)","Delay in Displaying the Intermediary Page (in msec)" -"E CARD","E CARD" -"ESP (Spanish)","ESP (Spanish)" -"EUROCARD & MASTERCARD","EUROCARD & MASTERCARD" -"Enabled","Enabled" -"Error in refunding the payment","Error in refunding the payment" -"Expiration Date","Expiration Date" -"FRA (French)","FRA (French)" -"GBR (English)","GBR (English)" -"GET","GET" -"HTML Form","HTML Form" -"ITA (Italian)","ITA (Italian)" -"JCB","JCB" -"Language of the Payment Page","Language of the Payment Page" -"Management Mode of the Intermediary Page","Management Mode of the Intermediary Page" -"Mode A","Mode A" -"Mode B","Mode B" -"Mode C","Mode C" -"Mode D","Mode D" -"Mode E","Mode E" -"Mode of Retrieval of Information","Mode of Retrieval of Information" -"NLD (Dutch)","NLD (Dutch)" -"Name of the Button on the Intermediary Page","Name of the Button on the Intermediary Page" -"Name on Card","Name on Card" -"Name on the Card: %s","Name on the Card: %s" -"New Order Status","New Order Status" -"Only if the ""HTML From"" mode selected.","Only if the ""HTML From"" mode selected." -"Only with ""Command Line"" mode.","Only with ""Command Line"" mode." -"Order does not match.","Order does not match." -"PAYBOX Identifier","PAYBOX Identifier" -"PAYNOVA","PAYNOVA" -"PAYPAL","PAYPAL" -"POST","POST" -"Paybox CGI File","Paybox CGI File" -"Paybox Direct","Paybox Direct" -"Paybox System","Paybox System" -"Paybox payment gateway is not available right now","Paybox payment gateway is not available right now" -"Payment","Payment" -"Payment Action","Payment Action" -"Payment Type","Payment Type" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Ping Flag","Ping Flag" -"Please Select","Please Select" -"Rank Number","Rank Number" -"SWE (Swedish)","SWE (Swedish)" -"SYMPASS","SYMPASS" -"Screen Background of the Intermediary Page","Screen Background of the Intermediary Page" -"Site Number (TPE)","Site Number (TPE)" -"Sort Order","Sort Order" -"Specify the URL of the primary backup payment server if different from default.","Specify the URL of the primary backup payment server if different from default." -"Specify the URL of the primary payment server if different from default.","Specify the URL of the primary payment server if different from default." -"Specify the URL of the second backup payment server if different from default.","Specify the URL of the second backup payment server if different from default." -"Specify the URL of the third backup payment server if different from default.","Specify the URL of the third backup payment server if different from default." -"TCP Port","TCP Port" -"TCP port used to check the availability of a payment server if ""Ping Flag"" enabled (default port is 443).","TCP port used to check the availability of a payment server if ""Ping Flag"" enabled (default port is 443)." -"TERMINEO","TERMINEO" -"Text on the Intermediary Page","Text on the Intermediary Page" -"The URL of the Backup Payment Server","The URL of the Backup Payment Server" -"The URL of the Primary Backup Payment Server","The URL of the Primary Backup Payment Server" -"The URL of the Primary Payment Server","The URL of the Primary Payment Server" -"The URL of the Second Backup Payment Server","The URL of the Second Backup Payment Server" -"The URL of the Third Backup Payment Server","The URL of the Third Backup Payment Server" -"The customer has returned from Paybox.","The customer has returned from Paybox." -"The customer was redirected to Paybox","The customer was redirected to Paybox" -"The customer was redirected to Paybox using \'command line\' mode.","The customer was redirected to Paybox using \'command line\' mode." -"The customer was refused by Paybox.","The customer was refused by Paybox." -"The customer was rejected by Paybox.","The customer was rejected by Paybox." -"The invoice has been created.","The invoice has been created." -"The order was canceled by the customer.","The order was canceled by the customer." -"There are no orders.","There are no orders." -"There has been an error processing your payment. ","There has been an error processing your payment. " -"There has been an error processing your payment. Please try later or contact us for help.","There has been an error processing your payment. Please try later or contact us for help." -"Time-out (in seconds) to check the avalaibility of the primary backup payment server (default 10 seconds).","Time-out (in seconds) to check the avalaibility of the primary backup payment server (default 10 seconds)." -"Time-out (in seconds) to check the avalaibility of the primary payment server (default 8 seconds).","Time-out (in seconds) to check the avalaibility of the primary payment server (default 8 seconds)." -"Time-out (in seconds) to check the avalaibility of the second backup payment server (fefault 20 seconds).","Time-out (in seconds) to check the avalaibility of the second backup payment server (fefault 20 seconds)." -"Time-out (in seconds) to check the avalaibility of the third backup payment server (default 20 seconds).","Time-out (in seconds) to check the avalaibility of the third backup payment server (default 20 seconds)." -"Timeout for Checking","Timeout for Checking" -"Title","Title" -"VISA","VISA" -"What is this?","What is this?" -"You will be redirected to Paybox in a few seconds.","You will be redirected to Paybox in a few seconds." -"You will be redirected to the Paybox website when you place an order.","You will be redirected to the Paybox website when you place an order." diff --git a/app/locale/en_US/Mage_Paypal.csv b/app/locale/en_US/Mage_Paypal.csv index cfd747db9a..027b56679b 100644 --- a/app/locale/en_US/Mage_Paypal.csv +++ b/app/locale/en_US/Mage_Paypal.csv @@ -90,10 +90,6 @@ "Enable Automatic Fetching","Enable Automatic Fetching" "Enable PayPal Guest Checkout","Enable PayPal Guest Checkout" "Enabled","Enabled" -"Error in authorizing the payment.","Error in authorizing the payment." -"Error in capturing the payment.","Error in capturing the payment." -"Error in refunding the payment.","Error in refunding the payment." -"Error in retrieving the transaction.","Error in retrieving the transaction." "Event","Event" "Event Code","Event Code" "Every 10 days","Every 10 days" @@ -161,8 +157,6 @@ "Impossible to issue a refund transaction because the capture transaction does not exist.","Impossible to issue a refund transaction because the capture transaction does not exist." "Incentive","Incentive" "Initiation Date","Initiation Date" -"Invalid amount for authorization.","Invalid amount for authorization." -"Invalid transaction ID.","Invalid transaction ID." "Invoice ID","Invoice ID" "Issuer Liability","Issuer Liability" "It is recommended to set this value to ""Debit or Credit Card"" per store views.","It is recommended to set this value to ""Debit or Credit Card"" per store views." @@ -325,6 +319,7 @@ "Subscription Payment, either payment sent or payment received","Subscription Payment, either payment sent or payment received" "Subtotal","Subtotal" "Summary Text for Aggregated Cart","Summary Text for Aggregated Cart" +"Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate.","Supporting of American Express cards require additional agreement. Learn more at http://www.paypal.com/amexupdate." "Switch/Maestro","Switch/Maestro" "Test Mode","Test Mode" "The background color for the checkout page around the header and payment form.","The background color for the checkout page around the header and payment form." @@ -369,7 +364,6 @@ "Virtual PayPal Debit Card Transaction","Virtual PayPal Debit Card Transaction" "Virtual Terminal Payment","Virtual Terminal Payment" "Void","Void" -"Voided transaction.","Voided transaction." "We prefer PayPal (150 X 40)","We prefer PayPal (150 X 40)" "We prefer PayPal (150 X 60)","We prefer PayPal (150 X 60)" "Website Payments Pro","Website Payments Pro" @@ -387,7 +381,7 @@ "Wrong PayPal Express Checkout Token specified.","Wrong PayPal Express Checkout Token specified." "Yes","Yes" "Yes. Matched Address and five-didgit ZIP","Yes. Matched Address and five-didgit ZIP" -"You will be redirected to PayPal in a few seconds.","You will be redirected to PayPal in a few seconds." -"You will be redirected to PayPal website when you place an order.","You will be redirected to PayPal website when you place an order." -"You will be redirected to PayPal website.","You will be redirected to PayPal website." +"You will be redirected to the PayPal website in a few seconds.","You will be redirected to the PayPal website in a few seconds." +"You will be redirected to the PayPal website when you place an order.","You will be redirected to the PayPal website when you place an order." +"You will be redirected to the PayPal website.","You will be redirected to the PayPal website." "eBay Auction Payment","eBay Auction Payment" diff --git a/app/locale/en_US/Mage_PaypalUk.csv b/app/locale/en_US/Mage_PaypalUk.csv index 1afd66b93b..e8ec4a8a56 100644 --- a/app/locale/en_US/Mage_PaypalUk.csv +++ b/app/locale/en_US/Mage_PaypalUk.csv @@ -18,4 +18,4 @@ "View","View" "View Transaction","View Transaction" "Wrong PayPal Express Checkout Token specified.","Wrong PayPal Express Checkout Token specified." -"You will be redirected to PayPal in a few seconds.","You will be redirected to PayPal in a few seconds." +"You will be redirected to the PayPal website in a few seconds.","You will be redirected to the PayPal website in a few seconds." diff --git a/app/locale/en_US/Mage_Protx.csv b/app/locale/en_US/Mage_Protx.csv deleted file mode 100644 index 277ec1686f..0000000000 --- a/app/locale/en_US/Mage_Protx.csv +++ /dev/null @@ -1,31 +0,0 @@ -"AUTHENTICATE","AUTHENTICATE" -"An error has occurred","An error has occurred" -"Click here to continue shopping.","Click here to continue shopping." -"Customer was redirected to Protx","Customer was redirected to Protx" -"DEFERRED","DEFERRED" -"Debug","Debug" -"Enabled","Enabled" -"General contact email will be used if left empty.","General contact email will be used if left empty." -"Live","Live" -"Mode","Mode" -"New Order Status","New Order Status" -"Order total amount does not match protx gross total amount","Order total amount does not match protx gross total amount" -"PAYMENT","PAYMENT" -"Payment Action","Payment Action" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Protx Standard","Protx Standard" -"Simulator","Simulator" -"Sort Order","Sort Order" -"Store name will be used if left empty.","Store name will be used if left empty." -"Test","Test" -"The customer has returned from Protx.","The customer has returned from Protx." -"The order %s was canceled by the customer.","The order %s was canceled by the customer." -"Title","Title" -"Transaction Description","Transaction Description" -"Vendor Email","Vendor Email" -"Vendor Email Notification","Vendor Email Notification" -"Vendor Encrypted Password","Vendor Encrypted Password" -"Vendor Name","Vendor Name" -"You will be redirected to protx in a few seconds.","You will be redirected to protx in a few seconds." -"You will be redirected to the Protx website when you place an order.","You will be redirected to the Protx website when you place an order." diff --git a/app/locale/en_US/Mage_Sales.csv b/app/locale/en_US/Mage_Sales.csv index ba33f57362..816effc967 100644 --- a/app/locale/en_US/Mage_Sales.csv +++ b/app/locale/en_US/Mage_Sales.csv @@ -204,7 +204,7 @@ "From:","From:" "G.T. (Base)","G.T. (Base)" "G.T. (Purchased)","G.T. (Purchased)" -"Genereal Information","Genereal Information" +"General Information","General Information" "Get Payment Update","Get Payment Update" "Get Update","Get Update" "Get shipping methods and rates","Get shipping methods and rates" diff --git a/app/locale/en_US/Mage_SalesRule.csv b/app/locale/en_US/Mage_SalesRule.csv index 569a5a8491..be13c7c478 100644 --- a/app/locale/en_US/Mage_SalesRule.csv +++ b/app/locale/en_US/Mage_SalesRule.csv @@ -77,6 +77,7 @@ "Shipping State/Province","Shipping State/Province" "Shopping Cart Price Rule","Shopping Cart Price Rule" "Shopping Cart Price Rules","Shopping Cart Price Rules" +"Shopping Cart Price Rules based on deleted attribute ""%s"" has been disabled.","Shopping Cart Price Rules based on deleted attribute ""%s"" has been disabled." "Special Price","Special Price" "Specific Coupon","Specific Coupon" "Start at: %s","Start at: %s" diff --git a/app/locale/en_US/Mage_Strikeiron.csv b/app/locale/en_US/Mage_Strikeiron.csv deleted file mode 100644 index b4cf87accb..0000000000 --- a/app/locale/en_US/Mage_Strikeiron.csv +++ /dev/null @@ -1,47 +0,0 @@ -"%s is not a supported currency.","%s is not a supported currency." -"Accept","Accept" -"Basic","Basic" -"Cannot retrieve rate from %s to %s.","Cannot retrieve rate from %s to %s." -"Cannot retrieve rate from Strikeiron.","Cannot retrieve rate from Strikeiron." -"Check All Email Servers","Check All Email Servers" -"Complete","Complete" -"Country/Region/Postal Code Combination","Country/Region/Postal Code Combination" -"Customer Tax Class","Customer Tax Class" -"Email Verification","Email Verification" -"Enable Email Verification","Enable Email Verification" -"Enable Foreign Exchange Rate","Enable Foreign Exchange Rate" -"Enable Global Address Verification","Enable Global Address Verification" -"Enable Sales and Use Tax","Enable Sales and Use Tax" -"Enable US Address Verification","Enable US Address Verification" -"Error Address Action","Error Address Action" -"Error Email Recipient","Error Email Recipient" -"Error Email Sender","Error Email Sender" -"Error Email Template","Error Email Template" -"Foreign Exchange Rates","Foreign Exchange Rates" -"Global Address Verification","Global Address Verification" -"If type is complete and zip code belongs to multiple tax rates, choose to charge minimum tax rate or maximum tax rate.","If type is complete and zip code belongs to multiple tax rates, choose to charge minimum tax rate or maximum tax rate." -"Invalid email address.","Invalid email address." -"Maximum Tax Rate","Maximum Tax Rate" -"Minimum Tax Rate","Minimum Tax Rate" -"Password","Password" -"Pop up warning and accept","Pop up warning and accept" -"Product Tax Class","Product Tax Class" -"Reject","Reject" -"Sales and Use Tax","Sales and Use Tax" -"Sales and Use Tax Type","Sales and Use Tax Type" -"Strikeiron","Strikeiron" -"Strikeiron Config","Strikeiron Config" -"Strikeiron Section","Strikeiron Section" -"Strikeiron foreign exchange rate is disabled.","Strikeiron foreign exchange rate is disabled." -"Tax","Tax" -"The email address cannot be verified. Please check again and make sure your email address is entered correctly.","The email address cannot be verified. Please check again and make sure your email address is entered correctly." -"There are no more hits remaining for the foreign Exchange Rate Service.","There are no more hits remaining for the foreign Exchange Rate Service." -"There is an error in retrieving the tax rate. Please contact us.","There is an error in retrieving the tax rate. Please contact us." -"There is an error in verifying an email. Please contact us.","There is an error in verifying an email. Please contact us." -"There is no response back from Strikeiron server.","There is no response back from Strikeiron server." -"US Address Verification","US Address Verification" -"Undetermined Email Action","Undetermined Email Action" -"Use","Use" -"User ID","User ID" -"Verify Address in Admin","Verify Address in Admin" -"Verify Email in Admin","Verify Email in Admin" diff --git a/app/locale/en_US/template/email/strikeiron_email_warning.html b/app/locale/en_US/template/email/strikeiron_email_warning.html deleted file mode 100644 index df8cf1f1bc..0000000000 --- a/app/locale/en_US/template/email/strikeiron_email_warning.html +++ /dev/null @@ -1,10 +0,0 @@ - - -Strikeririon Email Warning: - -{{var email}} was saved into the system but having following warnings: - -{{var warnings}} \ No newline at end of file diff --git a/js/prototype/validation.js b/js/prototype/validation.js index 620bfc6168..40b973bc78 100644 --- a/js/prototype/validation.js +++ b/js/prototype/validation.js @@ -735,14 +735,13 @@ function parseNumber(v) * function validateCreditCard wich you can find above in this file */ Validation.creditCartTypes = $H({ - 'SS': [new RegExp('^((6759[0-9]{12})|(6334|6767[0-9]{12})|(6334|6767[0-9]{14,15})|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})|(633[34][0-9]{12})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], - 'SM': [new RegExp('(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], - // SO == SM - 'SO': [new RegExp('(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], - 'VI': [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true], - 'MC': [new RegExp('^5[1-5][0-9]{14}$'), new RegExp('^[0-9]{3}$'), true], - 'AE': [new RegExp('^3[47][0-9]{13}$'), new RegExp('^[0-9]{4}$'), true], - 'DI': [new RegExp('^6011[0-9]{12}$'), new RegExp('^[0-9]{3}$'), true], + 'SS': [new RegExp('^((6759[0-9]{12})|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})|(6333[0-9]{12})|(6334[0-4]\d{11})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], + 'SO': [new RegExp('^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], + 'SM': [new RegExp('(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], + 'VI': [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true], + 'MC': [new RegExp('^5[1-5][0-9]{14}$'), new RegExp('^[0-9]{3}$'), true], + 'AE': [new RegExp('^3[47][0-9]{13}$'), new RegExp('^[0-9]{4}$'), true], + 'DI': [new RegExp('^6011[0-9]{12}$'), new RegExp('^[0-9]{3}$'), true], 'JCB': [new RegExp('^(3[0-9]{15}|(2131|1800)[0-9]{11})$'), new RegExp('^[0-9]{4}$'), true], - 'OT': [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), false] + 'OT': [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), false] }); diff --git a/lib/Varien/Data/Collection/Db.php b/lib/Varien/Data/Collection/Db.php index ca541341b3..b457466644 100644 --- a/lib/Varien/Data/Collection/Db.php +++ b/lib/Varien/Data/Collection/Db.php @@ -341,14 +341,8 @@ protected function _renderFilters() /** * Add field filter to collection * - * If $attribute is an array will add OR condition with following format: - * array( - * array('attribute'=>'firstname', 'like'=>'test%'), - * array('attribute'=>'lastname', 'like'=>'test%'), - * ) - * * @see self::_getConditionSql for $condition - * @param string|array $attribute + * @param string $field * @param null|string|array $condition * @return Mage_Eav_Model_Entity_Collection_Abstract */ @@ -795,4 +789,25 @@ protected function _getCacheTags() } return array(); } + + /** + * Add filter to Map + * + * @param string $filter + * @param string $alias + * @param string $group default 'fields' + * + * @return Varien_Data_Collection_Db + */ + public function addFilterToMap($filter, $alias, $group = 'fields') + { + if (is_null($this->_map)) { + $this->_map = array($group => array()); + } else if(is_null($this->_map[$group])) { + $this->_map[$group] = array(); + } + $this->_map[$group][$filter] = $alias; + + return $this; + } } \ No newline at end of file diff --git a/pkginfo/Mage_Cybermut.txt b/pkginfo/Mage_Cybermut.txt deleted file mode 100644 index cf656b598b..0000000000 --- a/pkginfo/Mage_Cybermut.txt +++ /dev/null @@ -1 +0,0 @@ -THIS PACKAGE MOVED TO COMMUNITY CHANNEL \ No newline at end of file diff --git a/pkginfo/Mage_Paybox.txt b/pkginfo/Mage_Paybox.txt deleted file mode 100644 index cf656b598b..0000000000 --- a/pkginfo/Mage_Paybox.txt +++ /dev/null @@ -1 +0,0 @@ -THIS PACKAGE MOVED TO COMMUNITY CHANNEL \ No newline at end of file