Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

@@ -709,6 +709,20 @@ class Package extends Model
return new Money( $priceOfThisPackage - $priceOfExistingPackage, $currency );
}
}
/* If the purchase is expired, charge the full amount */
if( !$purchase->active or ( $purchase->expire instanceof DateTime and $purchase->expire->getTimestamp() < time() ) )
{
$newPrice = new Money( $priceOfThisPackage, $currency );
/* If the package has a free trial, charge the renewal fee instead to stop endless free trials */
if( $newPrice->amount->isZero() )
{
return new Money( $renewalOptionsOnNewPackage['cost'][ $currency ]['amount'], $currency );
}
return new Money( $priceOfThisPackage, $currency );
}
/* It's a recurring subscription */
if ( $priceOfThisPackage >= $priceOfExistingPackage )
@@ -729,20 +743,6 @@ class Package extends Model
return new Money( 0, $currency );
case 1:
/* If the purchase is expired, charge the full amount */
if( !$purchase->active or ( $purchase->expire instanceof DateTime and $purchase->expire->getTimestamp() < time() ) )
{
$newPrice = new Money( $priceOfThisPackage, $currency );
/* If the package has a free trial, charge the renewal fee instead to stop endless free trials */
if( $newPrice->amount->isZero() )
{
return new Money( $renewalOptionsOnNewPackage['cost'][ $currency ]['amount'], $currency );
}
return new Money( $priceOfThisPackage, $currency );
}
return new Money( $priceOfThisPackage - $priceOfExistingPackage, $currency );
case 2: