Skip to content
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

Active subscription put "On hold" when first payment expires #194

Closed
rvdsteege opened this issue Sep 19, 2024 · 0 comments · Fixed by #195
Closed

Active subscription put "On hold" when first payment expires #194

rvdsteege opened this issue Sep 19, 2024 · 0 comments · Fixed by #195
Assignees
Labels

Comments

@rvdsteege
Copy link
Member

In internal support ticket https://secure.helpscout.net/conversation/2680320821/27602 an issue occurred with two attempts for a first payment for a new Restrict Content membership (probably by using the browser back button).

The 2nd attempt was successful and the subscription/membership was activated, but when the 1st attempt later expires, the subscription status was updated from "Active" to "On Hold" — resulting in the Restrict Content membership also being updated from the "Active" to "Pending" status.

It seems this is caused by a little bug in the core subscription module, as the SubscriptionStatus::ACTIVE === $subscription->get_status() check should use the !== operator:

case PaymentStatus::CANCELLED:
case PaymentStatus::EXPIRED:
// Set subscription status to 'On Hold' only if the subscription is not already active when processing the first payment.
if ( $subscription->is_first_payment( $payment ) && SubscriptionStatus::ACTIVE === $subscription->get_status() ) {
$status_update = SubscriptionStatus::ON_HOLD;
}
break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant