Skip to content

Commit

Permalink
Prevent payments for subscription payment method changes from updatin…
Browse files Browse the repository at this point in the history
…g subscription status.
  • Loading branch information
rvdsteege committed Nov 12, 2024
1 parent b96d116 commit cfccc0b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Subscriptions/SubscriptionsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ public function complement_subscription_by_payment( $payment ) {
* @return void
*/
public function payment_status_update( $payment ) {
// Payment method changes do not affect the subscription status.
if ( 'subscription_payment_method_change' === $payment->get_source() ) {
return;
}

foreach ( $payment->get_subscriptions() as $subscription ) {
// Status.
$status_before = $subscription->get_status();
Expand Down

0 comments on commit cfccc0b

Please sign in to comment.