Skip to content

Commit

Permalink
Merge pull request #516 from magento-mpi/MPI-BUGFIX-S69
Browse files Browse the repository at this point in the history
[MPI] Bugfixes S69
  • Loading branch information
dkvashninbay committed Aug 11, 2015
2 parents 3e3cf7c + 3bb20e7 commit f10ac7d
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 8 deletions.
5 changes: 5 additions & 0 deletions app/code/Magento/Backend/Model/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/Backend/Test/Unit/Model/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -97,7 +103,7 @@ define(

$.when(placeOrder).fail(function(){
self.isPlaceOrderActionAllowed(true);
});
}).done(this.afterPlaceOrder);
return true;
}
return false;
Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Paypal/Controller/Payflow/Form.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<?php
/**
*
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Paypal\Controller\Payflow;

class Form extends \Magento\Paypal\Controller\Payflow
use Magento\Paypal\Controller\Payflow;

/**
* Class Form
*/
class Form extends Payflow
{
/**
* Submit transaction to Payflow getaway into iframe
*
* @return void
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function execute()
{
$this->getResponse()->setHeader('P3P', 'CP="CAO PSA OUR"');
$this->_view->loadLayout(false)->renderLayout();
$layout = $this->_view->getLayout();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<div id="iframe-warning" class="message notice">
<div><!-- ko i18n: 'Please do not refresh the page until you complete payment.' --><!-- /ko --></div>
</div>
<!-- ko if: isPaymentReady() -->
<iframe data-bind="attr: {id: getCode() + '-iframe', src: getActionUrl()}"
data-container="paypal-iframe"
class="paypal iframe"
Expand All @@ -45,9 +46,9 @@
border="0"
height="610"
width="100%"
>
>
</iframe>
<!-- /ko -->
</div>
</div>
</div>

44 changes: 44 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit f10ac7d

Please sign in to comment.