-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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:
wp-pay-core/src/Subscriptions/SubscriptionsModule.php
Lines 165 to 172 in 6ed60c3
| 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; |
Metadata
Metadata
Assignees
Labels
Type
Projects
Status