-
Notifications
You must be signed in to change notification settings - Fork 211
Subscription detached notice when viewing subscription #4393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: add/subscriptions-detached-tool
Are you sure you want to change the base?
Subscription detached notice when viewing subscription #4393
Conversation
* @return bool | ||
*/ | ||
public static function is_subscription_edit_page() { | ||
if ( apply_filters( 'wc_stripe_is_subscription_edit_page', false ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about why we are using this wc_stripe_is_subscription_edit_page
filter in 3 places and what is the thought behind introducing this filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is basically used for unit tests. For some reason, I could not overwrite the check for the page using the query params. I tried multiple ways, but none worked. So I decided to use this filter instead.
I have improved the code in e4e48e1
…iption-detached-notice
📈 PHP Unit Code Coverage Report
|
Fixes STRIPE-500
Changes proposed in this Pull Request:
As part of STRIPE-483, this PR adds a new notice to the subscription edit page in wp-admin when the subscription payment method is detached. It also includes information about the new tool introduced in #4391
Notice preview:

I am also taking the opportunity to introduce the new page helper class I created a POC for here.
Testing instructions
add/single-subscription-detached-notice
)includes/compat/class-wc-stripe-subscriptions-helper.php:53
andincludes/compat/class-wc-stripe-subscriptions-helper.php:88
)includes/compat/class-wc-stripe-subscriptions-helper.php:74
andincludes/compat/class-wc-stripe-subscriptions-helper.php:77
, also comment out the closing brackets to avoid breaking the block) ** You can also purchase subscriptions as a shopper and detach their payment method using the Stripe dashboard instead.
Changelog entry
Changelog Entry Comment
Comment
Post merge