Extend stripe setting behavior to ppec

This commit is contained in:
Paul Dechov 2017-12-05 14:58:50 -05:00
parent d3c09a9ee5
commit 9571fa07d1
1 changed files with 4 additions and 6 deletions

View File

@ -124,25 +124,23 @@ jQuery( function( $ ) {
waitForJetpackInstall(); waitForJetpackInstall();
} ); } );
$( '.wc-wizard-services' ).on( 'change', 'input#stripe_create_account', function() { $( '.wc-wizard-services' ).on( 'change', 'input#stripe_create_account, input#ppec_paypal_reroute_requests', function() {
if ( $( this ).is( ':checked' ) ) { if ( $( this ).is( ':checked' ) ) {
$( this ).closest( '.wc-wizard-service-settings' ) $( this ).closest( '.wc-wizard-service-settings' )
.find( 'input.payment-email-input' ) .find( 'input.payment-email-input' )
.prop( 'required', true ); .prop( 'required', true );
$( this ).closest( '.wc-wizard-service-settings' ) $( this ).closest( '.wc-wizard-service-settings' )
.find( '.wc-wizard-service-setting-stripe_email' ) .find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_api_subject' )
.show(); .show();
} else { } else {
$( this ).closest( '.wc-wizard-service-settings' ) $( this ).closest( '.wc-wizard-service-settings' )
.find( 'input.payment-email-input' ) .find( 'input.payment-email-input' )
.prop( 'required', false ); .prop( 'required', false );
$( this ).closest( '.wc-wizard-service-settings' ) $( this ).closest( '.wc-wizard-service-settings' )
.find( '.wc-wizard-service-setting-stripe_email' ) .find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_api_subject' )
.hide(); .hide();
} }
} ); } ).find( 'input#stripe_create_account, input#ppec_paypal_reroute_requests' ).change();
$( '.wc-wizard-services input#stripe_create_account' ).change();
$( 'select#store_country_state' ).on( 'change', function() { $( 'select#store_country_state' ).on( 'change', function() {
var countryCode = this.value.split( ':' )[ 0 ]; var countryCode = this.value.split( ':' )[ 0 ];