Hi,

I have a problem that I am not sure how to fix.

I have a formstack form on my wordpress site. It allows people to buy a product. For this
particular page, there is only one item available for sale, so once the
form is processed (data sent to Formstack->Stripe and payment confirmation received),
the page needs to "turn off" so others can't purchase the item.

Before I used formstack, I used gravity forms plugin.

When the form submitted, I had a add_action filter in my functions.php in
wordpress. It fired when gravity forms completed the submission process and
ran a function that turned off the page.

Here is that code

Code:
add_action("gform_after_submission", "set_post_content", 10, 2);
function set_post_content(){

global $cfs;

$field_data = array('sold' => '1');
$post_data = array('ID' => get_the_ID()); // the ID is required
$cfs->save($field_data, $post_data);
}
I see formstack has a webhook function. My problem is I am not sure in PHP
how to say

"if formstack webhook fires, then turn run this add_action filter in
function.php in wordpress that turns off the page.."

Do you know what add_action code I need to add to my functions.php in order for formstack webhook to trigger the following code?
Code:
 
function set_post_content(){

global $cfs;

$field_data = array('sold' => '1');
$post_data = array('ID' => get_the_ID()); // the ID is required
$cfs->save($field_data, $post_data);
}