seperate state detection by production/sandbox

This commit is contained in:
David Remer 2020-09-25 11:38:22 +03:00
parent 3733576dff
commit e5a569e0a0
2 changed files with 93 additions and 24 deletions

View file

@ -1660,10 +1660,17 @@ return array(
unset( $fields['vault_enabled'] );
}
if ( $settings->has( 'merchant_email_production' ) && $settings->get( 'merchant_email_production' ) ) {
$state = $container->get('onboarding.state');
/**
* The state.
*
* @var State $state
*/
if ( State::STATE_ONBOARDED === $state->production_state() ) {
unset( $fields['ppcp_onboarding_production'] );
}
if ( $settings->has( 'merchant_email_sandbox' ) && $settings->get( 'merchant_email_sandbox' ) ) {
if ( State::STATE_ONBOARDED === $state->sandbox_state() ) {
unset( $fields['ppcp_onboarding_sandbox'] );
}