v4.8.
I have modified payment_submit_stripe.php to charge customers either the full amount or half the full amount, based on the amout of 500. So if total is greater than 500, ie, 620, then the charge would only be 310. If the total is 350, then the charge is 350. Here is the modified code portion:
//calculate payment amount
if($payment_price_type == 'fixed')
{
$charge_amount = $payment_price_amount 100; //charge in cents
}
else if($payment_price_type == 'variable')
{
$charge_amount = (double) mf_get_payment_total($dbh,$form_id,$payment_record_id,0,'live');
if($charge_amount >= '500')
{
$charge_amount = $charge_amount 100 0.50;
}else if($charge_amount <= '500')
{
$charge_amount = $charge_amount 100;
}
}
This works fine, but I need to modify it more for a date function and Im stuck.
I have a "date of event" field in my form and I would like to calulate if that date is 30 days from now or less and integrate it into the above code for this reason:
if total is > 500 and date is < 30 days, then full payment else half payment.
How do I get the value of the date field into the code?