Remove subscriptions api feature flag

This commit is contained in:
Emili Castells Guasch 2023-09-13 09:14:57 +02:00
parent 2bbd497e7c
commit b116d6cb20
6 changed files with 6 additions and 22 deletions

View file

@ -774,10 +774,6 @@ class SmartButton implements SmartButtonInterface {
* @return bool
*/
private function paypal_subscriptions_enabled(): bool {
if ( defined( 'PPCP_FLAG_SUBSCRIPTIONS_API' ) && ! PPCP_FLAG_SUBSCRIPTIONS_API ) {
return false;
}
try {
$subscriptions_mode = $this->settings->get( 'subscriptions_mode' );
} catch ( NotFoundException $exception ) {

View file

@ -163,11 +163,7 @@ class StatusReportModule implements ModuleInterface {
$had_ppec_plugin
),
),
);
// For now only show this status if PPCP_FLAG_SUBSCRIPTIONS_API is true.
if ( defined( 'PPCP_FLAG_SUBSCRIPTIONS_API' ) && PPCP_FLAG_SUBSCRIPTIONS_API ) {
$items[] = array(
array(
'label' => esc_html__( 'Subscriptions Mode', 'woocommerce-paypal-payments' ),
'exported_label' => 'Subscriptions Mode',
'description' => esc_html__( 'Whether subscriptions are active and their mode.', 'woocommerce-paypal-payments' ),
@ -176,8 +172,8 @@ class StatusReportModule implements ModuleInterface {
$settings->has( 'subscriptions_mode' ) ? (string) $settings->get( 'subscriptions_mode' ) : '',
$subscriptions_mode_settings
),
);
}
),
);
echo wp_kses_post(
$renderer->render(

View file

@ -150,14 +150,10 @@ class SubscriptionHelper {
/**
* Checks whether subscription needs subscription intent.
*
* @param string $subscription_mode The subscriptiopn mode.
* @param string $subscription_mode The subscription mode.
* @return bool
*/
public function need_subscription_intent( string $subscription_mode ): bool {
if ( defined( 'PPCP_FLAG_SUBSCRIPTIONS_API' ) && ! PPCP_FLAG_SUBSCRIPTIONS_API ) {
return false;
}
if ( $subscription_mode === 'subscriptions_api' ) {
if (
$this->current_product_is_subscription()

View file

@ -171,9 +171,7 @@ class SubscriptionModule implements ModuleInterface {
}
);
if ( defined( 'PPCP_FLAG_SUBSCRIPTIONS_API' ) && PPCP_FLAG_SUBSCRIPTIONS_API ) {
$this->subscriptions_api_integration( $c );
}
$this->subscriptions_api_integration( $c );
add_action(
'admin_enqueue_scripts',

View file

@ -881,7 +881,7 @@ return array(
),
);
if ( defined( 'PPCP_FLAG_SUBSCRIPTIONS_API' ) && ! PPCP_FLAG_SUBSCRIPTIONS_API || ! $subscription_helper->plugin_is_active() ) {
if ( ! $subscription_helper->plugin_is_active() ) {
unset( $fields['subscriptions_mode'] );
}

View file

@ -42,8 +42,6 @@ define( 'PAYPAL_INTEGRATION_DATE', '2023-08-11' );
* Initialize the plugin and its modules.
*/
function init(): void {
define( 'PPCP_FLAG_SUBSCRIPTIONS_API', apply_filters( 'ppcp_flag_subscriptions_api', getenv( 'PPCP_FLAG_SUBSCRIPTIONS_API' ) === '1' ) );
$root_dir = __DIR__;
if ( ! is_woocommerce_activated() ) {