1
0
mirror of synced 2024-11-21 21:06:07 +03:00

Add scopes in credentials method

This commit is contained in:
Alex Lushpai 2021-10-26 13:34:46 +03:00 committed by GitHub
commit c8be9c7891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -21,6 +21,7 @@ use RetailCrm\Api\Model\Response\SuccessResponse;
class Credentials extends SuccessResponse
{
/**
* @deprecated
* @var string[]
*
* @JMS\Type("array<string>")
@ -28,6 +29,14 @@ class Credentials extends SuccessResponse
*/
public $credentials;
/**
* @var string[]
*
* @JMS\Type("array<string>")
* @JMS\SerializedName("scopes")
*/
public $scopes;
/**
* @var string
*

View File

@ -52,6 +52,7 @@ EOF;
$json = <<<'EOF'
{
"success": true,
"scopes": ["order_read", "customer_read", "reference_read"],
"credentials": [
"/api/integration-modules/{code}",
"/api/integration-modules/{code}/edit"
@ -74,5 +75,6 @@ EOF;
"/api/integration-modules/{code}",
"/api/integration-modules/{code}/edit"
], $credentials->credentials);
self::assertEquals(["order_read", "customer_read", "reference_read"], $credentials->scopes);
}
}