Actually, I did it myself with an Ajax call to this PHP function I wrote…
function set_donation_amount()
{
$ret = array(
'success' => FALSE
);
$type = (isset($_POST['type']) && is_string($_POST['type'])) ? preg_replace('/[^\w_-]/', '', strtolower($_POST['type'])) : '';
$donation_form_id = (isset($_POST['form_id']) && is_numeric($_POST['form_id'])) ? intval($_POST['form_id']) : 0;
$amount = (isset($_POST['amount']) && is_numeric($_POST['amount'])) ? floatval($_POST['amount']) : 0;
switch($type)
{
case 'amount':
update_post_meta($donation_form_id, '_cf7pp_price', $amount);
$ret = array('success' => ($amount > 0), 'amount' => $amount);
break;
}
echo json_encode($ret, TRUE);
die();
}
It calls the function just before plugin requests the same amount/price information. It does the job unless two people submit at the same time.
Is there a better way, such as one of the methods in the first post?