mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
seperate state detection by production/sandbox
This commit is contained in:
parent
3733576dff
commit
e5a569e0a0
2 changed files with 93 additions and 24 deletions
|
@ -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'] );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue