namespace Symfony\Bundle\FrameworkBundle\Test;
abstract class WebTestCase extends KernelTestCase
{
protected static function createClient(array $options = [], array $server = [])
{
if (static::$booted) {
throw new \LogicException(sprintf('Booting the kernel before calling "%s()" is not supported, the kernel should only be booted once.', __METHOD__));
}
$kernel = static::bootKernel($options);
try {
$client = $kernel->getContainer()->get('test.client');
} catch (ServiceNotFoundException $e) {
if (class_exists(KernelBrowser::class)) {
throw new \LogicException('You cannot create the client used in functional tests if the "framework.test" config is not set to true.');
}
throw new \LogicException('You cannot create the client used in functional tests if the BrowserKit component is not available. Try running "composer require symfony/browser-kit".');
}
$client->setServerParameters($server);
return self::getClient($client);
}
....
{
"status": 0,
"receipt": {
"receipt_type": "ProductionSandbox",
"adam_id": 0,
"app_item_id": 0,
"bundle_id": "xxx.yyy.zzz",
"application_version": "6",
"download_id": 0,
"version_external_identifier": 0,
"receipt_creation_date": "2020-12-23 10:43:42 Etc/GMT",
"receipt_creation_date_ms": "1608720222000",
"receipt_creation_date_pst": "2020-12-23 02:43:42 America/Los_Angeles",
"request_date": "2020-12-23 14:46:13 Etc/GMT",
"request_date_ms": "1608734773664",
"request_date_pst": "2020-12-23 06:46:13 America/Los_Angeles",
"original_purchase_date": "2013-08-01 07:00:00 Etc/GMT",
"original_purchase_date_ms": "1375340400000",
"original_purchase_date_pst": "2013-08-01 00:00:00 America/Los_Angeles",
"original_application_version": "1.0",
"in_app": [
{
"quantity": "1",
"product_id": "rate1",
"transaction_id": "secret111",
"original_transaction_id": "secret111",
"purchase_date": "2020-12-22 17:17:11 Etc/GMT",
"purchase_date_ms": "1608657431000",
"purchase_date_pst": "2020-12-22 09:17:11 America/Los_Angeles",
"original_purchase_date": "2020-12-22 17:17:11 Etc/GMT",
"original_purchase_date_ms": "1608657431000",
"original_purchase_date_pst": "2020-12-22 09:17:11 America/Los_Angeles",
"is_trial_period": "false"
},
{
"quantity": "1",
"product_id": "rate3",
"transaction_id": "secret222",
"original_transaction_id": "secret222",
"purchase_date": "2020-12-23 10:43:42 Etc/GMT",
"purchase_date_ms": "1608720222000",
"purchase_date_pst": "2020-12-23 02:43:42 America/Los_Angeles",
"original_purchase_date": "2020-12-23 10:43:42 Etc/GMT",
"original_purchase_date_ms": "1608720222000",
"original_purchase_date_pst": "2020-12-23 02:43:42 America/Los_Angeles",
"is_trial_period": "false"
}
]
},
curl --location --request POST 'https://buy.itunes.apple.com/verifyReceipt' \
--header 'Content-Type: application/json' \
--data-raw '{
"password": "пароль в открытом виде",
"receipt-data": "Токен покупки"
}'
curl --location --request POST 'https://sandbox.itunes.apple.com/verifyReceipt' \
--header 'Content-Type: application/json' \
--data-raw '{
"password": "пароль в открытом виде",
"receipt-data": "Токен покупки"
}'
{
"password": "Пароль в открытом виде",
"receipt-data": "Токен покупки"
}
{
"status": 21007
}
$response->getBody()