Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/284367

Change subject: Turn on client-side amount validation for new forms
......................................................................

Turn on client-side amount validation for new forms

FIXME: DRY, should this just happen as a part of validate_form?

Bug: T132959
Change-Id: I8e415a4f9ec884a0f3e0dd5037f92920123ef01f
---
M adyen_gateway/forms/js/adyen.js
M astropay_gateway/astropay.js
M worldpay_gateway/forms/js/esop.js
3 files changed, 6 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/67/284367/1

diff --git a/adyen_gateway/forms/js/adyen.js b/adyen_gateway/forms/js/adyen.js
index 7710ba3..3f21500 100644
--- a/adyen_gateway/forms/js/adyen.js
+++ b/adyen_gateway/forms/js/adyen.js
@@ -100,7 +100,7 @@
        }
 
        $( 'input[name="payment_submethod"]' ).on( 'change', function () {
-               if ( window.validate_form( document.payment ) ) {
+               if ( validateAmount() && window.validate_form( document.payment 
) ) {
                        window.displayCreditCardForm();
                } else {
                        $( '#paymentContinue' ).show();
@@ -108,7 +108,7 @@
        } );
 
        $( '#paymentContinueBtn' ).on( 'click', function () {
-               if ( window.validate_form( document.payment ) ) {
+               if ( validateAmount() && window.validate_form( document.payment 
) ) {
                        window.displayCreditCardForm();
                        // hide the continue button so that people don't get 
confused with two of them
                        $( '#paymentContinue' ).hide();
diff --git a/astropay_gateway/astropay.js b/astropay_gateway/astropay.js
index 9ad4093..1387478 100644
--- a/astropay_gateway/astropay.js
+++ b/astropay_gateway/astropay.js
@@ -9,7 +9,7 @@
        // Submit on submethod click if valid,
        // otherwise show continue button.
        $( 'input[name="payment_submethod"]' ).on( 'click', function() {
-               if ( window.validate_form( form ) ) {
+               if ( validateAmount() && window.validate_form( form ) ) {
                        submitForm();
                } else {
                        $( '#paymentContinue' ).show();
@@ -17,7 +17,7 @@
        } );
 
        $( '#paymentContinueBtn' ).click( function() {
-               if ( window.validate_form( form ) ) {
+               if ( validateAmount() && window.validate_form( form ) ) {
                        submitForm();
                }
        });
diff --git a/worldpay_gateway/forms/js/esop.js 
b/worldpay_gateway/forms/js/esop.js
index f647aa2..80b7693 100644
--- a/worldpay_gateway/forms/js/esop.js
+++ b/worldpay_gateway/forms/js/esop.js
@@ -9,14 +9,14 @@
                if ( !$( this ).hasClass( 'enabled' ) ) {
                        return false;
                }
-               if ( window.validate_form( form ) ) {
+               if ( validateAmount() && window.validate_form( form ) ) {
                        submitForm();
                }
        } );
 
        // Submit on submethod selection if valid, otherwise show continute 
button.
        $( 'input[name="payment_submethod"]' ).on( 'change', function () {
-               if ( window.validate_form( form ) ) {
+               if ( validateAmount() && window.validate_form( form ) ) {
                        submitForm();
                } else {
                        $( '#paymentContinue' ).show();

-- 
To view, visit https://gerrit.wikimedia.org/r/284367
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e415a4f9ec884a0f3e0dd5037f92920123ef01f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to