Skip to content

feat(ecommerce): expose PayPal vaulting as a filterable value and admin UI toggle#1

Draft
Caffe1neAdd1ct with Copilot wants to merge 1 commit into
masterfrom
copilot/tutor-lms-paypal-vaulting-alpha
Draft

feat(ecommerce): expose PayPal vaulting as a filterable value and admin UI toggle#1
Caffe1neAdd1ct with Copilot wants to merge 1 commit into
masterfrom
copilot/tutor-lms-paypal-vaulting-alpha

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown

PaypalConfig::createConfig() hardcodes save_payment_method: true with no escape hatch. Overriding it requires substituting the config class before Ollyo\PaymentHub autoloads — a timing constraint that causes fatal errors.

Two independent branches address this:

PR Alpha — copilot/tutor-lms-paypal-vaulting-alpha

Developer-facing WordPress filter. Single-file change, zero new storage.

// ecommerce/PaymentGateways/Configs/PaypalConfig.php
$enable_vaulting = apply_filters( 'tutor_paypal_enable_vaulting', true );
$config = array(
    // ...
    'save_payment_method' => $enable_vaulting,
);

Opt-out anywhere after plugins_loaded:

add_filter( 'tutor_paypal_enable_vaulting', '__return_false' );

PR Beta — copilot/tutor-lms-paypal-vaulting-beta

Admin UI toggle; no custom plugin code required.

  • OptionKeys.phpconst PAYPAL_ENABLE_VAULTING = 'tutor_paypal_enable_vaulting'
  • Settings.php — new PayPal Settings block in the Checkout panel with a toggle_switch field; default on preserves backward compatibility
  • PaypalConfig.php — reads the saved option via the constant:
    $enable_vaulting = (bool) tutor_utils()->get_option( OptionKeys::PAYPAL_ENABLE_VAULTING, true );

Both branches are independent (each based off master) and fully backward-compatible.

Copilot AI changed the title Enhancement: Add filter to safely disable PayPal vaulting feat(ecommerce): expose PayPal vaulting as a filterable value and admin UI toggle Jun 19, 2026
Copilot AI requested a review from Caffe1neAdd1ct June 19, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants