Update billplz transaction review response contd
This commit is contained in:
@@ -16,16 +16,17 @@ class BillplzController extends Controller
|
||||
'KOPKB',
|
||||
];
|
||||
|
||||
$bills = array_map(function($company_code) use($request){
|
||||
$bills = array_reduce($companyMapping, function($carry, $company_code) use($request){
|
||||
$billplzService = new BillplzService($company_code);
|
||||
$billIdArray = json_decode($request->bill_ids);
|
||||
$billIdArray = $billplzService->getBills($billIdArray);
|
||||
return array_filter($billIdArray, function($bill) {
|
||||
$carry[$company_code] = array_filter($billIdArray, function($bill) {
|
||||
return $bill !== [];
|
||||
});
|
||||
}, $companyMapping);
|
||||
return $carry;
|
||||
}, []);
|
||||
|
||||
return array_merge(...$bills);
|
||||
return $bills;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,13 +18,12 @@ class BillplzTransactionReviewController extends Controller
|
||||
'KOPKB',
|
||||
];
|
||||
|
||||
$billplzTransactionReview = array_reduce($companyMapping, function($carry, $company_code) use($date){
|
||||
$billplzTransactionReview = array_map(function($company_code) use($date){
|
||||
$billplzService = new BillplzService($company_code);
|
||||
$carry[$company_code] = $billplzService->getBillplzTransactionReview($date)->toArray();
|
||||
return $carry;
|
||||
}, []);
|
||||
return $billplzService->getBillplzTransactionReview($date)->toArray();
|
||||
}, $companyMapping);
|
||||
|
||||
return response()->json($billplzTransactionReview, 200);
|
||||
return response()->json(array_merge(...$billplzTransactionReview), 200);
|
||||
}
|
||||
|
||||
public function show(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user