PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.3
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.3
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Events / Subscription / SubscriptionRenewalFailed.php

SubscriptionRenewalFailed.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.3, at app/Events/Subscription/SubscriptionRenewalFailed.php

62 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Events\Subscription;
4
5 use FluentCart\App\Events\EventDispatcher;
6 use FluentCart\App\Listeners;
7 use FluentCart\App\Models\Customer;
8 use FluentCart\App\Models\Order;
9 use FluentCart\App\Models\Subscription;
10
11 class SubscriptionRenewalFailed extends EventDispatcher
12 {
13 public string $hook = 'fluent_cart/subscription_renewal_failed';
14 protected array $listeners = [
15 Listeners\Subscription\SubscriptionRenewalFailed::class,
16 ];
17
18 /**
19 * @var Subscription $subscription
20 */
21 public Subscription $subscription;
22
23 /**
24 * @var Order $order
25 */
26 public Order $order;
27
28 /**
29 * @var Customer|null $customer
30 */
31 public ?Customer $customer;
32
33 /**
34 * @var string $error Gateway failure reason
35 */
36 public string $error;
37
38 public function __construct($subscription, $order, $customer, $error = '')
39 {
40 $this->subscription = $subscription;
41 $this->order = $order;
42 $this->customer = $customer;
43 $this->error = $error;
44 }
45
46 public function toArray(): array
47 {
48 return [
49 'subscription' => $this->subscription ?? null,
50 'order' => $this->order ?? null,
51 'customer' => $this->customer ?? null,
52 'error' => $this->error ?? '',
53 ];
54 }
55
56 public function getActivityEventModel()
57 {
58 return $this->subscription;
59 }
60
61 }
62