. */ namespace Storefront\BTCPay\Console\Command; use Storefront\BTCPay\Helper\Data; use Storefront\BTCPay\Model\BTCPay\BTCPayService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class InvoicesUpdate extends Command { /** * @var BTCPayService */ private $btcPayService; public function __construct(BTCPayService $btcPayService, string $name = null) { parent::__construct($name); $this->btcPayService = $btcPayService; } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $numUpdated = $this->btcPayService->updateIncompleteInvoices(); $output->writeln('Updated ' . $numUpdated . ' invoices from BTCPay Server'); } /** * {@inheritdoc} */ protected function configure() { $this->setName('btcpay:invoices:update'); $this->setDescription('Poll your BTCPay Server for the latest invoice updates (in case you missed any)'); parent::configure(); } }