Skip to content

Commit

Permalink
Merge pull request #23 from pronamic/22-flamingo-not-storing-submissions
Browse files Browse the repository at this point in the history
Store submissions with Flamingo when redirected for payment.
  • Loading branch information
rvdsteege authored Dec 4, 2024
2 parents ab3a1d7 + 3fd619c commit c1886c4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function init() {
\add_filter( 'wpcf7_collect_mail_tags', [ $this, 'collect_mail_tags' ] );
\add_filter( 'wpcf7_mail_tag_replaced', [ $this, 'replace_mail_tags' ], 10, 4 );
\add_filter( 'wpcf7_submission_result', [ $this, 'submission_result' ], 10, 2 );
\add_filter( 'wpcf7_flamingo_submit_if', [ $this, 'flamingo_submission_statuses' ] );

// Register tags.
new Tags\AmountTag();
Expand Down Expand Up @@ -175,6 +176,18 @@ public function submission_result( array $result, WPCF7_Submission $submission )
return $result;
}

/**
* Filter for which statuses Flamingo should store submissions.
*
* @param string[] $statuses Statuses.
* @return string[]
*/
public function flamingo_submission_statuses( array $statuses ): array {
$statuses[] = 'pronamic_pay_redirect';

return $statuses;
}

/**
* Redirect on form submit if Contact Form 7 scripts have been disabled.
*
Expand Down

0 comments on commit c1886c4

Please sign in to comment.