Skip to content

Commit

Permalink
Fix: tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghostscypher committed Aug 27, 2024
1 parent 6ee40dd commit 73119c6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ jobs:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: ^6.23
testbench: ^6.*
- laravel: 7.*
testbench: ^5.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.1
- laravel: 11.*
php: 8.2
- laravel: 11.*
php: 8.3

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
6 changes: 3 additions & 3 deletions src/Concerns/MpesaAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function generateToken(bool $force = false): ?string
if (! $force && ($token = app(config('mpesa.models.token'))->latest()->first())) {
$this->token = $token->token;

self::updateHttpClient([
$this->updateHttpClient([
'Authorization' => 'Bearer '.$this->token,
]);

Expand All @@ -55,7 +55,7 @@ public function generateToken(bool $force = false): ?string
}

// If the token is not valid, generate a new one
self::updateHttpClient([
$this->updateHttpClient([
'Authorization' => 'Basic '.$this->getCredentials(),
]);

Expand Down Expand Up @@ -97,7 +97,7 @@ public function generateToken(bool $force = false): ?string
$this->token = $token->token;

// Update the headers
self::updateHttpClient([
$this->updateHttpClient([
'Authorization' => 'Bearer '.$this->token,
]);

Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/MpesaGlobalConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct()
protected function updateHttpClient(array $headers = [], array $options = []): PendingRequest
{
// Get the original headers
$original_headers = $this->http_client->getHeaders();
$original_headers = $this->http_client->getOptions()['headers'] ?? [];

// Merge the headers
$headers = array_merge(
Expand Down
2 changes: 1 addition & 1 deletion src/Mpesa.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function rawRequest(string $method, string $url, array $data = [], array
$this->generateToken();
}

$response = self::getHttpClient($headers)
$response = self::updateHttpClient($headers)
->send($method, $url, $data);

return $response;
Expand Down

0 comments on commit 73119c6

Please sign in to comment.