mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Merge pull request #1396 from Tria-plc/alpha
fix: ( passenger-portal ) fix payment amount on booking confirmation
This commit is contained in:
@@ -659,8 +659,13 @@ export default function ConfirmationPage() {
|
|||||||
{(() => {
|
{(() => {
|
||||||
// The server-confirmed settled amount is authoritative — prefer it over
|
// The server-confirmed settled amount is authoritative — prefer it over
|
||||||
// any client-side session state, which can go stale (e.g. after a refresh).
|
// 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) {
|
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)
|
if (reviewedTotalMinor != null)
|
||||||
return `${paidCurrency || 'ETB'} ${(reviewedTotalMinor / 100).toFixed(2)}`;
|
return `${paidCurrency || 'ETB'} ${(reviewedTotalMinor / 100).toFixed(2)}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user