Skip to content

Commit

Permalink
Update Util.php
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed May 3, 2024
1 parent b15a942 commit 9a9023c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ public static function new_payment_from_rcp_gateway( $gateway ) {
$subscription = self::new_subscription_from_rcp_gateway( $gateway );

if ( null !== $subscription ) {
$new_period = $subscription->new_period();
$payment->add_subscription( $subscription );

if ( null !== $new_period ) {
$payment->add_period( $new_period );
$start_date = $subscription->get_start_date();

if ( null !== $start_date ) {
$period = $subscription->get_period_for_date( $start_date );

if ( null !== $period ) {
$payment->add_period( $period );
}
}
}

Expand Down

0 comments on commit 9a9023c

Please sign in to comment.