Skip to content

Commit

Permalink
Merge pull request #3091 from dparker1005/pps-free-order-fix
Browse files Browse the repository at this point in the history
Fixing free orders when PPS is the set gateway
  • Loading branch information
dparker1005 authored Jul 29, 2024
2 parents e5e4482 + af75a03 commit 9321277
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/gateways/class.pmprogateway_paypalstandard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 6 additions & 0 deletions classes/gateways/class.pmprogateway_twocheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 9321277

Please sign in to comment.