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();
} );
$( '.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' ) ) {
$( this ).closest( '.wc-wizard-service-settings' )
.find( 'input.payment-email-input' )
.prop( 'required', true );
$( 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();
} else {
$( this ).closest( '.wc-wizard-service-settings' )
.find( 'input.payment-email-input' )
.prop( 'required', false );
$( 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();
}
} );
$( '.wc-wizard-services input#stripe_create_account' ).change();
} ).find( 'input#stripe_create_account, input#ppec_paypal_reroute_requests' ).change();
$( 'select#store_country_state' ).on( 'change', function() {
var countryCode = this.value.split( ':' )[ 0 ];