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
|
|
|
* @method string getAnonymousId() |
38
|
|
|
* @method PaymentDraft setAnonymousId(string $anonymousId = null) |
39
|
|
|
*/ |
40
|
|
|
class PaymentDraft extends JsonObject |
41
|
|
|
{ |
42
|
26 |
|
public function fieldDefinitions() |
43
|
|
|
{ |
44
|
|
|
return [ |
45
|
26 |
|
'key' => [static::TYPE => 'string'], |
46
|
26 |
|
'customer' => [static::TYPE => CustomerReference::class], |
47
|
26 |
|
'anonymousId' => [static::TYPE => 'string'], |
48
|
26 |
|
'externalId' => [static::TYPE => 'string'], |
49
|
26 |
|
'interfaceId' => [static::TYPE => 'string'], |
50
|
26 |
|
'amountPlanned' => [static::TYPE => Money::class], |
51
|
26 |
|
'amountAuthorized' => [static::TYPE => Money::class], |
52
|
|
|
'authorizedUntil' => [ |
53
|
26 |
|
static::TYPE => DateTime::class, |
54
|
26 |
|
static::DECORATOR => DateTimeDecorator::class |
55
|
|
|
], |
56
|
26 |
|
'amountPaid' => [static::TYPE => Money::class], |
57
|
26 |
|
'amountRefunded' => [static::TYPE => Money::class], |
58
|
26 |
|
'paymentMethodInfo' => [static::TYPE => PaymentMethodInfo::class], |
59
|
26 |
|
'custom' => [static::TYPE => CustomFieldObjectDraft::class], |
60
|
26 |
|
'paymentStatus' => [static::TYPE => PaymentStatus::class], |
61
|
26 |
|
'transactions' => [static::TYPE => TransactionCollection::class], |
62
|
|
|
'interfaceInteractions' => [ |
63
|
26 |
|
static::TYPE => CustomFieldObjectDraftCollection::class |
64
|
|
|
], |
65
|
|
|
]; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @deprecated |
70
|
|
|
* @return string |
71
|
|
|
*/ |
72
|
1 |
|
public function getExternalId() |
73
|
|
|
{ |
74
|
1 |
|
return parent::getExternalId(); |
|
|
|
|
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @deprecated |
79
|
|
|
* @param string $externalId |
80
|
|
|
* @return static |
81
|
|
|
*/ |
82
|
25 |
|
public function setExternalId($externalId = null) |
83
|
|
|
{ |
84
|
25 |
|
return parent::setExternalId($externalId); |
|
|
|
|
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @deprecated |
89
|
|
|
* @return Money |
90
|
|
|
*/ |
91
|
|
|
public function getAmountAuthorized() |
92
|
|
|
{ |
93
|
|
|
return parent::getAmountAuthorized(); |
|
|
|
|
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @deprecated |
98
|
|
|
* @param Money $amountAuthorized |
99
|
|
|
* @return static |
100
|
|
|
*/ |
101
|
|
|
public function setAmountAuthorized(Money $amountAuthorized = null) |
102
|
|
|
{ |
103
|
|
|
return parent::setAmountAuthorized($amountAuthorized); |
|
|
|
|
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @deprecated |
108
|
|
|
* @return Money |
109
|
|
|
*/ |
110
|
|
|
public function getAmountPaid() |
111
|
|
|
{ |
112
|
|
|
return parent::getAmountPaid(); |
|
|
|
|
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @deprecated |
117
|
|
|
* @param Money $amountPaid |
118
|
|
|
* @return static |
119
|
|
|
*/ |
120
|
|
|
public function setAmountPaid(Money $amountPaid = null) |
121
|
|
|
{ |
122
|
|
|
return parent::setAmountPaid($amountPaid); |
|
|
|
|
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @deprecated |
127
|
|
|
* @return Money |
128
|
|
|
*/ |
129
|
|
|
public function getAmountRefunded() |
130
|
|
|
{ |
131
|
|
|
return parent::getAmountRefunded(); |
|
|
|
|
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @deprecated |
136
|
|
|
* @param Money $amountRefunded |
137
|
|
|
* @return static |
138
|
|
|
*/ |
139
|
|
|
public function setAmountRefunded(Money $amountRefunded = null) |
140
|
|
|
{ |
141
|
|
|
return parent::setAmountRefunded($amountRefunded); |
|
|
|
|
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @deprecated |
146
|
|
|
* @return Money |
147
|
|
|
*/ |
148
|
|
|
public function getAuthorizedUntil() |
149
|
|
|
{ |
150
|
|
|
return parent::getAuthorizedUntil(); |
|
|
|
|
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @deprecated |
155
|
|
|
* @param Money $amountUntil |
156
|
|
|
* @return static |
157
|
|
|
*/ |
158
|
|
|
public function setAuthorizedUntil(Money $amountUntil = null) |
159
|
|
|
{ |
160
|
|
|
return parent::setAuthorizedUntil($amountUntil); |
|
|
|
|
161
|
|
|
} |
162
|
|
|
} |
163
|
|
|
|