From b5dd7dda2bb760b8cb8d104497ef356ca6b43618 Mon Sep 17 00:00:00 2001 From: David Parker Date: Sat, 27 Jul 2024 08:29:46 -0400 Subject: [PATCH 1/2] Fixing free orders when PPS is the set gateway --- classes/gateways/class.pmprogateway_paypalstandard.php | 5 +++++ 1 file changed, 5 insertions(+) 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(); From af75a03100a95323ff50abb481522878ac7e1302 Mon Sep 17 00:00:00 2001 From: David Parker Date: Mon, 29 Jul 2024 08:48:41 -0400 Subject: [PATCH 2/2] Fix free gateway purchases for 2Checkout --- classes/gateways/class.pmprogateway_twocheckout.php | 6 ++++++ 1 file changed, 6 insertions(+) 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();