diff --git a/modules/ppcp-compat/src/Settings/SettingsTabMapHelper.php b/modules/ppcp-compat/src/Settings/SettingsTabMapHelper.php index 3e5ccfbdb..fddb31f99 100644 --- a/modules/ppcp-compat/src/Settings/SettingsTabMapHelper.php +++ b/modules/ppcp-compat/src/Settings/SettingsTabMapHelper.php @@ -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 $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; + } }