Skip to content

Commit

Permalink
1.4.13: «Sometimes getting duplicate orders in checkout»: https://mag…
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jul 26, 2017
1 parent ffbbbc5 commit ef245ad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/2checkout"
,"version": "1.4.12"
,"version": "1.4.13"
,"description": "The «2Checkout» payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/2checkout"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=2.8.0", "2checkout/2checkout-php": "*"}
,"require": {"mage2pro/core": ">=2.9.10", "2checkout/2checkout-php": "*"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\TwoCheckout\\": ""}}
,"keywords": [
"2Checkout"
Expand Down
33 changes: 26 additions & 7 deletions view/frontend/web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,32 @@ define([
},
/**
* @override
* @see https://github.com/magento/magento2/blob/2.1.0/app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js#L127-L159
* @used-by https://github.com/magento/magento2/blob/2.1.0/lib/web/knockoutjs/knockout.js#L3863
* @see Df_StripeClone/main::placeOrder()
* @used-by Df_Payment/main.html:
* <button
* class="action primary checkout"
* type="submit"
* data-bind="
* click: placeOrder
* ,css: {disabled: !isPlaceOrderActionAllowed()}
* ,enable: dfIsChosen()
* "
* disabled
* >
* <span data-bind="df_i18n: 'Place Order'"></span>
* </button>
* https://github.com/mage2pro/core/blob/2.9.10/Payment/view/frontend/web/template/main.html#L57-L68
* https://github.com/magento/magento2/blob/2.1.0/lib/web/knockoutjs/knockout.js#L3863
* @param {this} _this
*/
placeOrder: function(_this) {
* @param {Event} event
*/
placeOrder: function(_this, event) {
if (event) {
event.preventDefault();
}
if (this.validate()) {
// 2017-07-26 «Sometimes getting duplicate orders in checkout»: https://mage2.pro/t/4217
this.isPlaceOrderActionAllowed(false);
/**
* 2016-05-18
* https://www.2checkout.com/documentation/payment-api/create-token
Expand All @@ -96,9 +116,8 @@ define([
// https://www.2checkout.com/documentation/payment-api/create-token
// This error code indicates that the ajax call failed.
// We recommend that you retry the token request.
_this.showErrorMessage(
200 === data.errorCode ? 'Please, try again.' : data.errorMsg
);
_this.showErrorMessage(200 === data.errorCode ? 'Please, try again.' : data.errorMsg);
_this.isPlaceOrderActionAllowed(true);
},
{
cvv: this.creditCardVerificationNumber()
Expand Down

0 comments on commit ef245ad

Please sign in to comment.