diff --git a/classes/gateways/class.pmprogateway_paypalstandard.php b/classes/gateways/class.pmprogateway_paypalstandard.php index ad154f7e5..dbf1d70d3 100644 --- a/classes/gateways/class.pmprogateway_paypalstandard.php +++ b/classes/gateways/class.pmprogateway_paypalstandard.php @@ -197,6 +197,11 @@ static function pmpro_checkout_before_change_membership_level($user_id, $morder) if(empty($morder)) return; + // If this isn't a PayPal Standard order, bail. + if ( 'paypalstandard' !== $morder->gateway ) { + return; + } + $morder->user_id = $user_id; $morder->saveOrder(); diff --git a/classes/gateways/class.pmprogateway_twocheckout.php b/classes/gateways/class.pmprogateway_twocheckout.php index 11009e28f..17db41d6a 100644 --- a/classes/gateways/class.pmprogateway_twocheckout.php +++ b/classes/gateways/class.pmprogateway_twocheckout.php @@ -227,6 +227,12 @@ static function pmpro_checkout_before_change_membership_level($user_id, $morder) if(empty($morder)) return; + // If this isn't a 2Checkout order, bail. + if ( 'twocheckout' !== $morder->gateway ) { + return; + } + + $morder->user_id = $user_id; $morder->saveOrder();