PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
← All changes | app/Services/CurrenciesHelper.php +9 -0 2.2.0 → 2.5.0 View file →
@@ -377,8 +377,9 @@
377 377 'SOS' => 'Sh',
378 378 'SRD' => '$',
379 379 'SSP' => '£',
380 380 'STD' => 'Db',
381 + 'SVC' => '₡',
381 382 'SYP' => 'ل.س',
382 383 'SZL' => 'L',
383 384 'THB' => '฿',
384 385 'TJS' => 'ЅМ',
@@ -427,8 +428,16 @@
427 428 'XAF' => esc_html__('Central African Cfa Franc', 'fluent-booking'),
428 429 'XOF' => esc_html__('West African Cfa Franc', 'fluent-booking'),
429 430 'XPF' => esc_html__('Cfp Franc', 'fluent-booking'),
430 431 ));
432 + }
433 +
434 + // Every money write goes through here so the ledger and the gateway cannot diverge.
435 + // Rounds rather than truncates: 2.01 * 100 is 200.99999999999997 in IEEE-754, so
436 + // intval() records 200 where the card is charged 201. Factor is 1 for zero-decimal.
437 + public static function toCents($value, $conversionFactor = 100)
438 + {
439 + return (int) round((float) $value * $conversionFactor);
431 440 }
432 441
433 442 public static function isZeroDecimal($currencyCode)
434 443 {