mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Remove subscriptions api feature flag
This commit is contained in:
parent
2bbd497e7c
commit
b116d6cb20
6 changed files with 6 additions and 22 deletions
|
@ -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 ) {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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'] );
|
||||
}
|
||||
|
||||
|
|
|
@ -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() ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue