Skip to content

Commit

Permalink
Merge pull request #195 from pronamic/194-active-subscription-put-on-…
Browse files Browse the repository at this point in the history
…hold-when-first-payment-expires

Fix operator for checking subscription status on first payment attempt.
  • Loading branch information
rvdsteege authored Sep 20, 2024
2 parents 6ed60c3 + 3c8d63e commit 8f850ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Subscriptions/SubscriptionsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function payment_status_update( $payment ) {
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() ) {
if ( ! ( $subscription->is_first_payment( $payment ) && SubscriptionStatus::ACTIVE === $subscription->get_status() ) ) {
$status_update = SubscriptionStatus::ON_HOLD;
}

Expand Down

0 comments on commit 8f850ce

Please sign in to comment.