commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Payment
TransactionDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Payment
;
10
11
use
Commercetools\Api\Models\Common\Money
;
12
use
Commercetools\Api\Models\Common\MoneyBuilder
;
13
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
14
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
15
use
Commercetools\Base\Builder
;
16
use
Commercetools\Base\DateTimeImmutableCollection
;
17
use
Commercetools\Base\JsonObject
;
18
use
Commercetools\Base\JsonObjectModel
;
19
use
Commercetools\Base\MapperFactory
;
20
use DateTimeImmutable;
21
use stdClass;
22
26
final
class
TransactionDraftBuilder
implements
Builder
27
{
32
private
$timestamp;
33
38
private
$type;
39
44
private
$amount;
45
50
private
$interactionId;
51
56
private
$state;
57
62
private
$custom;
63
70
public
function
getTimestamp
()
71
{
72
return
$this->timestamp;
73
}
74
81
public
function
getType
()
82
{
83
return
$this->type;
84
}
85
92
public
function
getAmount
()
93
{
94
return
$this->amount instanceof
MoneyBuilder
? $this->amount->
build
() : $this->amount;
95
}
96
104
public
function
getInteractionId
()
105
{
106
return
$this->interactionId;
107
}
108
115
public
function
getState
()
116
{
117
return
$this->state;
118
}
119
126
public
function
getCustom
()
127
{
128
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
129
}
130
135
public
function
withTimestamp
(?DateTimeImmutable $timestamp)
136
{
137
$this->timestamp = $timestamp;
138
139
return
$this;
140
}
141
146
public
function
withType
(?
string
$type)
147
{
148
$this->type = $type;
149
150
return
$this;
151
}
152
157
public
function
withAmount
(?
Money
$amount)
158
{
159
$this->amount = $amount;
160
161
return
$this;
162
}
163
168
public
function
withInteractionId
(?
string
$interactionId)
169
{
170
$this->interactionId = $interactionId;
171
172
return
$this;
173
}
174
179
public
function
withState
(?
string
$state)
180
{
181
$this->state = $state;
182
183
return
$this;
184
}
185
190
public
function
withCustom
(?
CustomFieldsDraft
$custom)
191
{
192
$this->custom = $custom;
193
194
return
$this;
195
}
196
201
public
function
withAmountBuilder
(?
MoneyBuilder
$amount)
202
{
203
$this->amount = $amount;
204
205
return
$this;
206
}
207
212
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
213
{
214
$this->custom = $custom;
215
216
return
$this;
217
}
218
219
public
function
build
():
TransactionDraft
220
{
221
return
new
TransactionDraftModel
(
222
$this->timestamp,
223
$this->type,
224
$this->amount instanceof
MoneyBuilder
? $this->amount->
build
() : $this->amount,
225
$this->interactionId,
226
$this->state,
227
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
228
);
229
}
230
231
public
static
function
of
():
TransactionDraftBuilder
232
{
233
return
new
self
();
234
}
235
}
Commercetools\Api\Models\Common\MoneyBuilder
Definition
MoneyBuilder.php:22
Commercetools\Api\Models\Common\MoneyBuilder\build
build()
Definition
MoneyBuilder.php:84
Commercetools\Api\Models\Payment\TransactionDraftBuilder
Definition
TransactionDraftBuilder.php:27
Commercetools\Api\Models\Payment\TransactionDraftBuilder\build
build()
Definition
TransactionDraftBuilder.php:219
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withInteractionId
withInteractionId(?string $interactionId)
Definition
TransactionDraftBuilder.php:168
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
TransactionDraftBuilder.php:190
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withAmountBuilder
withAmountBuilder(?MoneyBuilder $amount)
Definition
TransactionDraftBuilder.php:201
Commercetools\Api\Models\Payment\TransactionDraftBuilder\getTimestamp
getTimestamp()
Definition
TransactionDraftBuilder.php:70
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
TransactionDraftBuilder.php:212
Commercetools\Api\Models\Payment\TransactionDraftBuilder\getState
getState()
Definition
TransactionDraftBuilder.php:115
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withAmount
withAmount(?Money $amount)
Definition
TransactionDraftBuilder.php:157
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withTimestamp
withTimestamp(?DateTimeImmutable $timestamp)
Definition
TransactionDraftBuilder.php:135
Commercetools\Api\Models\Payment\TransactionDraftBuilder\getInteractionId
getInteractionId()
Definition
TransactionDraftBuilder.php:104
Commercetools\Api\Models\Payment\TransactionDraftBuilder\getType
getType()
Definition
TransactionDraftBuilder.php:81
Commercetools\Api\Models\Payment\TransactionDraftBuilder\getCustom
getCustom()
Definition
TransactionDraftBuilder.php:126
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withType
withType(?string $type)
Definition
TransactionDraftBuilder.php:146
Commercetools\Api\Models\Payment\TransactionDraftBuilder\withState
withState(?string $state)
Definition
TransactionDraftBuilder.php:179
Commercetools\Api\Models\Payment\TransactionDraftBuilder\getAmount
getAmount()
Definition
TransactionDraftBuilder.php:92
Commercetools\Api\Models\Payment\TransactionDraftBuilder\of
static of()
Definition
TransactionDraftBuilder.php:231
Commercetools\Api\Models\Payment\TransactionDraftModel
Definition
TransactionDraftModel.php:26
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Common\Money
Definition
Money.php:15
Commercetools\Api\Models\Payment\TransactionDraft
Definition
TransactionDraft.php:18
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Payment
Definition
Payment.php:9
Generated by
1.9.8