Merge pull request #1396 from Tria-plc/alpha

fix: ( passenger-portal ) fix payment amount on booking confirmation
This commit is contained in:
Abubeker Yasin
2026-08-22 10:49:51 +03:00
committed by GitHub

View File

@@ -659,8 +659,13 @@ export default function ConfirmationPage() {
{(() => {
// The server-confirmed settled amount is authoritative — prefer it over
// any client-side session state, which can go stale (e.g. after a refresh).
// Despite its name, PaymentIntent.amountMinor holds MAJOR units — it is the
// charge amount produced by currencyService.*ToChargeMajor (see initiate() in
// payments.service.ts; reports.service.ts multiplies it by 100 to get real
// minor units). Do NOT divide by 100 here — the voucher does the same via
// fareIsMajorUnits.
if (_booking?.payment?.amountMinor != null) {
return `${_booking.payment.currency || 'ETB'} ${(_booking.payment.amountMinor / 100).toFixed(2)}`;
return `${_booking.payment.currency || 'ETB'} ${_booking.payment.amountMinor.toFixed(2)}`;
}
if (reviewedTotalMinor != null)
return `${paidCurrency || 'ETB'} ${(reviewedTotalMinor / 100).toFixed(2)}`;