protected function execute(InputInterface $input, OutputInterface $output)
{
$this->detectMagento($output, true);
if (!$this->initMagento()) {
return;
}
$data = array('status' => 1, 'is_redeemable' => 1, 'website_id' => $input->getOption('website') ? $input->getOption('website') : \Mage::app()->getStore(true)->getWebsiteId(), 'balance' => $input->getArgument('amount'));
$id = \Mage::getModel('enterprise_giftcardaccount/api')->create($data);
if (!$id) {
$output->writeln('<error>Failed to create gift card</error>');
}
$code = \Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->load($id)->getCode();
$output->writeln('<info>Gift card <comment>' . $code . '</comment> was created</info>');
}