<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Stripe Variable Payment Discount not rounding - Bug?</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Stripe Variable Payment Discount not rounding - Bug?</description>
<language>en</language>
<pubDate>Thu, 18 Jun 2026 11:28:04 +0000</pubDate>

<item>
<title>yuniar on "Stripe Variable Payment Discount not rounding - Bug?"</title>
<link>https://www.machform.com/forums/topic/stripe-variable-payment-discount-not-rounding-bug#post-23479</link>
<pubDate>Mon, 22 Jun 2015 19:52:18 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">23479@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Ahh.. you're right. This seems to be a new bug and what you did to fix it is correct. Thanks for letting us know! I'll update our code.
&#60;/p&#62;</description>
</item>
<item>
<title>timcov on "Stripe Variable Payment Discount not rounding - Bug?"</title>
<link>https://www.machform.com/forums/topic/stripe-variable-payment-discount-not-rounding-bug#post-23461</link>
<pubDate>Wed, 17 Jun 2015 15:09:01 +0000</pubDate>
<dc:creator>timcov</dc:creator>
<guid isPermaLink="false">23461@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I think I have found this glitch and does I think currently affect the v4.4 I downloaded earlier this week:&#60;br /&#62;
In payment_submit_stripe.php on line 160: &#60;code&#62;$payment_calculated_discount = round($payment_calculated_discount,2); //round to 2 digits decimal&#60;/code&#62;&#60;br /&#62;
This I think should be changed to: &#60;code&#62;$payment_calculated_discount = round($payment_calculated_discount,0); //round to 0 digits decimal&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;This is because  $payment_calculated_discount  and $charge_amount are already valued in cents not dollars. Making that change seems to have eliminated the errors I was getting.
&#60;/p&#62;</description>
</item>
<item>
<title>timcov on "Stripe Variable Payment Discount not rounding - Bug?"</title>
<link>https://www.machform.com/forums/topic/stripe-variable-payment-discount-not-rounding-bug#post-23460</link>
<pubDate>Wed, 17 Jun 2015 14:16:35 +0000</pubDate>
<dc:creator>timcov</dc:creator>
<guid isPermaLink="false">23460@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi, My problem is with v4.4 - I just upgraded from v4.2 but never used payments until now after upgrading. It isn't a new install though - so the mysql database is an upgrade from 4.2.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Stripe Variable Payment Discount not rounding - Bug?"</title>
<link>https://www.machform.com/forums/topic/stripe-variable-payment-discount-not-rounding-bug#post-23457</link>
<pubDate>Wed, 17 Jun 2015 10:29:20 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">23457@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;What is your exact MachForm version? There was some bug previously with older v4.x I think, related with this one.
&#60;/p&#62;</description>
</item>
<item>
<title>timcov on "Stripe Variable Payment Discount not rounding - Bug?"</title>
<link>https://www.machform.com/forums/topic/stripe-variable-payment-discount-not-rounding-bug#post-23452</link>
<pubDate>Tue, 16 Jun 2015 15:46:52 +0000</pubDate>
<dc:creator>timcov</dc:creator>
<guid isPermaLink="false">23452@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;My first time creating a payments form having signed up with Stripe. All good except when testing variable discount I often get a failure message such as &#34;Invalid Integer - 13495.25&#34;. Pretty sure the &#34;error&#34; is caused by Machform not rounding either the discount or the total amount (which in this case should be £134.95 being £149.95 -25%discount +20% tax = £134.95 showing on the payment screen but £134.9525 unrounded.&#60;/p&#62;
&#60;p&#62;Assuming I've assessed my issue correctly - can you suggest where I can tweak the php code to round the discount (or the total) to 2 decimal places?&#60;/p&#62;
&#60;p&#62;Fantastic product and also thank you for the recommendation of Stripe by the way (great to have a streamlined alternative to Paypal).&#60;/p&#62;
&#60;p&#62;Many Thanks,
&#60;/p&#62;</description>
</item>

</channel>
</rss>
