fix(SPG-1270): Pada Invoice/ tagihan booking tambahkan kode booking nya dan informasi booking date dan jumlah yang harus dibayarkan
parent
23b3c31810
commit
7be4c26ef2
|
@ -57,6 +57,7 @@ export class CreateBookingManager extends CreateTransactionManager {
|
|||
time: this.data.booking_date,
|
||||
id: this.data.id,
|
||||
},
|
||||
this.data.payment_total,
|
||||
`snap/v4/redirection/${this.data.payment_midtrans_token}`,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -324,10 +324,23 @@ export class WhatsappService {
|
|||
);
|
||||
}
|
||||
|
||||
async bookingRegister(data: WhatsappBookingCreate, paymentUrl: string) {
|
||||
async bookingRegister(
|
||||
data: WhatsappBookingCreate,
|
||||
total: number,
|
||||
paymentUrl: string,
|
||||
) {
|
||||
const momentDate = moment(data.time);
|
||||
const fallbackValue = momentDate.locale('id').format('dddd, DD MMMM YYYY');
|
||||
|
||||
const formattedTotal = new Intl.NumberFormat('id-ID', {
|
||||
style: 'currency',
|
||||
currency: 'IDR',
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 0,
|
||||
})
|
||||
.format(total)
|
||||
.replace('IDR', 'Rp');
|
||||
|
||||
const payload = {
|
||||
messaging_product: 'whatsapp',
|
||||
to: phoneNumberOnly(data.phone), // recipient's phone number
|
||||
|
@ -351,6 +364,16 @@ export class WhatsappService {
|
|||
parameter_name: 'booking_date',
|
||||
text: fallbackValue,
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
parameter_name: 'booking_code',
|
||||
text: data.code,
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
parameter_name: 'total',
|
||||
text: formattedTotal,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue