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
PaymentDraftBuilder.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\Customer\CustomerResourceIdentifier
;
14
use
Commercetools\Api\Models\Customer\CustomerResourceIdentifierBuilder
;
15
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
16
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
17
use
Commercetools\Api\Models\Type\CustomFieldsDraftCollection
;
18
use
Commercetools\Base\Builder
;
19
use
Commercetools\Base\DateTimeImmutableCollection
;
20
use
Commercetools\Base\JsonObject
;
21
use
Commercetools\Base\JsonObjectModel
;
22
use
Commercetools\Base\MapperFactory
;
23
use stdClass;
24
28
final
class
PaymentDraftBuilder
implements
Builder
29
{
34
private
$customer;
35
40
private
$anonymousId;
41
46
private
$interfaceId;
47
52
private
$amountPlanned;
53
58
private
$paymentMethodInfo;
59
64
private
$paymentStatus;
65
70
private
$transactions;
71
76
private
$interfaceInteractions;
77
82
private
$custom;
83
88
private
$key;
89
96
public
function
getCustomer
()
97
{
98
return
$this->customer instanceof
CustomerResourceIdentifierBuilder
? $this->customer->
build
() : $this->customer;
99
}
100
107
public
function
getAnonymousId
()
108
{
109
return
$this->anonymousId;
110
}
111
120
public
function
getInterfaceId
()
121
{
122
return
$this->interfaceId;
123
}
124
132
public
function
getAmountPlanned
()
133
{
134
return
$this->amountPlanned instanceof
MoneyBuilder
? $this->amountPlanned->
build
() : $this->amountPlanned;
135
}
136
143
public
function
getPaymentMethodInfo
()
144
{
145
return
$this->paymentMethodInfo instanceof
PaymentMethodInfoBuilder
? $this->paymentMethodInfo->
build
() : $this->paymentMethodInfo;
146
}
147
154
public
function
getPaymentStatus
()
155
{
156
return
$this->paymentStatus instanceof
PaymentStatusDraftBuilder
? $this->paymentStatus->
build
() : $this->paymentStatus;
157
}
158
165
public
function
getTransactions
()
166
{
167
return
$this->transactions;
168
}
169
176
public
function
getInterfaceInteractions
()
177
{
178
return
$this->interfaceInteractions;
179
}
180
187
public
function
getCustom
()
188
{
189
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
190
}
191
198
public
function
getKey
()
199
{
200
return
$this->key;
201
}
202
207
public
function
withCustomer
(?
CustomerResourceIdentifier
$customer)
208
{
209
$this->customer = $customer;
210
211
return
$this;
212
}
213
218
public
function
withAnonymousId
(?
string
$anonymousId)
219
{
220
$this->anonymousId = $anonymousId;
221
222
return
$this;
223
}
224
229
public
function
withInterfaceId
(?
string
$interfaceId)
230
{
231
$this->interfaceId = $interfaceId;
232
233
return
$this;
234
}
235
240
public
function
withAmountPlanned
(?
Money
$amountPlanned)
241
{
242
$this->amountPlanned = $amountPlanned;
243
244
return
$this;
245
}
246
251
public
function
withPaymentMethodInfo
(?
PaymentMethodInfo
$paymentMethodInfo)
252
{
253
$this->paymentMethodInfo = $paymentMethodInfo;
254
255
return
$this;
256
}
257
262
public
function
withPaymentStatus
(?
PaymentStatusDraft
$paymentStatus)
263
{
264
$this->paymentStatus = $paymentStatus;
265
266
return
$this;
267
}
268
273
public
function
withTransactions
(?
TransactionDraftCollection
$transactions)
274
{
275
$this->transactions = $transactions;
276
277
return
$this;
278
}
279
284
public
function
withInterfaceInteractions
(?
CustomFieldsDraftCollection
$interfaceInteractions)
285
{
286
$this->interfaceInteractions = $interfaceInteractions;
287
288
return
$this;
289
}
290
295
public
function
withCustom
(?
CustomFieldsDraft
$custom)
296
{
297
$this->custom = $custom;
298
299
return
$this;
300
}
301
306
public
function
withKey
(?
string
$key)
307
{
308
$this->key = $key;
309
310
return
$this;
311
}
312
317
public
function
withCustomerBuilder
(?
CustomerResourceIdentifierBuilder
$customer)
318
{
319
$this->customer = $customer;
320
321
return
$this;
322
}
323
328
public
function
withAmountPlannedBuilder
(?
MoneyBuilder
$amountPlanned)
329
{
330
$this->amountPlanned = $amountPlanned;
331
332
return
$this;
333
}
334
339
public
function
withPaymentMethodInfoBuilder
(?
PaymentMethodInfoBuilder
$paymentMethodInfo)
340
{
341
$this->paymentMethodInfo = $paymentMethodInfo;
342
343
return
$this;
344
}
345
350
public
function
withPaymentStatusBuilder
(?
PaymentStatusDraftBuilder
$paymentStatus)
351
{
352
$this->paymentStatus = $paymentStatus;
353
354
return
$this;
355
}
356
361
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
362
{
363
$this->custom = $custom;
364
365
return
$this;
366
}
367
368
public
function
build
():
PaymentDraft
369
{
370
return
new
PaymentDraftModel
(
371
$this->customer instanceof
CustomerResourceIdentifierBuilder
? $this->customer->
build
() : $this->customer,
372
$this->anonymousId,
373
$this->interfaceId,
374
$this->amountPlanned instanceof
MoneyBuilder
? $this->amountPlanned->
build
() : $this->amountPlanned,
375
$this->paymentMethodInfo instanceof
PaymentMethodInfoBuilder
? $this->paymentMethodInfo->
build
() : $this->paymentMethodInfo,
376
$this->paymentStatus instanceof
PaymentStatusDraftBuilder
? $this->paymentStatus->
build
() : $this->paymentStatus,
377
$this->transactions,
378
$this->interfaceInteractions,
379
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom,
380
$this->key
381
);
382
}
383
384
public
static
function
of
():
PaymentDraftBuilder
385
{
386
return
new
self
();
387
}
388
}
Commercetools\Api\Models\Common\MoneyBuilder
Definition
MoneyBuilder.php:22
Commercetools\Api\Models\Common\MoneyBuilder\build
build()
Definition
MoneyBuilder.php:84
Commercetools\Api\Models\Customer\CustomerResourceIdentifierBuilder
Definition
CustomerResourceIdentifierBuilder.php:24
Commercetools\Api\Models\Customer\CustomerResourceIdentifierBuilder\build
build()
Definition
CustomerResourceIdentifierBuilder.php:82
Commercetools\Api\Models\Payment\PaymentDraftBuilder
Definition
PaymentDraftBuilder.php:29
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withInterfaceId
withInterfaceId(?string $interfaceId)
Definition
PaymentDraftBuilder.php:229
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
PaymentDraftBuilder.php:361
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withAmountPlannedBuilder
withAmountPlannedBuilder(?MoneyBuilder $amountPlanned)
Definition
PaymentDraftBuilder.php:328
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withTransactions
withTransactions(?TransactionDraftCollection $transactions)
Definition
PaymentDraftBuilder.php:273
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getCustomer
getCustomer()
Definition
PaymentDraftBuilder.php:96
Commercetools\Api\Models\Payment\PaymentDraftBuilder\build
build()
Definition
PaymentDraftBuilder.php:368
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getAnonymousId
getAnonymousId()
Definition
PaymentDraftBuilder.php:107
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getInterfaceId
getInterfaceId()
Definition
PaymentDraftBuilder.php:120
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getAmountPlanned
getAmountPlanned()
Definition
PaymentDraftBuilder.php:132
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withPaymentMethodInfoBuilder
withPaymentMethodInfoBuilder(?PaymentMethodInfoBuilder $paymentMethodInfo)
Definition
PaymentDraftBuilder.php:339
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withAnonymousId
withAnonymousId(?string $anonymousId)
Definition
PaymentDraftBuilder.php:218
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getInterfaceInteractions
getInterfaceInteractions()
Definition
PaymentDraftBuilder.php:176
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withInterfaceInteractions
withInterfaceInteractions(?CustomFieldsDraftCollection $interfaceInteractions)
Definition
PaymentDraftBuilder.php:284
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getCustom
getCustom()
Definition
PaymentDraftBuilder.php:187
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withAmountPlanned
withAmountPlanned(?Money $amountPlanned)
Definition
PaymentDraftBuilder.php:240
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getTransactions
getTransactions()
Definition
PaymentDraftBuilder.php:165
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withPaymentStatus
withPaymentStatus(?PaymentStatusDraft $paymentStatus)
Definition
PaymentDraftBuilder.php:262
Commercetools\Api\Models\Payment\PaymentDraftBuilder\of
static of()
Definition
PaymentDraftBuilder.php:384
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
PaymentDraftBuilder.php:295
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getPaymentStatus
getPaymentStatus()
Definition
PaymentDraftBuilder.php:154
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getKey
getKey()
Definition
PaymentDraftBuilder.php:198
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withCustomerBuilder
withCustomerBuilder(?CustomerResourceIdentifierBuilder $customer)
Definition
PaymentDraftBuilder.php:317
Commercetools\Api\Models\Payment\PaymentDraftBuilder\getPaymentMethodInfo
getPaymentMethodInfo()
Definition
PaymentDraftBuilder.php:143
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withCustomer
withCustomer(?CustomerResourceIdentifier $customer)
Definition
PaymentDraftBuilder.php:207
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withPaymentMethodInfo
withPaymentMethodInfo(?PaymentMethodInfo $paymentMethodInfo)
Definition
PaymentDraftBuilder.php:251
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withKey
withKey(?string $key)
Definition
PaymentDraftBuilder.php:306
Commercetools\Api\Models\Payment\PaymentDraftBuilder\withPaymentStatusBuilder
withPaymentStatusBuilder(?PaymentStatusDraftBuilder $paymentStatus)
Definition
PaymentDraftBuilder.php:350
Commercetools\Api\Models\Payment\PaymentDraftModel
Definition
PaymentDraftModel.php:28
Commercetools\Api\Models\Payment\PaymentMethodInfoBuilder
Definition
PaymentMethodInfoBuilder.php:24
Commercetools\Api\Models\Payment\PaymentMethodInfoBuilder\build
build()
Definition
PaymentMethodInfoBuilder.php:122
Commercetools\Api\Models\Payment\PaymentStatusDraftBuilder
Definition
PaymentStatusDraftBuilder.php:24
Commercetools\Api\Models\Payment\PaymentStatusDraftBuilder\build
build()
Definition
PaymentStatusDraftBuilder.php:120
Commercetools\Api\Models\Payment\TransactionDraftCollection
Definition
TransactionDraftCollection.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
Commercetools\Api\Models\Type\CustomFieldsDraftCollection
Definition
CustomFieldsDraftCollection.php:22
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\Customer\CustomerResourceIdentifier
Definition
CustomerResourceIdentifier.php:16
Commercetools\Api\Models\Payment\PaymentDraft
Definition
PaymentDraft.php:19
Commercetools\Api\Models\Payment\PaymentMethodInfo
Definition
PaymentMethodInfo.php:16
Commercetools\Api\Models\Payment\PaymentStatusDraft
Definition
PaymentStatusDraft.php:16
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