Compare commits

...

2 Commits

19 changed files with 64547 additions and 419 deletions

69
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,69 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
},
{
"name": "Launch built-in server and Debug",
"type": "php",
"request": "launch",
"noDebug": false,
"runtimeArgs": [
"-S",
"localhost:8000",
"-t",
"."
],
"cwd": "${workspaceRoot}/.",
"serverReadyAction": {
"action": "openExternally"
}
},
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 KiB

After

Width:  |  Height:  |  Size: 429 KiB

0
comprobantes/Comprobante_Edward_Elric.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 419 KiB

After

Width:  |  Height:  |  Size: 419 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 KiB

After

Width:  |  Height:  |  Size: 426 KiB

View File

@ -1 +1 @@
{"ipserver":"172.16.5.134","apitoken":"6abef18c-783d-4dd0-b530-be6e6a7bbd1d","tokencallbell":"g8thcZkXGd3xBj2g3TtYNYFMH1fuesbJ.b6a940ea7d78cf6c9e42f067b21c8ddf96e9fa2a9e307bfd0c7c7c4d7fa38f79","tokenstripe":"sk_test_51OkG0REFY1WEUtgRH6UxBK5pu80Aq5Iy8EcdPnf0cOWzuVLQTpyLCd7CbPzqMsWMafZOHElCxhEHF7g8boURjWlJ00tBwE0W1M","unmsApiToken":null,"hostServerFTP":"siip.mx","usernameServerFTP":"siip0001","passServerFTP":"$spGiT,[wa)n","cashPaymentMethodId":false,"courtesyPaymentMethodId":false,"bankTransferPaymentMethodId":true,"paypalPaymentMethodId":true,"creditCardPaypalPaymentMethodId":true,"creditCardStripePaymentMethodId":true,"stripeSubscriptionCreditCardPaymentMethodId":true,"paypalSubscriptionPaymentMethodId":true,"mercadopagoPaymentMethodId":true,"checkPaymentMethodId":true,"customPaymentMethodId":true,"notificationTypeText":false,"dataInstallersWhatsApp":"{ \"instaladores\": [{\"ID\": 1015, \"nombre\": \"Daniel Peña, \"whatsapp\": 4181878106}, {\"ID\": 1020, \"nombre\": \"Angel Arvizu\", \"whatsapp\": 4123456789}, {\"ID\": 1035,\"nombre\": \"Juan Rostro, \"whatsapp\": 4198765432}] }","debugMode":true,"logging_level":true}
{"ipserver":"172.16.5.134","apitoken":"6abef18c-783d-4dd0-b530-be6e6a7bbd1d","tokencallbell":"g8thcZkXGd3xBj2g3TtYNYFMH1fuesbJ.b6a940ea7d78cf6c9e42f067b21c8ddf96e9fa2a9e307bfd0c7c7c4d7fa38f79","tokenstripe":"sk_test_51OkG0REFY1WEUtgRH6UxBK5pu80Aq5Iy8EcdPnf0cOWzuVLQTpyLCd7CbPzqMsWMafZOHElCxhEHF7g8boURjWlJ00tBwE0W1M","unmsApiToken":null,"hostServerFTP":"siip.mx","usernameServerFTP":"siip0001","passServerFTP":"$spGiT,[wa)n","cashPaymentMethodId":false,"courtesyPaymentMethodId":false,"bankTransferPaymentMethodId":true,"paypalPaymentMethodId":true,"creditCardPaypalPaymentMethodId":true,"creditCardStripePaymentMethodId":true,"stripeSubscriptionCreditCardPaymentMethodId":true,"paypalSubscriptionPaymentMethodId":true,"mercadopagoPaymentMethodId":true,"checkPaymentMethodId":true,"customPaymentMethodId":true,"notificationTypeText":false,"installersDataWhatsApp":"{\r\n \"instaladores\": [\r\n {\r\n \"id\": 1019,\r\n \"nombre\": \"Mucio Robledo\",\r\n \"whatsapp\": \"4181878106\"\r\n },\r\n {\r\n \"id\": 1173,\r\n \"nombre\": \"Angel Arvizu\",\r\n \"whatsapp\": \"4181878106\"\r\n },\r\n {\r\n \"id\": 1172,\r\n \"nombre\": \"Juan Rostro\",\r\n \"whatsapp\": \"4181878106\"\r\n },\r\n {\r\n \"id\": 1015,\r\n \"nombre\": \"Daniel Humberto\",\r\n \"whatsapp\": \"4181878106\"\r\n }\r\n ]\r\n}","debugMode":true,"logging_level":true}

View File

