mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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
|
@ -147,6 +147,19 @@ class ApplePayButton implements ButtonInterface {
|
|||
*/
|
||||
public function initialize(): void {
|
||||
add_filter( 'ppcp_onboarding_options', array( $this, 'add_apple_onboarding_option' ), 10, 1 );
|
||||
add_filter(
|
||||
'ppcp_partner_referrals_option',
|
||||
function ( array $option ): array {
|
||||
if ( $option['valid'] ) {
|
||||
return $option;
|
||||
}
|
||||
if ( $option['field'] === 'ppcp-onboarding-apple' ) {
|
||||
$option['valid'] = true;
|
||||
$option['value'] = ( $option['value'] ? '1' : '' );
|
||||
}
|
||||
return $option;
|
||||
}
|
||||
);
|
||||
add_filter(
|
||||
'ppcp_partner_referrals_data',
|
||||
function ( array $data ): array {
|
||||
|
@ -206,7 +219,7 @@ class ApplePayButton implements ButtonInterface {
|
|||
$checked = '';
|
||||
}
|
||||
|
||||
return $options . '<li><label><input type="checkbox" id="ppcp-onboarding-apple" ' . $checked . '> ' .
|
||||
return $options . '<li><label><input type="checkbox" id="ppcp-onboarding-apple" ' . $checked . ' data-onboarding-option="ppcp-onboarding-apple"> ' .
|
||||
__( 'Onboard with ApplePay', 'woocommerce-paypal-payments' ) . '
|
||||
</label></li>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue