- This topic has 2 replies, 2 voices, and was last updated 3 years, 8 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Stripe payment plugins for your WordPress site
· ·
Home › Forums › Stripe Payments Plugin › Subscription Payments Addon: Bug in get_cancel_link
Tagged: bug
The get_cancel_link function is broken for subscriptions because it errors out if the subscription is active when instead it should be if the subscription is not active. Partial code to repro the issue with an active $subscription_id.
$asp = new ASPSUB_subscription($subscription_id);
print($asp->get_cancel_link());
The offending code is in asp-subscription-class.php:
public function get_cancel_link() {
if ( $this->cancel_url ) {
return $this->cancel_url;
}
if ( $this->is_active() ) {
$this->last_error = __( 'Subscription is not active', 'asp-sub' );
return false;
}
Hi and thank you for your report.
This is a bug indeed. Good thing is that get_cancel_link()
function you mentioned is currently used by [asp_show_my_transactions]
shortcode only, so it does not affect any other parts where the cancellation URL is used (email merge tag, subscription details page etc).
This will be fixed in the upcoming version of the Subscriptions add-on.
Subscriptions add-on version 2.0.29 has been released. It has this issue fixed.