mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 18:00:15 +08:00
Fix wrong replacements
This commit is contained in:
parent
b5e1f1530a
commit
62364d1e84
3 changed files with 11 additions and 11 deletions
|
@ -38,7 +38,7 @@ class SubscriptionsHandler {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param RenewalHandler $ppcp_renewal_handler PayPal Payments BillingPlans renewal handler.
|
||||
* @param RenewalHandler $ppcp_renewal_handler PayPal Payments Subscriptions renewal handler.
|
||||
* @param MockGateway $gateway Mock gateway instance.
|
||||
*/
|
||||
public function __construct( RenewalHandler $ppcp_renewal_handler, MockGateway $gateway ) {
|
||||
|
@ -69,7 +69,7 @@ class SubscriptionsHandler {
|
|||
/**
|
||||
* Adds a mock gateway to disguise as PPEC when needed. Hooked onto `woocommerce_payment_gateways`.
|
||||
* The mock gateway fixes display issues where subscriptions paid via PPEC appear as "via Manual Renewal" and also
|
||||
* prevents BillingPlans from automatically changing the payment method to "manual" when a subscription is edited.
|
||||
* prevents subscriptions from automatically changing the payment method to "manual" when a subscription is edited.
|
||||
*
|
||||
* @param array $gateways List of gateways.
|
||||
* @return array
|
||||
|
@ -144,14 +144,14 @@ class SubscriptionsHandler {
|
|||
return true;
|
||||
}
|
||||
|
||||
// My Account > BillingPlans.
|
||||
// My Account > Subscriptions.
|
||||
if ( is_wc_endpoint_url( 'subscriptions' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Checks that require BillingPlans.
|
||||
// Checks that require Subscriptions.
|
||||
if ( class_exists( \WC_Subscriptions::class ) ) {
|
||||
// My Account > BillingPlans > (Subscription).
|
||||
// My Account > Subscriptions > (Subscription).
|
||||
if ( wcs_is_view_subscription_page() ) {
|
||||
$subscription = wcs_get_subscription( absint( get_query_var( 'view-subscription' ) ) );
|
||||
|
||||
|
@ -183,7 +183,7 @@ class SubscriptionsHandler {
|
|||
return true;
|
||||
}
|
||||
|
||||
// Are we on the WC > BillingPlans screen?
|
||||
// Are we on the WC > Subscriptions screen?
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
$post_type = wc_clean( wp_unslash( $_GET['post_type'] ?? $_POST['post_type'] ?? '' ) );
|
||||
if ( $post_type === 'shop_subscription' ) {
|
||||
|
|
|
@ -279,7 +279,7 @@ class SubscriptionModule implements ModuleInterface {
|
|||
$subscription_plan = $product->get_meta('ppcp_subscription_plan');
|
||||
add_meta_box('ppcp_subscription', __('PayPal Subscription', 'woocommerce-paypal-payments'),
|
||||
function () use ($subscription_product, $subscription_plan) {
|
||||
echo '<label><input type="checkbox" name="ppcp_connect_subscriptions_api" checked="checked">Connect to BillingPlans API</label>';
|
||||
echo '<label><input type="checkbox" name="ppcp_connect_subscriptions_api" checked="checked">Connect to Subscriptions API</label>';
|
||||
if ($subscription_product && $subscription_plan) {
|
||||
echo '<p>Product ID: ' . esc_attr($subscription_product->id) . '</p>';
|
||||
echo '<p>Plan ID: ' . esc_attr($subscription_plan->id) . '</p>';
|
||||
|
|
|
@ -409,17 +409,17 @@ return function ( ContainerInterface $container, array $fields ): array {
|
|||
'input_class' => $container->get( 'wcgateway.settings.should-disable-fraudnet-checkbox' ) ? array( 'ppcp-disabled-checkbox' ) : array(),
|
||||
),
|
||||
'subscriptions_configuration_heading' => array(
|
||||
'heading' => __( 'BillingPlans', 'woocommerce-paypal-payments' ),
|
||||
'heading' => __( 'Subscriptions', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'ppcp-heading',
|
||||
'screens' => array(
|
||||
State::STATE_ONBOARDED,
|
||||
),
|
||||
'requirements' => array(),
|
||||
'gateway' => Settings::CONNECTION_TAB_ID,
|
||||
'description' => __( 'Configure WooCommerce BillingPlans integration with PayPal.', 'woocommerce-paypal-payments' ),
|
||||
'description' => __( 'Configure WooCommerce Subscriptions integration with PayPal.', 'woocommerce-paypal-payments' ),
|
||||
),
|
||||
'subscriptions_mode' => array(
|
||||
'title' => __( 'BillingPlans Mode', 'woocommerce-paypal-payments' ),
|
||||
'title' => __( 'Subscriptions Mode', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'select',
|
||||
'class' => array(),
|
||||
'input_class' => array( 'wc-enhanced-select' ),
|
||||
|
@ -428,7 +428,7 @@ return function ( ContainerInterface $container, array $fields ): array {
|
|||
'default' => 'vaulting_api',
|
||||
'options' => array(
|
||||
'vaulting_api' => __( 'PayPal Vaulting', 'woocommerce-paypal-payments' ),
|
||||
'subscriptions_api' => __( 'PayPal BillingPlans', 'woocommerce-paypal-payments' ),
|
||||
'subscriptions_api' => __( 'PayPal Subscriptions', 'woocommerce-paypal-payments' ),
|
||||
),
|
||||
'screens' => array(
|
||||
State::STATE_ONBOARDED,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue