forked from hiqdev/php-billing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSaleInterface.php
77 lines (65 loc) · 1.71 KB
/
SaleInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* PHP Billing Library
*
* @link https://github.com/hiqdev/php-billing
* @package php-billing
* @license BSD-3-Clause
* @copyright Copyright (c) 2017-2020, HiQDev (http://hiqdev.com/)
*/
namespace hiqdev\php\billing\sale;
use DateTimeImmutable;
use hiqdev\php\billing\customer\CustomerInterface;
use hiqdev\php\billing\EntityInterface;
use hiqdev\php\billing\Exception\ConstraintException;
use hiqdev\php\billing\Exception\InvariantException;
use hiqdev\php\billing\plan\PlanInterface;
use hiqdev\php\billing\target\TargetInterface;
/**
* Sale interface.
*
* @author Andrii Vasyliev <sol@hiqdev.com>
*/
interface SaleInterface extends EntityInterface
{
/**
* @return int|string|null
*/
public function getId();
/**
* @return int|string|null
*/
public function setId($id);
/**
* @return TargetInterface
*/
public function getTarget();
/**
* @return CustomerInterface
*/
public function getCustomer();
/**
* Plan is required for sales that imply recurrent charges.
* If the sale is one-time and acts as a point-in-time mark of
* a single good being sold and billed single time, Plan might be omitted.
*
* @return PlanInterface|null
*/
public function getPlan();
/**
* @return DateTimeImmutable
*/
public function getTime();
public function getCloseTime(): ?DateTimeImmutable;
/**
* @return array|null
*/
public function getData(): ?array;
/**
* @param DateTimeImmutable $time
* @throws InvariantException
* @throws ConstraintException
*/
public function close(DateTimeImmutable $time): void;
public function cancelClosing(): void;
}