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
PaymentBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Payment
;
10
11
use
Commercetools\Api\Models\Common\BaseResource
;
12
use
Commercetools\Api\Models\Common\BaseResourceBuilder
;
13
use
Commercetools\Api\Models\Common\CentPrecisionMoney
;
14
use
Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder
;
15
use
Commercetools\Api\Models\Common\CreatedBy
;
16
use
Commercetools\Api\Models\Common\CreatedByBuilder
;
17
use
Commercetools\Api\Models\Common\LastModifiedBy
;
18
use
Commercetools\Api\Models\Common\LastModifiedByBuilder
;
19
use
Commercetools\Api\Models\Common\TypedMoney
;
20
use
Commercetools\Api\Models\Customer\CustomerReference
;
21
use
Commercetools\Api\Models\Customer\CustomerReferenceBuilder
;
22
use
Commercetools\Api\Models\Type\CustomFields
;
23
use
Commercetools\Api\Models\Type\CustomFieldsBuilder
;
24
use
Commercetools\Api\Models\Type\CustomFieldsCollection
;
25
use
Commercetools\Base\Builder
;
26
use
Commercetools\Base\DateTimeImmutableCollection
;
27
use
Commercetools\Base\JsonObject
;
28
use
Commercetools\Base\JsonObjectModel
;
29
use
Commercetools\Base\MapperFactory
;
30
use DateTimeImmutable;
31
use stdClass;
32
36
final
class
PaymentBuilder
implements
Builder
37
{
42
private
$id;
43
48
private
$version;
49
54
private
$createdAt;
55
60
private
$lastModifiedAt;
61
66
private
$lastModifiedBy;
67
72
private
$createdBy;
73
78
private
$customer;
79
84
private
$anonymousId;
85
90
private
$interfaceId;
91
96
private
$amountPlanned;
97
102
private
$paymentMethodInfo;
103
108
private
$paymentStatus;
109
114
private
$transactions;
115
120
private
$interfaceInteractions;
121
126
private
$custom;
127
132
private
$key;
133
140
public
function
getId
()
141
{
142
return
$this->id;
143
}
144
151
public
function
getVersion
()
152
{
153
return
$this->version;
154
}
155
162
public
function
getCreatedAt
()
163
{
164
return
$this->createdAt;
165
}
166
173
public
function
getLastModifiedAt
()
174
{
175
return
$this->lastModifiedAt;
176
}
177
184
public
function
getLastModifiedBy
()
185
{
186
return
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy;
187
}
188
195
public
function
getCreatedBy
()
196
{
197
return
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy;
198
}
199
206
public
function
getCustomer
()
207
{
208
return
$this->customer instanceof
CustomerReferenceBuilder
? $this->customer->
build
() : $this->customer;
209
}
210
217
public
function
getAnonymousId
()
218
{
219
return
$this->anonymousId;
220
}
221
229
public
function
getInterfaceId
()
230
{
231
return
$this->interfaceId;
232
}
233
241
public
function
getAmountPlanned
()
242
{
243
return
$this->amountPlanned instanceof
CentPrecisionMoneyBuilder
? $this->amountPlanned->
build
() : $this->amountPlanned;
244
}
245
252
public
function
getPaymentMethodInfo
()
253
{
254
return
$this->paymentMethodInfo instanceof
PaymentMethodInfoBuilder
? $this->paymentMethodInfo->
build
() : $this->paymentMethodInfo;
255
}
256
263
public
function
getPaymentStatus
()
264
{
265
return
$this->paymentStatus instanceof
PaymentStatusBuilder
? $this->paymentStatus->
build
() : $this->paymentStatus;
266
}
267
274
public
function
getTransactions
()
275
{
276
return
$this->transactions;
277
}
278
285
public
function
getInterfaceInteractions
()
286
{
287
return
$this->interfaceInteractions;
288
}
289
296
public
function
getCustom
()
297
{
298
return
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom;
299
}
300
307
public
function
getKey
()
308
{
309
return
$this->key;
310
}
311
316
public
function
withId
(?
string
$id)
317
{
318
$this->
id
= $id;
319
320
return
$this;
321
}
322
327
public
function
withVersion
(?
int
$version)
328
{
329
$this->version = $version;
330
331
return
$this;
332
}
333
338
public
function
withCreatedAt
(?DateTimeImmutable $createdAt)
339
{
340
$this->createdAt = $createdAt;
341
342
return
$this;
343
}
344
349
public
function
withLastModifiedAt
(?DateTimeImmutable $lastModifiedAt)
350
{
351
$this->lastModifiedAt = $lastModifiedAt;
352
353
return
$this;
354
}
355
360
public
function
withLastModifiedBy
(?
LastModifiedBy
$lastModifiedBy)
361
{
362
$this->lastModifiedBy = $lastModifiedBy;
363
364
return
$this;
365
}
366
371
public
function
withCreatedBy
(?
CreatedBy
$createdBy)
372
{
373
$this->createdBy = $createdBy;
374
375
return
$this;
376
}
377
382
public
function
withCustomer
(?
CustomerReference
$customer)
383
{
384
$this->customer = $customer;
385
386
return
$this;
387
}
388
393
public
function
withAnonymousId
(?
string
$anonymousId)
394
{
395
$this->anonymousId = $anonymousId;
396
397
return
$this;
398
}
399
404
public
function
withInterfaceId
(?
string
$interfaceId)
405
{
406
$this->interfaceId = $interfaceId;
407
408
return
$this;
409
}
410
415
public
function
withAmountPlanned
(?
CentPrecisionMoney
$amountPlanned)
416
{
417
$this->amountPlanned = $amountPlanned;
418
419
return
$this;
420
}
421
426
public
function
withPaymentMethodInfo
(?
PaymentMethodInfo
$paymentMethodInfo)
427
{
428
$this->paymentMethodInfo = $paymentMethodInfo;
429
430
return
$this;
431
}
432
437
public
function
withPaymentStatus
(?
PaymentStatus
$paymentStatus)
438
{
439
$this->paymentStatus = $paymentStatus;
440
441
return
$this;
442
}
443
448
public
function
withTransactions
(?
TransactionCollection
$transactions)
449
{
450
$this->transactions = $transactions;
451
452
return
$this;
453
}
454
459
public
function
withInterfaceInteractions
(?
CustomFieldsCollection
$interfaceInteractions)
460
{
461
$this->interfaceInteractions = $interfaceInteractions;
462
463
return
$this;
464
}
465
470
public
function
withCustom
(?
CustomFields
$custom)
471
{
472
$this->custom = $custom;
473
474
return
$this;
475
}
476
481
public
function
withKey
(?
string
$key)
482
{
483
$this->key = $key;
484
485
return
$this;
486
}
487
492
public
function
withLastModifiedByBuilder
(?
LastModifiedByBuilder
$lastModifiedBy)
493
{
494
$this->lastModifiedBy = $lastModifiedBy;
495
496
return
$this;
497
}
498
503
public
function
withCreatedByBuilder
(?
CreatedByBuilder
$createdBy)
504
{
505
$this->createdBy = $createdBy;
506
507
return
$this;
508
}
509
514
public
function
withCustomerBuilder
(?
CustomerReferenceBuilder
$customer)
515
{
516
$this->customer = $customer;
517
518
return
$this;
519
}
520
525
public
function
withAmountPlannedBuilder
(?
CentPrecisionMoneyBuilder
$amountPlanned)
526
{
527
$this->amountPlanned = $amountPlanned;
528
529
return
$this;
530
}
531
536
public
function
withPaymentMethodInfoBuilder
(?
PaymentMethodInfoBuilder
$paymentMethodInfo)
537
{
538
$this->paymentMethodInfo = $paymentMethodInfo;
539
540
return
$this;
541
}
542
547
public
function
withPaymentStatusBuilder
(?
PaymentStatusBuilder
$paymentStatus)
548
{
549
$this->paymentStatus = $paymentStatus;
550
551
return
$this;
552
}
553
558
public
function
withCustomBuilder
(?
CustomFieldsBuilder
$custom)
559
{
560
$this->custom = $custom;
561
562
return
$this;
563
}
564
565
public
function
build
():
Payment
566
{
567
return
new
PaymentModel
(
568
$this->
id
,
569
$this->version,
570
$this->createdAt,
571
$this->lastModifiedAt,
572
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy,
573
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy,
574
$this->customer instanceof
CustomerReferenceBuilder
? $this->customer->
build
() : $this->customer,
575
$this->anonymousId,
576
$this->interfaceId,
577
$this->amountPlanned instanceof
CentPrecisionMoneyBuilder
? $this->amountPlanned->
build
() : $this->amountPlanned,
578
$this->paymentMethodInfo instanceof
PaymentMethodInfoBuilder
? $this->paymentMethodInfo->
build
() : $this->paymentMethodInfo,
579
$this->paymentStatus instanceof
PaymentStatusBuilder
? $this->paymentStatus->
build
() : $this->paymentStatus,
580
$this->transactions,
581
$this->interfaceInteractions,
582
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom,
583
$this->key
584
);
585
}
586
587
public
static
function
of
():
PaymentBuilder
588
{
589
return
new
self
();
590
}
591
}
Commercetools\Api\Models\Common\BaseResourceBuilder
Definition
BaseResourceBuilder.php:491
Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder
Definition
CentPrecisionMoneyBuilder.php:22
Commercetools\Api\Models\Common\CentPrecisionMoneyBuilder\build
build()
Definition
CentPrecisionMoneyBuilder.php:112
Commercetools\Api\Models\Common\CreatedByBuilder
Definition
CreatedByBuilder.php:24
Commercetools\Api\Models\Common\CreatedByBuilder\build
build()
Definition
CreatedByBuilder.php:226
Commercetools\Api\Models\Common\LastModifiedByBuilder
Definition
LastModifiedByBuilder.php:24
Commercetools\Api\Models\Common\LastModifiedByBuilder\build
build()
Definition
LastModifiedByBuilder.php:226
Commercetools\Api\Models\Customer\CustomerReferenceBuilder
Definition
CustomerReferenceBuilder.php:24
Commercetools\Api\Models\Customer\CustomerReferenceBuilder\build
build()
Definition
CustomerReferenceBuilder.php:92
Commercetools\Api\Models\Payment\PaymentBuilder
Definition
PaymentBuilder.php:37
Commercetools\Api\Models\Payment\PaymentBuilder\withLastModifiedAt
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
Definition
PaymentBuilder.php:349
Commercetools\Api\Models\Payment\PaymentBuilder\withCreatedAt
withCreatedAt(?DateTimeImmutable $createdAt)
Definition
PaymentBuilder.php:338
Commercetools\Api\Models\Payment\PaymentBuilder\getTransactions
getTransactions()
Definition
PaymentBuilder.php:274
Commercetools\Api\Models\Payment\PaymentBuilder\withTransactions
withTransactions(?TransactionCollection $transactions)
Definition
PaymentBuilder.php:448
Commercetools\Api\Models\Payment\PaymentBuilder\withCustomerBuilder
withCustomerBuilder(?CustomerReferenceBuilder $customer)
Definition
PaymentBuilder.php:514
Commercetools\Api\Models\Payment\PaymentBuilder\getKey
getKey()
Definition
PaymentBuilder.php:307
Commercetools\Api\Models\Payment\PaymentBuilder\withInterfaceInteractions
withInterfaceInteractions(?CustomFieldsCollection $interfaceInteractions)
Definition
PaymentBuilder.php:459
Commercetools\Api\Models\Payment\PaymentBuilder\withLastModifiedByBuilder
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
Definition
PaymentBuilder.php:492
Commercetools\Api\Models\Payment\PaymentBuilder\withAmountPlannedBuilder
withAmountPlannedBuilder(?CentPrecisionMoneyBuilder $amountPlanned)
Definition
PaymentBuilder.php:525
Commercetools\Api\Models\Payment\PaymentBuilder\getPaymentStatus
getPaymentStatus()
Definition
PaymentBuilder.php:263
Commercetools\Api\Models\Payment\PaymentBuilder\withLastModifiedBy
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
Definition
PaymentBuilder.php:360
Commercetools\Api\Models\Payment\PaymentBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsBuilder $custom)
Definition
PaymentBuilder.php:558
Commercetools\Api\Models\Payment\PaymentBuilder\withPaymentStatusBuilder
withPaymentStatusBuilder(?PaymentStatusBuilder $paymentStatus)
Definition
PaymentBuilder.php:547
Commercetools\Api\Models\Payment\PaymentBuilder\withAmountPlanned
withAmountPlanned(?CentPrecisionMoney $amountPlanned)
Definition
PaymentBuilder.php:415
Commercetools\Api\Models\Payment\PaymentBuilder\withCreatedBy
withCreatedBy(?CreatedBy $createdBy)
Definition
PaymentBuilder.php:371
Commercetools\Api\Models\Payment\PaymentBuilder\getVersion
getVersion()
Definition
PaymentBuilder.php:151
Commercetools\Api\Models\Payment\PaymentBuilder\getCustom
getCustom()
Definition
PaymentBuilder.php:296
Commercetools\Api\Models\Payment\PaymentBuilder\getAmountPlanned
getAmountPlanned()
Definition
PaymentBuilder.php:241
Commercetools\Api\Models\Payment\PaymentBuilder\withPaymentMethodInfo
withPaymentMethodInfo(?PaymentMethodInfo $paymentMethodInfo)
Definition
PaymentBuilder.php:426
Commercetools\Api\Models\Payment\PaymentBuilder\build
build()
Definition
PaymentBuilder.php:565
Commercetools\Api\Models\Payment\PaymentBuilder\getAnonymousId
getAnonymousId()
Definition
PaymentBuilder.php:217
Commercetools\Api\Models\Payment\PaymentBuilder\getCustomer
getCustomer()
Definition
PaymentBuilder.php:206
Commercetools\Api\Models\Payment\PaymentBuilder\withKey
withKey(?string $key)
Definition
PaymentBuilder.php:481
Commercetools\Api\Models\Payment\PaymentBuilder\withCreatedByBuilder
withCreatedByBuilder(?CreatedByBuilder $createdBy)
Definition
PaymentBuilder.php:503
Commercetools\Api\Models\Payment\PaymentBuilder\withPaymentMethodInfoBuilder
withPaymentMethodInfoBuilder(?PaymentMethodInfoBuilder $paymentMethodInfo)
Definition
PaymentBuilder.php:536
Commercetools\Api\Models\Payment\PaymentBuilder\withId
withId(?string $id)
Definition
PaymentBuilder.php:316
Commercetools\Api\Models\Payment\PaymentBuilder\getId
getId()
Definition
PaymentBuilder.php:140
Commercetools\Api\Models\Payment\PaymentBuilder\getPaymentMethodInfo
getPaymentMethodInfo()
Definition
PaymentBuilder.php:252
Commercetools\Api\Models\Payment\PaymentBuilder\getLastModifiedBy
getLastModifiedBy()
Definition
PaymentBuilder.php:184
Commercetools\Api\Models\Payment\PaymentBuilder\withAnonymousId
withAnonymousId(?string $anonymousId)
Definition
PaymentBuilder.php:393
Commercetools\Api\Models\Payment\PaymentBuilder\of
static of()
Definition
PaymentBuilder.php:587
Commercetools\Api\Models\Payment\PaymentBuilder\getInterfaceId
getInterfaceId()
Definition
PaymentBuilder.php:229
Commercetools\Api\Models\Payment\PaymentBuilder\withCustom
withCustom(?CustomFields $custom)
Definition
PaymentBuilder.php:470
Commercetools\Api\Models\Payment\PaymentBuilder\withVersion
withVersion(?int $version)
Definition
PaymentBuilder.php:327
Commercetools\Api\Models\Payment\PaymentBuilder\withCustomer
withCustomer(?CustomerReference $customer)
Definition
PaymentBuilder.php:382
Commercetools\Api\Models\Payment\PaymentBuilder\getCreatedAt
getCreatedAt()
Definition
PaymentBuilder.php:162
Commercetools\Api\Models\Payment\PaymentBuilder\withInterfaceId
withInterfaceId(?string $interfaceId)
Definition
PaymentBuilder.php:404
Commercetools\Api\Models\Payment\PaymentBuilder\getLastModifiedAt
getLastModifiedAt()
Definition
PaymentBuilder.php:173
Commercetools\Api\Models\Payment\PaymentBuilder\withPaymentStatus
withPaymentStatus(?PaymentStatus $paymentStatus)
Definition
PaymentBuilder.php:437
Commercetools\Api\Models\Payment\PaymentBuilder\getInterfaceInteractions
getInterfaceInteractions()
Definition
PaymentBuilder.php:285
Commercetools\Api\Models\Payment\PaymentBuilder\getCreatedBy
getCreatedBy()
Definition
PaymentBuilder.php:195
Commercetools\Api\Models\Payment\PaymentMethodInfoBuilder
Definition
PaymentMethodInfoBuilder.php:24
Commercetools\Api\Models\Payment\PaymentMethodInfoBuilder\build
build()
Definition
PaymentMethodInfoBuilder.php:122
Commercetools\Api\Models\Payment\PaymentModel
Definition
PaymentModel.php:37
Commercetools\Api\Models\Payment\PaymentStatusBuilder
Definition
PaymentStatusBuilder.php:24
Commercetools\Api\Models\Payment\PaymentStatusBuilder\build
build()
Definition
PaymentStatusBuilder.php:120
Commercetools\Api\Models\Payment\TransactionCollection
Definition
TransactionCollection.php:22
Commercetools\Api\Models\Type\CustomFieldsBuilder
Definition
CustomFieldsBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsBuilder\build
build()
Definition
CustomFieldsBuilder.php:101
Commercetools\Api\Models\Type\CustomFieldsCollection
Definition
CustomFieldsCollection.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\BaseResource
Definition
BaseResource.php:250
Commercetools\Api\Models\Common\CentPrecisionMoney
Definition
CentPrecisionMoney.php:15
Commercetools\Api\Models\Common\CreatedBy
Definition
CreatedBy.php:16
Commercetools\Api\Models\Common\LastModifiedBy
Definition
LastModifiedBy.php:16
Commercetools\Api\Models\Common\TypedMoney
Definition
TypedMoney.php:15
Commercetools\Api\Models\Customer\CustomerReference
Definition
CustomerReference.php:16
Commercetools\Api\Models\Payment\Payment
Definition
Payment.php:24
Commercetools\Api\Models\Payment\PaymentMethodInfo
Definition
PaymentMethodInfo.php:16
Commercetools\Api\Models\Payment\PaymentStatus
Definition
PaymentStatus.php:16
Commercetools\Api\Models\Type\CustomFields
Definition
CustomFields.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