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 Nov 11, 2021
1 parent 3095b81 commit a0df00c
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 @@ -451,6 +451,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 a0df00c

Please sign in to comment.