diff --git a/app/Classes/Jobs/Commands/V2/OneTimeFixWalletGroupTransactionV2CommandJob.php b/app/Classes/Jobs/Commands/V2/OneTimeFixWalletGroupTransactionV2CommandJob.php new file mode 100644 index 00000000..cbd1af0c --- /dev/null +++ b/app/Classes/Jobs/Commands/V2/OneTimeFixWalletGroupTransactionV2CommandJob.php @@ -0,0 +1,49 @@ +get(); + + foreach ($invoices as $invoice) { + + if($invoice->status == ApprovalStatus::APPROVED){ + $paymentTransaction = (App()->make(CreatePaymentTransactionProcessor::class))->execute($invoice, PaymentMethodType::WALLET, '', false); + + if($paymentTransaction && $paymentTransaction->status == ApprovalStatus::APPROVED){ + $pL = $invoice->owner; + (App()->make(ReleaseGoodsToCustomerProcessor::class))->execute($pL, $invoice); + } + } + } + $group = Group::where('id', 1377)->first(); + $group->status = ApprovalStatus::APPROVED; + $group->save(); + + $end = new Carbon(); + $elapsedTime = $start->diff($end)->format('%H:%I:%S'); + Log::info(Carbon::now() . ': End job - This is a one time fix of a double charge problem of a group payment through wallet. ElapsedTime: ' . $elapsedTime . '.'); + } +} diff --git a/app/Classes/Jobs/Commands/V2/OneTimeTransactionFixBillplzFailedCbV2CommandJob.php b/app/Classes/Jobs/Commands/V2/OneTimeTransactionFixBillplzFailedCbV2CommandJob.php index 7c68d2f7..78c62b4f 100644 --- a/app/Classes/Jobs/Commands/V2/OneTimeTransactionFixBillplzFailedCbV2CommandJob.php +++ b/app/Classes/Jobs/Commands/V2/OneTimeTransactionFixBillplzFailedCbV2CommandJob.php @@ -20,13 +20,12 @@ class OneTimeTransactionFixBillplzFailedCbV2CommandJob implements ShouldQueue public function handle() { - Log::info(Carbon::now() . ': Start job - One time fix failled callback from billplz cron ended.'); + Log::info(Carbon::now() . ': Start job - One time fix failled callback from billplz.'); $start = new Carbon(); //Transaction fix with this one time fix command: 15205, 16803, 17310, 22008, 6770 //This transaction, 16803 has approve payment but not its owner, shipping invoice $transactions = Transaction::whereIn('id', [22008, 6770])->get(); - Log::info(Carbon::now() . ' : One time fix failled callback from billplz started.'); foreach ($transactions as $transaction){ if($transaction){ @@ -40,6 +39,6 @@ class OneTimeTransactionFixBillplzFailedCbV2CommandJob implements ShouldQueue $end = new Carbon(); $elapsedTime = $start->diff($end)->format('%H:%I:%S'); - Log::info(Carbon::now() . ': End job - One time fix failled callback from billplz cron ended. ElapsedTime: ' . $elapsedTime . '.'); + Log::info(Carbon::now() . ': End job - One time fix failled callback from billplz. ElapsedTime: ' . $elapsedTime . '.'); } } diff --git a/app/Console/Commands/V2/OneTimeFixWalletGroupTransactionV2Command.php b/app/Console/Commands/V2/OneTimeFixWalletGroupTransactionV2Command.php new file mode 100644 index 00000000..0c7c39a2 --- /dev/null +++ b/app/Console/Commands/V2/OneTimeFixWalletGroupTransactionV2Command.php @@ -0,0 +1,50 @@ +