mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix the "Pay Now Experience" mapping value
This commit is contained in:
parent
a71f687bcf
commit
c1b1f47bbe
1 changed files with 19 additions and 0 deletions
|
@ -64,6 +64,9 @@ class SettingsTabMapHelper {
|
|||
case 'intent':
|
||||
return $this->mapped_intent_value( $settings_model );
|
||||
|
||||
case 'blocks_final_review_enabled':
|
||||
return $this->mapped_pay_now_value( $settings_model );
|
||||
|
||||
default:
|
||||
return $settings_model[ $new_key ] ?? null;
|
||||
}
|
||||
|
@ -122,4 +125,20 @@ class SettingsTabMapHelper {
|
|||
|
||||
return $authorize_only ? 'AUTHORIZE' : 'CAPTURE';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the mapped value for the "Pay Now Experience" from the new settings.
|
||||
*
|
||||
* @param array<string, scalar|array> $settings_model The new settings model data as an array.
|
||||
* @return bool|null The mapped 'Pay Now Experience' setting value.
|
||||
*/
|
||||
protected function mapped_pay_now_value( array $settings_model ): ?bool {
|
||||
$enable_pay_now = $settings_model['enable_pay_now'] ?? null;
|
||||
|
||||
if ( is_null( $enable_pay_now ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ! $enable_pay_now;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue