Skip to content

Commit 9952f78

Browse files
committed
change some config values
1 parent 429b7e4 commit 9952f78

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ php artisan vendor:publish --tag="laravel-crisp-whatsapp-config"
3030
This is the contents of the published config file:
3131

3232
```php
33+
declare(strict_types=1);
34+
3335
return [
3436
'website_id' => env('CRISP_WEBSITE_ID'),
3537

3638
'base_url' => env('CRISP_BASE_URL', 'https://plugins.crisp.chat/urn:crisp.im:whatsapp:0/wa/api/website'),
37-
'identifier' => env('CRISP_WHATSAPP_IDENTIFIER'),
38-
'access_key' => env('CRISP_WHATSAPP_ACCESS_KEY'),
39+
'identifier' => env('CRISP_WHATSAPP_ACCESS_KEY_ID'),
40+
'access_key' => env('CRISP_WHATSAPP_SECRET_ACCESS_KEY'),
3941
'from_phone' => env('CRISP_WHATSAPP_FROM_PHONE'),
4042

4143
// change it to false when you are ready for production

config/crisp-whatsapp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
'website_id' => env('CRISP_WEBSITE_ID'),
77

88
'base_url' => env('CRISP_BASE_URL', 'https://plugins.crisp.chat/urn:crisp.im:whatsapp:0/wa/api/website'),
9-
'identifier' => env('CRISP_WHATSAPP_IDENTIFIER'),
10-
'access_key' => env('CRISP_WHATSAPP_ACCESS_KEY'),
9+
'identifier' => env('CRISP_WHATSAPP_ACCESS_KEY_ID'),
10+
'secret' => env('CRISP_WHATSAPP_SECRET_ACCESS_KEY'),
1111
'from_phone' => env('CRISP_WHATSAPP_FROM_PHONE'),
1212

1313
// change it to false when you are ready for production

src/LaravelCrispWhatsApp.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
{
1919
private string $websiteId;
2020

21-
private string $identifier;
21+
private string $accessKeyIdentifier;
2222

23-
private string $accessKey;
23+
private string $secretAccessKey;
2424

2525
private string $fromPhone;
2626

2727
public function __construct()
2828
{
2929
$this->websiteId = config('crisp-whatsapp.website_id');
30-
$this->identifier = config('crisp-whatsapp.identifier');
31-
$this->accessKey = config('crisp-whatsapp.access_key');
30+
$this->accessKeyIdentifier = config('crisp-whatsapp.access_key_id');
31+
$this->secretAccessKey = config('crisp-whatsapp.secret_access_key');
3232
$this->fromPhone = config('crisp-whatsapp.from_phone');
3333
}
3434

@@ -48,8 +48,8 @@ public function getMessageTemplates(
4848

4949
): array {
5050
$response = Http::withBasicAuth(
51-
$this->identifier,
52-
$this->accessKey
51+
$this->accessKeyIdentifier,
52+
$this->secretAccessKey
5353
)
5454
->get(
5555
config('crisp-whatsapp.base_url').
@@ -224,8 +224,8 @@ public function sendMessageTemplate(
224224
$toPhone = config('crisp-whatsapp.test_mode') ? config('crisp-whatsapp.to_test_phone') : $toPhone;
225225

226226
return Http::withBasicAuth(
227-
$this->identifier,
228-
$this->accessKey
227+
$this->accessKeyIdentifier,
228+
$this->secretAccessKey
229229
)
230230
->post(config('crisp-whatsapp.base_url')."/{$this->websiteId}/template/send",
231231
[

0 commit comments

Comments
 (0)