I've got a working credit card form that uses the pricing fields from 1.5RC4 and has the user enter a payment amount, then agree to a fee (it's a fee table, not a percentage), then it adds the fee to the Total field.
It's functioning perfectly but I just added this code directly to the gravityforms.js file in the middle of the gformCalculateTotalPrice function.
if(price >= 0.01 && price <= 225)price = price + 10;
else if(price >= 225.01 && price <= 450)price = price + 20;
else if(price >= 450.01 && price <= 700)price = price + 30;
else if(price >= 700.01 && price <= 925)price = price + 40;
else if(price >= 925.01 && price <= 1500)price = price + 65;
else if(price >= 1500.01 && price <= 2500)price = price + 105;
else if(price >= 2500.01 && price <= 3500)price = price + 150;
else if(price >= 3500.01 && price <= 4500)price = price + 195;
else if(price >= 4500.01 && price <= 6500)price = price + 275;
else if(price >= 6500.01 && price <= 8500)price = price + 360;
else if(price >= 8500.01 && price <= 10000)price = price + 425;
I know this is a problem when I go to do Gravity updates the file will be overwritten. So I've looked through other threads and documentation that may point how to do this the correct way using filters, hooks, etc. but I couldn't figure out the right way to do this.
Here is a link to the form, just enter a payment amount and click the "I agree to the fee" checkbox and you will see the total calculation.
https://hpaglobalrecovery.com/online-payment-form/credit-card-payment
Can anyone suggest a more proper way of doing this?
Thanks in advance.