diff --git a/app/Console/Commands/ShowBillplzPaymentStatus.php b/app/Console/Commands/ShowBillplzPaymentStatus.php new file mode 100644 index 00000000..a8fe7ae9 --- /dev/null +++ b/app/Console/Commands/ShowBillplzPaymentStatus.php @@ -0,0 +1,69 @@ +info(Carbon::now() . ' : Show Billplz payment status started.'); + $start = new Carbon(); + + $billplz_id = $this->argument('billplz_id'); + $billplz_id = explode(",", $billplz_id); + + foreach ($billplz_id as $payment) { + $response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$payment); + if($response->successful()){ + $data = $response->json(); + dump($data); + }else{ + $this->info("billplz error
"); + } + } + + $end = new Carbon(); + $elapsedTime = $start->diff($end)->format('%H:%I:%S'); + + $this->info(Carbon::now() . ' : Done Showing Billplz payment status. ElapsedTime: ' . $elapsedTime); + } +}