Skip to content

Commit 8fa30ec

Browse files
committed
Merge pull request magento#285 from magento-mpi/MPI-S75
[MPI] S75
2 parents 407f985 + f689c63 commit 8fa30ec

File tree

168 files changed

+4920
-4215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+4920
-4215
lines changed

app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js

+27-33
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,59 @@
55
define(
66
[
77
'jquery',
8-
'Magento_Payment/js/view/payment/iframe',
9-
'Magento_Checkout/js/action/set-payment-information',
10-
'Magento_Checkout/js/model/payment/additional-validators',
11-
'Magento_Checkout/js/model/full-screen-loader'
8+
'Magento_Payment/js/view/payment/iframe'
129
],
13-
function ($, Component, setPaymentInformationAction, additionalValidators, fullScreenLoader) {
10+
function ($, Component) {
1411
'use strict';
1512

1613
return Component.extend({
1714
defaults: {
18-
template: 'Magento_Authorizenet/payment/authorizenet-directpost'
15+
template: 'Magento_Authorizenet/payment/authorizenet-directpost',
16+
timeoutMessage: 'Sorry, but something went wrong. Please contact the seller.'
1917
},
2018
placeOrderHandler: null,
2119
validateHandler: null,
2220

23-
setPlaceOrderHandler: function(handler) {
21+
/**
22+
* @param {Object} handler
23+
*/
24+
setPlaceOrderHandler: function (handler) {
2425
this.placeOrderHandler = handler;
2526
},
2627

27-
setValidateHandler: function(handler) {
28+
/**
29+
* @param {Object} handler
30+
*/
31+
setValidateHandler: function (handler) {
2832
this.validateHandler = handler;
2933
},
3034

31-
context: function() {
35+
/**
36+
* @returns {Object}
37+
*/
38+
context: function () {
3239
return this;
3340
},
3441

35-
isShowLegend: function() {
42+
/**
43+
* @returns {Boolean}
44+
*/
45+
isShowLegend: function () {
3646
return true;
3747
},
3848

39-
getCode: function() {
49+
/**
50+
* @returns {String}
51+
*/
52+
getCode: function () {
4053
return 'authorizenet_directpost';
4154
},
4255

43-
isActive: function() {
44-
return true;
45-
},
46-
4756
/**
48-
* @override
57+
* @returns {Boolean}
4958
*/
50-
placeOrder: function () {
51-
var self = this;
52-
53-
if (this.validateHandler() && additionalValidators.validate()) {
54-
fullScreenLoader.startLoader();
55-
this.isPlaceOrderActionAllowed(false);
56-
$.when(setPaymentInformationAction(this.messageContainer, {
57-
'method': self.getCode()
58-
})).done(function () {
59-
self.placeOrderHandler().fail(function () {
60-
fullScreenLoader.stopLoader();
61-
});
62-
}).fail(function () {
63-
fullScreenLoader.stopLoader();
64-
self.isPlaceOrderActionAllowed(true);
65-
});
66-
}
59+
isActive: function () {
60+
return true;
6761
}
6862
});
6963
}

0 commit comments

Comments
 (0)