public function createSupplier(string $channelName, array $data) : SupplierObject
{
$supplierName = $this->escapeSupplierName($data['supplier']);
if (\file_exists(ROOT . '/config/supplier_keys/' . $supplierName . '.json')) {
throw new CouldNotCreateSupplier('File already exists: config/supplier_keys/' . $supplierName . '.json');
}
$written = \file_put_contents(ROOT . '/config/supplier_keys/' . $supplierName . '.json', \json_encode(['channels' => [$channelName], 'signing_keys' => []], JSON_PRETTY_PRINT));
if ($written === false) {
throw new AccessDenied(\__('Could not save new key'));
}
return $this->getSupplier($supplierName, true);
}