Add force option to enable or disable webhook status checking, defaults to false #801
This commit is contained in:
parent
3846ad5a43
commit
08084f682c
1 changed files with 17 additions and 10 deletions
|
|
@ -5,6 +5,7 @@ namespace App\Command;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
|
|
@ -34,11 +35,16 @@ class ProcessLatePaymongoTransactionsCommand extends Command
|
||||||
{
|
{
|
||||||
$this->setName('paymongo:checkpending')
|
$this->setName('paymongo:checkpending')
|
||||||
->setDescription('Check for any late PayMongo transactions and process if needed.')
|
->setDescription('Check for any late PayMongo transactions and process if needed.')
|
||||||
->setHelp('Check for any late PayMongo transactions and process if needed.');
|
->setHelp('Check for any late PayMongo transactions and process if needed.')
|
||||||
|
->addOption('force', 'f', InputOption::VALUE_NONE, 'Ignore webhook status and process anyway.');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
|
$force = $input->getOption('force');
|
||||||
|
|
||||||
|
// if we aren't forcing, check webhook status first
|
||||||
|
if (!$force) {
|
||||||
$output->writeln('Checking webhook status...');
|
$output->writeln('Checking webhook status...');
|
||||||
|
|
||||||
// check if webhook is disabled
|
// check if webhook is disabled
|
||||||
|
|
@ -53,6 +59,7 @@ class ProcessLatePaymongoTransactionsCommand extends Command
|
||||||
|
|
||||||
$this->paymongo->log('WEBHOOK', "[]", json_encode($webhook['response'], JSON_PRETTY_PRINT), 'webhook');
|
$this->paymongo->log('WEBHOOK', "[]", json_encode($webhook['response'], JSON_PRETTY_PRINT), 'webhook');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$output->writeln('Fetching all late pending transactions...');
|
$output->writeln('Fetching all late pending transactions...');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue