1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jenschude <[email protected]> |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Model\Payment; |
7
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\JsonObject; |
9
|
|
|
use Commercetools\Core\Model\Customer\CustomerReference; |
10
|
|
|
use Commercetools\Core\Model\Common\Money; |
11
|
|
|
use Commercetools\Core\Model\Common\DateTimeDecorator; |
12
|
|
|
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft; |
13
|
|
|
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraftCollection; |
14
|
|
|
use DateTime; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @package Commercetools\Core\Model\Payment |
18
|
|
|
* @link https://docs.commercetools.com/http-api-projects-payments.html#paymentdraft |
19
|
|
|
* @method CustomerReference getCustomer() |
20
|
|
|
* @method PaymentDraft setCustomer(CustomerReference $customer = null) |
21
|
|
|
* @method string getInterfaceId() |
22
|
|
|
* @method PaymentDraft setInterfaceId(string $interfaceId = null) |
23
|
|
|
* @method Money getAmountPlanned() |
24
|
|
|
* @method PaymentDraft setAmountPlanned(Money $amountPlanned = null) |
25
|
|
|
* @method PaymentMethodInfo getPaymentMethodInfo() |
26
|
|
|
* @method PaymentDraft setPaymentMethodInfo(PaymentMethodInfo $paymentMethodInfo = null) |
27
|
|
|
* @method CustomFieldObjectDraft getCustom() |
28
|
|
|
* @method PaymentDraft setCustom(CustomFieldObjectDraft $custom = null) |
29
|
|
|
* @method PaymentStatus getPaymentStatus() |
30
|
|
|
* @method PaymentDraft setPaymentStatus(PaymentStatus $paymentStatus = null) |
31
|
|
|
* @method TransactionCollection getTransactions() |
32
|
|
|
* @method PaymentDraft setTransactions(TransactionCollection $transactions = null) |
33
|
|
|
* @method CustomFieldObjectDraftCollection getInterfaceInteractions() |
34
|
|
|
* @method PaymentDraft setInterfaceInteractions(CustomFieldObjectDraftCollection $interfaceInteractions = null) |
35
|
|
|
* @method string getKey() |
36
|
|
|
* @method PaymentDraft setKey(string $key = null) |
37
|
|
|
*/ |
38
|
|
|
class PaymentDraft extends JsonObject |
39
|
|
|
{ |
40
|
25 |
|
public function fieldDefinitions() |
41
|
|
|
{ |
42
|
|
|
return [ |
43
|
25 |
|
'key' => [static::TYPE => 'string'], |
44
|
25 |
|
'customer' => [static::TYPE => CustomerReference::class], |
45
|
25 |
|
'externalId' => [static::TYPE => 'string'], |
46
|
25 |
|
'interfaceId' => [static::TYPE => 'string'], |
47
|
25 |
|
'amountPlanned' => [static::TYPE => Money::class], |
48
|
25 |
|
'amountAuthorized' => [static::TYPE => Money::class], |
49
|
|
|
'authorizedUntil' => [ |
50
|
25 |
|
static::TYPE => DateTime::class, |
51
|
25 |
|
static::DECORATOR => DateTimeDecorator::class |
52
|
|
|
], |
53
|
25 |
|
'amountPaid' => [static::TYPE => Money::class], |
54
|
25 |
|
'amountRefunded' => [static::TYPE => Money::class], |
55
|
25 |
|
'paymentMethodInfo' => [static::TYPE => PaymentMethodInfo::class], |
56
|
25 |
|
'custom' => [static::TYPE => CustomFieldObjectDraft::class], |
57
|
25 |
|
'paymentStatus' => [static::TYPE => PaymentStatus::class], |
58
|
25 |
|
'transactions' => [static::TYPE => TransactionCollection::class], |
59
|
|
|
'interfaceInteractions' => [ |
60
|
25 |
|
static::TYPE => CustomFieldObjectDraftCollection::class |
61
|
|
|
], |
62
|
|
|
]; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @deprecated |
67
|
|
|
* @return string |
68
|
|
|
*/ |
69
|
1 |
|
public function getExternalId() |
70
|
|
|
{ |
71
|
1 |
|
return parent::getExternalId(); |
|
|
|
|
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @deprecated |
76
|
|
|
* @param string $externalId |
77
|
|
|
* @return static |
78
|
|
|
*/ |
79
|
24 |
|
public function setExternalId($externalId = null) |
80
|
|
|
{ |
81
|
24 |
|
return parent::setExternalId($externalId); |
|
|
|
|
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @deprecated |
86
|
|
|
* @return Money |
87
|
|
|
*/ |
88
|
|
|
public function getAmountAuthorized() |
89
|
|
|
{ |
90
|
|
|
return parent::getAmountAuthorized(); |
|
|
|
|
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @deprecated |
95
|
|
|
* @param Money $amountAuthorized |
96
|
|
|
* @return static |
97
|
|
|
*/ |
98
|
|
|
public function setAmountAuthorized(Money $amountAuthorized = null) |
99
|
|
|
{ |
100
|
|
|
return parent::setAmountAuthorized($amountAuthorized); |
|
|
|
|
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @deprecated |
105
|
|
|
* @return Money |
106
|
|
|
*/ |
107
|
|
|
public function getAmountPaid() |
108
|
|
|
{ |
109
|
|
|
return parent::getAmountPaid(); |
|
|
|
|
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @deprecated |
114
|
|
|
* @param Money $amountPaid |
115
|
|
|
* @return static |
116
|
|
|
*/ |
117
|
|
|
public function setAmountPaid(Money $amountPaid = null) |
118
|
|
|
{ |
119
|
|
|
return parent::setAmountPaid($amountPaid); |
|
|
|
|
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @deprecated |
124
|
|
|
* @return Money |
125
|
|
|
*/ |
126
|
|
|
public function getAmountRefunded() |
127
|
|
|
{ |
128
|
|
|
return parent::getAmountRefunded(); |
|
|
|
|
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @deprecated |
133
|
|
|
* @param Money $amountRefunded |
134
|
|
|
* @return static |
135
|
|
|
*/ |
136
|
|
|
public function setAmountRefunded(Money $amountRefunded = null) |
137
|
|
|
{ |
138
|
|
|
return parent::setAmountRefunded($amountRefunded); |
|
|
|
|
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @deprecated |
143
|
|
|
* @return Money |
144
|
|
|
*/ |
145
|
|
|
public function getAuthorizedUntil() |
146
|
|
|
{ |
147
|
|
|
return parent::getAuthorizedUntil(); |
|
|
|
|
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @deprecated |
152
|
|
|
* @param Money $amountUntil |
153
|
|
|
* @return static |
154
|
|
|
*/ |
155
|
|
|
public function setAuthorizedUntil(Money $amountUntil = null) |
156
|
|
|
{ |
157
|
|
|
return parent::setAuthorizedUntil($amountUntil); |
|
|
|
|
158
|
|
|
} |
159
|
|
|
} |
160
|
|
|
|