mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Refactor onboarding link update endpoint refactor.
This commit is contained in:
parent
26a2b80b1b
commit
43136ecf3c
10 changed files with 168 additions and 85 deletions
|
@ -200,10 +200,12 @@ return array(
|
|||
return $ppcp_tab ? $ppcp_tab : $section;
|
||||
},
|
||||
|
||||
'wcgateway.settings' => static function ( ContainerInterface $container ): Settings {
|
||||
$default_button_locations = $container->get( 'wcgateway.button.default-locations' );
|
||||
return new Settings( $default_button_locations );
|
||||
},
|
||||
'wcgateway.settings' => SingletonDecorator::make(
|
||||
static function ( ContainerInterface $container ): Settings {
|
||||
$default_button_locations = $container->get( 'wcgateway.button.default-locations' );
|
||||
return new Settings( $default_button_locations );
|
||||
}
|
||||
),
|
||||
'wcgateway.notice.connect' => static function ( ContainerInterface $container ): ConnectAdminNotice {
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
|
|
|
@ -142,6 +142,20 @@ class PayUponInvoice {
|
|||
$this->settings->persist();
|
||||
}
|
||||
|
||||
add_filter(
|
||||
'ppcp_partner_referrals_option',
|
||||
function ( array $option ): array {
|
||||
if ( $option['valid'] ) {
|
||||
return $option;
|
||||
}
|
||||
if ( $option['field'] === 'ppcp-onboarding-pui' ) {
|
||||
$option['valid'] = true;
|
||||
$option['value'] = ( $option['value'] ? '1' : '' );
|
||||
}
|
||||
return $option;
|
||||
}
|
||||
);
|
||||
|
||||
add_filter(
|
||||
'ppcp_partner_referrals_data',
|
||||
function ( array $data ): array {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue