From dc44dccd827dfc00071123e52172b7ff9ea609ee Mon Sep 17 00:00:00 2001 From: adriano Date: Tue, 13 Aug 2024 10:43:32 -0300 Subject: [PATCH] feat: Upadate pyload properties to send client phone to the whatsapp official billing api --- backend/src/controllers/WhatsAppController.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/controllers/WhatsAppController.ts b/backend/src/controllers/WhatsAppController.ts index c6eea35..d6c2077 100644 --- a/backend/src/controllers/WhatsAppController.ts +++ b/backend/src/controllers/WhatsAppController.ts @@ -697,12 +697,15 @@ async function setCBP(msg_id: any, company_phone: any, client_phone: any, conver async function sendToAPIUsage(msg_id: any, company_phone: any, client_phone: any, conversation_type_category: any, ticketId: any, billable:string, pricing_model:string) { const data = JSON.stringify({ - "companyId": company_phone, + "companyId": process.env.COMPANY_ID || company_phone, + "companyPhone": company_phone, + "clientPhone": client_phone, "provider": "meta", "product": "whatsapp", "type": conversation_type_category, "msgId": msg_id, "ticketId": `${ticketId}`, + "ticketUrl": `${process.env.FRONTEND_URL}/tickets/${ticketId}`, "billable": billable, "pricing_model": pricing_model });