Fix billplz transaction review not working
This commit is contained in:
@@ -109,7 +109,14 @@ class BillplzService
|
||||
$billplzID = collect($arrahnTransactions)->pluck('billplz_id')->unique()->values();
|
||||
|
||||
$billplzTransactions = collect($billplzID)->map(function ($billId) {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
try {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
->filter(function ($transaction) {
|
||||
return $transaction !== [];
|
||||
})
|
||||
->map(function ($data) {
|
||||
$latestTransaction = reset($data['transactions']) == false ? [] : reset($data['transactions']);
|
||||
@@ -126,7 +133,14 @@ class BillplzService
|
||||
$billplzID = collect([$billId]);
|
||||
|
||||
$billplzTransactions = collect($billplzID)->map(function ($billId) {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
try {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
->filter(function ($transaction) {
|
||||
return $transaction !== [];
|
||||
})
|
||||
->map(function ($data) {
|
||||
$latestTransaction = reset($data['transactions']) == false ? [] : reset($data['transactions']);
|
||||
|
||||
Reference in New Issue
Block a user