Skip to content

Commit

Permalink
Merge branch 'MAGETWO-42099' into sprint70_mb
Browse files Browse the repository at this point in the history
  • Loading branch information
Yushkin, Dmytro committed Sep 2, 2015
2 parents ce23d68 + e317d07 commit 5386fa0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 1 addition & 3 deletions app/code/Magento/Payment/view/frontend/web/transparent.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
define([
"jquery",
"mage/template",
"Magento_Checkout/js/action/set-payment-information",
"jquery/ui",
"Magento_Payment/js/model/credit-card-validation/validator"
], function($, mageTemplate, setPaymentInformationAction){
], function($, mageTemplate){
'use strict';

$.widget('mage.transparent', {
Expand Down Expand Up @@ -74,7 +73,6 @@ define([
* @private
*/
_orderSave: function() {
setPaymentInformationAction();
var postData = $(this.options.paymentFormSelector).serialize();
if ($(this.options.reviewAgreementForm).length) {
postData += '&' + $(this.options.reviewAgreementForm).serialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/*global define*/
define(
[
'Magento_Payment/js/view/payment/iframe'
'jquery',
'Magento_Payment/js/view/payment/iframe',
'Magento_Checkout/js/action/set-payment-information'
],
function (Component) {
function ($, Component, setPaymentInformationAction) {
'use strict';

return Component.extend({
Expand Down Expand Up @@ -42,8 +44,14 @@ define(
},

placeOrder: function() {
var self = this;
if (this.validateHandler()) {
this.placeOrderHandler();
this.isPlaceOrderActionAllowed(false);
$.when(setPaymentInformationAction()).done(function() {
self.placeOrderHandler();
}).fail(function() {
self.isPlaceOrderActionAllowed(true);
});
}
}
});
Expand Down

0 comments on commit 5386fa0

Please sign in to comment.