mirror of
https://github.com/bitinflow/accounts.git
synced 2026-03-13 13:35:52 +00:00
change namespace and cleanup code
This commit is contained in:
4
AUTH.md
4
AUTH.md
@@ -3,8 +3,8 @@
|
|||||||
This method should typically be called in the `boot` method of your `AuthServiceProvider` class:
|
This method should typically be called in the `boot` method of your `AuthServiceProvider` class:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use GhostZero\BitinflowAccounts\Providers\BitinflowAccountsSsoUserProvider;
|
use Bitinflow\Accounts\Providers\BitinflowAccountsSsoUserProvider;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -27,7 +27,7 @@ composer require ghostzero/bitinflow-accounts
|
|||||||
Add Service Provider to your `app.php` configuration file:
|
Add Service Provider to your `app.php` configuration file:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
GhostZero\BitinflowAccounts\Providers\BitinflowAccountsServiceProvider::class,
|
Bitinflow\Accounts\Providers\BitinflowAccountsServiceProvider::class,
|
||||||
```
|
```
|
||||||
|
|
||||||
## Event Listener
|
## Event Listener
|
||||||
@@ -85,7 +85,7 @@ You will need to add an entry to the services configuration file so that after c
|
|||||||
#### Basic
|
#### Basic
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$bitinflowAccounts = new GhostZero\BitinflowAccounts\BitinflowAccounts();
|
$bitinflowAccounts = new Bitinflow\Accounts\BitinflowAccounts();
|
||||||
|
|
||||||
$bitinflowAccounts->setClientId('abc123');
|
$bitinflowAccounts->setClientId('abc123');
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ echo $sshKey->name;
|
|||||||
#### Setters
|
#### Setters
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$bitinflowAccounts = new GhostZero\BitinflowAccounts\BitinflowAccounts();
|
$bitinflowAccounts = new Bitinflow\Accounts\BitinflowAccounts();
|
||||||
|
|
||||||
$bitinflowAccounts->setClientId('abc123');
|
$bitinflowAccounts->setClientId('abc123');
|
||||||
$bitinflowAccounts->setClientSecret('abc456');
|
$bitinflowAccounts->setClientSecret('abc456');
|
||||||
@@ -120,7 +120,7 @@ $bitinflowAccounts = $bitinflowAccounts->withToken('abcdef123456');
|
|||||||
#### OAuth Tokens
|
#### OAuth Tokens
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$bitinflowAccounts = new GhostZero\BitinflowAccounts\BitinflowAccounts();
|
$bitinflowAccounts = new Bitinflow\Accounts\BitinflowAccounts();
|
||||||
|
|
||||||
$bitinflowAccounts->setClientId('abc123');
|
$bitinflowAccounts->setClientId('abc123');
|
||||||
$bitinflowAccounts->setToken('abcdef123456');
|
$bitinflowAccounts->setToken('abcdef123456');
|
||||||
@@ -143,7 +143,7 @@ $result = $bitinflowAccounts->withToken('uvwxyz456789')->getAuthedUser();
|
|||||||
#### Facade
|
#### Facade
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use GhostZero\BitinflowAccounts\Facades\BitinflowAccounts;
|
use Bitinflow\Accounts\Facades\BitinflowAccounts;
|
||||||
|
|
||||||
BitinflowAccounts::withClientId('abc123')->withToken('abcdef123456')->getAuthedUser();
|
BitinflowAccounts::withClientId('abc123')->withToken('abcdef123456')->getAuthedUser();
|
||||||
```
|
```
|
||||||
|
|||||||
12
README.stub
12
README.stub
@@ -26,7 +26,7 @@ composer require ghostzero/bitinflow-accounts
|
|||||||
Add Service Provider to your `app.php` configuration file:
|
Add Service Provider to your `app.php` configuration file:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
GhostZero\BitinflowAccounts\Providers\BitinflowAccountsServiceProvider::class,
|
Bitinflow\Accounts\Providers\BitinflowAccountsServiceProvider::class,
|
||||||
```
|
```
|
||||||
|
|
||||||
## Event Listener
|
## Event Listener
|
||||||
@@ -56,7 +56,7 @@ protected $listen = [
|
|||||||
Copy configuration to config folder:
|
Copy configuration to config folder:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ php artisan vendor:publish --provider="GhostZero\BitinflowAccounts\Providers\BitinflowAccountsServiceProvider"
|
$ php artisan vendor:publish --provider="Bitinflow\Accounts\Providers\BitinflowAccountsServiceProvider"
|
||||||
```
|
```
|
||||||
|
|
||||||
Add environmental variables to your `.env`
|
Add environmental variables to your `.env`
|
||||||
@@ -84,7 +84,7 @@ You will need to add an entry to the services configuration file so that after c
|
|||||||
#### Basic
|
#### Basic
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$bitinflowAccounts = new GhostZero\BitinflowAccounts\BitinflowAccounts();
|
$bitinflowAccounts = new Bitinflow\Accounts\BitinflowAccounts();
|
||||||
|
|
||||||
$bitinflowAccounts->setClientId('abc123');
|
$bitinflowAccounts->setClientId('abc123');
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ echo $sshKey->name;
|
|||||||
#### Setters
|
#### Setters
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$bitinflowAccounts = new GhostZero\BitinflowAccounts\BitinflowAccounts();
|
$bitinflowAccounts = new Bitinflow\Accounts\BitinflowAccounts();
|
||||||
|
|
||||||
$bitinflowAccounts->setClientId('abc123');
|
$bitinflowAccounts->setClientId('abc123');
|
||||||
$bitinflowAccounts->setClientSecret('abc456');
|
$bitinflowAccounts->setClientSecret('abc456');
|
||||||
@@ -119,7 +119,7 @@ $bitinflowAccounts = $bitinflowAccounts->withToken('abcdef123456');
|
|||||||
#### OAuth Tokens
|
#### OAuth Tokens
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$bitinflowAccounts = new GhostZero\BitinflowAccounts\BitinflowAccounts();
|
$bitinflowAccounts = new Bitinflow\Accounts\BitinflowAccounts();
|
||||||
|
|
||||||
$bitinflowAccounts->setClientId('abc123');
|
$bitinflowAccounts->setClientId('abc123');
|
||||||
$bitinflowAccounts->setToken('abcdef123456');
|
$bitinflowAccounts->setToken('abcdef123456');
|
||||||
@@ -142,7 +142,7 @@ $result = $bitinflowAccounts->withToken('uvwxyz456789')->getAuthedUser();
|
|||||||
#### Facade
|
#### Facade
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use GhostZero\BitinflowAccounts\Facades\BitinflowAccounts;
|
use Bitinflow\Accounts\Facades\BitinflowAccounts;
|
||||||
|
|
||||||
BitinflowAccounts::withClientId('abc123')->withToken('abcdef123456')->getAuthedUser();
|
BitinflowAccounts::withClientId('abc123')->withToken('abcdef123456')->getAuthedUser();
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -5,7 +5,11 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "René Preuß",
|
"name": "René Preuß",
|
||||||
"email": "rene@preuss.io"
|
"email": "rene@bitinflow.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Maurice Preuß",
|
||||||
|
"email": "maurice@bitinflow.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
@@ -24,12 +28,12 @@
|
|||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"GhostZero\\BitinflowAccounts\\": "src/GhostZero/BitinflowAccounts"
|
"Bitinflow\\Accounts\\": "src/Accounts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"GhostZero\\BitinflowAccounts\\Tests\\": "tests/GhostZero/BitinflowAccounts"
|
"Bitinflow\\Accounts\\Tests\\": "tests/Accounts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -39,10 +43,10 @@
|
|||||||
"extra": {
|
"extra": {
|
||||||
"laravel": {
|
"laravel": {
|
||||||
"providers": [
|
"providers": [
|
||||||
"GhostZero\\BitinflowAccounts\\Providers\\BitinflowAccountsServiceProvider"
|
"Bitinflow\\Accounts\\Providers\\BitinflowAccountsServiceProvider"
|
||||||
],
|
],
|
||||||
"aliases": {
|
"aliases": {
|
||||||
"BitinflowAccounts": "GhostZero\\BitinflowAccounts\\Facades\\BitinflowAccounts"
|
"BitinflowAccounts": "Bitinflow\\Accounts\\Facades\\BitinflowAccounts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
// Accounts
|
||||||
'client_id' => env('BITINFLOW_ACCOUNTS_KEY'),
|
'client_id' => env('BITINFLOW_ACCOUNTS_KEY'),
|
||||||
'client_secret' => env('BITINFLOW_ACCOUNTS_SECRET'),
|
'client_secret' => env('BITINFLOW_ACCOUNTS_SECRET'),
|
||||||
'redirect_url' => env('BITINFLOW_ACCOUNTS_REDIRECT_URI'),
|
'redirect_url' => env('BITINFLOW_ACCOUNTS_REDIRECT_URI'),
|
||||||
'base_url' => env('BITINFLOW_ACCOUNTS_BASE_URL'),
|
'base_url' => env('BITINFLOW_ACCOUNTS_BASE_URL'),
|
||||||
|
|
||||||
|
// Payments
|
||||||
'payments' => [
|
'payments' => [
|
||||||
'base_url' => env('BITINFLOW_PAYMENTS_BASE_URL', 'https://api.pay.bitinflow.com/v1/'),
|
'base_url' => env('BITINFLOW_PAYMENTS_BASE_URL', 'https://api.pay.bitinflow.com/v1/'),
|
||||||
'dashboard_url' => env('BITINFLOW_PAYMENTS_DASHBOARD_URL', 'https://pay.bitinflow.com/v1/'),
|
'dashboard_url' => env('BITINFLOW_PAYMENTS_DASHBOARD_URL', 'https://pay.bitinflow.com/v1/'),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
|
||||||
$markdown = collect(class_uses(BitinflowAccounts::class))
|
$markdown = collect(class_uses(BitinflowAccounts::class))
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\ApiOperations;
|
namespace Bitinflow\Accounts\ApiOperations;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Helpers\Paginator;
|
use Bitinflow\Accounts\Helpers\Paginator;
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\ApiOperations;
|
namespace Bitinflow\Accounts\ApiOperations;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Helpers\Paginator;
|
use Bitinflow\Accounts\Helpers\Paginator;
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\ApiOperations;
|
namespace Bitinflow\Accounts\ApiOperations;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Helpers\Paginator;
|
use Bitinflow\Accounts\Helpers\Paginator;
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\ApiOperations;
|
namespace Bitinflow\Accounts\ApiOperations;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Helpers\Paginator;
|
use Bitinflow\Accounts\Helpers\Paginator;
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts;
|
namespace Bitinflow\Accounts;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Firebase\JWT\JWT;
|
use Firebase\JWT\JWT;
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Auth;
|
namespace Bitinflow\Accounts\Auth;
|
||||||
|
|
||||||
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
|
use Bitinflow\Accounts\Helpers\JwtParser;
|
||||||
|
use Bitinflow\Accounts\Traits\HasBitinflowTokens;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Firebase\JWT\JWT;
|
use Firebase\JWT\JWT;
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
|
||||||
use GhostZero\BitinflowAccounts\Helpers\JwtParser;
|
|
||||||
use GhostZero\BitinflowAccounts\Traits\HasBitinflowTokens;
|
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Auth\GuardHelpers;
|
use Illuminate\Auth\GuardHelpers;
|
||||||
use Illuminate\Container\Container;
|
use Illuminate\Container\Container;
|
||||||
@@ -16,6 +15,7 @@ use Illuminate\Contracts\Debug\ExceptionHandler;
|
|||||||
use Illuminate\Contracts\Encryption\Encrypter;
|
use Illuminate\Contracts\Encryption\Encrypter;
|
||||||
use Illuminate\Cookie\CookieValuePrefix;
|
use Illuminate\Cookie\CookieValuePrefix;
|
||||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||||
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Auth;
|
namespace Bitinflow\Accounts\Auth;
|
||||||
|
|
||||||
use Illuminate\Contracts\Auth\Authenticatable;
|
use Illuminate\Contracts\Auth\Authenticatable;
|
||||||
use Illuminate\Contracts\Auth\UserProvider as Base;
|
use Illuminate\Contracts\Auth\UserProvider as Base;
|
||||||
@@ -1,16 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts;
|
namespace Bitinflow\Accounts;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\ApiOperations;
|
use Bitinflow\Accounts\ApiOperations;
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\RequestRequiresAuthenticationException;
|
use Bitinflow\Accounts\Exceptions\RequestRequiresAuthenticationException;
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\RequestRequiresClientIdException;
|
use Bitinflow\Accounts\Exceptions\RequestRequiresClientIdException;
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\RequestRequiresRedirectUriException;
|
use Bitinflow\Accounts\Exceptions\RequestRequiresRedirectUriException;
|
||||||
use GhostZero\BitinflowAccounts\Helpers\Paginator;
|
use Bitinflow\Accounts\Helpers\Paginator;
|
||||||
use GhostZero\BitinflowAccounts\Traits;
|
use Bitinflow\Accounts\Traits;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Exception\GuzzleException;
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use Illuminate\Contracts\Auth\Authenticatable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -29,61 +30,63 @@ class BitinflowAccounts
|
|||||||
use ApiOperations\Post;
|
use ApiOperations\Post;
|
||||||
use ApiOperations\Put;
|
use ApiOperations\Put;
|
||||||
|
|
||||||
private static $baseUrl = 'https://accounts.bitinflow.com/api/';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name for API token cookies.
|
* The name for API token cookies.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public static $cookie = 'bitinflow_token';
|
public static $cookie = 'bitinflow_token';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if Bitinflow Accounts should ignore incoming CSRF tokens.
|
* Indicates if Bitinflow Accounts should ignore incoming CSRF tokens.
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public static $ignoreCsrfToken = false;
|
public static $ignoreCsrfToken = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if Bitinflow Accounts should unserializes cookies.
|
* Indicates if Bitinflow Accounts should unserializes cookies.
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public static $unserializesCookies = false;
|
public static $unserializesCookies = false;
|
||||||
|
private static $baseUrl = 'https://accounts.bitinflow.com/api/';
|
||||||
/**
|
/**
|
||||||
* Guzzle is used to make http requests.
|
* Guzzle is used to make http requests.
|
||||||
* @var \GuzzleHttp\Client
|
*
|
||||||
|
* @var Client
|
||||||
*/
|
*/
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Paginator object.
|
* Paginator object.
|
||||||
|
*
|
||||||
* @var Paginator
|
* @var Paginator
|
||||||
*/
|
*/
|
||||||
protected $paginator;
|
protected $paginator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bitinflow Accounts OAuth token.
|
* bitinflow Accounts OAuth token.
|
||||||
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
protected $token = null;
|
protected $token = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bitinflow Accounts client id.
|
* bitinflow Accounts client id.
|
||||||
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
protected $clientId = null;
|
protected $clientId = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bitinflow Accounts client secret.
|
* bitinflow Accounts client secret.
|
||||||
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
protected $clientSecret = null;
|
protected $clientSecret = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bitinflow Accounts OAuth redirect url.
|
* bitinflow Accounts OAuth redirect url.
|
||||||
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
protected $redirectUri = null;
|
protected $redirectUri = null;
|
||||||
@@ -110,6 +113,16 @@ class BitinflowAccounts
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $baseUrl
|
||||||
|
*
|
||||||
|
* @internal only for internal and debug purposes.
|
||||||
|
*/
|
||||||
|
public static function setBaseUrl(string $baseUrl): void
|
||||||
|
{
|
||||||
|
self::$baseUrl = $baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get or set the name for API token cookies.
|
* Get or set the name for API token cookies.
|
||||||
*
|
*
|
||||||
@@ -130,14 +143,13 @@ class BitinflowAccounts
|
|||||||
/**
|
/**
|
||||||
* Set the current user for the application with the given scopes.
|
* Set the current user for the application with the given scopes.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Contracts\Auth\Authenticatable|Traits\HasBitinflowTokens $user
|
* @param Authenticatable|Traits\HasBitinflowTokens $user
|
||||||
* @param array $scopes
|
* @param array $scopes
|
||||||
* @param string $guard
|
* @param string $guard
|
||||||
* @return \Illuminate\Contracts\Auth\Authenticatable
|
* @return Authenticatable
|
||||||
*/
|
*/
|
||||||
public static function actingAs($user, $scopes = [], $guard = 'api')
|
public static function actingAs($user, $scopes = [], $guard = 'api')
|
||||||
{
|
{
|
||||||
|
|
||||||
$user->withBitinflowAccessToken((object)[
|
$user->withBitinflowAccessToken((object)[
|
||||||
'scopes' => $scopes
|
'scopes' => $scopes
|
||||||
]);
|
]);
|
||||||
@@ -153,42 +165,6 @@ class BitinflowAccounts
|
|||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $baseUrl
|
|
||||||
*
|
|
||||||
* @internal only for internal and debug purposes.
|
|
||||||
*/
|
|
||||||
public static function setBaseUrl(string $baseUrl): void
|
|
||||||
{
|
|
||||||
self::$baseUrl = $baseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get client id.
|
|
||||||
* @return string
|
|
||||||
* @throws RequestRequiresClientIdException
|
|
||||||
*/
|
|
||||||
public function getClientId(): string
|
|
||||||
{
|
|
||||||
if (!$this->clientId) {
|
|
||||||
throw new RequestRequiresClientIdException;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->clientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set client id.
|
|
||||||
*
|
|
||||||
* @param string $clientId bitinflow Accounts client id
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setClientId(string $clientId): void
|
|
||||||
{
|
|
||||||
$this->clientId = $clientId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fluid client id setter.
|
* Fluid client id setter.
|
||||||
*
|
*
|
||||||
@@ -205,6 +181,7 @@ class BitinflowAccounts
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get client secret.
|
* Get client secret.
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws RequestRequiresClientIdException
|
* @throws RequestRequiresClientIdException
|
||||||
*/
|
*/
|
||||||
@@ -245,6 +222,7 @@ class BitinflowAccounts
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get redirect url.
|
* Get redirect url.
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws RequestRequiresRedirectUriException
|
* @throws RequestRequiresRedirectUriException
|
||||||
*/
|
*/
|
||||||
@@ -285,6 +263,7 @@ class BitinflowAccounts
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get OAuth token.
|
* Get OAuth token.
|
||||||
|
*
|
||||||
* @return string bitinflow Accounts token
|
* @return string bitinflow Accounts token
|
||||||
* @return string|null
|
* @return string|null
|
||||||
* @throws RequestRequiresAuthenticationException
|
* @throws RequestRequiresAuthenticationException
|
||||||
@@ -338,6 +317,110 @@ class BitinflowAccounts
|
|||||||
return $this->query('GET', $path, $parameters, $paginator);
|
return $this->query('GET', $path, $parameters, $paginator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build query & execute.
|
||||||
|
*
|
||||||
|
* @param string $method HTTP method
|
||||||
|
* @param string $path Query path
|
||||||
|
* @param array $parameters Query parameters
|
||||||
|
* @param Paginator $paginator Paginator object
|
||||||
|
* @param mixed|null $jsonBody JSON data
|
||||||
|
*
|
||||||
|
* @return Result Result object
|
||||||
|
* @throws GuzzleException
|
||||||
|
* @throws RequestRequiresClientIdException
|
||||||
|
*/
|
||||||
|
public function query(string $method = 'GET', string $path = '', array $parameters = [], Paginator $paginator = null, $jsonBody = null): Result
|
||||||
|
{
|
||||||
|
if ($paginator !== null) {
|
||||||
|
$parameters[$paginator->action] = $paginator->cursor();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$response = $this->client->request($method, $path, [
|
||||||
|
'headers' => $this->buildHeaders($jsonBody ? true : false),
|
||||||
|
'query' => $this->buildQuery($parameters),
|
||||||
|
'json' => $jsonBody ?: null,
|
||||||
|
]);
|
||||||
|
$result = new Result($response, null, $paginator);
|
||||||
|
} catch (RequestException $exception) {
|
||||||
|
$result = new Result($exception->getResponse(), $exception, $paginator);
|
||||||
|
}
|
||||||
|
$result->bitinflow = $this;
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build headers for request.
|
||||||
|
*
|
||||||
|
* @param bool $json Body is JSON
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @throws RequestRequiresClientIdException
|
||||||
|
*/
|
||||||
|
private function buildHeaders(bool $json = false): array
|
||||||
|
{
|
||||||
|
$headers = [
|
||||||
|
'Client-ID' => $this->getClientId(),
|
||||||
|
'Accept' => 'application/json',
|
||||||
|
];
|
||||||
|
if ($this->token) {
|
||||||
|
$headers['Authorization'] = 'Bearer ' . $this->token;
|
||||||
|
}
|
||||||
|
if ($json) {
|
||||||
|
$headers['Content-Type'] = 'application/json';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get client id.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @throws RequestRequiresClientIdException
|
||||||
|
*/
|
||||||
|
public function getClientId(): string
|
||||||
|
{
|
||||||
|
if (!$this->clientId) {
|
||||||
|
throw new RequestRequiresClientIdException;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set client id.
|
||||||
|
*
|
||||||
|
* @param string $clientId bitinflow Accounts client id
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setClientId(string $clientId): void
|
||||||
|
{
|
||||||
|
$this->clientId = $clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build query with support for multiple smae first-dimension keys.
|
||||||
|
*
|
||||||
|
* @param array $query
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function buildQuery(array $query): string
|
||||||
|
{
|
||||||
|
$parts = [];
|
||||||
|
foreach ($query as $name => $value) {
|
||||||
|
$value = (array)$value;
|
||||||
|
array_walk_recursive($value, function ($value) use (&$parts, $name) {
|
||||||
|
$parts[] = urlencode($name) . '=' . urlencode($value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode('&', $parts);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
@@ -397,81 +480,4 @@ class BitinflowAccounts
|
|||||||
|
|
||||||
return $this->query($method, $path, [], null, $body);
|
return $this->query($method, $path, [], null, $body);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Build query & execute.
|
|
||||||
*
|
|
||||||
* @param string $method HTTP method
|
|
||||||
* @param string $path Query path
|
|
||||||
* @param array $parameters Query parameters
|
|
||||||
* @param Paginator $paginator Paginator object
|
|
||||||
* @param mixed|null $jsonBody JSON data
|
|
||||||
*
|
|
||||||
* @return Result Result object
|
|
||||||
* @throws GuzzleException
|
|
||||||
* @throws RequestRequiresClientIdException
|
|
||||||
*/
|
|
||||||
public function query(string $method = 'GET', string $path = '', array $parameters = [], Paginator $paginator = null, $jsonBody = null): Result
|
|
||||||
{
|
|
||||||
if ($paginator !== null) {
|
|
||||||
$parameters[$paginator->action] = $paginator->cursor();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
$response = $this->client->request($method, $path, [
|
|
||||||
'headers' => $this->buildHeaders($jsonBody ? true : false),
|
|
||||||
'query' => $this->buildQuery($parameters),
|
|
||||||
'json' => $jsonBody ?: null,
|
|
||||||
]);
|
|
||||||
$result = new Result($response, null, $paginator);
|
|
||||||
} catch (RequestException $exception) {
|
|
||||||
$result = new Result($exception->getResponse(), $exception, $paginator);
|
|
||||||
}
|
|
||||||
$result->bitinflow = $this;
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build query with support for multiple smae first-dimension keys.
|
|
||||||
*
|
|
||||||
* @param array $query
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function buildQuery(array $query): string
|
|
||||||
{
|
|
||||||
$parts = [];
|
|
||||||
foreach ($query as $name => $value) {
|
|
||||||
$value = (array) $value;
|
|
||||||
array_walk_recursive($value, function ($value) use (&$parts, $name) {
|
|
||||||
$parts[] = urlencode($name) . '=' . urlencode($value);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return implode('&', $parts);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build headers for request.
|
|
||||||
*
|
|
||||||
* @param bool $json Body is JSON
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
* @throws RequestRequiresClientIdException
|
|
||||||
*/
|
|
||||||
private function buildHeaders(bool $json = false): array
|
|
||||||
{
|
|
||||||
$headers = [
|
|
||||||
'Client-ID' => $this->getClientId(),
|
|
||||||
'Accept' => 'application/json',
|
|
||||||
];
|
|
||||||
if ($this->token) {
|
|
||||||
$headers['Authorization'] = 'Bearer ' . $this->token;
|
|
||||||
}
|
|
||||||
if ($json) {
|
|
||||||
$headers['Content-Type'] = 'application/json';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $headers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Enums;
|
namespace Bitinflow\Accounts\Enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Exceptions;
|
namespace Bitinflow\Accounts\Exceptions;
|
||||||
|
|
||||||
use Illuminate\Auth\Access\AuthorizationException;
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Exceptions;
|
namespace Bitinflow\Accounts\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Exceptions;
|
namespace Bitinflow\Accounts\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Exceptions;
|
namespace Bitinflow\Accounts\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Exceptions;
|
namespace Bitinflow\Accounts\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Exceptions;
|
namespace Bitinflow\Accounts\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Facades;
|
namespace Bitinflow\Accounts\Facades;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts as BitinflowAccountsService;
|
use Bitinflow\Accounts\BitinflowAccounts as BitinflowAccountsService;
|
||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Helpers;
|
namespace Bitinflow\Accounts\Helpers;
|
||||||
|
|
||||||
|
|
||||||
use Firebase\JWT\JWT;
|
use Firebase\JWT\JWT;
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Helpers;
|
namespace Bitinflow\Accounts\Helpers;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,17 +13,18 @@ use stdClass;
|
|||||||
class Paginator
|
class Paginator
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* bitinflow Accounts response pagination cursor.
|
|
||||||
* @var null|stdClass
|
|
||||||
*/
|
|
||||||
private $pagination;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Next desired action (first, after, before).
|
* Next desired action (first, after, before).
|
||||||
|
*
|
||||||
* @var null|string
|
* @var null|string
|
||||||
*/
|
*/
|
||||||
public $action = null;
|
public $action = null;
|
||||||
|
/**
|
||||||
|
* bitinflow Accounts response pagination cursor.
|
||||||
|
*
|
||||||
|
* @var null|stdClass
|
||||||
|
*/
|
||||||
|
private $pagination;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -49,6 +50,7 @@ class Paginator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the current active cursor.
|
* Return the current active cursor.
|
||||||
|
*
|
||||||
* @return string bitinflow Accounts cursor
|
* @return string bitinflow Accounts cursor
|
||||||
*/
|
*/
|
||||||
public function cursor(): string
|
public function cursor(): string
|
||||||
@@ -58,6 +60,7 @@ class Paginator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Paginator to fetch the next set of results.
|
* Set the Paginator to fetch the next set of results.
|
||||||
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function first(): self
|
public function first(): self
|
||||||
@@ -69,6 +72,7 @@ class Paginator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Paginator to fetch the first set of results.
|
* Set the Paginator to fetch the first set of results.
|
||||||
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function next(): self
|
public function next(): self
|
||||||
@@ -80,6 +84,7 @@ class Paginator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Paginator to fetch the last set of results.
|
* Set the Paginator to fetch the last set of results.
|
||||||
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function back(): self
|
public function back(): self
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Http\Middleware;
|
namespace Bitinflow\Accounts\Http\Middleware;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\MissingScopeException;
|
use Bitinflow\Accounts\Exceptions\MissingScopeException;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
class CheckClientCredentials extends CheckCredentials
|
class CheckClientCredentials extends CheckCredentials
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Http\Middleware;
|
namespace Bitinflow\Accounts\Http\Middleware;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\MissingScopeException;
|
use Bitinflow\Accounts\Exceptions\MissingScopeException;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
class CheckClientCredentialsForAnyScope extends CheckCredentials
|
class CheckClientCredentialsForAnyScope extends CheckCredentials
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Http\Middleware;
|
namespace Bitinflow\Accounts\Http\Middleware;
|
||||||
|
|
||||||
|
use Bitinflow\Accounts\Exceptions\MissingScopeException;
|
||||||
|
use Bitinflow\Accounts\Helpers\JwtParser;
|
||||||
use Closure;
|
use Closure;
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\MissingScopeException;
|
|
||||||
use GhostZero\BitinflowAccounts\Helpers\JwtParser;
|
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Http\Middleware;
|
namespace Bitinflow\Accounts\Http\Middleware;
|
||||||
|
|
||||||
|
|
||||||
|
use Bitinflow\Accounts\Exceptions\MissingScopeException;
|
||||||
use Closure;
|
use Closure;
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\MissingScopeException;
|
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Http\Middleware;
|
namespace Bitinflow\Accounts\Http\Middleware;
|
||||||
|
|
||||||
|
use Bitinflow\Accounts\Exceptions\MissingScopeException;
|
||||||
use Closure;
|
use Closure;
|
||||||
use GhostZero\BitinflowAccounts\Exceptions\MissingScopeException;
|
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Http\Middleware;
|
namespace Bitinflow\Accounts\Http\Middleware;
|
||||||
|
|
||||||
|
use Bitinflow\Accounts\ApiTokenCookieFactory;
|
||||||
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use Closure;
|
use Closure;
|
||||||
use GhostZero\BitinflowAccounts\ApiTokenCookieFactory;
|
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Providers;
|
namespace Bitinflow\Accounts\Providers;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Auth\TokenGuard;
|
use Bitinflow\Accounts\Auth\TokenGuard;
|
||||||
use GhostZero\BitinflowAccounts\Auth\UserProvider;
|
use Bitinflow\Accounts\Auth\UserProvider;
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use GhostZero\BitinflowAccounts\Helpers\JwtParser;
|
use Bitinflow\Accounts\Helpers\JwtParser;
|
||||||
use Illuminate\Auth\RequestGuard;
|
use Illuminate\Auth\RequestGuard;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
@@ -17,6 +17,7 @@ class BitinflowAccountsServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Bootstrap the application services.
|
* Bootstrap the application services.
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
@@ -28,6 +29,7 @@ class BitinflowAccountsServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
@@ -40,15 +42,6 @@ class BitinflowAccountsServiceProvider extends ServiceProvider
|
|||||||
$this->registerGuard();
|
$this->registerGuard();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the services provided by the provider.
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function provides()
|
|
||||||
{
|
|
||||||
return [BitinflowAccounts::class];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the token guard.
|
* Register the token guard.
|
||||||
*
|
*
|
||||||
@@ -81,4 +74,14 @@ class BitinflowAccountsServiceProvider extends ServiceProvider
|
|||||||
))->user($request);
|
))->user($request);
|
||||||
}, $this->app['request']);
|
}, $this->app['request']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the services provided by the provider.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function provides()
|
||||||
|
{
|
||||||
|
return [BitinflowAccounts::class];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Providers;
|
namespace Bitinflow\Accounts\Providers;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use Illuminate\Contracts\Auth\Authenticatable;
|
use Illuminate\Contracts\Auth\Authenticatable;
|
||||||
use Illuminate\Contracts\Auth\UserProvider;
|
use Illuminate\Contracts\Auth\UserProvider;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts;
|
namespace Bitinflow\Accounts;
|
||||||
|
|
||||||
|
use Bitinflow\Accounts\Helpers\Paginator;
|
||||||
use Exception;
|
use Exception;
|
||||||
use GhostZero\BitinflowAccounts\Helpers\Paginator;
|
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
@@ -18,54 +18,63 @@ class Result
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Query successfull.
|
* Query successfull.
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $success = false;
|
public $success = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guzzle exception, if present.
|
* Guzzle exception, if present.
|
||||||
|
*
|
||||||
* @var null|mixed
|
* @var null|mixed
|
||||||
*/
|
*/
|
||||||
public $exception = null;
|
public $exception = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query result data.
|
* Query result data.
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $data = [];
|
public $data = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Total amount of result data.
|
* Total amount of result data.
|
||||||
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $total = 0;
|
public $total = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Status Code.
|
* Status Code.
|
||||||
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $status = 0;
|
public $status = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bitinflow Accounts response pagination cursor.
|
* bitinflow Accounts response pagination cursor.
|
||||||
* @var null|\stdClass
|
*
|
||||||
|
* @var null|stdClass
|
||||||
*/
|
*/
|
||||||
public $pagination;
|
public $pagination;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal paginator.
|
* Internal paginator.
|
||||||
|
*
|
||||||
* @var null|Paginator
|
* @var null|Paginator
|
||||||
*/
|
*/
|
||||||
public $paginator;
|
public $paginator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Original Guzzle HTTP Response.
|
* Original Guzzle HTTP Response.
|
||||||
|
*
|
||||||
* @var ResponseInterface|null
|
* @var ResponseInterface|null
|
||||||
*/
|
*/
|
||||||
public $response;
|
public $response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Original bitinflow Accounts instance.
|
* Original bitinflow Accounts instance.
|
||||||
|
*
|
||||||
* @var BitinflowAccounts
|
* @var BitinflowAccounts
|
||||||
*/
|
*/
|
||||||
public $bitinflow;
|
public $bitinflow;
|
||||||
@@ -111,6 +120,7 @@ class Result
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns wether the query was successfull.
|
* Returns wether the query was successfull.
|
||||||
|
*
|
||||||
* @return bool Success state
|
* @return bool Success state
|
||||||
*/
|
*/
|
||||||
public function success(): bool
|
public function success(): bool
|
||||||
@@ -120,6 +130,7 @@ class Result
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the response data, also available as public attribute.
|
* Get the response data, also available as public attribute.
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function data()
|
public function data()
|
||||||
@@ -129,6 +140,7 @@ class Result
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the last HTTP or API error.
|
* Returns the last HTTP or API error.
|
||||||
|
*
|
||||||
* @return string Error message
|
* @return string Error message
|
||||||
*/
|
*/
|
||||||
public function error(): string
|
public function error(): string
|
||||||
@@ -148,6 +160,7 @@ class Result
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Shifts the current result (Use for single user/video etc. query).
|
* Shifts the current result (Use for single user/video etc. query).
|
||||||
|
*
|
||||||
* @return mixed Shifted data
|
* @return mixed Shifted data
|
||||||
*/
|
*/
|
||||||
public function shift()
|
public function shift()
|
||||||
@@ -163,6 +176,7 @@ class Result
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the current count of items in dataset.
|
* Return the current count of items in dataset.
|
||||||
|
*
|
||||||
* @return int Count
|
* @return int Count
|
||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
@@ -170,17 +184,9 @@ class Result
|
|||||||
return count((array)$this->data);
|
return count((array)$this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the Paginator to fetch the first set of results.
|
|
||||||
* @return null|Paginator
|
|
||||||
*/
|
|
||||||
public function first(): ?Paginator
|
|
||||||
{
|
|
||||||
return $this->paginator !== null ? $this->paginator->first() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Paginator to fetch the next set of results.
|
* Set the Paginator to fetch the next set of results.
|
||||||
|
*
|
||||||
* @return null|Paginator
|
* @return null|Paginator
|
||||||
*/
|
*/
|
||||||
public function next(): ?Paginator
|
public function next(): ?Paginator
|
||||||
@@ -190,6 +196,7 @@ class Result
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Paginator to fetch the last set of results.
|
* Set the Paginator to fetch the last set of results.
|
||||||
|
*
|
||||||
* @return null|Paginator
|
* @return null|Paginator
|
||||||
*/
|
*/
|
||||||
public function back(): ?Paginator
|
public function back(): ?Paginator
|
||||||
@@ -248,4 +255,14 @@ class Result
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the Paginator to fetch the first set of results.
|
||||||
|
*
|
||||||
|
* @return null|Paginator
|
||||||
|
*/
|
||||||
|
public function first(): ?Paginator
|
||||||
|
{
|
||||||
|
return $this->paginator !== null ? $this->paginator->first() : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Socialite;
|
namespace Bitinflow\Accounts\Socialite;
|
||||||
|
|
||||||
use SocialiteProviders\Manager\SocialiteWasCalled;
|
use SocialiteProviders\Manager\SocialiteWasCalled;
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Socialite;
|
namespace Bitinflow\Accounts\Socialite;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Enums\Scope;
|
use Bitinflow\Accounts\Enums\Scope;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Laravel\Socialite\Two\ProviderInterface;
|
use Laravel\Socialite\Two\ProviderInterface;
|
||||||
use SocialiteProviders\Manager\OAuth2\AbstractProvider;
|
use SocialiteProviders\Manager\OAuth2\AbstractProvider;
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Traits;
|
namespace Bitinflow\Accounts\Traits;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Exception\GuzzleException;
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
use Illuminate\Http\Client\PendingRequest;
|
use Illuminate\Http\Client\PendingRequest;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use RuntimeException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property string access_token todo: can we get this from HasBitinflowTokens ?
|
* @property string access_token todo: can we get this from HasBitinflowTokens ?
|
||||||
@@ -15,7 +13,33 @@ use RuntimeException;
|
|||||||
*/
|
*/
|
||||||
trait HasBitinflowPaymentsWallet
|
trait HasBitinflowPaymentsWallet
|
||||||
{
|
{
|
||||||
protected ?object $paymentsUser = null;
|
protected $paymentsUser = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if user has an active wallet.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @throws GuzzleException
|
||||||
|
*/
|
||||||
|
public function hasWallet(): bool
|
||||||
|
{
|
||||||
|
return $this->getPaymentsUser()->data->has_wallet;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user from payments gateway.
|
||||||
|
*
|
||||||
|
* @return object|null
|
||||||
|
* @throws GuzzleException
|
||||||
|
*/
|
||||||
|
public function getPaymentsUser(): ?object
|
||||||
|
{
|
||||||
|
if (is_null($this->paymentsUser)) {
|
||||||
|
$this->paymentsUser = $this->paymentsGatewayRequest('GET', 'user');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->paymentsUser;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new payment gateway request.
|
* Create a new payment gateway request.
|
||||||
@@ -44,32 +68,6 @@ trait HasBitinflowPaymentsWallet
|
|||||||
return json_decode($response->getBody());
|
return json_decode($response->getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get user from payments gateway.
|
|
||||||
*
|
|
||||||
* @return object|null
|
|
||||||
* @throws GuzzleException
|
|
||||||
*/
|
|
||||||
public function getPaymentsUser(): ?object
|
|
||||||
{
|
|
||||||
if (is_null($this->paymentsUser)) {
|
|
||||||
$this->paymentsUser = $this->paymentsGatewayRequest('GET', 'user');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->paymentsUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if user has an active wallet.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
* @throws GuzzleException
|
|
||||||
*/
|
|
||||||
public function hasWallet(): bool
|
|
||||||
{
|
|
||||||
return $this->getPaymentsUser()->data->has_wallet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getWalletSetupIntent(string $success_path = ''): string
|
public function getWalletSetupIntent(string $success_path = ''): string
|
||||||
{
|
{
|
||||||
return sprintf('%swallet?continue_url=%s', config('bitinflow-accounts.payments.dashboard_url'), url($success_path));
|
return sprintf('%swallet?continue_url=%s', config('bitinflow-accounts.payments.dashboard_url'), url($success_path));
|
||||||
@@ -97,6 +95,24 @@ trait HasBitinflowPaymentsWallet
|
|||||||
return $this->getPaymentsUser()->data->taxation->vat;
|
return $this->getPaymentsUser()->data->taxation->vat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasSubscribed($name = 'default'): bool
|
||||||
|
{
|
||||||
|
$subscription = $this->getSubscription($name);
|
||||||
|
|
||||||
|
return $subscription && $subscription->status === 'settled' || $subscription && $subscription->resumeable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSubscription($name = 'default'): ?object
|
||||||
|
{
|
||||||
|
foreach ($this->getSubscriptions() as $subscription) {
|
||||||
|
if (isset($subscription->payload->name) && $subscription->payload->name === $name) {
|
||||||
|
return $subscription;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get vat from user.
|
* Get vat from user.
|
||||||
*
|
*
|
||||||
@@ -116,24 +132,6 @@ trait HasBitinflowPaymentsWallet
|
|||||||
return $subscriptions;
|
return $subscriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSubscription($name = 'default'): ?object
|
|
||||||
{
|
|
||||||
foreach ($this->getSubscriptions() as $subscription) {
|
|
||||||
if (isset($subscription->payload->name) && $subscription->payload->name === $name) {
|
|
||||||
return $subscription;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function hasSubscribed($name = 'default'): bool
|
|
||||||
{
|
|
||||||
$subscription = $this->getSubscription($name);
|
|
||||||
|
|
||||||
return $subscription && $subscription->status === 'settled' || $subscription && $subscription->resumeable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new subscription.
|
* Create a new subscription.
|
||||||
*
|
*
|
||||||
@@ -153,7 +151,10 @@ trait HasBitinflowPaymentsWallet
|
|||||||
'client_id' => config('bitinflow-accounts.client_id')
|
'client_id' => config('bitinflow-accounts.client_id')
|
||||||
];
|
];
|
||||||
$defaults = ['period' => 'monthly'];
|
$defaults = ['period' => 'monthly'];
|
||||||
$attributes = array_merge(array_merge($defaults, $attributes), ['payload' => array_merge($payload, $client), 'checkout' => $checkout]);
|
$attributes = array_merge(array_merge($defaults, $attributes), [
|
||||||
|
'payload' => array_merge($payload, $client),
|
||||||
|
'checkout' => $checkout
|
||||||
|
]);
|
||||||
|
|
||||||
return $this->paymentsGatewayRequest('POST', 'subscriptions', $attributes)->data;
|
return $this->paymentsGatewayRequest('POST', 'subscriptions', $attributes)->data;
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Traits;
|
namespace Bitinflow\Accounts\Traits;
|
||||||
|
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Traits;
|
namespace Bitinflow\Accounts\Traits;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Traits;
|
namespace Bitinflow\Accounts\Traits;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\ApiOperations\Delete;
|
use Bitinflow\Accounts\ApiOperations\Delete;
|
||||||
use GhostZero\BitinflowAccounts\ApiOperations\Get;
|
use Bitinflow\Accounts\ApiOperations\Get;
|
||||||
use GhostZero\BitinflowAccounts\ApiOperations\Post;
|
use Bitinflow\Accounts\ApiOperations\Post;
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
|
|
||||||
trait SshKeysTrait
|
trait SshKeysTrait
|
||||||
{
|
{
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Traits;
|
namespace Bitinflow\Accounts\Traits;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\ApiOperations\Get;
|
use Bitinflow\Accounts\ApiOperations\Get;
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
|
|
||||||
trait UsersTrait
|
trait UsersTrait
|
||||||
{
|
{
|
||||||
@@ -14,6 +14,7 @@ trait UsersTrait
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get currently authed user with Bearer Token
|
* Get currently authed user with Bearer Token
|
||||||
|
*
|
||||||
* @return Result Result object
|
* @return Result Result object
|
||||||
*/
|
*/
|
||||||
public function getAuthedUser(): Result
|
public function getAuthedUser(): Result
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Tests;
|
namespace Bitinflow\Accounts\Tests;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Tests\TestCases\ApiTestCase;
|
use Bitinflow\Accounts\Tests\TestCases\ApiTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Tests;
|
namespace Bitinflow\Accounts\Tests;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
use GhostZero\BitinflowAccounts\Tests\TestCases\ApiTestCase;
|
use Bitinflow\Accounts\Tests\TestCases\ApiTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Tests;
|
namespace Bitinflow\Accounts\Tests;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\Enums\Scope;
|
use Bitinflow\Accounts\Enums\Scope;
|
||||||
use GhostZero\BitinflowAccounts\Tests\TestCases\ApiTestCase;
|
use Bitinflow\Accounts\Tests\TestCases\ApiTestCase;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Tests;
|
namespace Bitinflow\Accounts\Tests;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use GhostZero\BitinflowAccounts\Facades\BitinflowAccounts as BitinflowAccountsFacade;
|
use Bitinflow\Accounts\Facades\BitinflowAccounts as BitinflowAccountsFacade;
|
||||||
use GhostZero\BitinflowAccounts\Tests\TestCases\TestCase;
|
use Bitinflow\Accounts\Tests\TestCases\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Tests\TestCases;
|
namespace Bitinflow\Accounts\Tests\TestCases;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use GhostZero\BitinflowAccounts\Result;
|
use Bitinflow\Accounts\Result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author René Preuß <rene@preuss.io>
|
* @author René Preuß <rene@preuss.io>
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GhostZero\BitinflowAccounts\Tests\TestCases;
|
namespace Bitinflow\Accounts\Tests\TestCases;
|
||||||
|
|
||||||
use GhostZero\BitinflowAccounts\BitinflowAccounts;
|
use Bitinflow\Accounts\BitinflowAccounts;
|
||||||
use GhostZero\BitinflowAccounts\Providers\BitinflowAccountsServiceProvider;
|
use Bitinflow\Accounts\Providers\BitinflowAccountsServiceProvider;
|
||||||
use Orchestra\Testbench\TestCase as BaseTestCase;
|
use Orchestra\Testbench\TestCase as BaseTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reference in New Issue
Block a user