update web route for active wallet

This commit is contained in:
edmondlang
2023-10-20 15:14:29 +08:00
parent e687dd2b9a
commit c44bf46a42
+1 -18
View File
@@ -1209,23 +1209,6 @@ Route::get('/404', function () {
Route::get('transaction/{id}/credit_note/download', 'Transactions\GenerateCreditNotePdfController@download')->name('transaction.credit_note.download');
Route::get('/check-successful-payment-or-topup', function () {
$sum = 0 ;
$transactions = Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP, TransactionType::GROUP_PAYMENT])->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get();
foreach ($transactions as $transaction){
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
if($response->successful()){
$sum += $transaction->amount;
dump($transaction->payment_reference . 'Amount : ' . $transaction->amount);
}else{
dump("billplz error</br>");
}
}
dump("Sum is : " . $sum);
});
Route::get('/wallets/active', function(){
$wallets = Wallet::all();
@@ -1233,7 +1216,7 @@ Route::get('/wallets/active', function(){
foreach ($wallets as $wallet){
$companyMarking = $wallet->owner->getMarking();
echo '<tr>';
echo '<td><a href="'.route('wallet.details', $companyMarking).'" target="_blank">'.$companyMarking.'</a></td>';
echo '<td><a href="'.route('wallet.details', $companyMarking).'" target="_blank">'.$companyMarking.'</a>'."(".$wallet->id.")".'</td>';
echo '<td>'.$wallet->amount.'</td>';
echo '</tr>';
}