# fluent-cart/trunk/app/Events/Subscription/SubscriptionRenewalFailed.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version trunk. 62 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/trunk/code/app/Events/Subscription/SubscriptionRenewalFailed.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/trunk/raw/app/Events/Subscription/SubscriptionRenewalFailed.php
- Modified: 2026-08-11T13:30:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/trunk/code/app/Events/Subscription/SubscriptionRenewalFailed.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Events\Subscription;

use FluentCart\App\Events\EventDispatcher;
use FluentCart\App\Listeners;
use FluentCart\App\Models\Customer;
use FluentCart\App\Models\Order;
use FluentCart\App\Models\Subscription;

class SubscriptionRenewalFailed extends EventDispatcher
{
    public string $hook = 'fluent_cart/subscription_renewal_failed';
    protected array $listeners = [
        Listeners\Subscription\SubscriptionRenewalFailed::class,
    ];

    /**
     * @var Subscription $subscription
     */
    public Subscription $subscription;

    /**
     * @var Order $order
     */
    public Order $order;

    /**
     * @var Customer|null $customer
     */
    public ?Customer $customer;

    /**
     * @var string $error Gateway failure reason
     */
    public string $error;

    public function __construct($subscription, $order, $customer, $error = '')
    {
        $this->subscription = $subscription;
        $this->order = $order;
        $this->customer = $customer;
        $this->error = $error;
    }

    public function toArray(): array
    {
        return [
            'subscription' => $this->subscription ?? null,
            'order'        => $this->order ?? null,
            'customer'     => $this->customer ?? null,
            'error'        => $this->error ?? '',
        ];
    }

    public function getActivityEventModel()
    {
        return $this->subscription;
    }

}

```
