mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
debug billplz
This commit is contained in:
+18
-1
@@ -1078,7 +1078,8 @@ Route::get('/wallet/audit', function (Request $request) {
|
||||
|
||||
foreach ($wallet->transactions as $transaction){
|
||||
if(!in_array((int) $transaction->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) continue;
|
||||
if((int) $transaction->type === TransactionType::TOP_UP) {
|
||||
if((int) $transaction->type === TransactionType::TOP_UP || (int) $transaction->type === TransactionType::GROUP_PAYMENT) {
|
||||
// if((int) $transaction->type === TransactionType::TOP_UP) {
|
||||
$topups += (float) $transaction->amount;
|
||||
}
|
||||
if((int) $transaction->type === TransactionType::CREDIT_NOTE) $credit += (float) $transaction->amount;
|
||||
@@ -1191,4 +1192,20 @@ Route::get('/duplicate-package-clean-up', 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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user