mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
✨ New services to check the onboarding status
This commit is contained in:
parent
70abceeee0
commit
11f3071579
2 changed files with 19 additions and 0 deletions
|
@ -117,6 +117,16 @@ return array(
|
|||
$settings = $container->get( 'wcgateway.settings' );
|
||||
return new State( $settings );
|
||||
},
|
||||
/**
|
||||
* Checks if the onboarding process is completed and the merchant API can be used.
|
||||
* This service is overwritten by the ppcp-settings module, when it's active.
|
||||
*/
|
||||
'settings.flag.is-connected' => static function ( ContainerInterface $container ) : bool {
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
assert( $state instanceof State );
|
||||
|
||||
return $state->current_state() >= State::STATE_ONBOARDED;
|
||||
},
|
||||
'onboarding.environment' => function( ContainerInterface $container ) : Environment {
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
return new Environment( $settings );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue