fixed nextcloud and wa api
This commit is contained in:
@@ -37,19 +37,24 @@ class WhatsappHelper
|
||||
];
|
||||
}
|
||||
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
try {
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
|
||||
return $response->getBody()->getContents();
|
||||
return $response->getBody()->getContents();
|
||||
} catch (\Exception $e) {
|
||||
AuditTrailHelper::AddAuditTrail('Error', 'Failed to send WhatsApp message at Form (' . $expense_number . ')');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function approve2Expense($phones, $expense_number, $url = null, $tanggal, $total, $name)
|
||||
@@ -81,19 +86,24 @@ class WhatsappHelper
|
||||
];
|
||||
}
|
||||
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
try {
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
|
||||
return $response->getBody()->getContents();
|
||||
return $response->getBody()->getContents();
|
||||
} catch (\Exception $e) {
|
||||
AuditTrailHelper::AddAuditTrail('Error', 'Failed to send WhatsApp message at Form (' . $expense_number . ')');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function rejectExpense($phones, $expense_number, $url = null, $tanggal, $total, $name)
|
||||
@@ -125,19 +135,24 @@ class WhatsappHelper
|
||||
];
|
||||
}
|
||||
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
try {
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
|
||||
return $response->getBody()->getContents();
|
||||
return $response->getBody()->getContents();
|
||||
} catch (\Exception $e) {
|
||||
AuditTrailHelper::AddAuditTrail('Error', 'Failed to send WhatsApp message at Form (' . $expense_number . ')');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function finalApprove($phones, $expense_number, $url = null, $tanggal, $total, $name)
|
||||
@@ -169,19 +184,24 @@ class WhatsappHelper
|
||||
];
|
||||
}
|
||||
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
try {
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
|
||||
return $response->getBody()->getContents();
|
||||
return $response->getBody()->getContents();
|
||||
} catch (\Exception $e) {
|
||||
AuditTrailHelper::AddAuditTrail('Error', 'Failed to send WhatsApp message at Form (' . $expense_number . ')');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function newExpense($phones, $expense_number, $url = null, $tanggal, $total, $name)
|
||||
@@ -213,18 +233,28 @@ class WhatsappHelper
|
||||
];
|
||||
}
|
||||
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
dd(env('WABLAS_HOST'), env('WABLAS_TOKEN'), $data);
|
||||
|
||||
return $response->getBody()->getContents();
|
||||
try {
|
||||
// Send the request to the WABLAS API
|
||||
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
|
||||
'headers' => [
|
||||
'Authorization' => env('WABLAS_TOKEN'),
|
||||
'Content-Type' => 'application/json'
|
||||
],
|
||||
'json' => [
|
||||
'data' => $data
|
||||
],
|
||||
'verify' => false,
|
||||
]);
|
||||
|
||||
dd($response->getBody()->getContents());
|
||||
|
||||
return $response->getBody()->getContents();
|
||||
} catch (\Exception $e) {
|
||||
dd($e->getMessage());
|
||||
AuditTrailHelper::AddAuditTrail('Error', 'Failed to send WhatsApp message at Form (' . $expense_number . ')');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user