@ -1,301 +1,466 @@
[2025-01-10 18:05:53.941663] [notice] Logging level set to:debug
[2025-01-10 18:05:53.942004] [debug] El valor de webhook_string: {"type":"oxxo.request","client_id":2,"amount":310}
[2025-01-10 18:05:53.942078] [info] Evento de referencia de oxxo recibido
[2025-01-10 18:05:53.942130] [info] Creando referencia del cliente para OXXO:
[2025-01-24 3:49:18.309273] [notice] Logging level set to:debug
[2025-01-24 3:49:18.333165] [debug] valor el evento recibido por webhook: job.edit
[2025-01-10 18:07:52.605911] [notice] Logging level set to:debug
[2025-01-10 18:07:52.606019] [debug] El valor de webhook_string: {"type":"oxxo.request","client_id":2,"amount":310}
[2025-01-24 3:49:18.333333] [debug] Valor de JSON: {"uuid":"2f02ac4a-f928-4f68-ac5e-472ba1ed23dc","changeType":"edit","entity":"job","entityId":"23","eventName":"job.edit","extraData":{"entity":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1172,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]},"entityBeforeEdit":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1173,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]}}}
[2025-01-10 18:07:52.606035] [info] Evento de referencia de oxxo recibido
[2025-01-24 3:49:18.333591] [debug] Se actualiza un trabajo
[2025-01-10 18:07:52.606045] [info] Referencia persnoalizada, Valor del monto: 310
[2025-01-24 3:49:18.333623] [debug] Valor de json_data: {"uuid":"2f02ac4a-f928-4f68-ac5e-472ba1ed23dc","changeType":"edit","entity":"job","entityId":"23","eventName":"job.edit","extraData":{"entity":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1172,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]},"entityBeforeEdit":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1173,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]}}}
[2025-01-24 3:49:18.333635] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 3:49:18.333645] [debug] Los datos entityBeforeEdit y entity contienen el campo assignedUserId
[2025-01-24 3:49:18.333679] [debug] El campo assignedUserId cambió de un valor a otro y la fecha no cambió
[2025-01-24 3:49:18.333703] [debug] Valor de $jsonNotificationData en verifyJobActionToDo: {"uuid":"2f02ac4a-f928-4f68-ac5e-472ba1ed23dc","changeType":"edit","entity":"job","entityId":"23","eventName":"job.edit","extraData":{"entity":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1172,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]},"entityBeforeEdit":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1173,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]}}}
[2025-01-10 18:07:52.606055] [info] Creando referencia del cliente para OXXO:
[2025-01-24 3:49:18.333718] [debug] Valor de $clientId en verifyJobActionToDo: 2
[2025-01-10 18:07:52.741453] [info] Monto proporcionado directamente: 310
[2025-01-24 3:49:18.333725] [debug] Valor de $installerId en verifyJobActionToDo: 1172
[2025-01-10 18:07:52.741590] [info] Creando referencia en Stripe por: 31000
[2025-01-24 3:49:18.333733] [debug] Valor de $jobId en verifyJobActionToDo: 23
[2025-01-10 18:07:53.363145] [info] Creando payment methods del voucher
[2025-01-24 3:49:18.333786] [debug] Valor de $installersData en verifyJobActionToDo: {
"instaladores": [
{
"id": 1019,
"nombre": "Mucio Robledo",
"whatsapp": "4181878106"
},
{
"id": 1173,
"nombre": "Angel Arvizu",
"whatsapp": "4181878106"
},
{
"id": 1172,
"nombre": "Juan Rostro",
"whatsapp": "4181878106"
},
{
"id": 1015,
"nombre": "Daniel Humberto",
"whatsapp": "4181878106"
}
]
}
[2025-01-10 18:07:53.640343] [info] Confirmando el paymentIntent
[2025-01-24 3:49:18.366851] [debug] Valor de $usersInstallers en verifyJobActionToDo: {"id":1172,"unmsId":"2ac31363-6037-40f3-8196-5cc7c71866b0","email":"amazonrostro@gmail.com","firstName":"Juan","lastName":"Rostro","username":"rostro","avatarColor":"#00695c","isActive":true}
[2025-01-10 18:07:54.403819] [info] Se terminó de confirmar el paymentIntent
[2025-01-24 3:49:18.366909] [debug] tipo de dato de installerWhatsApp: string
[2025-01-10 18:07:54.404211] [info] Referencia OXXO: 12345678901234657890123456789012
[2025-01-24 3:49:18.366920] [debug] Número de WhatsApp del Instalador: 4181878106
[2025-01-10 18:07:54.404366] [info] URL del recibo: https://payments.stripe.com/oxxo/voucher/test_YWNjdF8xT2tHMFJFRlkxV0VVdGdSLF9SWXVSR2VEQzYwZElqdGdjOE4wVUlpcE5MY1VmeEJ001003GOIe43u
[2025-01-24 3:49:18.398832] [debug] Valor de $usersInstallers {"id":1172,"unmsId":"2ac31363-6037-40f3-8196-5cc7c71866b0","email":"amazonrostro@gmail.com","firstName":"Juan","lastName":"Rostro","username":"rostro","avatarColor":"#00695c","isActive":true}
[2025-01-10 18:07:54.405272] [debug] Reponse que se envía a CallBell: {"url": "https://payments.stripe.com/oxxo/voucher/test_YWNjdF8xT2tHMFJFRlkxV0VVdGdSLF9SWXVSR2VEQzYwZElqdGdjOE4wVUlpcE5MY1VmeEJ001003GOIe43u"}
[2025-01-10 18:07:54.405514] [error] JSON error: No error
[2025-01-10 18:07:54.405670] [debug] HTTP request processing ended.
[2025-01-10 18:10:10.583622] [notice] Logging level set to:debug
[2025-01-10 18:10:10.586545] [debug] El valor de webhook_string: {"id":"evt_1QfmesEFY1WEUtgR7TgS1zyu","object":"event","api_version":"2023-10-16","created":1736532609,"data":{"object":{"id":"ccsbtxn_1QfmerEFY1WEUtgRwLLwoX9O","object":"customer_cash_balance_transaction","created":1736532609,"currency":"mxn","customer":"cus_PetN1dhr4rx0kX","ending_balance":213000,"funded":{"bank_transfer":{"reference":"","type":"mx_bank_transfer"}},"livemode":false,"net_amount":23000,"type":"funded"}},"livemode":false,"pending_webhooks":2,"request":{"id":"req_7zPOXTISfYQhwn","idempotency_key":"9eaedb86-ddbe-44b4-99da-ca33cf716ee6"},"type":"customer_cash_balance_transaction.created"}
[2025-01-24 3:49:18.398873] [debug] Valor de $installerFullName: Juan Rostro
[2025-01-10 18:10:10.586699] [info] Evento de transfencia al cliente encontrado
[2025-01-10 18:10:10.586956] [info] Valor del EventJSON: {"id":"evt_1QfmesEFY1WEUtgR7TgS1zyu","object":"event","api_version":"2023-10-16","created":1736532609,"data":{"object":{"id":"ccsbtxn_1QfmerEFY1WEUtgRwLLwoX9O","object":"customer_cash_balance_transaction","created":1736532609,"currency":"mxn","customer":"cus_PetN1dhr4rx0kX","ending_balance":213000,"funded":{"bank_transfer":{"reference":"","type":"mx_bank_transfer"}},"livemode":false,"net_amount":23000,"type":"funded"}},"livemode":false,"pending_webhooks":2,"request":{"id":"req_7zPOXTISfYQhwn","idempotency_key":"9eaedb86-ddbe-44b4-99da-ca33cf716ee6"},"type":"customer_cash_balance_transaction.created"}
[2025-01-24 3:49:18.486335] [debug] Valor de $arrayClientCRM en verifyJobActionToDo: {"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}
[2025-01-10 18:10:10.676408] [notice] Logging level set to:debug
[2025-01-10 18:10:10.676522] [debug] El valor de webhook_string: {"id":"evt_1QfmesEFY1WEUtgRRcOXRF2K","object":"event","api_version":"2023-10-16","created":1736532609,"data":{"object":{"object":"cash_balance","available":{"mxn":213000},"customer":"cus_PetN1dhr4rx0kX","livemode":false,"settings":{"reconciliation_mode":"automatic","using_merchant_default":true}}},"livemode":false,"pending_webhooks":2,"request":{"id":"req_7zPOXTISfYQhwn","idempotency_key":"9eaedb86-ddbe-44b4-99da-ca33cf716ee6"},"type":"cash_balance.funds_available"}
[2025-01-24 3:49:18.486388] [debug] Dirección completa: Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México
[2025-01-10 18:10:10.676562] [error] JSON error: No error
[2025-01-10 18:10:10.676575] [debug] HTTP request processing ended.
[2025-01-10 18:10:12.738172] [info] PaymentIntent creado: pi_3QfmetEFY1WEUtgR0xHkzs5q
[2025-01-24 3:49:18.486402] [debug] URL de Google Maps: https://www.google.com/maps?q=21.1564209,-100.9384185
[2025-01-10 18:10:12.738810] [error] JSON error: No error
[2025-01-10 18:10:12.739032] [debug] HTTP request processing ended.
[2025-01-10 18:10:13.246512] [notice] Logging level set to:debug
[2025-01-10 18:10:13.246690] [debug] El valor de webhook_string: {"id":"evt_1QfmeuEFY1WEUtgRGAYZ8dre","object":"event","api_version":"2023-10-16","created":1736532611,"data":{"object":{"id":"ccsbtxn_1QfmetEFY1WEUtgRnBbOkFZ3","object":"customer_cash_balance_transaction","applied_to_payment":{"payment_intent":"pi_3QfmetEFY1WEUtgR0xHkzs5q"},"created":1736532611,"currency":"mxn","customer":"cus_PetN1dhr4rx0kX","ending_balance":190000,"livemode":false,"net_amount":-23000,"type":"applied_to_payment"}},"livemode":false,"pending_webhooks":2,"request":{"id":"req_4nXY7qRwVRIJg9","idempotency_key":"d90780a1-8d32-464e-a74e-1a024edf55cd"},"type":"customer_cash_balance_transaction.created"}
[2025-01-24 3:49:18.486481] [debug] Valor de $arrayPhones en verifyJobActionToDo: {"WhatsNotifica":"4181148783"}
[2025-01-10 18:10:13.246751] [info] Evento de transfencia al cliente encontrado
[2025-01-10 18:10:13.246808] [info] Valor del EventJSON: {"id":"evt_1QfmeuEFY1WEUtgRGAYZ8dre","object":"event","api_version":"2023-10-16","created":1736532611,"data":{"object":{"id":"ccsbtxn_1QfmetEFY1WEUtgRnBbOkFZ3","object":"customer_cash_balance_transaction","applied_to_payment":{"payment_intent":"pi_3QfmetEFY1WEUtgR0xHkzs5q"},"created":1736532611,"currency":"mxn","customer":"cus_PetN1dhr4rx0kX","ending_balance":190000,"livemode":false,"net_amount":-23000,"type":"applied_to_payment"}},"livemode":false,"pending_webhooks":2,"request":{"id":"req_4nXY7qRwVRIJg9","idempotency_key":"d90780a1-8d32-464e-a74e-1a024edf55cd"},"type":"customer_cash_balance_transaction.created"}
[2025-01-24 3:49:18.486499] [debug] Valor de $clientAllPhonesString en verifyJobActionToDo: 5214181878106,4181148783
[2025-01-10 18:10:14.052741] [info] Error creando PaymentIntent: This value must be greater than or equal to 1.
[2025-01-24 3:49:18.486509] [debug] Valor de $arrayNumeros en verifyJobActionToDo: ["5214181878106","4181148783"]
[2025-01-10 18:10:14.052828] [error] JSON error: No error
[2025-01-10 18:10:14.052844] [debug] HTTP request processing ended.
[2025-01-10 18:10:14.279191] [notice] Logging level set to:debug
[2025-01-10 18:10:14.279361] [debug] El valor de webhook_string: {"uuid":"2f7460f0-9fc8-46e1-8c9d-132cc2fb8584","changeType":"insert","entity":"payment","entityId":"504","eventName":"payment.add","extraData":{"entity":{"id":504,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:13-0600","amount":230,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":230,"userId":null,"attributes":[]},"entityBeforeEdit":null}}
[2025-01-24 3:49:18.492254] [debug] Valor de $resultados en verifyJobActionToDo: ["5214181878106","5214181148783"]
[2025-01-10 18:10:14.392301] [debug] valor el evento recibido por webhook: payment.add
[2025-01-24 3:49:18.492301] [debug] Valor de $resultadoFinalNumerosCliente en verifyJobActionToDo: 5214181878106, 5214181148783
[2025-01-10 18:10:14.392611] [debug] datos del notification para el invoice add:{"uuid":"2f7460f0-9fc8-46e1-8c9d-132cc2fb8584","changeType":"insert","entity":"payment","entityId":504,"message":null,"clientId":2,"eventName":"payment.add","clientData":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas Polleria","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"4181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":7945,"accountCredit":7945,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":{"id":504,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:13-0600","amount":230,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":230,"userId":null,"attributes":[]}}
[2025-01-24 3:49:18.492351] [debug] Se encontró un tipo de contacto WhatsNotifica
[2025-01-10 18:10:14.392699] [debug] valor del payment data: {"id":504,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:13-0600","amount":230,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":230,"userId":null,"attributes":[]}
Enviando mensaje de trabajo para el cliente
[2025-01-10 18:10:14.392760] [debug] ***Se notifica y actualiza al cliente sobre su pago***
Datos de la notificación de trabajo: {"clientFullName":"Daniel Humberto Soto Villegas","jobId":"23","date":"04\/02\/2025 05:00 AM","installerName":"Juan Rostro"}
Eviando comprobante de pago al cliente: 2 con número: 5214181878106
La cadena CURL que se envia es: {
"to": "5214181148783",
"from": "whatsapp",
"type": "text",
"content": {
"text": "S/M"
},
"template_values": ["*Daniel Humberto Soto Villegas*", "*#23*", "*04/02/2025 05:00 AM*", "*Juan Rostro*"],
"template_uuid": "0d57fd210595422caf2f5999642882a3",
"optin_contact": true
}
Response del CallBell: {"message":{"uuid":"23d85d1749a34f4aa4561e18b3a76c43","status":"enqueued"}}
La notificación fue enviada correctamente con estado: enqueued
El archivo se ha descargado correctamente y se ha guardado en: /data/ucrm/data/plugins/siip-whatsapp-notifications/src/Facade/../../comprobantes/Comprobante_Daniel_Humberto_Soto_Villegas_Polleria.png
[2025-01-24 3:49:19.391700] [info] Notificación enviada correctamente al contacto 4181148783 después de 1 intento(s).
El nombre del archivo PDF es: /home/unms/data/ucrm/ucrm/data/payment_receipts/11206cc1-0b2c-4fe2-ba8c-996d7a07a093.pdf
[2025-01-24 3:49:19.391830] [debug] Valor de $installerWhatsApp en verifyJobActionToDo: 4181878106
[2025-01-10 18:10:15.092138] [notice] Logging level set to:debug
[2025-01-10 18:10:15.092322] [debug] El valor de webhook_string: {"uuid":"a3aaae53-93a2-4a82-babf-51af1ad52a6c","changeType":"edit","entity":"payment","entityId":"504","eventName":"payment.edit","extraData":{"entity":{"id":504,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:13-0600","amount":230,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":230,"userId":null,"attributes":[]},"entityBeforeEdit":{"id":504,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:13-0600","amount":230,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":230,"userId":null,"attributes":[]}}}
[2025-01-24 3:49:19.391884] [debug] Se cambió el instalador, por lo tanto se procede a enviarle mensaje al que se le desasignó
[2025-01-10 18:10:15.212456] [debug] valor el evento recibido por webhook: payment.edit
[2025-01-24 3:49:19.427062] [debug] Se encontró el Whatsapp del instalador anterior en el JSON y es: 4181878106
[2025-01-10 18:10:15.212882] [debug] HTTP request processing ended.
[2025-01-10 18:10:57.359107] [notice] Logging level set to:debug
[2025-01-10 18:10:57.359576] [debug] El valor de webhook_string: {"uuid":"f60489ba-0b71-4541-8138-7276ef1e4581","changeType":"insert","entity":"payment","entityId":"505","eventName":"payment.add","extraData":{"entity":{"id":505,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:57-0600","amount":310,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":310,"userId":null,"attributes":[]},"entityBeforeEdit":null}}
Enviando mensaje de tarea al instalador
[2025-01-10 18:10:57.522614] [debug] valor el evento recibido por webhook: payment.add
[2025-01-10 18:10:57.523077] [debug] datos del notification para el invoice add:{"uuid":"f60489ba-0b71-4541-8138-7276ef1e4581","changeType":"insert","entity":"payment","entityId":505,"message":null,"clientId":2,"eventName":"payment.add","clientData":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas Polleria","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"4181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":8255,"accountCredit":8255,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":{"id":505,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:57-0600","amount":310,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":310,"userId":null,"attributes":[]}}
[2025-01-10 18:10:57.523178] [debug] valor del payment data: {"id":505,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:57-0600","amount":310,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":310,"userId":null,"attributes":[]}
[2025-01-10 18:10:57.523241] [debug] ***Se notifica y actualiza al cliente sobre su pago***
Eviando comprobante de pago al cliente: 2 con número: 5214181878106
El archivo se ha descargado correctamente y se ha guardado en: /data/ucrm/data/plugins/siip-whatsapp-notifications/src/Facade/../../comprobantes/Comprobante_Daniel_Humberto_Soto_Villegas_Polleria.png
El nombre del archivo PDF es: /home/unms/data/ucrm/ucrm/data/payment_receipts/4821392a-561e-4518-a05f-269977cf1abc.pdf
[2025-01-10 18:10:58.473439] [notice] Logging level set to:debug
[2025-01-10 18:10:58.473608] [debug] El valor de webhook_string: {"uuid":"31e9875d-fae3-4be5-93a6-7a94920cfcef","changeType":"edit","entity":"payment","entityId":"505","eventName":"payment.edit","extraData":{"entity":{"id":505,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:57-0600","amount":310,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":310,"userId":null,"attributes":[]},"entityBeforeEdit":{"id":505,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-10T12:10:57-0600","amount":310,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":310,"userId":null,"attributes":[]}}}
[2025-01-10 18:10:58.674854] [debug] valor el evento recibido por webhook: payment.edit
[2025-01-10 18:10:58.675149] [debug] HTTP request processing ended.
[2025-01-11 6:25:03.674705] [notice] Logging level set to:debug
[2025-01-11 6:25:03.674897] [debug] El valor de webhook_string: {"uuid":"357b7e66-efe7-49c0-bc7e-30b387c6dfd8","changeType":"overdue","entity":"invoice","entityId":"1337","eventName":"invoice.overdue","extraData":{"entity":{"id":1337,"clientId":3,"number":"001301","createdDate":"2024-12-27T10:00:01-0600","dueDate":"2025-01-10T10:00:01-0600","emailSentDate":null,"maturityDays":14,"taxableSupplyDate":"2024-12-25T18:00:00-0600","notes":null,"adminNotes":null,"items":[{"id":1340,"type":"service","label":"plan300 27\/11\/2024 \u2013 26\/12\/2024","price":300,"quantity":1,"total":300,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":3,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":0,"discountQuantity":0,"discountTotal":0}],"subtotal":300,"discount":null,"discountLabel":"Descuento","taxes":[],"total":300,"amountPaid":0,"totalUntaxed":300,"totalDiscount":0,"totalTaxAmount":0,"amountToPay":300,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"Lupita","clientLastName":"Morales","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":null,"clientStreet2":null,"clientCity":null,"clientCountryId":173,"clientStateId":null,"clientZipCode":null,"attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"entityBeforeEdit":null}}
[2025-01-11 6:25:03.933916] [debug] valor el evento recibido por webhook: invoice.overdue
[2025-01-11 6:25:03.934158] [debug] Factura vencida
[2025-01-11 6:25:03.934207] [debug] datos del notification para el invoice overdue:{"uuid":"357b7e66-efe7-49c0-bc7e-30b387c6dfd8","changeType":"overdue","entity":"invoice","entityId":1337,"message":null,"clientId":3,"eventName":"invoice.overdue","clientData":{"id":3,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-27T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Lupita","lastName":"Morales","username":"lmorales03","contacts":[{"id":3,"clientId":3,"email":null,"phone":"5214181577623","name":null,"isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]}],"attributes":[],"accountBalance":-300,"accountCredit":0,"accountOutstanding":300,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f9a825","addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":true,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":{"id":1337,"clientId":3,"number":"001301","createdDate":"2024-12-27T10:00:01-0600","dueDate":"2025-01-10T10:00:01-0600","emailSentDate":null,"maturityDays":14,"taxableSupplyDate":"2024-12-25T18:00:00-0600","notes":null,"adminNotes":null,"items":[{"id":1340,"type":"service","label":"plan300 27\/11\/2024 \u2013 26\/12\/2024","price":300,"quantity":1,"total":300,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":3,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":-0,"discountQuantity":0,"discountTotal":-0}],"subtotal":300,"discount":null,"discountLabel":"Descuento","taxes":[],"total":300,"amountPaid":0,"totalUntaxed":300,"totalDiscount":-0,"totalTaxAmount":0,"amountToPay":300,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"Lupita","clientLastName":"Morales","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":null,"clientStreet2":null,"clientCity":null,"clientCountryId":173,"clientStateId":null,"clientZipCode":null,"attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"paymentData":null}
[2025-01-11 6:25:03.934228] [debug] ***Se notifica al cliente que la factura de su servicio está vencida***
[2025-01-11 6:25:03.934345] [debug] Numero de cel obtenido
[2025-01-11 6:25:03.934357] [warning] No se encontró un teléfono celular válido para el cliente: 3
[2025-01-11 6:25:03.934375] [debug] HTTP request processing ended.
[2025-01-11 6:25:04.137595] [notice] Logging level set to:debug
[2025-01-11 6:25:04.137682] [debug] El valor de webhook_string: {"uuid":"939afb7c-bf01-4ea8-9d6b-8dbb16e9a61e","changeType":"overdue","entity":"invoice","entityId":"1338","eventName":"invoice.overdue","extraData":{"entity":{"id":1338,"clientId":4,"number":"001302","createdDate":"2024-12-27T10:00:01-0600","dueDate":"2025-01-10T10:00:01-0600","emailSentDate":"2025-01-11T00:00:00-0600","maturityDays":14,"taxableSupplyDate":"2024-12-25T18:00:00-0600","notes":null,"adminNotes":null,"items":[{"id":1341,"type":"service","label":"plan300 27\/11\/2024 \u2013 26\/12\/2024","price":300,"quantity":1,"total":300,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":4,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":0,"discountQuantity":0,"discountTotal":0}],"subtotal":300,"discount":null,"discountLabel":"Descuento","taxes":[],"total":300,"amountPaid":0,"totalUntaxed":300,"totalDiscount":0,"totalTaxAmount":0,"amountToPay":300,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"Griselda","clientLastName":"Avalos","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":null,"clientStreet2":null,"clientCity":null,"clientCountryId":173,"clientStateId":null,"clientZipCode":null,"attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"entityBeforeEdit":null}}
[2025-01-11 6:25:04.321850] [debug] valor el evento recibido por webhook: invoice.overdue
[2025-01-11 6:25:04.321985] [debug] Factura vencida
[2025-01-11 6:25:04.322029] [debug] datos del notification para el invoice overdue:{"uuid":"939afb7c-bf01-4ea8-9d6b-8dbb16e9a61e","changeType":"overdue","entity":"invoice","entityId":1338,"message":null,"clientId":4,"eventName":"invoice.overdue","clientData":{"id":4,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":null,"street2":null,"city":null,"countryId":173,"stateId":null,"zipCode":null,"fullAddress":null,"invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-27T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Griselda","lastName":"Avalos","username":"gavalos04","contacts":[{"id":4,"clientId":4,"email":"chicarosa@gmail.com","phone":"4181156999","name":null,"isBilling":true,"isContact":true,"types":[{"id":1,"name":"Billing"},{"id":2,"name":"General"},{"id":1000,"name":"WhatsApp"}]},{"id":5,"clientId":4,"email":null,"phone":"5214181148554","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]},{"id":106,"clientId":4,"email":null,"phone":"4181169874","name":null,"isBilling":true,"isContact":false,"types":[{"id":1,"name":"Billing"}]},{"id":107,"clientId":4,"email":null,"phone":"5214181817609","name":null,"isBilling":false,"isContact":false,"types":[]},{"id":108,"clientId":4,"email":null,"phone":"4188562314","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":-3600,"accountCredit":0,"accountOutstanding":3600,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#ff8f00","addressGpsLat":null,"addressGpsLon":null,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":true,"hasOutage":false,"hasSuspendedService":true,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":{"id":1338,"clientId":4,"number":"001302","createdDate":"2024-12-27T10:00:01-0600","dueDate":"2025-01-10T10:00:01-0600","emailSentDate":"2025-01-11T00:00:00-0600","maturityDays":14,"taxableSupplyDate":"2024-12-25T18:00:00-0600","notes":null,"adminNotes":null,"items":[{"id":1341,"type":"service","label":"plan300 27\/11\/2024 \u2013 26\/12\/2024","price":300,"quantity":1,"total":300,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":4,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":-0,"discountQuantity":0,"discountTotal":-0}],"subtotal":300,"discount":null,"discountLabel":"Descuento","taxes":[],"total":300,"amountPaid":0,"totalUntaxed":300,"totalDiscount":-0,"totalTaxAmount":0,"amountToPay":300,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"Griselda","clientLastName":"Avalos","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":null,"clientStreet2":null,"clientCity":null,"clientCountryId":173,"clientStateId":null,"clientZipCode":null,"attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"paymentData":null}
[2025-01-11 6:25:04.322052] [debug] ***Se notifica al cliente que la factura de su servicio está vencida***
[2025-01-11 6:25:04.322122] [debug] Numero de cel obtenido
[2025-01-11 6:25:04.322133] [warning] No se encontró un teléfono celular válido para el cliente: 4
[2025-01-11 6:25:04.322149] [debug] HTTP request processing ended.
[2025-01-12 19:30:03.710498] [notice] Logging level set to:debug
[2025-01-12 19:30:03.711055] [debug] El valor de webhook_string: {"uuid":"22cf5c60-9f8f-4598-943f-5293ddc53a53","changeType":"suspend","entity":"service","entityId":"3","eventName":"service.suspend","extraData":{"entity":{"id":3,"prepaid":false,"clientId":3,"status":3,"name":"plan300","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"servicePlanId":2,"servicePlanPeriodId":7,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2024-01-27T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2024-01-28T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":27,"nextInvoicingDayAdjustment":0,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"plan300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":6,"uploadSpeed":6,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":"2024-12-26T00:00:00-0600","unmsClientSiteId":"c4ea6c5c-0577-42bc-852e-e54cad6255b8","attributes":[],"addressData":null,"suspensionReasonId":1,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[{"id":43,"startDate":"2024-03-13T00:00:00-0600","endDate":"2024-12-11T00:00:00-0600"},{"id":133,"startDate":"2025-01-12T13:30:02-0600","endDate":null}],"surcharges":[]},"entityBeforeEdit":{"id":3,"prepaid":false,"clientId":3,"status":1,"name":"plan300","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"servicePlanId":2,"servicePlanPeriodId":7,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2024-01-27T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2024-01-28T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":27,"nextInvoicingDayAdjustment":0,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"plan300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":6,"uploadSpeed":6,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":"2024-12-26T00:00:00-0600","unmsClientSiteId":"c4ea6c5c-0577-42bc-852e-e54cad6255b8","attributes":[],"addressData":null,"suspensionReasonId":null,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[{"id":43,"startDate":"2024-03-13T00:00:00-0600","endDate":"2024-12-11T00:00:00-0600"},{"id":133,"startDate":"2025-01-12T13:30:02-0600","endDate":null}],"surcharges":[]}}}
[2025-01-12 19:30:03.988663] [debug] valor el evento recibido por webhook: service.suspend
[2025-01-12 19:30:03.989017] [debug] Se suspendió el servicio a un cliente
[2025-01-12 19:30:03.989139] [info] {"uuid":"22cf5c60-9f8f-4598-943f-5293ddc53a53","changeType":"suspend","entity":"service","entityId":3,"message":null,"clientId":3,"eventName":"service.suspend","clientData":{"id":3,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-27T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Lupita","lastName":"Morales","username":"lmorales03","contacts":[{"id":3,"clientId":3,"email":null,"phone":"5214181577623","name":null,"isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]}],"attributes":[],"accountBalance":-300,"accountCredit":0,"accountOutstanding":300,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f9a825","addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":true,"hasOutage":false,"hasSuspendedService":true,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":{"id":3,"prepaid":false,"clientId":3,"status":3,"name":"plan300","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"servicePlanId":2,"servicePlanPeriodId":7,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2024-01-27T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2024-01-28T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":27,"nextInvoicingDayAdjustment":0,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"plan300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":6,"uploadSpeed":6,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":"2024-12-26T00:00:00-0600","unmsClientSiteId":"c4ea6c5c-0577-42bc-852e-e54cad6255b8","attributes":[],"addressData":null,"suspensionReasonId":1,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[{"id":43,"startDate":"2024-03-13T00:00:00-0600","endDate":"2024-12-11T00:00:00-0600"},{"id":133,"startDate":"2025-01-12T00:00:00-0600","endDate":null}],"surcharges":[],"stopReason":"Payments overdue"},"invoiceData":null,"paymentData":null}
Actualizando estado del servicio
Nombre del cliente al que se va a actualizar el estado del servicio: Lupita Morales
UUID: 7ec1948ad8af4bcd8eff0d7c2a995d09
JSON con los datos a actualizar: {"custom_fields":{"Estado":"\ud83d\udfe0 Suspendido","Fecha Ultima Actualizacion":"\ud83d\udcc6\ud83d\udd04\ufe0f 12\/01\/2025 13:30"}}
Response Patch CallBell: {"contact":{"uuid":"7ec1948ad8af4bcd8eff0d7c2a995d09","name":"Lupita Morales","phoneNumber":"5214181577623","avatarUrl":null,"createdAt":"2023-12-22T16:52:57Z","closedAt":"2025-01-07T23:12:30Z","source":"whatsapp","href":"https://dash.callbell.eu/contacts/7ec1948ad8af4bcd8eff0d7c2a995d09","conversationHref":"https://dash.callbell.eu/chat/d06f5a96768c4945b7a659a6930e5fa0","tags":[],"assignedUser":"miriam.moctezuma2m@gmail.com","customFields":{"user entry point":"inbound_message","Nombre":"👤 Lupita Morales","Cliente":"3","Domicilio":"📍 Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México","Clabe Transferencia Banamex":"124180650725363841","Fecha Ultimo Pago":"📆💸 11/12/2024 13:32 con Cheque 📄","Saldo Actual":"💲300 pendientes","user name":"Míriam Moctezuma","Resumen":"{\"Cliente\": \"3\",\"Domicilio\": \"📍 Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México\",\"Nombre\": \"👤 Lupita Morales\",\"URL\": \"🌐 https://172.16.5.120/crm/client/3\",\"Saldo Actual\": \"💲300 pendientes\",\"Monto Ultimo Pago\": \"💲 3000\",\"Estado\": \"🟢 Activo\",\"Fecha Ultimo Pago\": \"📆💰 11/12/2024 13:32 con Cheque 📄\",\"Fecha Ultima Actualizacion\": \"📆🔄️ 04/01/2025 16:20\",\"Clabe Transferencia Banamex\": \"\"}","Estado":"🟠 Suspendido","URL":"🌐 https://172.16.5.120/crm/client/3","Monto Ultimo Pago":"💲 3000","Fecha Ultima Actualizacion":"📆🔄️ 12/01/2025 13:30"},"team":{"uuid":"5faeed738d6a44ccacf6509762eb288d","name":"General","default":true,"members":8,"createdAt":"2023-11-07T00:37:10Z"},"channel":{"uuid":"dbaa248932634e7ea4346a320960c24a","title":null,"type":"whatsapp","main":true},"blockedAt":null}}
[2025-01-12 19:30:05.333286] [debug] HTTP request processing ended.
[2025-01-12 19:30:05.501734] [notice] Logging level set to:debug
[2025-01-12 19:30:05.502194] [debug] El valor de webhook_string: {"uuid":"3a5c05df-21f0-479d-9933-d645c2b6f566","changeType":"edit","entity":"service","entityId":"3","eventName":"service.edit","extraData":{"entity":{"id":3,"prepaid":false,"clientId":3,"status":3,"name":"plan300","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"servicePlanId":2,"servicePlanPeriodId":7,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2024-01-27T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2024-01-28T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":27,"nextInvoicingDayAdjustment":0,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"plan300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":6,"uploadSpeed":6,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":"2024-12-26T00:00:00-0600","unmsClientSiteId":"c4ea6c5c-0577-42bc-852e-e54cad6255b8","attributes":[],"addressData":null,"suspensionReasonId":1,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[{"id":43,"startDate":"2024-03-13T00:00:00-0600","endDate":"2024-12-11T00:00:00-0600"},{"id":133,"startDate":"2025-01-12T13:30:02-0600","endDate":null}],"surcharges":[]},"entityBeforeEdit":{"id":3,"prepaid":false,"clientId":3,"status":1,"name":"plan300","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"servicePlanId":2,"servicePlanPeriodId":7,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2024-01-27T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2024-01-28T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":27,"nextInvoicingDayAdjustment":0,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"plan300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":6,"uploadSpeed":6,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":"2024-12-26T00:00:00-0600","unmsClientSiteId":"c4ea6c5c-0577-42bc-852e-e54cad6255b8","attributes":[],"addressData":null,"suspensionReasonId":null,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[{"id":43,"startDate":"2024-03-13T00:00:00-0600","endDate":"2024-12-11T00:00:00-0600"},{"id":133,"startDate":"2025-01-12T13:30:02-0600","endDate":null}],"surcharges":[]}}}
[2025-01-12 19:30:05.655270] [debug] valor el evento recibido por webhook: service.edit
[2025-01-12 19:30:05.655433] [debug] HTTP request processing ended.
[2025-01-12 19:30:12.555260] [notice] Logging level set to:debug
[2025-01-12 19:30:12.555963] [debug] El valor de webhook_string: {"uuid":"5add7bb2-d7da-492e-a6a4-e98790432f1f","changeType":"edit","entity":"service","entityId":"3","eventName":"service.edit","extraData":{"entity":{"id":3,"prepaid":false,"clientId":3,"status":3,"name":"plan300","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"servicePlanId":2,"servicePlanPeriodId":7,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2024-01-27T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2024-01-28T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":27,"nextInvoicingDayAdjustment":0,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"plan300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":6,"uploadSpeed":6,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":"2024-12-26T00:00:00-0600","unmsClientSiteId":"c4ea6c5c-0577-42bc-852e-e54cad6255b8","attributes":[],"addressData":null,"suspensionReasonId":1,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[{"id":43,"startDate":"2024-03-13T00:00:00-0600","endDate":"2024-12-11T00:00:00-0600"},{"id":133,"startDate":"2025-01-12T00:00:00-0600","endDate":null}],"surcharges":[]},"entityBeforeEdit":{"id":3,"prepaid":false,"clientId":3,"status":3,"name":"plan300","fullAddress":"Oaxaca 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"56 Oaxaca","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.16004,"addressGpsLon":-100.9368203,"servicePlanId":2,"servicePlanPeriodId":7,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2024-01-27T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2024-01-28T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":27,"nextInvoicingDayAdjustment":0,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"plan300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":6,"uploadSpeed":6,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":"2024-12-26T00:00:00-0600","unmsClientSiteId":"c4ea6c5c-0577-42bc-852e-e54cad6255b8","attributes":[],"addressData":null,"suspensionReasonId":1,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[{"id":43,"startDate":"2024-03-13T00:00:00-0600","endDate":"2024-12-11T00:00:00-0600"},{"id":133,"startDate":"2025-01-12T00:00:00-0600","endDate":null}],"surcharges":[]}}}
[2025-01-12 19:30:12.725733] [debug] valor el evento recibido por webhook: service.edit
[2025-01-12 19:30:12.726030] [debug] HTTP request processing ended.
[2025-01-13 4:07:22.324639] [notice] Logging level set to:debug
[2025-01-13 4:07:22.324762] [debug] El valor de webhook_string: {"type":"oxxo.request","client_id":162,"amount":180}
[2025-01-13 4:07:22.324779] [info] Evento de referencia de oxxo recibido
[2025-01-13 4:07:22.324790] [info] Referencia persnoalizada, Valor del monto: 180
[2025-01-13 4:07:22.324799] [info] Creando referencia del cliente para OXXO:
[2025-01-13 4:07:24.017492] [info] Monto proporcionado directamente: 180
[2025-01-13 4:07:24.017538] [info] Creando referencia en Stripe por: 18000
[2025-01-13 4:07:25.496715] [info] Creando payment methods del voucher
[2025-01-13 4:07:25.642267] [info] Confirmando el paymentIntent
[2025-01-13 4:07:26.222693] [info] Se terminó de confirmar el paymentIntent
[2025-01-13 4:07:26.222794] [info] Referencia OXXO: 12345678901234657890123456789012
[2025-01-13 4:07:26.222819] [info] URL del recibo: https://payments.stripe.com/oxxo/voucher/test_YWNjdF8xT2tHMFJFRlkxV0VVdGdSLF9SWm9aaWttMmVDb0U5SWx4dEFKUVk2Zkpua0FiOWdu0100WYj107tU
[2025-01-13 4:07:26.224097] [debug] Reponse que se envía a CallBell: {"url": "https://payments.stripe.com/oxxo/voucher/test_YWNjdF8xT2tHMFJFRlkxV0VVdGdSLF9SWm9aaWttMmVDb0U5SWx4dEFKUVk2Zkpua0FiOWdu0100WYj107tU"}
[2025-01-13 4:07:26.224214] [error] JSON error: No error
[2025-01-13 4:07:26.224250] [debug] HTTP request processing ended.
[2025-01-13 4:10:30.494155] [notice] Logging level set to:debug
[2025-01-13 4:10:30.494261] [debug] El valor de webhook_string: {"uuid":"2264d1a4-2eb3-4093-9511-6d6ca35ce491","changeType":"insert","entity":"payment","entityId":"506","eventName":"payment.add","extraData":{"entity":{"id":506,"clientId":162,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-12T22:10:30-0600","amount":180,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":180,"userId":null,"attributes":[]},"entityBeforeEdit":null}}
[2025-01-13 4:10:30.623610] [debug] valor el evento recibido por webhook: payment.add
[2025-01-13 4:10:30.624093] [debug] datos del notification para el invoice add:{"uuid":"2264d1a4-2eb3-4093-9511-6d6ca35ce491","changeType":"insert","entity":"payment","entityId":506,"message":null,"clientId":162,"eventName":"payment.add","clientData":{"id":162,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"76 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 76, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-10T10:32:20-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Edward","lastName":"Elric","username":null,"contacts":[{"id":166,"clientId":162,"email":"eduardelric@gmail.com","phone":"5214181878106","name":null,"isBilling":true,"isContact":true,"types":[{"id":1,"name":"Billing"},{"id":2,"name":"General"},{"id":1000,"name":"WhatsApp"}]}],"attributes":[{"id":159,"clientId":162,"customAttributeId":9,"name":"oxxo","key":"oxxo","value":"434876867834423324","clientZoneVisible":true},{"id":160,"clientId":162,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_RYsuykCEvupaGF","clientZoneVisible":true},{"id":161,"clientId":162,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"124180599808752427","clientZoneVisible":true}],"accountBalance":180,"accountCredit":180,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#d84315","addressGpsLat":21.1575488,"addressGpsLon":-100.9409119,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":{"id":506,"clientId":162,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-12T22:10:30-0600","amount":180,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":180,"userId":null,"attributes":[]}}
[2025-01-13 4:10:30.624178] [debug] valor del payment data: {"id":506,"clientId":162,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-12T22:10:30-0600","amount":180,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":180,"userId":null,"attributes":[]}
[2025-01-13 4:10:30.624255] [debug] ***Se notifica y actualiza al cliente sobre su pago***
Eviando comprobante de pago al cliente: 162 con número: 5214181878106
El archivo se ha descargado correctamente y se ha guardado en: /data/ucrm/data/plugins/siip-whatsapp-notifications/src/Facade/../../comprobantes/Comprobante_Edward_Elric.png
El nombre del archivo PDF es: /home/unms/data/ucrm/ucrm/data/payment_receipts/d61cccdc-9048-4c1e-a8bf-0378ee239d8f.pdf
se creó la instancia de Imagick
Ancho original de la imagen:482 Altura original de la imagen: 1024
Terminó de crear la imagen del comprobante
Subiendo comprobante a worpdpress
Conexión FTP exitosa
El archivo ha sido cargado exitosamente.
La URL es: https://siip.mx/wp/wp-content/uploads/img/Comprobante_Edward_Elric.png
[2025-01-13 4:10:40.666646] [notice] Logging level set to:debug
[2025-01-13 4:10:40.667059] [debug] El valor de webhook_string: {"uuid":"75e564c6-ec31-49db-adb8-e59ef8a28f46","changeType":"edit","entity":"payment","entityId":"506","eventName":"payment.edit","extraData":{"entity":{"id":506,"clientId":162,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-12T22:10:30-0600","amount":180,"currencyCode":"MXN","note":null,"receiptSentDate":"2025-01-12T22:10:31-0600","providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":180,"userId":null,"attributes":[]},"entityBeforeEdit":{"id":506,"clientId":162,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-12T22:10:30-0600","amount":180,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":180,"userId":null,"attributes":[]}}}
[2025-01-13 4:10:40.814348] [debug] valor el evento recibido por webhook: payment.edit
[2025-01-13 4:10:40.814608] [debug] HTTP request processing ended.
Comprobante eliminado de Wordpress: Comprobante_MARCO_ANTONIO_VAZQUEZ_ROJAS.png
Archivos eliminados
Se terminó de subir comprobante a wordpress
Datos de la notificación de tarea: {"installerName":"\u00c1ngel Arvizu","subjectOfChange":"se te ha desasignado la tarea con el folio ","jobId":"23","clientFullName":"[2] Daniel Humberto Soto Villegas","additionalChangeData":"En tu lugar asistir\u00e1 el t\u00e9cnico *Juan Rostro*"}
La cadena CURL que se envia es: {
"to": "5214181878106",
"from": "whatsapp",
"type": "document",
"type": "text",
"content": {
"text": "S/M",
"url": "https://siip.mx/wp/wp-content/uploads/img/Comprobante_Edward_Elric.png"
"text": "S/M"
},
"template_values": ["Edward Elric", "$180", "$180 a favor"],
"template_uuid": "57ead79cebd14902921477922403093b",
"template_values": ["Ángel Arvizu", "se te ha desasignado la tarea con el folio ", "*#23*", "[2] Daniel Humberto Soto Villegas", "En tu lugar asistirá el técnico *Juan Rostro*"],
"template_uuid": "e1aa2b0fd3884595918f4ac2676acd29",
"optin_contact": true
}
Response del CallBell: {"message":{"uuid":"41198fadab0947ef8ab8088d70e7731a","status":"enqueued"}}
Hay menos de 50 archivos en el directorio. No se eliminarán archivos.
Response del CallBell: {"message":{"uuid":"805438bcb0984986b826ee8be26c0866","status":"enqueued"}}
La notificación fue enviada correctamente con estado: enqueued
Enviando mensaje de tarea al instalador
Datos de la notificación de tarea: {"installerName":"Juan Rostro","clientFullName":"[2] Daniel Humberto Soto Villegas","jobId":"23","clientAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","clientWhatsApp":"5214181878106, 5214181148783","date":"04\/02\/2025 05:00 AM","jobDescription":"Alinear con la sectorial mas cercana","gmapsLocation":"https:\/\/www.google.com\/maps?q=21.1564209,-100.9384185"}
La cadena CURL que se envia es: {
"to": "5214181878106",
"from": "whatsapp",
"type": "text",
"content": {
"text": "S/M"
},
"template_values": ["Juan Rostro", "*#23*", "[2] Daniel Humberto Soto Villegas", "Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México", "5214181878106, 5214181148783", "04/02/2025 05:00 AM", "Alinear con la sectorial mas cercana", "https://www.google.com/maps?q=21.1564209,-100.9384185"],
"template_uuid": "b6663394265e4bcdb215369aa9ba0f21",
"optin_contact": true
}
Response del CallBell: {"message":{"uuid":"01266be614184acc8cfaeeb0316a6289","status":"enqueued"}}
La notificación fue enviada correctamente con estado: enqueued
[2025-01-24 3:54:45.734533] [notice] Logging level set to:debug
[2025-01-24 3:54:45.778528] [debug] valor el evento recibido por webhook: job.edit
[2025-01-24 3:54:45.778708] [debug] Valor de JSON: {"uuid":"97d12c97-54e3-44cb-bde6-cc6a0e5d0182","changeType":"edit","entity":"job","entityId":"23","eventName":"job.edit","extraData":{"entity":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1173,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]},"entityBeforeEdit":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1172,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]}}}
[2025-01-24 3:54:45.778994] [debug] Se actualiza un trabajo
[2025-01-24 3:54:45.779092] [debug] Valor de json_data: {"uuid":"97d12c97-54e3-44cb-bde6-cc6a0e5d0182","changeType":"edit","entity":"job","entityId":"23","eventName":"job.edit","extraData":{"entity":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1173,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]},"entityBeforeEdit":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1172,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]}}}
[2025-01-24 3:54:45.779170] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 3:54:45.779220] [debug] Los datos entityBeforeEdit y entity contienen el campo assignedUserId
[2025-01-24 3:54:45.779267] [debug] El campo assignedUserId cambió de un valor a otro y la fecha no cambió
[2025-01-24 3:54:45.779331] [debug] Valor de $jsonNotificationData en verifyJobActionToDo: {"uuid":"97d12c97-54e3-44cb-bde6-cc6a0e5d0182","changeType":"edit","entity":"job","entityId":"23","eventName":"job.edit","extraData":{"entity":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1173,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]},"entityBeforeEdit":{"id":23,"title":"Alinear","description":"Alinear con la sectorial mas cercana","assignedUserId":1172,"clientId":2,"date":"2025-02-04T05:00:00-0600","duration":60,"status":0,"address":"31 Chiapas, Dolores Hidalgo Cuna de la Independencia Nacional, 37800, Mexico","gpsLat":null,"gpsLon":null,"attachments":[],"tasks":[]}}}
[2025-01-24 3:54:45.779395] [debug] Valor de $clientId en verifyJobActionToDo: 2
[2025-01-24 3:54:45.779443] [debug] Valor de $installerId en verifyJobActionToDo: 1173
[2025-01-24 3:54:45.779503] [debug] Valor de $jobId en verifyJobActionToDo: 23
[2025-01-24 3:54:45.779727] [debug] Valor de $installersData en verifyJobActionToDo: {
"instaladores": [
{
"id": 1019,
"nombre": "Mucio Robledo",
"whatsapp": "4181878106"
},
{
"id": 1173,
"nombre": "Angel Arvizu",
"whatsapp": "4181878106"
},
{
"id": 1172,
"nombre": "Juan Rostro",
"whatsapp": "4181878106"
},
{
"id": 1015,
"nombre": "Daniel Humberto",
"whatsapp": "4181878106"
}
]
}
[2025-01-24 3:54:45.814189] [debug] Valor de $usersInstallers en verifyJobActionToDo: {"id":1173,"unmsId":"5cb37ee8-e445-4b2a-87d4-6c83eebb8944","email":"hachi9801@gmail.com","firstName":"\u00c1ngel ","lastName":"Arvizu","username":"mamey","avatarColor":"#4caf50","isActive":true}
[2025-01-24 3:54:45.814327] [debug] tipo de dato de installerWhatsApp: string
[2025-01-24 3:54:45.814378] [debug] Número de WhatsApp del Instalador: 4181878106
[2025-01-24 3:54:45.845829] [debug] Valor de $usersInstallers {"id":1173,"unmsId":"5cb37ee8-e445-4b2a-87d4-6c83eebb8944","email":"hachi9801@gmail.com","firstName":"\u00c1ngel ","lastName":"Arvizu","username":"mamey","avatarColor":"#4caf50","isActive":true}
[2025-01-24 3:54:45.845882] [debug] Valor de $installerFullName: Ángel Arvizu
[2025-01-24 3:54:45.914691] [debug] Valor de $arrayClientCRM en verifyJobActionToDo: {"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}
[2025-01-24 3:54:45.914830] [debug] Dirección completa: Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México
[2025-01-24 3:54:45.914885] [debug] URL de Google Maps: https://www.google.com/maps?q=21.1564209,-100.9384185
[2025-01-24 3:54:45.915009] [debug] Valor de $arrayPhones en verifyJobActionToDo: {"WhatsNotifica":"4181148783"}
[2025-01-24 3:54:45.915062] [debug] Valor de $clientAllPhonesString en verifyJobActionToDo: 5214181878106,4181148783
[2025-01-24 3:54:45.915111] [debug] Valor de $arrayNumeros en verifyJobActionToDo: ["5214181878106","4181148783"]
[2025-01-24 3:54:45.915281] [debug] Valor de $resultados en verifyJobActionToDo: ["5214181878106","5214181148783"]
[2025-01-24 3:54:45.915338] [debug] Valor de $resultadoFinalNumerosCliente en verifyJobActionToDo: 5214181878106, 5214181148783
[2025-01-24 3:54:45.920906] [debug] Se encontró un tipo de contacto WhatsNotifica
Enviando mensaje de trabajo para el cliente
Datos de la notificación de trabajo: {"clientFullName":"Daniel Humberto Soto Villegas","jobId":"23","date":"04\/02\/2025 05:00 AM","installerName":"\u00c1ngel Arvizu"}
La cadena CURL que se envia es: {
"to": "5214181148783",
"from": "whatsapp",
"type": "text",
"content": {
"text": "S/M"
},
"template_values": ["*Daniel Humberto Soto Villegas*", "*#23*", "*04/02/2025 05:00 AM*", "*Ángel Arvizu*"],
"template_uuid": "0d57fd210595422caf2f5999642882a3",
"optin_contact": true
}
Response del CallBell: {"message":{"uuid":"1be3306fedfc418484e7b768e93fd432","status":"enqueued"}}
La notificación fue enviada correctamente con estado: enqueued
[2025-01-24 3:54:46.814254] [info] Notificación enviada correctamente al contacto 4181148783 después de 1 intento(s).
[2025-01-24 3:54:46.814506] [debug] Valor de $installerWhatsApp en verifyJobActionToDo: 4181878106
[2025-01-24 3:54:46.814657] [debug] Se cambió el instalador, por lo tanto se procede a enviarle mensaje al que se le desasignó
[2025-01-24 3:54:46.851881] [debug] Se encontró el Whatsapp del instalador anterior en el JSON y es: 4181878106
Enviando mensaje de tarea al instalador
Datos de la notificación de tarea: {"installerName":"Juan Rostro","subjectOfChange":"se te ha desasignado la tarea con el folio ","jobId":"23","clientFullName":"[2] Daniel Humberto Soto Villegas","additionalChangeData":"En tu lugar asistir\u00e1 el t\u00e9cnico *\u00c1ngel Arvizu*"}
La cadena CURL que se envia es: {
"to": "5214181878106",
"from": "whatsapp",
"type": "text",
"content": {
"text": "S/M"
},
"template_values": ["Juan Rostro", "se te ha desasignado la tarea con el folio ", "23", "[2] Daniel Humberto Soto Villegas", "En tu lugar asistirá el técnico *Ángel Arvizu*"],
"template_uuid": "e1aa2b0fd3884595918f4ac2676acd29",
"optin_contact": true
}
Response del CallBell: {"message":{"uuid":"ef8bd89ca480434e9ac446074c6380e9","status":"enqueued"}}
La notificación fue enviada correctamente con estado: enqueued
Enviando mensaje de tarea al instalador
Datos de la notificación de tarea: {"installerName":"\u00c1ngel Arvizu","clientFullName":"[2] Daniel Humberto Soto Villegas","jobId":"23","clientAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","clientWhatsApp":"5214181878106, 5214181148783","date":"04\/02\/2025 05:00 AM","jobDescription":"Alinear con la sectorial mas cercana","gmapsLocation":"https:\/\/www.google.com\/maps?q=21.1564209,-100.9384185"}
La cadena CURL que se envia es: {
"to": "5214181878106",
"from": "whatsapp",
"type": "text",
"content": {
"text": "S/M"
},
"template_values": ["Ángel Arvizu", "*#23*", "[2] Daniel Humberto Soto Villegas", "Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México", "5214181878106, 5214181148783", "04/02/2025 05:00 AM", "Alinear con la sectorial mas cercana", "https://www.google.com/maps?q=21.1564209,-100.9384185"],
"template_uuid": "b6663394265e4bcdb215369aa9ba0f21",
"optin_contact": true
}
Response del CallBell: {"message":{"uuid":"a5e4eba50227420caf7cddb0fc8717a5","status":"enqueued"}}
La notificación fue enviada correctamente con estado: enqueued
[2025-01-24 4:35:03.392863] [notice] Logging level set to:debug
[2025-01-24 4:35:03.481223] [debug] valor el evento recibido por webhook: client.edit
[2025-01-24 4:35:03.481401] [debug] Valor de JSON: {"uuid":"77cc8efa-b15d-4528-8814-09c9cd13499c","changeType":"edit","entity":"client","entityId":"163","eventName":"client.edit","extraData":{"entity":{"id":163,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":163,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":true,"isContact":true,"types":[{"id":1,"name":"Billing"},{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 4:35:03.481704] [debug] Se actualiza a un cliente
[2025-01-24 4:35:03.481798] [debug] Valor de json_data: {"uuid":"77cc8efa-b15d-4528-8814-09c9cd13499c","changeType":"edit","entity":"client","entityId":"163","eventName":"client.edit","extraData":{"entity":{"id":163,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":163,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":true,"isContact":true,"types":[{"id":1,"name":"Billing"},{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 4:35:03.481859] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 4:35:03.481908] [debug] Los datos entityBeforeEdit y entity contienen el campo isLead
[2025-01-24 4:35:03.481955] [debug] No hubo cambio de true a false en el campo isLead
[2025-01-24 4:35:03.482028] [debug] {"uuid":"77cc8efa-b15d-4528-8814-09c9cd13499c","changeType":"edit","entity":"client","entityId":163,"message":null,"clientId":163,"eventName":"client.edit","clientData":{"id":163,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":null}
[2025-01-24 4:35:22.925306] [notice] Logging level set to:debug
[2025-01-24 4:35:23.179027] [debug] valor el evento recibido por webhook: service.add
[2025-01-24 4:35:23.179090] [debug] Valor de JSON: {"uuid":"1c07d3b9-2179-400e-a704-1f1eb9264d6b","changeType":"insert","entity":"service","entityId":"130","eventName":"service.add","extraData":{"entity":{"id":130,"prepaid":false,"clientId":163,"status":7,"name":"INTERMEDIO","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"servicePlanId":3,"servicePlanPeriodId":13,"price":500,"hasIndividualPrice":false,"totalPrice":500,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":null,"activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":null,"invoicingPeriodType":1,"invoicingPeriodStartDay":1,"nextInvoicingDayAdjustment":10,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"INTERMEDIO","servicePlanPrice":500,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":12,"uploadSpeed":12,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":null,"unmsClientSiteId":"9a0290aa-e3d5-4597-8f68-729571f76695","attributes":[],"addressData":null,"suspensionReasonId":null,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[],"surcharges":[]},"entityBeforeEdit":null}}
[2025-01-24 4:35:32.430568] [notice] Logging level set to:debug
[2025-01-24 4:35:32.568543] [debug] valor el evento recibido por webhook: service.edit
[2025-01-24 4:35:32.568634] [debug] Valor de JSON: {"uuid":"94459419-9189-4612-855a-93c3d649c010","changeType":"edit","entity":"service","entityId":"130","eventName":"service.edit","extraData":{"entity":{"id":130,"prepaid":false,"clientId":163,"status":7,"name":"INTERMEDIO","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"servicePlanId":3,"servicePlanPeriodId":13,"price":500,"hasIndividualPrice":false,"totalPrice":500,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":null,"activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":null,"invoicingPeriodType":1,"invoicingPeriodStartDay":1,"nextInvoicingDayAdjustment":10,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"INTERMEDIO","servicePlanPrice":500,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":12,"uploadSpeed":12,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":null,"unmsClientSiteId":"9a0290aa-e3d5-4597-8f68-729571f76695","attributes":[],"addressData":null,"suspensionReasonId":null,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[],"surcharges":[]},"entityBeforeEdit":{"id":130,"prepaid":false,"clientId":163,"status":7,"name":"INTERMEDIO","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"servicePlanId":3,"servicePlanPeriodId":13,"price":500,"hasIndividualPrice":false,"totalPrice":500,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":null,"activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":null,"invoicingPeriodType":1,"invoicingPeriodStartDay":1,"nextInvoicingDayAdjustment":10,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"INTERMEDIO","servicePlanPrice":500,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":12,"uploadSpeed":12,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":null,"unmsClientSiteId":"9a0290aa-e3d5-4597-8f68-729571f76695","attributes":[],"addressData":null,"suspensionReasonId":null,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[],"surcharges":[]}}}
[2025-01-24 6:25:06.379214] [notice] Logging level set to:debug
[2025-01-24 6:25:06.939824] [debug] valor el evento recibido por webhook: invoice.overdue
[2025-01-24 6:25:06.939898] [debug] Valor de JSON: {"uuid":"70ecb3b0-3eff-4bcd-8998-076c832270c5","changeType":"overdue","entity":"invoice","entityId":"1436","eventName":"invoice.overdue","extraData":{"entity":{"id":1436,"clientId":118,"number":"001400","createdDate":"2025-01-09T10:00:01-0600","dueDate":"2025-01-23T10:00:01-0600","emailSentDate":"2025-01-24T00:00:00-0600","maturityDays":14,"taxableSupplyDate":"2025-01-07T18:00:00-0600","notes":null,"adminNotes":null,"items":[{"id":1439,"type":"service","label":"plan300 09\/12\/2024 \u2013 08\/01\/2025","price":300,"quantity":1,"total":300,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":105,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":0,"discountQuantity":0,"discountTotal":0}],"subtotal":300,"discount":null,"discountLabel":"Descuento","taxes":[],"total":300,"amountPaid":0,"totalUntaxed":300,"totalDiscount":0,"totalTaxAmount":0,"amountToPay":300,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"Toro Sentado","clientLastName":"Ram\u00edrez","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":"56 Chiapas","clientStreet2":null,"clientCity":"Dolores Hidalgo Cuna de la Independencia Nacional","clientCountryId":173,"clientStateId":null,"clientZipCode":"37800","attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"entityBeforeEdit":null}}
[2025-01-24 6:25:06.940144] [debug] Factura vencida
[2025-01-24 6:25:06.940201] [debug] datos del notification para el invoice overdue:{"uuid":"70ecb3b0-3eff-4bcd-8998-076c832270c5","changeType":"overdue","entity":"invoice","entityId":1436,"message":null,"clientId":118,"eventName":"invoice.overdue","clientData":{"id":118,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"56 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 56, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-04-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Toro Sentado","lastName":"Ram\u00edrez","username":null,"contacts":[{"id":122,"clientId":118,"email":"pepeeltoro141089@gmail.com","phone":"4181878106","name":null,"isBilling":true,"isContact":true,"types":[{"id":1,"name":"Billing"},{"id":2,"name":"General"},{"id":1000,"name":"WhatsApp"}]}],"attributes":[{"id":119,"clientId":118,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"002180173419260258","clientZoneVisible":true}],"accountBalance":-2400,"accountCredit":0,"accountOutstanding":2400,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#fb8c00","addressGpsLat":21.1572733,"addressGpsLon":-100.9403274,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":true,"hasOutage":false,"hasSuspendedService":true,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":{"id":1436,"clientId":118,"number":"001400","createdDate":"2025-01-09T10:00:01-0600","dueDate":"2025-01-23T10:00:01-0600","emailSentDate":"2025-01-24T00:00:00-0600","maturityDays":14,"taxableSupplyDate":"2025-01-07T18:00:00-0600","notes":null,"adminNotes":null,"items":[{"id":1439,"type":"service","label":"plan300 09\/12\/2024 \u2013 08\/01\/2025","price":300,"quantity":1,"total":300,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":105,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":-0,"discountQuantity":0,"discountTotal":-0}],"subtotal":300,"discount":null,"discountLabel":"Descuento","taxes":[],"total":300,"amountPaid":0,"totalUntaxed":300,"totalDiscount":-0,"totalTaxAmount":0,"amountToPay":300,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"Toro Sentado","clientLastName":"Ram\u00edrez","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":"56 Chiapas","clientStreet2":null,"clientCity":"Dolores Hidalgo Cuna de la Independencia Nacional","clientCountryId":173,"clientStateId":null,"clientZipCode":"37800","attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"paymentData":null}
[2025-01-24 6:25:06.940234] [debug] ***Se notifica al cliente que la factura de su servicio está vencida***
[2025-01-24 6:25:06.940365] [debug] Numero de cel obtenido
[2025-01-24 6:25:06.940381] [warning] No se encontró un teléfono celular válido para el cliente: 118
[2025-01-24 15:48:31.074307] [notice] Logging level set to:debug
[2025-01-24 15:48:31.176049] [debug] valor el evento recibido por webhook: client.edit
[2025-01-24 15:48:31.176217] [debug] Valor de JSON: {"uuid":"1207a9de-5172-44c5-b56f-e9537c3d838a","changeType":"edit","entity":"client","entityId":"163","eventName":"client.edit","extraData":{"entity":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":163,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 15:48:31.176495] [debug] Se actualiza a un cliente
[2025-01-24 15:48:31.176604] [debug] Valor de json_data: {"uuid":"1207a9de-5172-44c5-b56f-e9537c3d838a","changeType":"edit","entity":"client","entityId":"163","eventName":"client.edit","extraData":{"entity":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":163,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 15:48:31.176661] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 15:48:31.176709] [debug] Los datos entityBeforeEdit y entity contienen el campo isLead
[2025-01-24 15:48:31.176757] [debug] El campo isLead cambió de true a false
[2025-01-24 15:48:31.242400] [info] ID correspondiente a 'Customer Stripe ID': 10
[2025-01-24 15:48:31.245258] [info] El valor de 'isLead' es: false
[2025-01-24 15:48:31.245366] [info] El cliente NO es un lead, se procesará
[2025-01-24 15:48:31.245424] [info] Creando el Customer Stripe
[2025-01-24 15:48:31.245472] [info] El cliente a procesar es : Juan Ramirez Gueerero
[2025-01-24 15:48:31.245534] [info] Datos notificationData: {"uuid":"1207a9de-5172-44c5-b56f-e9537c3d838a","changeType":"edit","entity":"client","entityId":163,"message":null,"clientId":163,"eventName":"client.edit","clientData":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":null}
[2025-01-24 15:48:31.245589] [info] Ya dentro del FOREACH!!!
[2025-01-24 15:48:31.245635] [info] REVISANDO EL PRIMER CONTACTO!!!
[2025-01-24 15:48:31.245682] [info] SE VALIDA EL EMAIL!!!
[2025-01-24 15:48:31.246484] [info] ahora se procede a validar el teléfono!!!
[2025-01-24 15:48:31.246653] [info] AHORA SE MANDA A CREAR EL CLIENTE A STRIPE!!!
[2025-01-24 15:48:31.870918] [info] {"id":"cus_Re7MGhVHdTArv4","object":"customer","address":null,"balance":0,"created":1737733711,"currency":null,"default_source":null,"delinquent":false,"description":"Cliente SIIP CRM con client_id: 163","discount":null,"email":"rmgjuan@gmail.com","invoice_prefix":"29FB0ED3","invoice_settings":{"custom_fields":null,"default_payment_method":null,"footer":null,"rendering_options":null},"livemode":false,"metadata":[],"name":"Juan Ramirez Gueerero","next_invoice_sequence":1,"phone":"4181876543","preferred_locales":["es-419"],"shipping":null,"tax_exempt":"none","test_clock":null}
[2025-01-24 15:48:34.194176] [info] {"id":"cus_Re7MGhVHdTArv4","object":"customer","address":null,"balance":0,"created":1737733711,"currency":null,"default_source":null,"delinquent":false,"description":"Cliente SIIP CRM con client_id: 163","discount":null,"email":"rmgjuan@gmail.com","invoice_prefix":"29FB0ED3","invoice_settings":{"custom_fields":null,"default_payment_method":null,"footer":null,"rendering_options":null},"livemode":false,"metadata":{"ucrm_client_id":"163"},"name":"Juan Ramirez Gueerero","next_invoice_sequence":1,"phone":"4181876543","preferred_locales":["es-419"],"shipping":null,"tax_exempt":"none","test_clock":null}
[2025-01-24 15:48:34.673861] [notice] Logging level set to:debug
[2025-01-24 15:48:34.674166] [info] No UUID found in the webhook data
[2025-01-24 15:48:36.642779] [info] {"object":"funding_instructions","bank_transfer":{"country":"MX","financial_addresses":[{"spei":{"account_holder_address":{"city":"Ciudad de M\u00e9xico","country":"MX","line1":"Av Paseo de la Reforma 180 piso 29 col Juarez","line2":null,"postal_code":"06600","state":"Ciudad de M\u00e9xico"},"account_holder_name":"SIIP INTERNET","bank_address":{"city":"Naucalpan","country":"MX","line1":"Blvd. Manuel Avila Camacho 1902","line2":"Planta Baja, Cd. Satelite","postal_code":"C.P. 53100","state":"Estado de Mexico"},"bank_code":"124","bank_name":"CITI MEXICO","clabe":"124180636412837853"},"supported_networks":["spei"],"type":"spei"}],"type":"mx_bank_transfer"},"currency":"mxn","funding_type":"bank_transfer","livemode":false}
[2025-01-24 15:48:36.960540] [info] CLABE guardada en metadata: 124180636412837853
[2025-01-24 15:48:37.153096] [info] {}
[2025-01-24 15:48:37.154201] [debug] {"uuid":"1207a9de-5172-44c5-b56f-e9537c3d838a","changeType":"edit","entity":"client","entityId":163,"message":null,"clientId":163,"eventName":"client.edit","clientData":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":null}
[2025-01-24 15:48:37.302537] [notice] Logging level set to:debug
[2025-01-24 15:48:37.387998] [debug] valor el evento recibido por webhook: client.edit
[2025-01-24 15:48:37.388186] [debug] Valor de JSON: {"uuid":"b99cd812-950c-465c-908b-588923d3c934","changeType":"edit","entity":"client","entityId":"163","eventName":"client.edit","extraData":{"entity":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[{"id":168,"clientId":163,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_Re7MGhVHdTArv4","clientZoneVisible":true},{"id":169,"clientId":163,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"124180636412837853","clientZoneVisible":true}],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 15:48:37.388487] [debug] Se actualiza a un cliente
[2025-01-24 15:48:37.388573] [debug] Valor de json_data: {"uuid":"b99cd812-950c-465c-908b-588923d3c934","changeType":"edit","entity":"client","entityId":"163","eventName":"client.edit","extraData":{"entity":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[{"id":168,"clientId":163,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_Re7MGhVHdTArv4","clientZoneVisible":true},{"id":169,"clientId":163,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"124180636412837853","clientZoneVisible":true}],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 15:48:37.388628] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 15:48:37.388674] [debug] Los datos entityBeforeEdit y entity contienen el campo isLead
[2025-01-24 15:48:37.388720] [debug] No hubo cambio de true a false en el campo isLead
[2025-01-24 15:48:37.388793] [debug] {"uuid":"b99cd812-950c-465c-908b-588923d3c934","changeType":"edit","entity":"client","entityId":163,"message":null,"clientId":163,"eventName":"client.edit","clientData":{"id":163,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"45 Tamaulipas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Tamaulipas 45, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-07T00:00:00-0600","leadConvertedAt":"2025-01-24T09:48:30-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Juan","lastName":"Ramirez Gueerero","username":"rmgjuan@gmail.com","contacts":[{"id":167,"clientId":163,"email":"rmgjuan@gmail.com","phone":"4181876543","name":null,"isBilling":false,"isContact":true,"types":[{"id":2,"name":"General"}]}],"attributes":[{"id":168,"clientId":163,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_Re7MGhVHdTArv4","clientZoneVisible":true},{"id":169,"clientId":163,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"124180636412837853","clientZoneVisible":true}],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f4511e","addressGpsLat":21.1562555,"addressGpsLon":-100.9302794,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":true,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":null}
[2025-01-24 15:48:37.390886] [notice] Logging level set to:debug
[2025-01-24 15:48:37.391066] [info] No UUID found in the webhook data
[2025-01-24 15:49:18.368396] [notice] Logging level set to:debug
[2025-01-24 15:49:18.452897] [debug] valor el evento recibido por webhook: client.edit
[2025-01-24 15:49:18.453103] [debug] Valor de JSON: {"uuid":"962918fc-8e81-470a-8782-3a25f0976598","changeType":"edit","entity":"client","entityId":"2","eventName":"client.edit","extraData":{"entity":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 15:49:18.453388] [debug] Se actualiza a un cliente
[2025-01-24 15:49:18.453497] [debug] Valor de json_data: {"uuid":"962918fc-8e81-470a-8782-3a25f0976598","changeType":"edit","entity":"client","entityId":"2","eventName":"client.edit","extraData":{"entity":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 15:49:18.453558] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 15:49:18.453605] [debug] Los datos entityBeforeEdit y entity contienen el campo isLead
[2025-01-24 15:49:18.453651] [debug] No hubo cambio de true a false en el campo isLead
[2025-01-24 15:49:18.453727] [debug] {"uuid":"962918fc-8e81-470a-8782-3a25f0976598","changeType":"edit","entity":"client","entityId":2,"message":null,"clientId":2,"eventName":"client.edit","clientData":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":null}
[2025-01-24 15:49:18.453895] [info] Se proceso los contactos
[2025-01-24 15:49:18.454161] [info] Se actualizara el correo del cliente en Stripe: dhsv.141089@gmail.com
Dentro del proceso del patch:
Datos traidos con payment api: [{"id":506,"clientId":162,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-12T22:10:30-0600","amount":180,"currencyCode":"MXN","note":null,"receiptSentDate":"2025-01-12T22:10:31-0600","providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":180,"userId":null,"attributes":[]}]
Datos traidos con payment api: [{"id":517,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-22T03:48:11-0600","amount":235,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":235,"userId":1015,"attributes":[]}]
Nombre del cliente que se va a actualizar: Edward Elric
Nombre del cliente que se va a actualizar: Daniel Humberto Soto Villegas
UUID: 74cc2bb45eb8409f92cd5dba99200d26
JSON con los datos a actualizar: {"name":"Edward Elric","custom_fields":{"Cliente":162,"Domicilio":"\ud83d\udccd Chiapas 76, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","Nombre":"\ud83d\udc64 Edward Elric","URL":"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/162","Saldo Actual":"\ud83d\udcb2180 a favor","Monto Ultimo Pago":"\ud83d\udcb2 180","Estado":"\ud83d\udfe2 Activo ","Resumen":"{\"Cliente\": \"162\",\"Domicilio\": \"\ud83d\udccd Chiapas 76, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico\",\"Nombre\": \"\ud83d\udc64 Edward Elric\",\"URL\": \"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/162\",\"Saldo Actual\": \"\ud83d\udcb2180 a favor\",\"Monto Ultimo Pago\": \"\ud83d\udcb2 180\",\"Estado\": \"\ud83d\udfe2 Activo\",\"Fecha Ultimo Pago\": \"\ud83d\udcc6\ud83d\udcb0 12\/01\/2025 22:10 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3\",\"Fecha Ultima Actualizacion\": \"\ud83d\udcc6\ud83d\udd04\ufe0f 12\/01\/2025 22:10\",\"Clabe Transferencia Banamex\": \"\"}","Fecha Ultimo Pago":"\ud83d\udcc6\ud83d\udcb8 12\/01\/2025 22:10 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3","Fecha Ultima Actualizacion":"\ud83d\udcc6\ud83d\udd04\ufe0f 12\/01\/2025 22:10","Clabe Transferencia Banamex":null}}
JSON con los datos a actualizar: {"name":"Daniel Humberto Soto Villegas","custom_fields":{"Cliente":2,"Domicilio":"\ud83d\udccd Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","Nombre":"\ud83d\udc64 Daniel Humberto Soto Villegas","URL":"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/2","Saldo Actual":"\ud83d\udcb29545 a favor","Monto Ultimo Pago":"\ud83d\udcb2 235","Estado":"\ud83d\udfe2 Activo ","Resumen":"{\"Cliente\": \"2\",\"Domicilio\": \"\ud83d\udccd Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico\",\"Nombre\": \"\ud83d\udc64 Daniel Humberto Soto Villegas\",\"URL\": \"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/2\",\"Saldo Actual\": \"\ud83d\udcb29545 a favor\",\"Monto Ultimo Pago\": \"\ud83d\udcb2 235\",\"Estado\": \"\ud83d\udfe2 Activo\",\"Fecha Ultimo Pago\": \"\ud83d\udcc6\ud83d\udcb0 22\/01\/2025 03:48 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3\",\"Fecha Ultima Actualizacion\": \"\ud83d\udcc6\ud83d\udd04\ufe0f 24\/01\/2025 09:49\",\"Clabe Interbancaria\": \"0021804341999569810\"}","Fecha Ultimo Pago":"\ud83d\udcc6\ud83d\udcb8 22\/01\/2025 03:48 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3","Fecha Ultima Actualizacion":"\ud83d\udcc6\ud83d\udd04\ufe0f 24\/01\/2025 09:49","Clabe Interbancaria":"0021804341999569810"}}
Response Patch CallBell: {"contact":{"uuid":"74cc2bb45eb8409f92cd5dba99200d26","name":"Edward Elric","phoneNumber":"5214181878106","avatarUrl":null,"createdAt":"2024-01-08T17:04:13Z","closedAt":"2025-01-13T04:07:26Z","source":"whatsapp","href":"https://dash.callbell.eu/contacts/74cc2bb45eb8409f92cd5dba99200d26","conversationHref":"https://dash.callbell.eu/chat/53c8229c428c4081b197ab136feab73b","tags":[],"assignedUser":null,"customFields":{"Clabe Transferencia Banamex":"124180599808752427","Cliente":"162","user entry point":"inbound_message","Domicilio":"📍 Chiapas 76, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México","Nombre":"👤 Edward Elric","Monto Ultimo Pago":"💲 180","URL":"🌐 https://172.16.5.120/crm/client/162","Fecha Ultima Actualizacion":"📆🔄️ 12/01/2025 22:10","user name":"Daniel Humberto 🐁","Estado":"🟢 Activo ","Fecha Ultimo Pago":"📆💸 12/01/2025 22:10 con Tarjeta de crédito Stripe 💳","Resumen":"{\"Cliente\": \"162\",\"Domicilio\": \"📍 Chiapas 76, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México\",\"Nombre\": \"👤 Edward Elric\",\"URL\": \"🌐 https://172.16.5.120/crm/client/162\",\"Saldo Actual\": \"💲180 a favor\",\"Monto Ultimo Pago\": \"💲 180\",\"Estado\": \"🟢 Activo\",\"Fecha Ultimo Pago\": \"📆💰 12/01/2025 22:10 con Tarjeta de crédito Stripe 💳\",\"Fecha Ultima Actualizacion\": \"📆🔄️ 12/01/2025 22:10\",\"Clabe Transferencia Banamex\": \"\"}","Saldo Actual":"💲180 a favor"},"team":{"uuid":"5faeed738d6a44ccacf6509762eb288d","name":"General","default":true,"members":8,"createdAt":"2023-11-07T00:37:10Z"},"channel":{"uuid":"dbaa248932634e7ea4346a320960c24a","title":null,"type":"whatsapp","main":true},"blockedAt":null}}
Response Patch CallBell: {"contact":{"uuid":"74cc2bb45eb8409f92cd5dba99200d26","name":"Daniel Humberto Soto Villegas","phoneNumber":"5214181878106","avatarUrl":null,"createdAt":"2024-01-08T17:04:13Z","closedAt":"2025-01-18T00:00:11Z","source":"whatsapp","href":"https://dash.callbell.eu/contacts/74cc2bb45eb8409f92cd5dba99200d26","conversationHref":"https://dash.callbell.eu/chat/53c8229c428c4081b197ab136feab73b","tags":[],"assignedUser":null,"customFields":{"Clabe Interbancaria":"0021804341999569810","Cliente":"2","user entry point":"inbound_message","Monto Ultimo Pago":"💲 235","URL":"🌐 https://172.16.5.120/crm/client/2","Fecha Ultima Actualizacion":"📆🔄️ 24/01/2025 09:49","user name":"Daniel Humberto 🐁","Estado":"🟢 Activo ","Fecha Ultimo Pago":"📆💸 22/01/2025 03:48 con Tarjeta de crédito Stripe 💳","Saldo Actual":"💲9545 a favor","Nombre":"👤 Daniel Humberto Soto Villegas","Domicilio":"📍 Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México","Resumen":"{\"Cliente\": \"2\",\"Domicilio\": \"📍 Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México\",\"Nombre\": \"👤 Daniel Humberto Soto Villegas\",\"URL\": \"🌐 https://172.16.5.120/crm/client/2\",\"Saldo Actual\": \"💲9545 a favor\",\"Monto Ultimo Pago\": \"💲 235\",\"Estado\": \"🟢 Activo\",\"Fecha Ultimo Pago\": \"📆💰 22/01/2025 03:48 con Tarjeta de crédito Stripe 💳\",\"Fecha Ultima Actualizacion\": \"📆🔄️ 24/01/2025 09:49\",\"Clabe Interbancaria\": \"0021804341999569810\"}"},"team":{"uuid":"5faeed738d6a44ccacf6509762eb288d","name":"General","default":true,"members":8,"createdAt":"2023-11-07T00:37:10Z"},"channel":{"uuid":"dbaa248932634e7ea4346a320960c24a","title":null,"type":"whatsapp","main":true},"blockedAt":null}}
[2025-01-13 4:10:47.768976] [debug] HTTP request processing ended.
[2025-01-13 5:26:30.201463] [notice] Logging level set to:debug
[2025-01-13 5:26:30.201580] [debug] El valor de webhook_string: {"type":"oxxo.request","client_id":162}
[2025-01-24 15:49:20.976260] [info] Tipo de contacto no reconocido: WhatsNotifica
[2025-01-13 5:26:30.201600] [info] Evento de referencia de oxxo recibido
[2025-01-24 15:50:42.518944] [notice] Logging level set to:debug
[2025-01-24 15:50:42.617646] [debug] valor el evento recibido por webhook: client.edit
[2025-01-13 5:26:30.201613] [info] Creando referencia del cliente para OXXO:
[2025-01-24 15:50:42.617744] [debug] Valor de JSON: {"uuid":"13875e0f-b326-4236-9e0c-1db92426baa8","changeType":"edit","entity":"client","entityId":"2","eventName":"client.edit","extraData":{"entity":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas x","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-13 5:26:30.326323] [info] Se obtuvieron los datos del cliente y Stripe Customer ID: cus_RYsuykCEvupaGF
[2025-01-24 15:50:42.617964] [debug] Se actualiza a un cliente
[2025-01-24 15:50:42.618015] [debug] Valor de json_data: {"uuid":"13875e0f-b326-4236-9e0c-1db92426baa8","changeType":"edit","entity":"client","entityId":"2","eventName":"client.edit","extraData":{"entity":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas x","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 15:50:42.618032] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 15:50:42.618041] [debug] Los datos entityBeforeEdit y entity contienen el campo isLead
[2025-01-24 15:50:42.618051] [debug] No hubo cambio de true a false en el campo isLead
[2025-01-24 15:50:42.618092] [debug] {"uuid":"13875e0f-b326-4236-9e0c-1db92426baa8","changeType":"edit","entity":"client","entityId":2,"message":null,"clientId":2,"eventName":"client.edit","clientData":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas x","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Transferencia Banamex","key":"clabeTransferenciaBanamex","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":null}
[2025-01-13 5:26:30.326442] [info] Este cliente no tiene adeudos por lo tanto no se puede generar su referencia de OXXO.
[2025-01-24 15:50:42.618216] [info] Se proceso los contactos
[2025-01-13 5:26:30.326833] [info] Creando referencia del cliente para OXXO:
[2025-01-24 15:50:42.618453] [info] Se actualizara el correo del cliente en Stripe: dhsv.141089@gmail.com
[2025-01-13 5:26:30.427974] [info] Se obtuvieron los datos del cliente y Stripe Customer ID: cus_RYsuykCEvupaGF
Dentro del proceso del patch:
[2025-01-13 5:26:30.428137] [info] Este cliente no tiene adeudos por lo tanto no se puede generar su referencia de OXXO.
Datos traidos con payment api: [{"id":517,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-22T03:48:11-0600","amount":235,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":235,"userId":1015,"attributes":[]}]
[2025-01-13 5:26:30.428421] [info] Creando referencia del cliente para OXXO:
Nombre del cliente que se va a actualizar: Daniel Humberto Soto Villegas x
[2025-01-13 5:26:30.524568] [info] Se obtuvieron los datos del cliente y Stripe Customer ID: cus_RYsuykCEvupaGF
UUID: 74cc2bb45eb8409f92cd5dba99200d26
[2025-01-13 5:26:30.524697] [info] Este cliente no tiene adeudos por lo tanto no se puede generar su referencia de OXXO.
JSON con los datos a actualizar: {"name":"Daniel Humberto Soto Villegas x","custom_fields":{"Cliente":2,"Domicilio":"\ud83d\udccd Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","Nombre":"\ud83d\udc64 Daniel Humberto Soto Villegas x","URL":"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/2","Saldo Actual":"\ud83d\udcb29545 a favor","Monto Ultimo Pago":"\ud83d\udcb2 235","Estado":"\ud83d\udfe2 Activo ","Resumen":"{\"Cliente\": \"2\",\"Domicilio\": \"\ud83d\udccd Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico\",\"Nombre\": \"\ud83d\udc64 Daniel Humberto Soto Villegas x\",\"URL\": \"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/2\",\"Saldo Actual\": \"\ud83d\udcb29545 a favor\",\"Monto Ultimo Pago\": \"\ud83d\udcb2 235\",\"Estado\": \"\ud83d\udfe2 Activo\",\"Fecha Ultimo Pago\": \"\ud83d\udcc6\ud83d\udcb0 22\/01\/2025 03:48 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3\",\"Fecha Ultima Actualizacion\": \"\ud83d\udcc6\ud83d\udd04\ufe0f 24\/01\/2025 09:50\",\"Clabe Interbancaria\": \"0021804341999569810\"}","Fecha Ultimo Pago":"\ud83d\udcc6\ud83d\udcb8 22\/01\/2025 03:48 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3","Fecha Ultima Actualizacion":"\ud83d\udcc6\ud83d\udd04\ufe0f 24\/01\/2025 09:50","Clabe Interbancaria":"0021804341999569810"}}
[2025-01-13 5:26:30.524967] [info] Creando referencia del cliente para OXXO:
Response Patch CallBell: {"contact":{"uuid":"74cc2bb45eb8409f92cd5dba99200d26","name":"Daniel Humberto Soto Villegas x","phoneNumber":"5214181878106","avatarUrl":null,"createdAt":"2024-01-08T17:04:13Z","closedAt":"2025-01-18T00:00:11Z","source":"whatsapp","href":"https://dash.callbell.eu/contacts/74cc2bb45eb8409f92cd5dba99200d26","conversationHref":"https://dash.callbell.eu/chat/53c8229c428c4081b197ab136feab73b","tags":[],"assignedUser":null,"customFields":{"Clabe Interbancaria":"0021804341999569810","Cliente":"2","user entry point":"inbound_message","Monto Ultimo Pago":"💲 235","URL":"🌐 https://172.16.5.120/crm/client/2","Fecha Ultima Actualizacion":"📆🔄️ 24/01/2025 09:50","user name":"Daniel Humberto 🐁","Estado":"🟢 Activo ","Fecha Ultimo Pago":"📆💸 22/01/2025 03:48 con Tarjeta de crédito Stripe 💳","Saldo Actual":"💲9545 a favor","Nombre":"👤 Daniel Humberto Soto Villegas x","Domicilio":"📍 Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México","Resumen":"{\"Cliente\": \"2\",\"Domicilio\": \"📍 Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México\",\"Nombre\": \"👤 Daniel Humberto Soto Villegas x\",\"URL\": \"🌐 https://172.16.5.120/crm/client/2\",\"Saldo Actual\": \"💲9545 a favor\",\"Monto Ultimo Pago\": \"💲 235\",\"Estado\": \"🟢 Activo\",\"Fecha Ultimo Pago\": \"📆💰 22/01/2025 03:48 con Tarjeta de crédito Stripe 💳\",\"Fecha Ultima Actualizacion\": \"📆🔄️ 24/01/2025 09:50\",\"Clabe Interbancaria\": \"0021804341999569810\"}"},"team":{"uuid":"5faeed738d6a44ccacf6509762eb288d","name":"General","default":true,"members":8,"createdAt":"2023-11-07T00:37:10Z"},"channel":{"uuid":"dbaa248932634e7ea4346a320960c24a","title":null,"type":"whatsapp","main":true},"blockedAt":null}}
[2025-01-13 5:26:30.621985] [info] Se obtuvieron los datos del cliente y Stripe Customer ID: cus_RYsuykCEvupaGF
[2025-01-24 15:50:45.092567] [info] Tipo de contacto no reconocido: WhatsNotifica
[2025-01-13 5:26:30.622114] [info] Este cliente no tiene adeudos por lo tanto no se puede generar su referencia de OXXO.
[2025-01-24 16:00:05.110285] [notice] Logging level set to:debug
[2025-01-24 16:00:05.367860] [debug] valor el evento recibido por webhook: invoice.add_draft
[2025-01-13 5:26:30.622395] [info] Creando referencia del cliente para OXXO:
[2025-01-24 16:00:05.367923] [debug] Valor de JSON: {"uuid":"eb6b4bd3-f067-4099-8ba5-7b2c660ab451","changeType":"insert","entity":"invoice","entityId":"1447","eventName":"invoice.add_draft","extraData":{"entity":{"id":1447,"clientId":126,"number":"001411","createdDate":"2025-01-24T10:00:01-0600","dueDate":"2025-02-07T10:00:01-0600","emailSentDate":null,"maturityDays":14,"taxableSupplyDate":"2025-01-23T00:00:00+0000","notes":null,"adminNotes":null,"items":[{"id":1450,"type":"service","label":"PREMIUM 24\/12\/2024 \u2013 23\/01\/2025","price":700,"quantity":1,"total":700,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":108,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":0,"discountQuantity":0,"discountTotal":0}],"subtotal":700,"discount":null,"discountLabel":"Descuento","taxes":[],"total":700,"amountPaid":0,"totalUntaxed":700,"totalDiscount":0,"totalTaxAmount":0,"amountToPay":700,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"DANIEL INNU","clientLastName":"RATA","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":"Chiapas","clientStreet2":null,"clientCity":"Dolores Hidalgo Cuna de la Independencia Nacional","clientCountryId":173,"clientStateId":null,"clientZipCode":"37800","attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"entityBeforeEdit":null}}
[2025-01-13 5:26:30.723656] [info] Se obtuvieron los datos del cliente y Stripe Customer ID: cus_RYsuykCEvupaGF
[2025-01-24 16:00:05.588649] [notice] Logging level set to:debug
[2025-01-24 16:00:05.754511] [debug] valor el evento recibido por webhook: invoice.draft_approved
[2025-01-13 5:26:30.723881] [info] Este cliente no tiene adeudos por lo tanto no se puede generar su referencia de OXXO.
[2025-01-24 16:00:05.754584] [debug] Valor de JSON: {"uuid":"507f8baa-6eda-407d-a355-01d389d4aa51","changeType":"draft_approved","entity":"invoice","entityId":"1447","eventName":"invoice.draft_approved","extraData":{"entity":{"id":1447,"clientId":126,"number":"001411","createdDate":"2025-01-24T10:00:01-0600","dueDate":"2025-02-07T10:00:01-0600","emailSentDate":null,"maturityDays":14,"taxableSupplyDate":"2025-01-23T00:00:00+0000","notes":null,"adminNotes":null,"items":[{"id":1450,"type":"service","label":"PREMIUM 24\/12\/2024 \u2013 23\/01\/2025","price":700,"quantity":1,"total":700,"unit":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"serviceId":108,"serviceSurchargeId":null,"productId":null,"feeId":null,"discountPrice":0,"discountQuantity":0,"discountTotal":0}],"subtotal":700,"discount":null,"discountLabel":"Descuento","taxes":[],"total":700,"amountPaid":0,"totalUntaxed":700,"totalDiscount":0,"totalTaxAmount":0,"amountToPay":700,"currencyCode":"MXN","status":1,"paymentCovers":[],"invoiceTemplateId":2,"proformaInvoiceTemplateId":2,"organizationName":"SIIP Pruebas","organizationRegistrationNumber":null,"organizationTaxId":null,"organizationStreet1":"Morel 34","organizationStreet2":null,"organizationCity":"Dolores Hidalgo","organizationStateId":null,"organizationCountryId":173,"organizationZipCode":"37800","organizationBankAccountName":null,"organizationBankAccountField1":null,"organizationBankAccountField2":null,"clientFirstName":"DANIEL INNU","clientLastName":"RATA","clientCompanyName":null,"clientCompanyRegistrationNumber":null,"clientCompanyTaxId":null,"clientStreet1":"Chiapas","clientStreet2":null,"clientCity":"Dolores Hidalgo Cuna de la Independencia Nacional","clientCountryId":173,"clientStateId":null,"clientZipCode":"37800","attributes":[],"uncollectible":false,"proforma":false,"generatedInvoiceId":null,"proformaInvoiceId":null,"isAppliedVatReverseCharge":false,"payAutomatically":false},"entityBeforeEdit":null}}
[2025-01-24 16:04:53.075215] [notice] Logging level set to:debug
[2025-01-24 16:04:53.198448] [debug] valor el evento recibido por webhook: client.edit
[2025-01-24 16:04:53.198540] [debug] Valor de JSON: {"uuid":"9f38dcba-aa40-42fb-bf8d-c78605e0f225","changeType":"edit","entity":"client","entityId":"2","eventName":"client.edit","extraData":{"entity":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas Test","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Interbancaria","key":"clabeInterbancaria","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas x","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Interbancaria","key":"clabeInterbancaria","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 16:04:53.198796] [debug] Se actualiza a un cliente
[2025-01-24 16:04:53.198844] [debug] Valor de json_data: {"uuid":"9f38dcba-aa40-42fb-bf8d-c78605e0f225","changeType":"edit","entity":"client","entityId":"2","eventName":"client.edit","extraData":{"entity":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas Test","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Interbancaria","key":"clabeInterbancaria","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas x","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Interbancaria","key":"clabeInterbancaria","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
[2025-01-24 16:04:53.198869] [debug] Validando claves dentro de entityBeforeEdit y entity
[2025-01-24 16:04:53.198880] [debug] Los datos entityBeforeEdit y entity contienen el campo isLead
[2025-01-24 16:04:53.198889] [debug] No hubo cambio de true a false en el campo isLead
[2025-01-24 16:04:53.198936] [debug] {"uuid":"9f38dcba-aa40-42fb-bf8d-c78605e0f225","changeType":"edit","entity":"client","entityId":2,"message":null,"clientId":2,"eventName":"client.edit","clientData":{"id":2,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"31 Chiapas","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37800","fullAddress":"Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2024-01-25T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":true,"firstName":"Daniel Humberto","lastName":"Soto Villegas Test","username":"danydhsv","contacts":[{"id":2,"clientId":2,"email":"dhsv.141089@gmail.com","phone":"5214181878106","name":"Personal","isBilling":false,"isContact":false,"types":[{"id":1000,"name":"WhatsApp"}]},{"id":170,"clientId":2,"email":"chavoloco@homail.com","phone":"4181148783","name":"Tio","isBilling":false,"isContact":false,"types":[{"id":1003,"name":"WhatsNotifica"}]}],"attributes":[{"id":112,"clientId":2,"customAttributeId":10,"name":"Stripe Customer ID","key":"stripeCustomerId","value":"cus_PetN1dhr4rx0kX","clientZoneVisible":true},{"id":113,"clientId":2,"customAttributeId":11,"name":"Clabe Interbancaria","key":"clabeInterbancaria","value":"0021804341999569810","clientZoneVisible":true}],"accountBalance":9545,"accountCredit":9545,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#f1df43","addressGpsLat":21.1564209,"addressGpsLon":-100.9384185,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":true,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"serviceData":null,"invoiceData":null,"paymentData":null}
[2025-01-24 16:04:53.199054] [info] Se proceso los contactos
[2025-01-24 16:04:53.199295] [info] Se actualizara el correo del cliente en Stripe: dhsv.141089@gmail.com
Dentro del proceso del patch:
Datos traidos con payment api: [{"id":517,"clientId":2,"methodId":"1dd098fa-5d63-4c8d-88b7-3c27ffbbb6ae","checkNumber":null,"createdDate":"2025-01-22T03:48:11-0600","amount":235,"currencyCode":"MXN","note":null,"receiptSentDate":null,"providerName":null,"providerPaymentId":null,"providerPaymentTime":null,"paymentCovers":[],"creditAmount":235,"userId":1015,"attributes":[]}]
Nombre del cliente que se va a actualizar: Daniel Humberto Soto Villegas Test
UUID: 74cc2bb45eb8409f92cd5dba99200d26
JSON con los datos a actualizar: {"name":"Daniel Humberto Soto Villegas Test","custom_fields":{"Cliente":2,"Domicilio":"\ud83d\udccd Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","Nombre":"\ud83d\udc64 Daniel Humberto Soto Villegas Test","URL":"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/2","Saldo Actual":"\ud83d\udcb29545 a favor","Monto Ultimo Pago":"\ud83d\udcb2 235","Estado":"\ud83d\udfe2 Activo ","Resumen":"{\"Cliente\": \"2\",\"Domicilio\": \"\ud83d\udccd Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico\",\"Nombre\": \"\ud83d\udc64 Daniel Humberto Soto Villegas Test\",\"URL\": \"\ud83c\udf10 https:\/\/172.16.5.120\/crm\/client\/2\",\"Saldo Actual\": \"\ud83d\udcb29545 a favor\",\"Monto Ultimo Pago\": \"\ud83d\udcb2 235\",\"Estado\": \"\ud83d\udfe2 Activo\",\"Fecha Ultimo Pago\": \"\ud83d\udcc6\ud83d\udcb0 22\/01\/2025 03:48 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3\",\"Fecha Ultima Actualizacion\": \"\ud83d\udcc6\ud83d\udd04\ufe0f 24\/01\/2025 10:04\",\"Clabe Interbancaria\": \"0021804341999569810\"}","Fecha Ultimo Pago":"\ud83d\udcc6\ud83d\udcb8 22\/01\/2025 03:48 con Tarjeta de cr\u00e9dito Stripe \ud83d\udcb3","Fecha Ultima Actualizacion":"\ud83d\udcc6\ud83d\udd04\ufe0f 24\/01\/2025 10:04","Clabe Interbancaria":"0021804341999569810"}}
Response Patch CallBell: {"contact":{"uuid":"74cc2bb45eb8409f92cd5dba99200d26","name":"Daniel Humberto Soto Villegas Test","phoneNumber":"5214181878106","avatarUrl":null,"createdAt":"2024-01-08T17:04:13Z","closedAt":"2025-01-18T00:00:11Z","source":"whatsapp","href":"https://dash.callbell.eu/contacts/74cc2bb45eb8409f92cd5dba99200d26","conversationHref":"https://dash.callbell.eu/chat/53c8229c428c4081b197ab136feab73b","tags":[],"assignedUser":null,"customFields":{"Clabe Interbancaria":"0021804341999569810","Cliente":"2","user entry point":"inbound_message","Monto Ultimo Pago":"💲 235","URL":"🌐 https://172.16.5.120/crm/client/2","Fecha Ultima Actualizacion":"📆🔄️ 24/01/2025 10:04","user name":"Daniel Humberto 🐁","Estado":"🟢 Activo ","Fecha Ultimo Pago":"📆💸 22/01/2025 03:48 con Tarjeta de crédito Stripe 💳","Saldo Actual":"💲9545 a favor","Nombre":"👤 Daniel Humberto Soto Villegas Test","Domicilio":"📍 Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México","Resumen":"{\"Cliente\": \"2\",\"Domicilio\": \"📍 Chiapas 31, Centro, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., México\",\"Nombre\": \"👤 Daniel Humberto Soto Villegas Test\",\"URL\": \"🌐 https://172.16.5.120/crm/client/2\",\"Saldo Actual\": \"💲9545 a favor\",\"Monto Ultimo Pago\": \"💲 235\",\"Estado\": \"🟢 Activo\",\"Fecha Ultimo Pago\": \"📆💰 22/01/2025 03:48 con Tarjeta de crédito Stripe 💳\",\"Fecha Ultima Actualizacion\": \"📆🔄️ 24/01/2025 10:04\",\"Clabe Interbancaria\": \"0021804341999569810\"}"},"team":{"uuid":"5faeed738d6a44ccacf6509762eb288d","name":"General","default":true,"members":8,"createdAt":"2023-11-07T00:37:10Z"},"channel":{"uuid":"dbaa248932634e7ea4346a320960c24a","title":null,"type":"whatsapp","main":true},"blockedAt":null}}
[2025-01-24 16:04:55.647032] [info] Tipo de contacto no reconocido: WhatsNotifica
[2025-01-13 5:26:30.724423] [debug] Reponse que se envía a CallBell: {"url": "errorsinadeudo"}
[2025-01-13 5:26:30.724517] [error] JSON error: No error
[2025-01-13 5:26:30.724570] [debug] HTTP request processing ended.

View File

@ -2,10 +2,10 @@
"version": "1",
"information": {
"name": "siip-whatsapp-notifications",
"displayName": "SIIP - Procesador de Pagos en línea con Stripe, Sincronizador de CallBell y Envío de Notificaciones y comprobantes vía WhatsApp",
"description": "Este plugin sincroniza los clientes del sitema UISP CRM con los contactos de WhatsApp en CallBell, además procesa pagos de Stripe como las trasferencias bancarias y genera referencias de pago vía OXXO, además envía comprobantes de pago en formato imagen PNG vía Whatsapp a los clientes",
"displayName": "SIIP - Procesador de Pagos en línea con Stripe, Oxxo y Transferencia, Sincronizador de CallBell y Envío de Notificaciones y comprobantes vía WhatsApp",
"description": "Este plugin sincroniza los clientes del sitema UISP CRM con los contactos de WhatsApp en CallBell, además procesa pagos de Stripe como las trasferencias bancarias y genera referencias de pago vía OXXO, además envía comprobantes de pago en formato imagen PNG o texto vía Whatsapp a los clientes",
"url": "https://siip.mx/",
"version": "2.5.3",
"version": "2.6.0",
"unmsVersionCompliancy": {
"min": "2.1.0",
"max": null
@ -154,10 +154,11 @@
"type": "checkbox"
},
{
"key": "dataInstallersWhatsApp",
"key": "installersDataWhatsApp",
"label": "Datos de los instaladores en formato JSON",
"description": "El número identificador (id) del instalador se obtiene desde la API del CRM en su ednpoint \"/api/v1.0/user\" y se debe de obtener el campo 'id' de cada instalador para agregarlo en este campo en formato JSON",
"required": 1,
"type": "text"
"type": "textarea"
},
{
"key": "debugMode",

View File

@ -10,6 +10,9 @@ use SmsNotifier\Service\Logger;
use SmsNotifier\Service\SmsNumberProvider;
use Twilio\Exceptions\HttpException;
use SmsNotifier\Facade\ClientCallBellAPI;
use GuzzleHttp\Client;
use Ubnt\UcrmPluginSdk\Service\UcrmApi;
use \DateTime;
/*
@ -38,6 +41,13 @@ abstract class AbstractMessageNotifierFacade
*/
private $pluginNotifierFacade;
/**
* @var UcrmApi
*/
protected $ucrmApi;
const SUBJECT_OF_INSTALLER_CHANGE = ["se ha cancelado una tarea que tenías asignada con el folio ", "se te ha desasignado la tarea con el folio "];
const ADDITIONAL_CHANGE_DATA = ["Ya no es necesario realizar la visita técnica.", "En tu lugar asistirá el técnico"];
public function __construct(
@ -48,7 +58,7 @@ abstract class AbstractMessageNotifierFacade
$this->logger = $logger;
$this->messageTextFactory = $messageTextFactory;
$this->clientPhoneNumber = $clientPhoneNumber;
}
/*
@ -59,7 +69,7 @@ abstract class AbstractMessageNotifierFacade
//$this->logger->debug(print_r(json_encode($notificationData),true).PHP_EOL);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData, null);
// Procesar el array de teléfonos y ejecutar la función correspondiente
foreach ($arrayPhones as $type => $phone) {
@ -88,10 +98,11 @@ abstract class AbstractMessageNotifierFacade
*/
public function verifyClientActionToDo(NotificationData $notificationData): void
{
//$this->logger->debug("Verificar contactos" . PHP_EOL);
//$this->logger->debug(print_r(json_encode($notificationData),true).PHP_EOL);
$this->logger->debug(print_r(json_encode($notificationData), true) . PHP_EOL);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData, null);
// Procesar el array de teléfonos y ejecutar la función correspondiente
foreach ($arrayPhones as $type => $phone) {
@ -119,7 +130,7 @@ abstract class AbstractMessageNotifierFacade
//$this->logger->debug(print_r(json_encode($notificationData),true).PHP_EOL);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData, null);
// Procesar el array de teléfonos y ejecutar la función correspondiente
foreach ($arrayPhones as $type => $phone) {
@ -140,6 +151,375 @@ abstract class AbstractMessageNotifierFacade
}
/*
* Verify contact type numbers to do client's
*/
public function verifyJobActionToDo($jsonNotificationData, $reprogramming = false, $changeInstaller = false): void
{
$this->logger->debug('Valor de $jsonNotificationData en verifyJobActionToDo: ' . json_encode($jsonNotificationData) . PHP_EOL);
$clientId = $jsonNotificationData['extraData']['entity']['clientId'];
$installerId = $jsonNotificationData['extraData']['entity']['assignedUserId'];
$jobId = $jsonNotificationData['entityId'];
$jobDescription = $jsonNotificationData['extraData']['entity']['description'] ?? null;
$this->logger->debug('Valor de $clientId en verifyJobActionToDo: ' . $clientId . PHP_EOL);
$this->logger->debug('Valor de $installerId en verifyJobActionToDo: ' . $installerId . PHP_EOL);
$this->logger->debug('Valor de $jobId en verifyJobActionToDo: ' . $jobId . PHP_EOL);
// Obtener la fecha del nodo "entity"
$dateString = $jsonNotificationData['extraData']['entity']['date'] ?? null;
if ($dateString) {
// Crear un objeto DateTime a partir de la fecha
$date = new DateTime($dateString);
// Formatear la fecha al formato día/mes/año hora:minuto am/pm
$formattedDate = $date->format('d/m/Y h:i A');
} else {
echo "La fecha no está disponible en el JSON.\n";
}
$configManager = \Ubnt\UcrmPluginSdk\Service\PluginConfigManager::create();
$config = $configManager->loadConfig();
$IPServer = $config['ipserver'];
$UCRMAPIToken = $config['apitoken'];
$CallBellAPIToken = $config['tokencallbell'];
$IPServer = $config['ipserver'];
$installersData = $config['installersDataWhatsApp'];
$this->logger->debug('Valor de $installersData en verifyJobActionToDo: ' . $installersData . PHP_EOL);
$this->ucrmApi = UcrmApi::create();
$usersInstallers = $this->ucrmApi->get('users/admins/' . $installerId, []);
$this->logger->debug('Valor de $usersInstallers en verifyJobActionToDo: ' . json_encode($usersInstallers) . PHP_EOL);
// Inicializar la variable para el nombre completo
$installerFullName = '';
$jsonInstallersData = json_decode($installersData, true);
if (json_last_error() !== JSON_ERROR_NONE) {
$this->logger->error('Error al decodificar el JSON de instaladores: ' . json_last_error_msg());
return;
}
// Verificar si el nodo "instaladores" existe
if (!isset($jsonInstallersData['instaladores'])) {
$this->logger->error('El nodo "instaladores" no existe en el JSON');
return;
}
// Buscar el número de WhatsApp en el JSON
$installerWhatsApp = '';
foreach ($jsonInstallersData['instaladores'] as $installer) {
if ($installer['id'] === $installerId) {
$installerWhatsApp = $installer['whatsapp'];
break;
}
}
$this->logger->debug('tipo de dato de installerWhatsApp: ' . gettype($installerWhatsApp) . PHP_EOL);
// Validar si se encontró el WhatsApp
if (empty($installerWhatsApp)) {
$this->logger->warning('No se encontró un número de WhatsApp para el instalador con ID 1019');
} else {
$this->logger->debug('Número de WhatsApp del Instalador: ' . $installerWhatsApp . PHP_EOL);
}
$this->ucrmApi = UcrmApi::create();
$usersInstallers = $this->ucrmApi->get('users/admins/' . $installerId, []);
$this->logger->debug('Valor de $usersInstallers ' . json_encode($usersInstallers) . PHP_EOL);
$firstName = $usersInstallers['firstName'] ?? '';
$lastName = $usersInstallers['lastName'] ?? '';
$installerFullName = trim("$firstName $lastName");
$this->logger->debug('Valor de $installerFullName: ' . $installerFullName . PHP_EOL);
$baseUri = 'https://' . $IPServer . '/crm/api/v1.0/';
$clientGuzzleHttp = new Client([
'base_uri' => $baseUri,
'headers' => [
'X-Auth-App-Key' => $UCRMAPIToken,
'Accept' => 'application/json',
],
'verify' => false,
]);
$response = $clientGuzzleHttp->request('GET', "clients/" . $clientId);
$arrayClientCRM = json_decode($response->getBody()->getContents(), true);
$this->logger->debug('Valor de $arrayClientCRM en verifyJobActionToDo: ' . json_encode($arrayClientCRM) . PHP_EOL);
$clientFullName = sprintf("%s %s", $arrayClientCRM['firstName'], $arrayClientCRM['lastName']);
// Extraer la dirección completa
$fullAddress = $arrayClientCRM['fullAddress'] ?? null;
// Validar si la dirección completa está disponible
if ($fullAddress) {
// Convertir la dirección a HTML seguro
$safeAddress = htmlspecialchars($fullAddress, ENT_QUOTES, 'UTF-8');
$this->logger->debug('Dirección completa: ' . $safeAddress . PHP_EOL);
} else {
$this->logger->error('La dirección completa no está disponible en el JSON' . PHP_EOL);
}
// Extraer las coordenadas del nodo "entity"
$gpsLat = $arrayClientCRM['addressGpsLat'] ?? null;
$gpsLon = $arrayClientCRM['addressGpsLon'] ?? null;
// Validar si las coordenadas están disponibles
if ($gpsLat && $gpsLon) {
// Construir la URL de Google Maps
$googleMapsUrl = sprintf('https://www.google.com/maps?q=%s,%s', $gpsLat, $gpsLon);
$this->logger->debug('URL de Google Maps: ' . $googleMapsUrl . PHP_EOL);
} else {
$this->logger->error('Las coordenadas no están disponibles en el JSON' . PHP_EOL);
}
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers(null, $arrayClientCRM);
$this->logger->debug('Valor de $arrayPhones en verifyJobActionToDo: ' . json_encode($arrayPhones) . PHP_EOL);
$arrayAllPhones = $this->clientPhoneNumber->getAllUcrmClientNumbers($arrayClientCRM);
// Convertir el array de teléfonos en una cadena separada por comas
$clientAllPhonesString = implode(',', $arrayAllPhones);
$this->logger->debug('Valor de $clientAllPhonesString en verifyJobActionToDo: ' . $clientAllPhonesString . PHP_EOL);
// Dividir los números en un array
$arrayNumeros = explode(',', $clientAllPhonesString);
$this->logger->debug('Valor de $arrayNumeros en verifyJobActionToDo: ' . json_encode($arrayNumeros) . PHP_EOL);
// Procesar cada número
$resultados = [];
foreach ($arrayNumeros as $numero) {
// Limpiar espacios alrededor de cada número
$numero = trim($numero);
// Validar el número
$numeroValidado = $this->validarNumeroTelefono($numero);
// Remover el prefijo 521 si está presente y tiene 12 dígitos
if (substr($numeroValidado, 0, 3) === "521" && strlen($numeroValidado) === 12) {
$resultados[] = substr($numeroValidado, 3); // Remover "521"
} else {
$resultados[] = $numeroValidado; // Mantener el número sin cambios
}
}
$this->logger->debug('Valor de $resultados en verifyJobActionToDo: ' . json_encode($resultados) . PHP_EOL);
// Convertir el array de resultados en una cadena separada por comas
$resultadoFinalNumerosCliente = implode(', ', $resultados);
$this->logger->debug('Valor de $resultadoFinalNumerosCliente en verifyJobActionToDo: ' . $resultadoFinalNumerosCliente . PHP_EOL);
$client_callbell_api = new ClientCallBellAPI($UCRMAPIToken, $IPServer, $CallBellAPIToken);
// Construir el array asociativo con los datos de la notificación para el cliente
$jsonClientJobNotificationData = [
"clientFullName" => $clientFullName,
"jobId" => $jobId,
"date" => $formattedDate,
"installerName" => $installerFullName
];
$clientWhatsApp = '';
// Procesar el array de teléfonos y ejecutar la función correspondiente
foreach ($arrayPhones as $type => $phone) {
switch ($type) {
case 'WhatsApp':
case 'WhatsNotifica':
$this->logger->debug("Se encontró un tipo de contacto $type" . PHP_EOL);
$attempts = 0;
$maxAttempts = 3;
$result = false;
// Reintentar hasta 3 veces si la función retorna false
while ($attempts < $maxAttempts && $result === false) {
$attempts++;
$result = $client_callbell_api->sendJobNotificationWhatsAppToClient(
$this->validarNumeroTelefono($phone),
$jsonClientJobNotificationData,
$reprogramming,
$changeInstaller
);
if ($result === false) {
sleep(1);
$this->logger->warning("Intento $attempts fallido para enviar notificación a $phone. Reintentando..." . PHP_EOL);
}
}
// Verificar el resultado final
if ($result === true) {
$this->logger->info("Notificación enviada correctamente al contacto $phone después de $attempts intento(s)." . PHP_EOL);
} else {
$this->logger->error("No se pudo enviar la notificación al contacto $phone después de $maxAttempts intentos." . PHP_EOL);
}
break;
default:
$this->logger->info("Tipo de contacto no reconocido: $type" . PHP_EOL);
break;
}
}
//$installerWhatsApp = $this->validarNumeroTelefono((string)$installerWhatsApp); //Obtiene el número de celular del cliente que sea del tipo de contacto "WhatsApp"
$this->logger->debug('Valor de $installerWhatsApp en verifyJobActionToDo: ' . $installerWhatsApp . PHP_EOL);
if ($changeInstaller) { //Si se cambió el instalador
$this->logger->debug('Se cambió el instalador, por lo tanto se procede a enviarle mensaje al que se le desasignó' . PHP_EOL);
// Construir el array asociativo con los datos de la notificación
//Enviar notificación al instalador anterior
$previousinstallerInstallerId = $installerId = $jsonNotificationData['extraData']['entityBeforeEdit']['assignedUserId'];
$usersInstallers = $this->ucrmApi->get('users/admins/' . $previousinstallerInstallerId, []);
$firstNamePreviousInstaller = $usersInstallers['firstName'] ?? ''; //Obtener el nombre del instalador anterior
$lastNamePreviousInstaller = $usersInstallers['lastName'] ?? ''; //Obtener el apellido del instalador anterior
$previousInstallerFullName = trim("$firstNamePreviousInstaller $lastNamePreviousInstaller");
$attempts = 0;
$maxAttempts = 3;
$result = false;
$jsonPreviousInstallerJobNotificationData = [
"installerName" => $previousInstallerFullName,
"subjectOfChange" => self::SUBJECT_OF_INSTALLER_CHANGE[1],
"jobId" => $jobId,
"clientFullName" => sprintf("[%s] %s", $arrayClientCRM['id'], $clientFullName),
"additionalChangeData" => self::ADDITIONAL_CHANGE_DATA[1] . ' *' . $installerFullName . '*'
];
// Buscar el número de WhatsApp en el JSON del instalador anterior
$previousInstallerWhatsApp = '';
foreach ($jsonInstallersData['instaladores'] as $installer) {
if ($installer['id'] === $previousinstallerInstallerId) {
$previousInstallerWhatsApp = $installer['whatsapp'];
$this->logger->debug('Se encontró el Whatsapp del instalador anterior en el JSON y es: ' . $previousInstallerWhatsApp . PHP_EOL);
break;
}
}
// Reintentar hasta 3 veces si la función retorna false
while ($attempts < $maxAttempts && $result === false) {
$attempts++;
$result = $client_callbell_api->sendJobNotificationWhatsAppToInstaller(
$this->validarNumeroTelefono((string) $previousInstallerWhatsApp),
$jsonPreviousInstallerJobNotificationData,
false,
true
);
if ($result === false) {
sleep(1);
$this->logger->warning("Intento $attempts fallido para enviar notificación a $phone. Reintentando..." . PHP_EOL);
}
}
sleep(4);
// Construir el array asociativo con los datos de la notificación para el instalador nuevo
$jsonInstallerJobNotificationData = [
"installerName" => $installerFullName,
"clientFullName" => sprintf("[%s] %s", $arrayClientCRM['id'], $clientFullName),
"jobId" => $jobId,
"clientAddress" => $safeAddress,
"clientWhatsApp" => $resultadoFinalNumerosCliente,
"date" => $formattedDate,
"jobDescription" => $jobDescription,
"gmapsLocation" => $googleMapsUrl
];
//Enviar notificación al instalador nuevo
$attempts = 0;
$maxAttempts = 3;
$result = false;
// Reintentar hasta 3 veces si la función retorna false
while ($attempts < $maxAttempts && $result === false) {
$attempts++;
$result = $client_callbell_api->sendJobNotificationWhatsAppToInstaller(
$this->validarNumeroTelefono((string) $installerWhatsApp),
$jsonInstallerJobNotificationData,
$reprogramming,
false
);
if ($result === false) {
sleep(1);
$this->logger->warning("Intento $attempts fallido para enviar notificación a $phone. Reintentando..." . PHP_EOL);
}
}
} else {
// Construir el array asociativo con los datos de la notificación
$jsonInstallerJobNotificationData = [
"installerName" => $installerFullName,
"clientFullName" => sprintf("[%s] %s", $arrayClientCRM['id'], $clientFullName),
"jobId" => $jobId,
"clientAddress" => $safeAddress,
"clientWhatsApp" => $resultadoFinalNumerosCliente,
"date" => $formattedDate,
"jobDescription" => $jobDescription,
"gmapsLocation" => $googleMapsUrl
];
$attempts = 0;
$maxAttempts = 3;
$result = false;
// Reintentar hasta 3 veces si la función retorna false
while ($attempts < $maxAttempts && $result === false) {
$attempts++;
$result = $client_callbell_api->sendJobNotificationWhatsAppToInstaller(
$this->validarNumeroTelefono((string) $installerWhatsApp),
$jsonInstallerJobNotificationData,
$reprogramming,
$changeInstaller
);
if ($result === false) {
sleep(1);
$this->logger->warning("Intento $attempts fallido para enviar notificación a $phone. Reintentando..." . PHP_EOL);
}
}
}
}
/*
* Verify contact type numbers to do client's data update at CallBell by invoice add or edit
@ -149,7 +529,7 @@ abstract class AbstractMessageNotifierFacade
$this->logger->debug(print_r(json_encode($notificationData), true) . PHP_EOL);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData);
$arrayPhones = $this->clientPhoneNumber->getUcrmClientNumbers($notificationData, null);
// Procesar el array de teléfonos y ejecutar la función correspondiente
foreach ($arrayPhones as $type => $phone) {
@ -205,29 +585,49 @@ abstract class AbstractMessageNotifierFacade
if ($notificationTypeText) {
try {
//$this->logger->debug(sprintf('llego al llamado de sendPaymentNotificationWhatsApp con client_id: %s y número de celular: %s', $notificationData->clientId, $clientPhoneNumber));
//$this->sendMessage($notificationData, $clientSmsNumber, $messageBody);
//$this->sendWhatsApp($notificationData, $clientSmsNumber);
if (!$client_callbell_api->sendTextPaymentNotificationWhatsApp($clientPhoneNumber, $notificationData)) {
$this->logger->warning("No se pudo enviar el comprobante para este cliente" . PHP_EOL);
$attempts = 0;
$maxAttempts = 3;
$result = false;
while ($attempts < $maxAttempts && !$result) {
$attempts++;
$result = $client_callbell_api->sendTextPaymentNotificationWhatsApp($clientPhoneNumber, $notificationData);
if (!$result) {
$this->logger->warning("Intento $attempts fallido para enviar notificación de texto al cliente con número $clientPhoneNumber." . PHP_EOL);
}
}
if ($result) {
$this->logger->info("Notificación de texto enviada correctamente al cliente con número $clientPhoneNumber después de $attempts intento(s)." . PHP_EOL);
} else {
$this->logger->error("No se pudo enviar la notificación de texto al cliente con número $clientPhoneNumber después de $maxAttempts intentos." . PHP_EOL);
}
} catch (HttpException $httpException) {
//$this->logger->debug('Ocurrio un error en el try catch');
$this->logger->error($httpException->getCode() . ' ' . $httpException->getMessage());
}
} else {
try {
//$this->logger->debug(sprintf('llego al llamado de sendPaymentNotificationWhatsApp con client_id: %s y número de celular: %s', $notificationData->clientId, $clientPhoneNumber));
//$this->sendMessage($notificationData, $clientSmsNumber, $messageBody);
//$this->sendWhatsApp($notificationData, $clientSmsNumber);
if (!$client_callbell_api->sendPaymentNotificationWhatsApp($clientPhoneNumber, $notificationData)) {
$this->logger->warning("No se pudo enviar el comprobante para este cliente" . PHP_EOL);
$attempts = 0;
$maxAttempts = 3;
$result = false;
while ($attempts < $maxAttempts && !$result) {
$attempts++;
$result = $client_callbell_api->sendPaymentNotificationWhatsApp($clientPhoneNumber, $notificationData);
if (!$result) {
$this->logger->warning("Intento $attempts fallido para enviar notificación al cliente con número $clientPhoneNumber." . PHP_EOL);
}
}
if ($result) {
$this->logger->info("Notificación enviada correctamente al cliente con número $clientPhoneNumber después de $attempts intento(s)." . PHP_EOL);
} else {
$this->logger->error("No se pudo enviar la notificación al cliente con número $clientPhoneNumber después de $maxAttempts intentos." . PHP_EOL);
}
} catch (HttpException $httpException) {
//$this->logger->debug('Ocurrio un error en el try catch');
$this->logger->error($httpException->getCode() . ' ' . $httpException->getMessage());
}
@ -286,7 +686,7 @@ abstract class AbstractMessageNotifierFacade
//$this->logger->debug(sprintf('llego al llamado de sendPaymentNotificationWhatsApp con client_id: %s y número de celular: %s', $notificationData->clientId, $clientPhoneNumber));
if ($notificationTypeText) {
$this->logger->debug("Activado el check de mensajes de texto: ".$notificationTypeText.PHP_EOL);
$this->logger->debug("Activado el check de mensajes de texto: " . $notificationTypeText . PHP_EOL);
}
if ($notificationTypeText) {
@ -441,8 +841,9 @@ abstract class AbstractMessageNotifierFacade
$this->logger->info("Se proceso los contactos " . PHP_EOL);
$stripe = new \Stripe\StripeClient($StripeToken); //Instancia de la clase manejadora de clientes para la API de Stripe
if ($client_email !== null && $customerStripeID !== null) {
$this->logger->info("Se actualizara el correo del cliente en Stripe " . PHP_EOL);
$this->logger->info("Se actualizara el correo del cliente en Stripe: " . $client_email . PHP_EOL);
$stripe->customers->update($customerStripeID, ['email' => $client_email]); //Actualiza el correo electrónico del cliente en la plataforma de Stripe en su correspondiente "customer Stripe ID"
}
@ -456,7 +857,7 @@ abstract class AbstractMessageNotifierFacade
$this->logger->warning('No se encontró un teléfono celular válido para el cliente: ' . $notificationData->clientId);
return;
} else {
try {
//$this->logger->debug(sprintf('llego al llamado de sendwhatsapp con client_id: %s y número de celular: %s', $notificationData->clientId, $clientPhoneNumber));
//$this->sendMessage($notificationData, $clientSmsNumber, $messageBody);

View File

@ -67,7 +67,7 @@ abstract class AbstractOxxoOperationsFacade
$stripe = new \Stripe\StripeClient($StripeToken);
$this->ucrmApi = UcrmApi::create();
$currentUserAdmin = $this->ucrmApi->get('users/admins', []);
$clientID = $event_json->client_id;
$clientID = $event_json['client_id'];
$stripeCustomerId = null;
$clientEmail = '';
@ -123,7 +123,7 @@ abstract class AbstractOxxoOperationsFacade
if ($amount > 10) {
$amount = intval($amount * 100);
try {
$this->logger->info("Creando referencia en Stripe por: $amount " . PHP_EOL);
$this->logger->info("Creando referencia en Stripe por: $amount para el cliente $stripeCustomerId" . PHP_EOL);
$paymentIntent = $stripe->paymentIntents->create([
'amount' => $amount,
'currency' => 'mxn',

View File

@ -117,11 +117,158 @@ class ClientCallBellAPI
curl_close($ch);
}
public function sendPaymentNotificationWhatsApp($clientWhatsAppNumber, $notificationData): bool
public function sendJobNotificationWhatsAppToClient($clientWhatsAppNumber, $jobNotificationData, $reprogramming = false, $changeInstaller = false): bool
{
$log = PluginLogManager::create(); //Initialize Logger
$log->appendLog("Enviando mensaje de trabajo para el cliente" . PHP_EOL);
$jsonJobNotificationData = json_encode($jobNotificationData, true);
$log->appendLog("Datos de la notificación de trabajo: " . $jsonJobNotificationData . PHP_EOL);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.callbell.eu/v1/messages/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $this->CallBellAPIToken,
'Content-Type: application/json',
]);
$campo1 = sprintf('*%s*', $jobNotificationData['clientFullName']);
$campo2 = sprintf('*#%s*', $jobNotificationData['jobId']);
$campo3 = sprintf('*%s*', $jobNotificationData['date']);
$campo4 = sprintf('*%s*', $jobNotificationData['installerName']);
if ($reprogramming && $changeInstaller == false) {
//Enviar notificación de reprogramación al cliente
$curl_string = "{\n \"to\": \"$clientWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"S/M\"\n },\n \"template_values\": [\"$campo1\", \"$campo2\", \"$campo3\", \"$campo4\"],\n \"template_uuid\": \"70579353773f4de1836d4f9b6bf6074d\",\n \"optin_contact\": true\n }";
}if($changeInstaller){
//Enviar notificación de cambio de instalador
$curl_string = "{\n \"to\": \"$clientWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"S/M\"\n },\n \"template_values\": [\"$campo1\", \"$campo2\", \"$campo3\", \"$campo4\"],\n \"template_uuid\": \"0d57fd210595422caf2f5999642882a3\",\n \"optin_contact\": true\n }";
} else {
//Enviar notificación normal de visita técnica al cliente
$curl_string = "{\n \"to\": \"$clientWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"S/M\"\n },\n \"template_values\": [\"$campo1\", \"$campo2\", \"$campo3\", \"$campo4\"],\n \"template_uuid\": \"c0ef8228b50a4d9690a2e87bc11e9ab3\",\n \"optin_contact\": true\n }";
}
$log->appendLog("La cadena CURL que se envia es: " . $curl_string);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_string);
$response = curl_exec($ch);
$log->appendLog("Response del CallBell: " . $response);
curl_close($ch);
// Validar la respuesta de Callbell
$jsonResponse = json_decode($response, true);
if (json_last_error() === JSON_ERROR_NONE) {
// Evaluar si contiene "message" con "status": "enqueued"
if (isset($jsonResponse['message']) && $jsonResponse['message']['status'] === 'enqueued') {
$log->appendLog("La notificación fue enviada correctamente con estado: enqueued" . PHP_EOL);
return true;
}
// Evaluar si contiene "error"
if (isset($jsonResponse['error'])) {
$log->appendLog("Error al enviar la notificación: " . json_encode($jsonResponse['error']) . PHP_EOL);
return false;
}
} else {
// Manejo de error en caso de que la respuesta no sea un JSON válido
$log->appendLog("La respuesta no es un JSON válido." . PHP_EOL);
return false;
}
// Valor de retorno predeterminado en caso de que ninguna condición se cumpla
$log->appendLog("Ruta no prevista en la función." . PHP_EOL);
return false;
}
public function sendJobNotificationWhatsAppToInstaller($installerWhatsAppNumber, $jobInstallerNotificationData, $reprogramming = false, $changeInstaller = false): bool
{
$log = PluginLogManager::create(); //Initialize Logger
$log->appendLog("Enviando mensaje de tarea al instalador" . PHP_EOL);
$jsonJobNotificationData = json_encode($jobInstallerNotificationData, true);
$log->appendLog("Datos de la notificación de tarea: " . $jsonJobNotificationData . PHP_EOL);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.callbell.eu/v1/messages/send');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $this->CallBellAPIToken,
'Content-Type: application/json',
]);
$campo1 = $jobInstallerNotificationData['installerName'];
if ($changeInstaller) {
$campo2 = $jobInstallerNotificationData['subjectOfChange'];
$campo3 = $jobInstallerNotificationData['jobId'];
$campo4 = $jobInstallerNotificationData['clientFullName'];
$campo5 = $jobInstallerNotificationData['additionalChangeData'];
} else {
$campo2 = sprintf("*#%s*", $jobInstallerNotificationData['jobId']);
$campo3 = $jobInstallerNotificationData['clientFullName'];
$campo4 = $jobInstallerNotificationData['clientAddress'];
$campo5 = $jobInstallerNotificationData['clientWhatsApp'];
$campo6 = $jobInstallerNotificationData['date'];
$campo7 = $jobInstallerNotificationData['jobDescription'];
$campo8 = $jobInstallerNotificationData['gmapsLocation'];
}
if ($reprogramming && $changeInstaller===false) {
//Enviar notificación de reprogramación
$curl_string = "{\n \"to\": \"$installerWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"S/M\"\n },\n \"template_values\": [\"$campo1\", \"$campo2\", \"$campo3\", \"$campo4\", \"$campo5\", \"$campo6\", \"$campo7\", \"$campo8\"],\n \"template_uuid\": \"42152c07c67b468ba68e581c0283e22e\",\n \"optin_contact\": true\n }";
}else if ($changeInstaller){
//Enviar notificación de cambio de instalador
$curl_string = "{\n \"to\": \"$installerWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"S/M\"\n },\n \"template_values\": [\"$campo1\", \"$campo2\", \"$campo3\", \"$campo4\", \"$campo5\"],\n \"template_uuid\": \"e1aa2b0fd3884595918f4ac2676acd29\",\n \"optin_contact\": true\n }";
}else {
//Enviar notificación normal de asignación de tarea
$curl_string = "{\n \"to\": \"$installerWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"S/M\"\n },\n \"template_values\": [\"$campo1\", \"$campo2\", \"$campo3\", \"$campo4\", \"$campo5\", \"$campo6\", \"$campo7\", \"$campo8\"],\n \"template_uuid\": \"b6663394265e4bcdb215369aa9ba0f21\",\n \"optin_contact\": true\n }";
}
$log->appendLog("La cadena CURL que se envia es: " . $curl_string);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_string);
$response = curl_exec($ch);
$log->appendLog("Response del CallBell: " . $response);
curl_close($ch);
// Validar la respuesta de Callbell
$jsonResponse = json_decode($response, true);
if (json_last_error() === JSON_ERROR_NONE) {
// Evaluar si contiene "message" con "status": "enqueued"
if (isset($jsonResponse['message']) && $jsonResponse['message']['status'] === 'enqueued') {
$log->appendLog("La notificación fue enviada correctamente con estado: enqueued" . PHP_EOL);
return true;
}
// Evaluar si contiene "error"
if (isset($jsonResponse['error'])) {
$log->appendLog("Error al enviar la notificación: " . json_encode($jsonResponse['error']) . PHP_EOL);
return false;
}
} else {
// Manejo de error en caso de que la respuesta no sea un JSON válido
$log->appendLog("La respuesta no es un JSON válido." . PHP_EOL);
return false;
}
// Valor de retorno predeterminado en caso de que ninguna condición se cumpla
$log->appendLog("Ruta no prevista en la función." . PHP_EOL);
return false;
}
public function sendPaymentNotificationWhatsApp($clientWhatsAppNumber, $notificationData): bool
{
$log = PluginLogManager::create(); //Initialize Logger
@ -368,9 +515,33 @@ class ClientCallBellAPI
// }
curl_close($ch);
$this->deleteFilesExceptLastFifty();
$this->deleteFilesExceptLastHundred();
//return $fileNameComprobante;
return true;
// Validar la respuesta de Callbell
$jsonResponse = json_decode($response, true);
if (json_last_error() === JSON_ERROR_NONE) {
// Evaluar si contiene "message" con "status": "enqueued"
if (isset($jsonResponse['message']) && $jsonResponse['message']['status'] === 'enqueued') {
$log->appendLog("La notificación fue enviada correctamente con estado: enqueued" . PHP_EOL);
return true;
}
// Evaluar si contiene "error"
if (isset($jsonResponse['error'])) {
$log->appendLog("Error al enviar la notificación: " . json_encode($jsonResponse['error']) . PHP_EOL);
return false;
}
} else {
// Manejo de error en caso de que la respuesta no sea un JSON válido
$log->appendLog("La respuesta no es un JSON válido." . PHP_EOL);
return false;
}
// Valor de retorno predeterminado en caso de que ninguna condición se cumpla
$log->appendLog("Ruta no prevista en la función." . PHP_EOL);
return false;
}
public function sendTextPaymentNotificationWhatsApp($clientWhatsAppNumber, $notificationData): bool
{
@ -485,17 +656,17 @@ class ClientCallBellAPI
}
$log->appendLog("Datos client data credit amount: " . $notificationData->paymentData['creditAmount'] . PHP_EOL);
$cantidad_pagadaFormateada = '$' . number_format($cantidad_pagada, 2, ',', '.') . ' MXN';
$creditoPorPagoFormateado = '$' . number_format($creditoPorPago, 2, ',', '.') . ' MXN';
if ($creditoClienteBase > 0 && empty($notificationData->paymentData['paymentCovers'])) {
$texto_credito = "La cantidad que sobra de $creditoPorPagoFormateado se ha convertido a crédito";
$log->appendLog("La cantidad que sobra de $creditoPorPagoFormateado se ha convertido a crédito" . PHP_EOL);
$texto_credito = "La cantidad que sobra de $creditoPorPagoFormateado se ha convertido a crédito";
$log->appendLog("La cantidad que sobra de $creditoPorPagoFormateado se ha convertido a crédito" . PHP_EOL);
$curl_string = "{\n \"to\": \"$clientWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"John Doe\"\n },\n \"template_values\": [\"$nombre_cliente\", \"$folio\", \"$client_id\", \"$fecha_pago\", \"$cantidad_pagadaFormateada\", \"$metodo_pago\", \"$saldoTexto\", \"$texto_credito\"],\n \"template_uuid\": \"4ac9dc060cf746b6ad7f2e8acad355e0\",\n \"optin_contact\": true\n }";
@ -505,8 +676,8 @@ class ClientCallBellAPI
if ($creditoPorPago > 0) {
$texto_credito = "La cantidad que sobra de $creditoPorPagoFormateado se ha convertido a crédito";
$log->appendLog("La cantidad que sobra de $creditoPorPagoFormateado se ha convertido a crédito" . PHP_EOL);
}else{
} else {
$texto_credito = '_________________________';
}
@ -581,7 +752,7 @@ class ClientCallBellAPI
//$cantidad_pagadaFormateada = '$' . number_format($cantidad_pagada, 2, ',', '.') . ' MXN';
$log->appendLog("Se terminó de verificar payment covers" . PHP_EOL);
$total_facturaFormateada = '$' . number_format($total_factura, 2, ',', '.') . ' MXN';
$pagoFacturaFormateado = '$' . $amounts. ' MXN';
$pagoFacturaFormateado = '$' . $amounts . ' MXN';
$curl_string = "{\n \"to\": \"$clientWhatsAppNumber\",\n \"from\": \"whatsapp\",\n \"type\": \"text\",\n \"content\": {\n \"text\": \"John Doe\"\n },\n \"template_values\": [\"$nombre_cliente\", \"$folio\", \"$client_id\", \"$fecha_pago\", \"$cantidad_pagadaFormateada\", \"$metodo_pago\", \"$invoiceIds\", \"$total_facturaFormateada\", \"$pagoFacturaFormateado\", \"$saldoTexto\", \"$texto_credito\"],\n \"template_uuid\": \"c1396a6ad3cb4192916d4ac2bfb782a5\",\n \"optin_contact\": true\n }";
@ -623,7 +794,30 @@ class ClientCallBellAPI
curl_close($ch);
//$this->deleteFilesExceptLastFifty();
//return $fileNameComprobante;
return true;
// Validar la respuesta de Callbell
$jsonResponse = json_decode($response, true);
if (json_last_error() === JSON_ERROR_NONE) {
// Evaluar si contiene "message" con "status": "enqueued"
if (isset($jsonResponse['message']) && $jsonResponse['message']['status'] === 'enqueued') {
$log->appendLog("La notificación fue enviada correctamente con estado: enqueued" . PHP_EOL);
return true;
}
// Evaluar si contiene "error"
if (isset($jsonResponse['error'])) {
$log->appendLog("Error al enviar la notificación: " . json_encode($jsonResponse['error']) . PHP_EOL);
return false;
}
} else {
// Manejo de error en caso de que la respuesta no sea un JSON válido
$log->appendLog("La respuesta no es un JSON válido." . PHP_EOL);
return false;
}
// Valor de retorno predeterminado en caso de que ninguna condición se cumpla
$log->appendLog("Ruta no prevista en la función." . PHP_EOL);
return false;
}
public function sendOverdueNotificationWhatsApp($clientWhatsAppNumber, $notificationData): void
@ -899,7 +1093,7 @@ class ClientCallBellAPI
(($notificationData->clientData['hasSuspendedService']) ? '🔴 Suspendido' : '🟢 Activo') . '",' .
'"Fecha Ultimo Pago": "📆💰 ' . $fecha_ultimoPago_ajustada . ' con ' . $payment_method . '",' .
'"Fecha Ultima Actualizacion": "📆🔄️ ' . $fecha_actual_ajustada . '",' .
'"Clabe Transferencia Banamex": "' . $clabeInterbancaria . '"' .
'"Clabe Interbancaria": "' . $clabeInterbancaria . '"' .
'}';
@ -921,7 +1115,7 @@ class ClientCallBellAPI
"Resumen" => $resumenClienteJSON,
"Fecha Ultimo Pago" => '📆💸 ' . $fecha_ultimoPago_ajustada . ' con ' . $payment_method,
"Fecha Ultima Actualizacion" => '📆🔄️ ' . $fecha_actual_ajustada,
"Clabe Transferencia Banamex" => $clabeInterbancaria
"Clabe Interbancaria" => $clabeInterbancaria
)
);
$log->appendLog("JSON con los datos a actualizar: " . json_encode($data_CRM) . PHP_EOL);
@ -1239,10 +1433,10 @@ class ClientCallBellAPI
/**
* /Elimina los archivos del directorio de comprobantes de pago a excepción de los últimos 30 para evitar errores de envío
* /Elimina los archivos del directorio de comprobantes de pago a excepción de los últimos 100 para evitar errores de envío
* @return void
*/
function deleteFilesExceptLastFifty()
function deleteFilesExceptLastHundred()
{
$log = PluginLogManager::create(); //Initialize Logger
$directory = __DIR__ . '/../../comprobantes/';
@ -1261,10 +1455,10 @@ class ClientCallBellAPI
return filemtime($b) - filemtime($a);
});
// Verificar que haya más de 30 archivos
if (count($files) > 50) {
// Obtener los archivos que deben ser eliminados (todos menos los 50 más recientes)
$filesToDelete = array_slice($files, 50);
// Verificar que haya más de 100 archivos
if (count($files) > 100) {
// Obtener los archivos que deben ser eliminados (todos menos los 100 más recientes)
$filesToDelete = array_slice($files, 100);
// Eliminar los archivos
foreach ($filesToDelete as $file) {
@ -1274,7 +1468,7 @@ class ClientCallBellAPI
}
}
} else {
$log->appendLog("Hay menos de 50 archivos en el directorio. No se eliminarán archivos." . PHP_EOL);
$log->appendLog("Hay menos de 100 archivos en el directorio. No se eliminarán archivos." . PHP_EOL);
}
}

View File

@ -14,6 +14,7 @@ use SmsNotifier\Service\Logger;
use SmsNotifier\Service\OptionsManager;
use SmsNotifier\Service\PluginDataValidator;
use Twilio\Exceptions\TwilioException;
use Ubnt\UcrmPluginSdk\Service\UcrmApi;
class Plugin
{
@ -50,6 +51,12 @@ class Plugin
*/
private $notificationDataFactory;
/**
* @var UcrmApi
*/
protected $ucrmApi;
public function __construct(
Logger $logger,
OptionsManager $optionsManager,
@ -73,13 +80,13 @@ class Plugin
// $hola = PHP_SAPI;
// $this->logger->info('valor de PHP_SAPI: ' . $hola);
if (PHP_SAPI === 'fpm-fcgi') {
$this->logger->debug('Whatsapp over HTTP started');
//$this->logger->debug('Whatsapp over HTTP started');
$this->processHttpRequest();
$this->logger->debug('HTTP request processing ended.');
//$this->logger->debug('HTTP request processing ended.');
} elseif (PHP_SAPI === 'cli') {
$this->logger->debug('Whatsapp over CLI started');
//$this->logger->debug('Whatsapp over CLI started');
$this->processCli();
$this->logger->debug('CLI process ended.');
//$this->logger->debug('CLI process ended.');
} else {
throw new \UnexpectedValueException('Unknown PHP_SAPI type: ' . PHP_SAPI);
}
@ -111,106 +118,157 @@ class Plugin
return;
}
$event_json = json_decode($userInput);
$webhook_string = json_encode($event_json);
$this->logger->debug("El valor de webhook_string: " . $webhook_string . PHP_EOL);
// Maneja el evento del webhook
if ($event_json) {
switch ($event_json->type) {
case 'customer_cash_balance_transaction.created':
$this->logger->info('Evento de transfencia al cliente encontrado');
$this->logger->info('Valor del EventJSON: ' . json_encode($event_json) . PHP_EOL);
$this->pluginNotifierFacade->createPaymentIntent($event_json);
break;
case 'inbound_payment.payment_attempt':
$this->logger->info('Evento de Pago de OXXO recibido');
$this->logger->info('Valor del EventJSON: ' . json_encode($event_json) . PHP_EOL);
break;
case 'energy.alert':
$this->logger->info('Evento de Energía recibido: ' . $event_json->message . PHP_EOL);
break;
case 'oxxo.request':
$this->logger->info('Evento de referencia de oxxo recibido' . PHP_EOL);
// Construir la URL basada en el "client_id"
// $url = "https://siip.mx/wp/wp-content/uploads/img/voucher.png";
if (!empty($event_json->amount)) {
$this->logger->info('Referencia persnoalizada, Valor del monto: ' . $event_json->amount . PHP_EOL);
$intentos = 0;
do {
if ($intentos > 1) {
sleep(2);
}
$url = $this->pluginOxxoNotifierFacade->createOxxoPaymentIntent($event_json, $event_json->amount);
$intentos++;
} while (strpos($url, 'https') !== 0 && $intentos < 5);
} else {
$intentos = 0;
do {
// if ($intentos > 1) {
// sleep(2);
// }
$url = $this->pluginOxxoNotifierFacade->createOxxoPaymentIntent($event_json);
$intentos++;
} while (strpos($url, 'https') !== 0 && $intentos < 5);
}
// Crear una respuesta en formato JSON
// $response = [
// 'event' => 'response.siip',
// 'status' => 'success',
// 'url' => $url
// ];
$response = '{' .
'"url": "' . $url . '"' .
'}';
$this->logger->debug('Reponse que se envía a CallBell: ' . $response);
// $json_codificado = json_encode($response);
// if (json_last_error() !== JSON_ERROR_NONE) {
// $this->logger->error('Error en la codificación JSON: ' . json_last_error_msg() . PHP_EOL);
// }
//$this->logger->info('Se está enviando esta respuesta: ' . json_encode($json_codificado) . PHP_EOL);
// Enviar el encabezado de respuesta como JSON
header('Content-Type: application/json');
// Enviar la respuesta en formato JSON
//echo json_encode($response);
echo $response;
break;
// Otros eventos relevantes
}
}
$jsonData = @json_decode($userInput, true, 10);
if (!isset($jsonData['uuid'])) {
$this->logger->error('JSON error: ' . json_last_error_msg());
if (!isset($jsonData['uuid'])) {
$this->logger->info('No UUID found in the webhook data');
//$this->logger->error('JSON error: ' . json_last_error_msg());
//return;
// Maneja el evento del webhook externo
if ($jsonData) {
switch ($jsonData['type']) {
case 'customer_cash_balance_transaction.created':
$this->logger->info('Evento de transfencia al cliente encontrado');
$this->logger->info('Valor del EventJSON: ' . json_encode($jsonData) . PHP_EOL);
$this->pluginNotifierFacade->createPaymentIntent($jsonData);
break;
case 'inbound_payment.payment_attempt':
$this->logger->info('Evento de Pago de OXXO recibido');
$this->logger->info('Valor del EventJSON: ' . json_encode($jsonData) . PHP_EOL);
break;
case 'energy.alert':
$this->logger->info('Evento de Energía recibido: ' . $jsonData['message'] . PHP_EOL);
break;
case 'oxxo.request':
$this->logger->info('Evento de referencia de oxxo recibido' . PHP_EOL);
// Construir la URL basada en el "client_id"
// $url = "https://siip.mx/wp/wp-content/uploads/img/voucher.png";
if (!empty($jsonData['amount'])) {
$this->logger->info('Referencia persnoalizada, Valor del monto: ' . $jsonData['amount'] . PHP_EOL);
$intentos = 0;
do {
if ($intentos > 1) {
sleep(2);
}
$url = $this->pluginOxxoNotifierFacade->createOxxoPaymentIntent($jsonData, $jsonData['amount']);
$intentos++;
} while (strpos($url, 'https') !== 0 && $intentos < 5);
} else {
$intentos = 0;
do {
// if ($intentos > 1) {
// sleep(2);
// }
$url = $this->pluginOxxoNotifierFacade->createOxxoPaymentIntent($jsonData);
$intentos++;
} while (strpos($url, 'https') !== 0 && $intentos < 5);
}
// Crear una respuesta en formato JSON
// $response = [
// 'event' => 'response.siip',
// 'status' => 'success',
// 'url' => $url
// ];
$response = '{' .
'"url": "' . $url . '"' .
'}';
$this->logger->debug('Reponse que se envía a CallBell: ' . $response);
// $json_codificado = json_encode($response);
// if (json_last_error() !== JSON_ERROR_NONE) {
// $this->logger->error('Error en la codificación JSON: ' . json_last_error_msg() . PHP_EOL);
// }
//$this->logger->info('Se está enviando esta respuesta: ' . json_encode($json_codificado) . PHP_EOL);
// Enviar el encabezado de respuesta como JSON
header('Content-Type: application/json');
// Enviar la respuesta en formato JSON
//echo json_encode($response);
echo $response;
break;
// Otros eventos relevantes
}
}
return;
}
// $event_json = json_decode($userInput);
// $webhook_string = json_encode($event_json);
// $this->logger->debug("El valor de webhook_string: " . $webhook_string . PHP_EOL);
$notification = $this->notificationDataFactory->getObject($jsonData);
$this->logger->debug('valor el evento recibido por webhook: ' . $notification->eventName . PHP_EOL);
$this->logger->debug('Valor de JSON: ' . json_encode($jsonData) . PHP_EOL);
if ($notification->changeType === 'test') {
$configManager = \Ubnt\UcrmPluginSdk\Service\PluginConfigManager::create();
$config = $configManager->loadConfig();
$installersData = $config['installersDataWhatsApp'];
$this->logger->debug('Valor de $installersData: ' . $installersData . PHP_EOL);
// Decodificar el JSON y verificar errores
$jsonInstallersData = json_decode($installersData, true);
if (json_last_error() !== JSON_ERROR_NONE) {
$this->logger->error('Error al decodificar el JSON de instaladores: ' . json_last_error_msg());
return;
}
// Verificar si el nodo "instaladores" existe
if (!isset($jsonInstallersData['instaladores'])) {
$this->logger->error('El nodo "instaladores" no existe en el JSON');
return;
}
// Buscar el número de WhatsApp en el JSON
$installerWhatsApp = '';
foreach ($jsonInstallersData['instaladores'] as $installer) {
if ($installer['id'] === 1019) {
$installerWhatsApp = $installer['whatsapp'];
break;
}
}
// Validar si se encontró el WhatsApp
if (empty($installerWhatsApp)) {
$this->logger->warning('No se encontró un número de WhatsApp para el instalador con ID 1019');
} else {
$this->logger->debug('Número de WhatsApp del Instalador: ' . $installerWhatsApp . PHP_EOL);
}
$this->ucrmApi = UcrmApi::create();
$usersInstallers = $this->ucrmApi->get('users/admins/1019', []);
$this->logger->debug('Valor de $usersInstallers ' . json_encode($usersInstallers) . PHP_EOL);
$firstName = $usersInstallers['firstName'] ?? '';
$lastName = $usersInstallers['lastName'] ?? '';
$installerFullName = trim("$firstName $lastName");
$this->logger->debug('Valor de $installerFullName: ' . $installerFullName . PHP_EOL);
$this->logger->info('Webhook test successful.');
return;
}
if (!$notification->clientId) {
$this->logger->warning('No client specified, cannot notify them.');
// if (!$notification->clientId) {
// $this->logger->warning('No client specified, cannot notify them.');
return;
}
// return;
// }
$configManager = \Ubnt\UcrmPluginSdk\Service\PluginConfigManager::create();
$config = $configManager->loadConfig();
@ -310,27 +368,64 @@ class Plugin
} else if ($notification->eventName === 'client.edit') {
$this->logger->debug('Se actualiza a un cliente' . PHP_EOL);
// Verificar que existen tanto 'entityBeforeEdit' como 'entity'
if (isset($event_json['extraData']['entityBeforeEdit']['isLead']) && isset($event_json['extraData']['entity']['isLead'])) {
$isLeadBefore = $event_json['extraData']['entityBeforeEdit']['isLead'];
$isLeadAfter = $event_json['extraData']['entity']['isLead'];
$this->logger->debug('Se actualiza a un cliente');
$this->logger->debug('Valor de json_data: ' . json_encode($jsonData));
// Comprobar si 'isLead' cambió de true a false
if ($isLeadBefore === true && $isLeadAfter === false) {
$this->logger->debug('El campo isLead cambió de true a false');
$this->pluginNotifierFacade->createStripeClient($notification);
// Validar que 'extraData' existe y contiene las claves necesarias
if (
isset($jsonData['extraData']['entityBeforeEdit']) &&
isset($jsonData['extraData']['entity'])
) {
$entityBeforeEdit = $jsonData['extraData']['entityBeforeEdit'];
$entity = $jsonData['extraData']['entity'];
$this->logger->debug('Validando claves dentro de entityBeforeEdit y entity');
// Validar que 'isLead' existe en ambas entidades
if (array_key_exists('isLead', $entityBeforeEdit) && array_key_exists('isLead', $entity)) {
$this->logger->debug('Los datos entityBeforeEdit y entity contienen el campo isLead');
$isLeadBefore = $entityBeforeEdit['isLead'];
$isLeadAfter = $entity['isLead'];
// Validar el tipo de dato de isLead
if (!is_bool($isLeadBefore) || !is_bool($isLeadAfter)) {
$this->logger->warning('El campo isLead no es de tipo booleano');
} else {
// Comprobar si 'isLead' cambió de true a false
if ($isLeadBefore === true && $isLeadAfter === false) {
$this->logger->debug('El campo isLead cambió de true a false');
$this->pluginNotifierFacade->createStripeClient($notification);
} else {
$this->logger->debug('No hubo cambio de true a false en el campo isLead');
}
}
} else {
$this->logger->debug('No hubo cambio de true a false en el campo isLead');
$this->logger->warning('El campo isLead no existe en entityBeforeEdit o entity');
}
} else {
$this->logger->warning('Los datos entityBeforeEdit o entity no contienen el campo isLead');
$this->logger->warning('Los datos entityBeforeEdit o entity no están presentes en extraData');
}
$this->notifierFacade->verifyClientActionToDo($notification);
} else if ($notification->eventName === 'client.add') {
$this->logger->debug('Se agregó un nuevo cliente' . PHP_EOL);
$this->pluginNotifierFacade->createStripeClient($notification);
// Verificar que existen tanto 'entityBeforeEdit' como 'entity'
if (isset($event_json['extraData']['entity']['isLead'])) {
$this->logger->debug('El campo isLead existe en los datos del evento');
$isLead = $jsonData['extraData']['entity']['isLead'];
// Comprobar si 'isLead' es true
if ($isLead === true) {
$this->logger->debug('El campo isLead es true');
$this->pluginNotifierFacade->createStripeClient($notification);
} else {
$this->logger->debug('El campo isLead es false');
}
} else {
$this->logger->warning('El campo isLead no existe en los datos del evento');
}
} else if ($notification->eventName === 'service.suspend') {
$this->logger->debug('Se suspendió el servicio a un cliente' . PHP_EOL);
$this->notifierFacade->verifyServiceActionToDo($notification);
@ -361,6 +456,79 @@ class Plugin
} else if ($notification->eventName === 'invoice.edit') {
$this->logger->debug('Edición de Factura' . PHP_EOL);
$this->notifierFacade->verifyInvoiceActionToDo($notification);
} else if ($notification->eventName === 'job.add') {
$this->logger->debug('Se ha agregado un nuevo trabajo' . PHP_EOL);
// Verificar que existen tanto 'assignedUserId' como 'entity'
if (isset($event_json['extraData']['entity']['assignedUserId'])) {
$this->logger->debug('El campo assignedUserId existe en los datos del evento');
$assignedUserId = $jsonData['extraData']['entity']['assignedUserId'];
// Comprobar si 'isLead' es null
if ($assignedUserId === null) {
$this->logger->debug('El campo assignedUserId es null');
$this->pluginNotifierFacade->createStripeClient($notification);
} else {
$this->logger->debug('El campo assignedUserId no es null');
$this->notifierFacade->verifyJobActionToDo($notification);
}
} else {
$this->logger->warning('El campo assignedUserId no existe en los datos del evento');
}
} else if ($notification->eventName === 'job.edit') {
$this->logger->debug('Se actualiza un trabajo' . PHP_EOL);
$this->logger->debug('Valor de json_data: ' . json_encode($jsonData));
// Validar que 'extraData' existe y contiene las claves necesarias
if (
isset($jsonData['extraData']['entityBeforeEdit']) &&
isset($jsonData['extraData']['entity'])
) {
$entityBeforeEdit = $jsonData['extraData']['entityBeforeEdit'];
$entity = $jsonData['extraData']['entity'];
$this->logger->debug('Validando claves dentro de entityBeforeEdit y entity');
// Validar que 'assignedUserId' existe en ambas entidades
if (array_key_exists('assignedUserId', $entityBeforeEdit) && array_key_exists('assignedUserId', $entity)) {
$this->logger->debug('Los datos entityBeforeEdit y entity contienen el campo assignedUserId');
$assignedUserIdBefore = $entityBeforeEdit['assignedUserId'];
$assignedUserIdAfter = $entity['assignedUserId'];
$dateBefore = $entityBeforeEdit['date'];
$dateAfter = $entity['date'];
$statusBefore = $entityBeforeEdit['status'];
$statusAfter = $entity['status'];
// Comprobar si 'assignedUserId' cambió
if ($assignedUserIdBefore === null && $assignedUserIdAfter != null) { //Si el campo "assignedUserId" cambió de null a un valor
$this->logger->debug('El campo assignedUserId cambió de null a un valor');
$this->notifierFacade->verifyJobActionToDo($jsonData); // Se envía notificación de trabajo asignado
} else if (($assignedUserIdBefore != null && $assignedUserIdAfter != $assignedUserIdBefore)&&($dateBefore === $dateAfter)) {//Si el campo "assignedUserId" cambió de un valor a otro y la fecha no cambió
$this->logger->debug('El campo assignedUserId cambió de un valor a otro y la fecha no cambió');
$this->notifierFacade->verifyJobActionToDo($jsonData, false , true); // Se envía notificación de trabajo reasignado
}else if (($assignedUserIdBefore != null && $assignedUserIdBefore === $assignedUserIdAfter) && ($dateBefore != $dateAfter)) {//Si el campo "assignedUserId" no cambió y la fecha cambió
$this->logger->debug('El campo assignedUserId no cambió y la fecha sí cambió');
$this->notifierFacade->verifyJobActionToDo($jsonData, true , false); // Se envía notificación de reprogramación de trabajo
} else if (($assignedUserIdBefore != null && $assignedUserIdAfter != $assignedUserIdBefore)&&($dateBefore != $dateAfter)){
$this->logger->debug('El campo assignedUserId cambió de un valor a otro y la fecha cambió');
$this->notifierFacade->verifyJobActionToDo($jsonData, true , true); // Se envía notificación de trabajo reasignado
} else if ($assignedUserIdBefore != null && $assignedUserIdAfter === null) { //Si el campo "assignedUserId" cambió de un valor a null
$this->logger->debug('El campo assignedUserId cambió de un valor a null');
$this->notifierFacade->verifyJobActionToDo($jsonData, null,true); // Se envía notificación de trabajo desasignado
}else {
$this->logger->debug('No hubo cambio en el campo assignedUserId ni en el campo date');
}
} else {
$this->logger->warning('El campo assignedUserId no existe en entityBeforeEdit o entity');
}
} else {
$this->logger->warning('Los datos entityBeforeEdit o entity no están presentes en extraData');
}
}

View File

@ -33,26 +33,76 @@ class SmsNumberProvider
/*
* go through client's contacts and find an applicable one, if any
*/
public function getUcrmClientNumbers(NotificationData $notificationData)
public function getUcrmClientNumbers(NotificationData $notificationData = null, $arrayClientCRM = null)
{
$log = PluginLogManager::create(); //Initialize Logger
//$log->appendLog("Ejecutando metodo getUcrmClientNumbers: " . json_encode($arrayClientCRM) . PHP_EOL);
// Array asociativo donde almacenarás los números de teléfono con sus tipos correspondientes
$arrayPhones = [];
// Recorrer los contactos del cliente para encontrar los teléfonos con sus tipos
foreach ($notificationData->clientData['contacts'] as $contact) {
if (!empty($contact['phone'])) { // Verificar que el teléfono no esté vacío
if (isset($contact['types']) && is_array($contact['types'])) { // Verificar que 'types' exista y sea un array
foreach ($contact['types'] as $type) {
if (in_array($type['name'], ['WhatsApp', 'WhatsNotifica', 'WhatsActualiza'])) {
// Si el tipo de contacto es uno de los deseados, agregamos al array asociativo
$arrayPhones[$type['name']] = $contact['phone'];
if ($arrayClientCRM != null) {
//$log->appendLog("Entrando al if del método getUcrmClientNumbers: " . $arrayClientCRM . PHP_EOL);
//$jsonNotificationData = json_decode($jsonNotificationData, true);
// Recorrer los contactos del cliente para encontrar los teléfonos con sus tipos
foreach ($arrayClientCRM['contacts'] as $contact) {
if (!empty($contact['phone'])) { // Verificar que el teléfono no esté vacío
if (isset($contact['types']) && is_array($contact['types'])) { // Verificar que 'types' exista y sea un array
foreach ($contact['types'] as $type) {
if (in_array($type['name'], ['WhatsApp', 'WhatsNotifica'])) {
// Si el tipo de contacto es uno de los deseados, agregamos al array asociativo
$arrayPhones[$type['name']] = $contact['phone'];
}
}
}
}
}
} else {
// Recorrer los contactos del cliente para encontrar los teléfonos con sus tipos
foreach ($notificationData->clientData['contacts'] as $contact) {
if (!empty($contact['phone'])) { // Verificar que el teléfono no esté vacío
if (isset($contact['types']) && is_array($contact['types'])) { // Verificar que 'types' exista y sea un array
foreach ($contact['types'] as $type) {
if (in_array($type['name'], ['WhatsApp', 'WhatsNotifica', 'WhatsActualiza'])) {
// Si el tipo de contacto es uno de los deseados, agregamos al array asociativo
$arrayPhones[$type['name']] = $contact['phone'];
}
}
}
}
}
}
return $arrayPhones; // Devolver el arreglo de teléfonos por tipo
}
/*
* go through client's contacts and find an applicable one, if any
*/
public function getAllUcrmClientNumbers($arrayClientCRM = null)
{
$log = PluginLogManager::create(); //Initialize Logger
//$log->appendLog("Ejecutando metodo getUcrmClientNumbers: " . json_encode($arrayClientCRM) . PHP_EOL);
// Array asociativo donde almacenarás los números de teléfono con sus tipos correspondientes
$arrayPhones = [];
//$log->appendLog("Entrando al if del método getUcrmClientNumbers: " . $arrayClientCRM . PHP_EOL);
//$jsonNotificationData = json_decode($jsonNotificationData, true);
// Recorrer los contactos del cliente para encontrar los teléfonos con sus tipos
foreach ($arrayClientCRM['contacts'] as $contact) {
if (!empty($contact['phone'])) { // Verificar que el teléfono no esté vacío
// agregamos al array asociativo
$arrayPhones[] = $contact['phone'];
}
}
return $arrayPhones; // Devolver el arreglo de teléfonos por tipo
}
/*
* not every contact has a phone; also check if the type of notification is applicable to contact
@ -94,18 +144,17 @@ class SmsNumberProvider
}
return false;
}
case 'service':
{
case 'service': {
$types = $contact['types'] ?? [];
foreach ($types as $type) {
//$log->appendLog("Entrando al case client del switch: " . json_encode($type));
if ($type['name'] == 'WhatsApp') {
return true;
}
$types = $contact['types'] ?? [];
foreach ($types as $type) {
//$log->appendLog("Entrando al case client del switch: " . json_encode($type));
if ($type['name'] == 'WhatsApp') {
return true;
}
return false;
}
return false;
}
default:
return $contact['isContact'] ?? false;
}

File diff suppressed because it is too large Load Diff

View File

@ -34,22 +34,13 @@ class ComposerAutoloaderInitd6442a7ec79f2f43fc97d16bdcdd18ee
call_user_func(\Composer\Autoload\ComposerStaticInitd6442a7ec79f2f43fc97d16bdcdd18ee::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->setClassMapAuthoritative(true);
$loader->register(true);
if ($useStaticLoader) {

File diff suppressed because it is too large Load Diff

View File

@ -2040,6 +2040,6 @@
"install-path": "../ubnt/ucrm-plugin-sdk"
}
],
"dev": true,
"dev": false,
"dev-package-names": []
}

View File

@ -5,9 +5,9 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '93a0f30eecd7b45a1b45bcb2c4642e734275029d',
'reference' => 'efd6f36c37acff90564096937d34b606769ee63c',
'name' => 'ucrm-plugins/sms-twilio',
'dev' => true,
'dev' => false,
),
'versions' => array(
'firebase/php-jwt' => array(
@ -307,7 +307,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '93a0f30eecd7b45a1b45bcb2c4642e734275029d',
'reference' => 'efd6f36c37acff90564096937d34b606769ee63c',
'dev_requirement' => false,
),
),