fix: preserve KOOP identity and payment eligibility when using a single API
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class CustomerInfoService
|
||||
@@ -26,6 +27,15 @@ class CustomerInfoService
|
||||
return $requests;
|
||||
});
|
||||
|
||||
return [$responses[0]->json(), isset($responses[1]) ? $responses[1]->json() : []];
|
||||
$customer = $responses[0]->json();
|
||||
|
||||
if ($pkbUrl === $koopUrl) {
|
||||
// Preserve the source company: payment rules depend on this identity.
|
||||
return config('api.company') == CompanyStatus::COM_KOOPPKB
|
||||
? [[], $customer]
|
||||
: [$customer, []];
|
||||
}
|
||||
|
||||
return [$customer, $responses[1]->json()];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user