feat(integrations): resolve payment context from events
This commit is contained in:
@@ -3,11 +3,12 @@
|
||||
namespace App\Shared\Integration\Services;
|
||||
|
||||
use App\Domains\Core\Client\Models\Client;
|
||||
use App\Domains\Core\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticketing\Event\Models\Event;
|
||||
use App\Shared\Integration\Models\AdminWebsiteTypeIntegration;
|
||||
use App\Shared\Integration\Models\ClientIntegration;
|
||||
use App\Shared\Integration\Models\Integration;
|
||||
use App\Shared\Integration\Models\IntegrationInstance;
|
||||
use App\Shared\Integration\Models\AdminWebsiteTypeIntegration;
|
||||
use App\Domains\Core\Tenant\Models\Tenant;
|
||||
use Exception;
|
||||
use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
@@ -86,6 +87,17 @@ abstract class BaseIntegrationService
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function forEvent(Event $event): self
|
||||
{
|
||||
$event->loadMissing(['client', 'tenant.client']);
|
||||
$this->tenant = $event->tenant;
|
||||
$this->tenantCode = $event->tenant_code;
|
||||
$this->clientContext = $event->effectiveClient();
|
||||
$this->loadIntegration();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the integration definition and its effective instance configuration.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user