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

add scopes in credentials method

This commit is contained in:
Akolzin Dmitry 2021-10-26 13:02:54 +03:00
parent 0ada1cd922
commit a17a816198
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 class Credentials extends SuccessResponse
{ {
/** /**
* @deprecated
* @var string[] * @var string[]
* *
* @JMS\Type("array<string>") * @JMS\Type("array<string>")
@ -28,6 +29,14 @@ class Credentials extends SuccessResponse
*/ */
public $credentials; public $credentials;
/**
* @var string[]
*
* @JMS\Type("array<string>")
* @JMS\SerializedName("scopes")
*/
public $scopes;
/** /**
* @var string * @var string
* *

View File

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