Skip to content

Commit

Permalink
Store submissions with Flamingo when redirected for payment.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Dec 4, 2024
1 parent ab3a1d7 commit 6cbdb96
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[]
*/
function flamingo_submission_statuses( array $statuses ) : array {

Check failure on line 185 in src/Extension.php

View workflow job for this annotation

GitHub Actions / phpcs / phpcs

Visibility must be declared on method "flamingo_submission_statuses"

Check failure on line 185 in src/Extension.php

View workflow job for this annotation

GitHub Actions / phpcs / phpcs

There must not be a space before the colon in a return type declaration
$statuses[] = 'pronamic_pay_redirect';

return $statuses;
}

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

0 comments on commit 6cbdb96

Please sign in to comment.