commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
MyPaymentDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
22use stdClass;
23
27final class MyPaymentDraftBuilder implements Builder
28{
33 private $amountPlanned;
34
39 private $paymentMethodInfo;
40
45 private $custom;
46
51 private $transaction;
52
60 public function getAmountPlanned()
61 {
62 return $this->amountPlanned instanceof MoneyBuilder ? $this->amountPlanned->build() : $this->amountPlanned;
63 }
64
71 public function getPaymentMethodInfo()
72 {
73 return $this->paymentMethodInfo instanceof PaymentMethodInfoBuilder ? $this->paymentMethodInfo->build() : $this->paymentMethodInfo;
74 }
75
82 public function getCustom()
83 {
84 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
85 }
86
93 public function getTransaction()
94 {
95 return $this->transaction instanceof MyTransactionDraftBuilder ? $this->transaction->build() : $this->transaction;
96 }
97
102 public function withAmountPlanned(?Money $amountPlanned)
103 {
104 $this->amountPlanned = $amountPlanned;
105
106 return $this;
107 }
108
113 public function withPaymentMethodInfo(?PaymentMethodInfo $paymentMethodInfo)
114 {
115 $this->paymentMethodInfo = $paymentMethodInfo;
116
117 return $this;
118 }
119
124 public function withCustom(?CustomFieldsDraft $custom)
125 {
126 $this->custom = $custom;
127
128 return $this;
129 }
130
135 public function withTransaction(?MyTransactionDraft $transaction)
136 {
137 $this->transaction = $transaction;
138
139 return $this;
140 }
141
146 public function withAmountPlannedBuilder(?MoneyBuilder $amountPlanned)
147 {
148 $this->amountPlanned = $amountPlanned;
149
150 return $this;
151 }
152
157 public function withPaymentMethodInfoBuilder(?PaymentMethodInfoBuilder $paymentMethodInfo)
158 {
159 $this->paymentMethodInfo = $paymentMethodInfo;
160
161 return $this;
162 }
163
169 {
170 $this->custom = $custom;
171
172 return $this;
173 }
174
180 {
181 $this->transaction = $transaction;
182
183 return $this;
184 }
185
186 public function build(): MyPaymentDraft
187 {
188 return new MyPaymentDraftModel(
189 $this->amountPlanned instanceof MoneyBuilder ? $this->amountPlanned->build() : $this->amountPlanned,
190 $this->paymentMethodInfo instanceof PaymentMethodInfoBuilder ? $this->paymentMethodInfo->build() : $this->paymentMethodInfo,
191 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
192 $this->transaction instanceof MyTransactionDraftBuilder ? $this->transaction->build() : $this->transaction
193 );
194 }
195
196 public static function of(): MyPaymentDraftBuilder
197 {
198 return new self();
199 }
200}
withPaymentMethodInfo(?PaymentMethodInfo $paymentMethodInfo)
withTransactionBuilder(?MyTransactionDraftBuilder $transaction)
withPaymentMethodInfoBuilder(?PaymentMethodInfoBuilder $paymentMethodInfo)