Skip to content

Commit

Permalink
Fix processing delayed feeds during fulfilment for free payments, e.g…
Browse files Browse the repository at this point in the history
…. user registration for entry with discount (pronamic/wp-pronamic-pay#279).
  • Loading branch information
rvdsteege committed Feb 15, 2022
1 parent 5286629 commit fb89dba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ public function entry_post_save( $lead, $form ) {
// First payment and subscription amount are free.
( $payment->get_lines()->get_amount()->get_number()->is_zero() && $subscription_lines->get_amount()->get_number()->is_zero() )
) {
// Allow delayed feeds to be processed during fulfilment for free payments (e.g. user registration for entry with discount).
\remove_filter( 'gform_is_delayed_pre_process_feed_' . $this->form_id, array( $this, 'maybe_delay_feed' ), 10 );

$payment->set_status( PaymentStatus::SUCCESS );
$payment->save();

Expand Down

0 comments on commit fb89dba

Please sign in to comment.