twomice / com.joineryhq.percentagepricesetfield

Other
5 stars 10 forks source link

contribution (Stripe payment) fails when percentage field is enabled #55

Closed MtnPavlas closed 1 month ago

MtnPavlas commented 7 months ago

Cross-posting here as I'm not sure if it's % field or Stripe Pmt extension or CiviCRM core issue : (

https://lab.civicrm.org/extensions/stripe/-/issues/465

Thank you so much for any pointers.

kcristiano commented 5 months ago

adding my notes - https://lab.civicrm.org/extensions/stripe/-/issues/465#note_162573

konadave commented 4 months ago

CRM.percentagepricesetfield..calculateTotalFee doesn't take into account the hidden $1 price attached to the checkbox for the % fee. For example, a $100 donation + 3.5% fee is being calculated as $101 + 3.5% = $104.54.

Should the price option on the checkbox have an amount of $1.00 ? Setting it to $0.00 causes the UI to calculate the fee properly but I don't know what other side effects there are.

I have a code fix that subs out the extra $1 from baseTotal that seems to fix the issue.

MtnPavlas commented 3 months ago

Hello, any progress on this please? Thank you so much.

twomice commented 1 month ago

Confirmed: I can reproduce this under v1.5.2 (the current latest release). Working on a solution now. Thanks @MtnPavlas for the report!

twomice commented 1 month ago

This has been fixed by 606aa53, which also fixes "Always adding $1 and calculating based on that additional amount" (#57).

I've tested this on my own live site. If anyone here could test the latest master and report back, that would be helpful, but either way I expect to tag a new release this week.

Thanks @konadave and @kcristiano for your additional insights!

twomice commented 1 month ago

I'll go ahead and close this, as I believe it's fixed in today's release of version 1.5.3. Please feel free to re-open if you believe it still needs attention under that version. Thanks!