Skip to content

Commit d8251c1

Browse files
committed
fixed some checkout validation issues
1 parent 9cb3a9c commit d8251c1

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

view/frontend/web/css/nofrixion-styles.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,7 @@
9696
}
9797

9898
#processing-animation {
99-
text-align: center; margin: 8rem;
99+
text-align: center;
100+
margin: 4rem;
101+
height: 40%;
100102
}

view/frontend/web/js/view/payment/method-renderer/nofrixion-bank.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ define(
33
'jquery',
44
'ko',
55
'Magento_Customer/js/model/customer',
6-
'Magento_Ui/js/model/messages',
76
'Magento_Checkout/js/view/payment/default'
87
],
9-
function ($, ko, Customer, Messages, Component) {
8+
function ($, ko, customer, Component) {
109
'use strict';
1110
var self;
1211
var baseRedirectUrl = window.checkoutConfig.payment.nofrixion.paymentRedirectUrl;
1312
var payByBankProviderId = '';
14-
//var buttonClicked = ko.observable(false);
1513
return Component.extend({
1614
defaults: {
1715
template: 'Nofrixion_Payments/payment/nofrixion-bank'
@@ -22,17 +20,19 @@ define(
2220
self = this;
2321
self.payByBankProviders = window.checkoutConfig.payment.nofrixion.payByBankProviders;
2422
},
23+
isCustomerLoggedIn: customer.isLoggedIn,
24+
isProcessing: ko.observable(false),
25+
redirectAfterPlaceOrder: false,
2526
initiatePayment: function (data, event) {
2627
payByBankProviderId = data.personalInstitutionID;
27-
self.isProcessing(true);
28-
self.placeOrder(data, event);
28+
if (self.placeOrder(data, event)) {
29+
// placeOrder returns true if form validates
30+
self.isProcessing(true);
31+
};
2932
},
3033
getPayByBankProviders: function () {
3134
return self.payByBankProviders;
3235
},
33-
isCustomerLoggedIn: Customer.isLoggedIn,
34-
isProcessing: ko.observable(false),
35-
redirectAfterPlaceOrder: false,
3636
afterPlaceOrder: function () {
3737
var url = baseRedirectUrl + '?bankId=' + encodeURIComponent(payByBankProviderId);
3838
console.log('Redirecting to : ' + url);

view/frontend/web/template/payment/nofrixion-bank.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<!-- /ko -->
3232
<!--/ko-->
3333
<div id="payment-blocks" data-bind="hidden: isProcessing()">
34+
3435
<div class="nofrixion-payment-section nofrixion-email-warning"
3536
data-bind="visible: !isPlaceOrderActionAllowed()">
3637
Email and billing address are required before proceeding with payment.
@@ -54,7 +55,9 @@
5455
<div class="nofrixion-login-prompt" data-bind="hidden: isCustomerLoggedIn">
5556
<p><strong>You are NOT logged in.</strong></p>
5657
<p>Registering an account and signing in improves the chance of your cart being restored if
57-
your financial institution has difficulties processing the payment.</p>
58+
your financial institution has difficulties processing the payment. <a class="action action-register action-help" data-bind="attr: {href: window.checkoutConfig.registerUrl}">
59+
<span data-bind="i18n: 'Create an account.'"></span>
60+
</a></p>
5861
</div>
5962
</div>
6063

0 commit comments

Comments
 (0)