fix billplz bill status

This commit is contained in:
Omair Saleh
2022-12-13 10:56:36 +08:00
parent d7328bafdc
commit 414f22ab05
+2 -2
View File
@@ -598,7 +598,7 @@ Route::get('/yd/fix', function(){
});
Route::get('/billplz/fix', function(){
$payments = \App\Models\Transaction::where('type', \App\Classes\ValueObjects\Constants\TransactionType::PAYMENT)->where('payment_method',\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_GATEWAY)->where('status', '!=', \App\Classes\ValueObjects\Constants\ApprovalStatus::APPROVED)->get();
$payments = \App\Models\Transaction::where('type', \App\Classes\ValueObjects\Constants\TransactionType::PAYMENT)->where('payment_method',\App\Classes\ValueObjects\Constants\PaymentMethodType::PAYMENT_GATEWAY)->get();
echo '<h3>fixed orders</h3>';
foreach ($payments as $payment){
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$payment->payment_reference);
@@ -607,7 +607,7 @@ Route::get('/billplz/fix', function(){
$data = $response->json();
$invoice = $payment->owner;
if(!$invoice){
dd($payment);
continue;
}
$packingList = $invoice->owner;
$order = $packingList->owner;