php-commerce/Notifications/PaymentFailed.php
Snider a774f4e285 refactor: migrate namespace from Core\Commerce to Core\Mod\Commerce
Align commerce module with the monorepo module structure by updating
all namespaces to use the Core\Mod\Commerce convention. This change
supports the recent monorepo separation and ensures consistency with
other modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:23:12 +00:00

44 lines
1.4 KiB
PHP

<?php
namespace Core\Mod\Commerce\Notifications;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class PaymentFailed extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
public Subscription $subscription
) {}
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('Payment failed - action required')
->greeting('We couldn\'t process your payment')
->line('We attempted to charge your payment method for your subscription renewal, but the payment was declined.')
->line('Please update your payment details to avoid service interruption.')
->action('Update Payment Method', route('hub.dashboard'))
->line('If you believe this is an error, please contact our support team.')
->line('We\'ll automatically retry the payment in a few days.')
->salutation('Host UK');
}
public function toArray(object $notifiable): array
{
return [
'subscription_id' => $this->subscription->id,
'workspace_id' => $this->subscription->workspace_id,
];
}
}