mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
feat: ( payment ) add changing payment for booking
This commit is contained in:
@@ -338,7 +338,14 @@ export class PaymentsService {
|
||||
};
|
||||
return this.prisma.paymentIntent.upsert({
|
||||
where: { bookingId },
|
||||
update: data,
|
||||
// amountMinor/currency are refreshed on update too: a cross-currency method switch
|
||||
// (e.g. Waafi/USD → Telebirr/ETB) re-initiates over the same row, and the projection
|
||||
// must reflect the currency the new provider actually charges — not the first one's.
|
||||
update: {
|
||||
...data,
|
||||
amountMinor: snapshot.amountMinor,
|
||||
currency: snapshot.currency,
|
||||
},
|
||||
create: {
|
||||
bookingId,
|
||||
amountMinor: snapshot.amountMinor,
|
||||
|
||||
Reference in New Issue
Block a user