We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit f354e475 authored by Rik ter Beek's avatar Rik ter Beek

minor fixes optimalizations

parent 1b91df43
......@@ -42,7 +42,7 @@ define(
var brandCode = ko.observable(null);
var paymentMethod = ko.observable(null);
var dfValue = ko.observable(null);
var messageComponents;
return Component.extend({
self: this,
defaults: {
......@@ -128,18 +128,9 @@ define(
document.body.appendChild(dfScriptTag);
waitForDfSet();
fullScreenLoader.stopLoader();
}
).fail(function (error) {
console.log(JSON.stringify(error));
fullScreenLoader.stopLoader();
});
// create component needs to be in initialize method
var messageComponents = {};
var paymentMethods = adyenPaymentService.getAvailablePaymentMethods();
_.map(paymentMethods, function (value) {
_.map(response, function (value) {
var messageContainer = new Messages();
var name = 'messages-' + value.brandCode;
......@@ -156,7 +147,14 @@ define(
messageComponents[name] = messageContainer;
});
this.messageComponents = messageComponents;
self.messageComponents = messageComponents;
fullScreenLoader.stopLoader();
}
).fail(function (error) {
console.log(JSON.stringify(error));
fullScreenLoader.stopLoader();
});
},
getAdyenHppPaymentMethods: function () {
var self = this;
......@@ -320,7 +318,6 @@ define(
this.isPlaceOrderActionAllowed(false);
fullScreenLoader.startLoader();
$.when(
placeOrderAction(data, messageContainer)
).fail(
......
......@@ -297,21 +297,12 @@ define(
self.expiry(true);
return true;
},
getRegion: function (name) {
self.getRegion(name);
},
getMessageName: function () {
return 'messages-' + value.reference_id;
},
getMessageContainer: function () {
return messageContainer;
},
/**
* @return {String}
*/
getBillingAddressFormName: function () {
return 'billing-address-form-' + self.item.method;
}
}
});
return paymentList;
......
......@@ -57,7 +57,7 @@
<!--/ko-->
<div class="payment-method-billing-address">
<!-- ko foreach: $parents[1].getRegion(getBillingAddressFormName()) -->
<!-- ko foreach: $parents[1].getRegion($parent.getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment