Skip to content

Commit

Permalink
Baushop express magento 2 sporadic error during checkout with install…
Browse files Browse the repository at this point in the history
…ments (#65)

* validation for placeOrder to run only once

* version bump
  • Loading branch information
tikohov20 authored Feb 6, 2023
1 parent a4968fe commit c025bc0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mondu/magento2-payment",
"description": "Mondu payment method for magento 2",
"type": "magento2-module",
"version": "1.1.13",
"version": "1.1.14",
"license": [
"MIT"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mondu_Mondu" setup_version="1.1.13">
<module name="Mondu_Mondu" setup_version="1.1.14">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down
3 changes: 3 additions & 0 deletions view/frontend/web/js/view/payment/method-renderer/mondu.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ define([
placeOrder: function (data, event) {
var self = this;
if (!additionalValidators.validate()) return;
if(!self.isPlaceOrderActionAllowed() === true) return;
if (event) {
event.preventDefault();
}
if (self.isBillingSameAsShipping) {
quote.billingAddress(quote.shippingAddress());
}
$("body").trigger("processStart");
self.isPlaceOrderActionAllowed(false);
let payment_method;

switch (self.getCode()) {
Expand Down Expand Up @@ -159,6 +161,7 @@ define([
self.openCheckout(res.token);
return;
} else {
self.isPlaceOrderActionAllowed(true);
self.messageContainer.addErrorMessage({
message: res.message,
});
Expand Down

0 comments on commit c025bc0

Please sign in to comment.