fix console update status
This commit is contained in:
@@ -240,8 +240,22 @@ class BillplzService
|
||||
return $summarizedBillplzTransactions;
|
||||
}
|
||||
|
||||
public function getTransactionByBillId($billId)
|
||||
public function getTransactionByBillId($billId,$company)
|
||||
{
|
||||
$appEnvironment = config('app.env');
|
||||
|
||||
$billplzEnvironments = [
|
||||
'PKB' => ($appEnvironment === 'production') ? config('services.billplz.production') : config('services.billplz.sandbox'),
|
||||
'KOPKB' => ($appEnvironment === 'production') ? config('services.billplz.production_kopkb') : config('services.billplz.sandbox_kopkb'),
|
||||
];
|
||||
|
||||
$billplzConfig = $appEnvironment === 'production'
|
||||
? ($billplzEnvironments[$company] ?? config('services.billplz.production'))
|
||||
: ($billplzEnvironments[$company] ?? config('services.billplz.sandbox'));
|
||||
|
||||
$client = Client::make($billplzConfig['api_key'], ($this->isBase64($billplzConfig['x_signature'])) ? $billplzConfig['x_signature'] : base64_encode($billplzConfig['x_signature']));
|
||||
$client->useVersion('v4');
|
||||
|
||||
try {
|
||||
return $this->client->bill()->transaction($billId)->toArray();
|
||||
} catch (\Throwable $th) {
|
||||
|
||||
Reference in New Issue
Block a user