diff --git a/app/code/Magento/Backend/Model/Url.php b/app/code/Magento/Backend/Model/Url.php index 36fbfafe66974..eb4abc1c2a408 100644 --- a/app/code/Magento/Backend/Model/Url.php +++ b/app/code/Magento/Backend/Model/Url.php @@ -181,6 +181,10 @@ protected function _setRouteParams(array $data, $unsetOldParams = true) */ public function getUrl($routePath = null, $routeParams = null) { + if (filter_var($routePath, FILTER_VALIDATE_URL)) { + return $routePath; + } + $cacheSecretKey = false; if (is_array($routeParams) && isset($routeParams['_cache_secret_key'])) { unset($routeParams['_cache_secret_key']); @@ -190,6 +194,7 @@ public function getUrl($routePath = null, $routeParams = null) if (!$this->useSecretKey()) { return $result; } + $this->_setRoutePath($routePath); $routeName = $this->_getRouteName('*'); $controllerName = $this->_getControllerName(self::DEFAULT_CONTROLLER_NAME); $actionName = $this->_getActionName(self::DEFAULT_ACTION_NAME); diff --git a/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php b/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php index b833fe25752a0..66b6e0282783c 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php @@ -407,4 +407,10 @@ public function testGetSecretKeyGenerationWithRouteNameInForwardInfo() $keyFromRequest = $this->_model->getSecretKey(); $this->assertEquals($keyFromParams, $keyFromRequest); } + + public function testGetUrlWithUrlInRoutePath() + { + $routePath = 'https://localhost/index.php/catalog/product/view/id/100/?foo=bar#anchor'; + static::assertEquals($routePath, $this->_model->getUrl($routePath)); + } } diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js b/app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js index 0a28a60594c41..972114b197300 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js @@ -32,6 +32,12 @@ define( 'use strict'; return Component.extend({ redirectAfterPlaceOrder: true, + /** + * After place order callback + */ + afterPlaceOrder: function () { + // + }, isPlaceOrderActionAllowed: ko.observable(quote.billingAddress() != null), /** * Initialize view. @@ -97,7 +103,7 @@ define( $.when(placeOrder).fail(function(){ self.isPlaceOrderActionAllowed(true); - }); + }).done(this.afterPlaceOrder); return true; } return false; diff --git a/app/code/Magento/Paypal/Controller/Payflow/Form.php b/app/code/Magento/Paypal/Controller/Payflow/Form.php index 8b5f966ce8ad3..47834722d2b21 100644 --- a/app/code/Magento/Paypal/Controller/Payflow/Form.php +++ b/app/code/Magento/Paypal/Controller/Payflow/Form.php @@ -1,23 +1,25 @@ getResponse()->setHeader('P3P', 'CP="CAO PSA OUR"'); $this->_view->loadLayout(false)->renderLayout(); - $layout = $this->_view->getLayout(); } } diff --git a/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js b/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js index 85d1c701fa005..ab13dd5647ae0 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/view/payment/method-renderer/iframe-methods.js @@ -13,10 +13,20 @@ define( return Component.extend({ defaults: { - template: 'Magento_Paypal/payment/iframe-methods' + template: 'Magento_Paypal/payment/iframe-methods', + paymentReady: false }, redirectAfterPlaceOrder: false, isInAction: iframe.isInAction, + initObservable: function () { + this._super() + .observe('paymentReady'); + + return this; + }, + isPaymentReady: function () { + return this.paymentReady(); + }, /** * Get action url for payment method iframe. * @returns {String} @@ -28,6 +38,10 @@ define( * Places order in pending payment status. */ placePendingPaymentOrder: function () { + var self = this; + this.afterPlaceOrder = function () { + self.paymentReady(true); + }; if (this.placeOrder()) { this.isInAction(true); // capture all click events diff --git a/app/code/Magento/Paypal/view/frontend/web/template/payment/iframe-methods.html b/app/code/Magento/Paypal/view/frontend/web/template/payment/iframe-methods.html index 302fe41a664f6..0f3a8f23c7ddc 100644 --- a/app/code/Magento/Paypal/view/frontend/web/template/payment/iframe-methods.html +++ b/app/code/Magento/Paypal/view/frontend/web/template/payment/iframe-methods.html @@ -37,6 +37,7 @@
+ + - diff --git a/package.json b/package.json new file mode 100644 index 0000000000000..d65941df608b4 --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "Magento2", + "author": "Magento, an eBay Inc. company", + "description": "Magento2 node modules dependencies for local development", + "version": "1.0.0-beta", + "repository": { + "type": "git", + "url": "https://github.com/magento/magento2.git" + }, + "homepage": "http://magento.com/", + "devDependencies": { + "glob": "^5.0.14", + "grunt": "^0.4.5", + "grunt-autoprefixer": "^2.0.0", + "grunt-banner": "^0.4.0", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-connect": "^0.9.0", + "grunt-contrib-cssmin": "^0.10.0", + "grunt-contrib-imagemin": "^0.9.2", + "grunt-contrib-jasmine": "^0.8.1", + "grunt-contrib-less": "^0.12.0", + "grunt-contrib-watch": "^0.6.1", + "grunt-eslint": "^16.0.0", + "grunt-exec": "^0.4.6", + "grunt-jscs": "^1.8.0", + "grunt-replace": "^0.9.2", + "grunt-styledocco": "^0.1.4", + "grunt-template-jasmine-requirejs": "^0.2.3", + "grunt-text-replace": "^0.4.0", + "imagemin-svgo": "^4.0.1", + "jscs-jsdoc": "^1.1.0", + "load-grunt-config": "^0.16.0", + "morgan": "^1.5.0", + "node-minify": "^1.0.1", + "path": "^0.11.14", + "serve-static": "^1.7.1", + "strip-json-comments": "^1.0.2", + "time-grunt": "^1.0.0", + "underscore": "^1.7.0" + }, + "engines": { + "node": ">=0.10.0" + } +}