static::
assertIsString($client->
getResponse()->
getContent());
$response =
json_decode($client->
getResponse()->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
static::
assertArrayHasKey('errors',
$response);
static::
assertSame('CHECKOUT__INVALID_PAYMENT_TOKEN',
$response['errors'
][0
]['code'
]);
} public function testValidTokenWithInvalidOrder(): void
{ $client =
$this->
getBrowser();
$tokenStruct =
new TokenStruct(null, null, Uuid::
randomHex(), Uuid::
randomHex(), 'testFinishUrl'
);
$token =
$this->tokenFactory->
generateToken($tokenStruct);
$client->
request('GET', '/payment/finalize-transaction?_sw_payment_token=' .
$token);
static::
assertIsString($client->
getResponse()->
getContent());
$response =
json_decode($client->
getResponse()->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
static::
assertArrayHasKey('errors',
$response);
static::
assertSame('CHECKOUT__INVALID_PAYMENT_TOKEN',
$response['errors'
][0
]['code'
]);
} public function testValid(): void
{