Commit 38b20ea0 authored by Vincent Mrose's avatar Vincent Mrose 💬
Browse files

Changed afterRender trigger which fixes #8



Fixed an issue where the library did not get initialized
Signed-off-by: Vincent Mrose's avatarVincent Mrose <v.mrose@crefopay.de>
parent d48b2679
......@@ -4,9 +4,12 @@ var config = {
'Magento_Checkout/js/action/set-shipping-information': {
'Trilix_CrefoPay/js/action/set-shipping-information': true
},
'Magento_Checkout/js/model/payment-service': {
'Trilix_CrefoPay/js/model/payment-service': true
},
'Magento_Checkout/js/view/billing-address': {
'Trilix_CrefoPay/js/view/billing-address': true
},
}
}
},
map: {
......@@ -16,5 +19,5 @@ var config = {
cookies: 'Trilix_CrefoPay/js/lib/jscookie',
mask: 'Trilix_CrefoPay/js/lib/jquery.maskedinput'
}
},
}
};
......@@ -4,12 +4,12 @@ define([
'jquery',
'mage/utils/wrapper',
'Trilix_CrefoPay/js/view/payment/adapter'
], function($, wrapper, adapter) {
], function ($, wrapper, adapter) {
'use strict';
return function(targetModule){
return function (targetModule) {
var func = targetModule.setPaymentMethods;
var setPaymentMethodsWrapper = wrapper.wrap(func, function(original){
var setPaymentMethodsWrapper = wrapper.wrap(func, function (original) {
adapter.initialize();
original();
});
......
......@@ -63,11 +63,14 @@ define([
case 'error.paymentInstrument.number.field.invalid':
message = $.mage.__('error.paymentInstrument.number.field.invalid');
break;
case 'error.cvv.field.invalid':
message = $.mage.__('error.cvv.field.invalid');
break;
case 'error.paymentInstrument.cvv.field.invalid':
message = $.mage.__('error.cvv.field.invalid');
break;
default:
message = errorElement.message;
message = $.mage.__(errorElement.message);
}
return message;
}
......
......@@ -19,7 +19,7 @@
</label>
</div>
<div class="payment-method-content" data-bind="afterRender:initializeAdapter">
<div class="payment-method-content" afterRender="initializeAdapter">
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
......
......@@ -34,7 +34,7 @@
</label>
</div>
<div class="payment-method-content" data-bind="afterRender:initializeAdapter">
<div class="payment-method-content" afterRender="initializeAdapter">
<label class="label">
<span><!-- ko i18n: 'CVV'--><!-- /ko --></span>
</label>
......
......@@ -19,7 +19,7 @@
</label>
</div>
<div class="payment-method-content" data-bind="afterRender:initializeAdapter">
<div class="payment-method-content" afterRender="initializeAdapter">
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
......@@ -57,7 +57,7 @@
</div>
<div class="field text required">
<label class="label">
<span><!-- ko i18n: 'Cardholder Name.'--><!-- /ko --></span>
<span><!-- ko i18n: 'Accountholder Name.'--><!-- /ko --></span>
</label>
<div class="control">
<input style = "border: 1px solid #c2c2c2; height: 32px; width: 400px" class="hosted-date-wrap" type="text" data-crefopay="paymentInstrument.bankAccountHolder" />
......
......@@ -35,7 +35,7 @@
</label>
</div>
<div class="payment-method-content" data-bind="afterRender:initializeAdapter">
<div class="payment-method-content" afterRender="initializeAdapter">
<each args="getRegion('messages')" render=""></each>
<div class="checkout-agreements-block">
<!-- ko foreach: $parent.getRegion('before-place-order') -->
......
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