fix(events): point Messaging settings at suite defaults, not API keys
Deploy Ladill Events / deploy (push) Successful in 48s
Deploy Ladill Events / deploy (push) Successful in 48s
Mirror Care: suite platform keys count as ready for attendee email/SMS; Account Messaging is primary, product Bird/SMS keys are advanced. SmsService now prefers channel=suite before customer API keys.
This commit is contained in:
@@ -39,7 +39,8 @@ class EventsMessagingIntegrationsTest extends TestCase
|
||||
->assertOk()
|
||||
->assertSee('SMS')
|
||||
->assertSee('Email')
|
||||
->assertSee('credentials for outbound messaging');
|
||||
->assertSee('work by default')
|
||||
->assertSee('optional');
|
||||
}
|
||||
|
||||
public function test_saving_sms_credentials_encrypts_key(): void
|
||||
|
||||
@@ -91,6 +91,34 @@ class EventsSuiteMessagingTest extends TestCase
|
||||
$this->assertTrue(app(EventMailer::class)->isConfiguredForOwner($user->public_id));
|
||||
}
|
||||
|
||||
public function test_sms_service_uses_suite_when_platform_configured(): void
|
||||
{
|
||||
config([
|
||||
'sms.platform_api_key' => 'events-sms-key',
|
||||
'sms.platform_api_url' => 'https://platform.test/api',
|
||||
]);
|
||||
|
||||
Http::fake([
|
||||
'platform.test/api/sms/messages/send' => Http::response(['success' => true, 'path' => 'suite']),
|
||||
]);
|
||||
|
||||
$user = User::factory()->create(['public_id' => 'usr_sms_suite']);
|
||||
$ok = app(\App\Services\Billing\SmsService::class)->send(
|
||||
$user->public_id,
|
||||
'0241234567',
|
||||
'Programme link',
|
||||
);
|
||||
|
||||
$this->assertTrue($ok);
|
||||
$this->assertTrue(app(\App\Services\Billing\SmsService::class)->isConfiguredForOwner($user->public_id));
|
||||
Http::assertSent(function ($request) {
|
||||
$data = $request->data();
|
||||
|
||||
return str_contains($request->url(), '/sms/messages/send')
|
||||
&& ($data['channel'] ?? null) === 'suite';
|
||||
});
|
||||
}
|
||||
|
||||
public function test_billing_client_syncs_suite_entitlement(): void
|
||||
{
|
||||
config([
|
||||
|
||||
Reference in New Issue
Block a user