1 | <?php |
||
13 | class Subscription extends BaseSubscription implements SubscriptionInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var Collection|PaymentInterface[] |
||
17 | */ |
||
18 | protected $payments; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $purchaseState = SubscriptionPurchaseStates::STATE_NEW; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $paymentState = SubscriptionPaymentStates::STATE_NEW; |
||
29 | |||
30 | /** |
||
31 | * @var null|string |
||
32 | */ |
||
33 | protected $tokenValue; |
||
34 | |||
35 | /** |
||
36 | * @var PaymentMethodInterface |
||
37 | */ |
||
38 | protected $method; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $metadata = []; |
||
44 | |||
45 | /** |
||
46 | * Subscription constructor. |
||
47 | */ |
||
48 | public function __construct() |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function getPayments(): Collection |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function setPayments(Collection $payments): void |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function hasPayments(): bool |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function addPayment(PaymentInterface $payment): void |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function removePayment(PaymentInterface $payment): void |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function hasPayment(PaymentInterface $payment): bool |
||
110 | |||
111 | /** |
||
112 | * @param string|null $state |
||
113 | * |
||
114 | * @return PaymentInterface|null |
||
115 | */ |
||
116 | public function getLastPayment(string $state = null): ?PaymentInterface |
||
128 | |||
129 | /** |
||
130 | * {@inheritdoc} |
||
131 | */ |
||
132 | public function getPurchaseState(): string |
||
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | public function setPurchaseState(string $purchaseState): void |
||
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | public function getPaymentState(): string |
||
152 | |||
153 | /** |
||
154 | * {@inheritdoc} |
||
155 | */ |
||
156 | public function setPaymentState(string $paymentState): void |
||
160 | |||
161 | /** |
||
162 | * {@inheritdoc} |
||
163 | */ |
||
164 | public function getTokenValue(): ?string |
||
168 | |||
169 | /** |
||
170 | * {@inheritdoc} |
||
171 | */ |
||
172 | public function setTokenValue(string $tokenValue): void |
||
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | public function getMethod(): ?PaymentMethodInterface |
||
184 | |||
185 | /** |
||
186 | * {@inheritdoc} |
||
187 | */ |
||
188 | public function setMethod(?PaymentMethodInterface $method): void |
||
192 | |||
193 | /** |
||
194 | * {@inheritdoc} |
||
195 | */ |
||
196 | public function getMetadata(): array |
||
200 | |||
201 | /** |
||
202 | * {@inheritdoc} |
||
203 | */ |
||
204 | public function setMetadata(array $metadata): void |
||
208 | } |
||
209 |