/
Payment.php
99 lines (76 loc) · 1.85 KB
/
Payment.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/*
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Payment\Model;
use Sylius\Component\Resource\Model\TimestampableTrait;
class Payment implements PaymentInterface
{
use TimestampableTrait;
/** @var mixed */
protected $id;
/** @var PaymentMethodInterface|null */
protected $method;
/** @var string|null */
protected $currencyCode;
/** @var int */
protected $amount = 0;
/** @var string|null */
protected $state = PaymentInterface::STATE_CART;
/** @var mixed[] */
protected $details = [];
public function __construct()
{
$this->createdAt = new \DateTime();
}
public function getId()
{
return $this->id;
}
public function getMethod(): ?PaymentMethodInterface
{
return $this->method;
}
public function setMethod(?PaymentMethodInterface $method): void
{
$this->method = $method;
}
public function getCurrencyCode(): ?string
{
return $this->currencyCode;
}
public function setCurrencyCode(string $currencyCode): void
{
$this->currencyCode = $currencyCode;
}
public function getAmount(): ?int
{
return $this->amount;
}
public function setAmount(int $amount): void
{
$this->amount = $amount;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(string $state): void
{
$this->state = $state;
}
public function getDetails(): array
{
return $this->details;
}
public function setDetails(array $details): void
{
$this->details = $details;
}
}