commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
MyPaymentDraftModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
32 protected $amountPlanned;
33
39
44 protected $custom;
45
50 protected $transaction;
51
52
56 public function __construct(
57 ?Money $amountPlanned = null,
61 ) {
62 $this->amountPlanned = $amountPlanned;
63 $this->paymentMethodInfo = $paymentMethodInfo;
64 $this->custom = $custom;
65 $this->transaction = $transaction;
66 }
67
75 public function getAmountPlanned()
76 {
77 if (is_null($this->amountPlanned)) {
79 $data = $this->raw(self::FIELD_AMOUNT_PLANNED);
80 if (is_null($data)) {
81 return null;
82 }
83
84 $this->amountPlanned = MoneyModel::of($data);
85 }
86
88 }
89
96 public function getPaymentMethodInfo()
97 {
98 if (is_null($this->paymentMethodInfo)) {
100 $data = $this->raw(self::FIELD_PAYMENT_METHOD_INFO);
101 if (is_null($data)) {
102 return null;
103 }
104
105 $this->paymentMethodInfo = PaymentMethodInfoModel::of($data);
106 }
107
109 }
110
117 public function getCustom()
118 {
119 if (is_null($this->custom)) {
121 $data = $this->raw(self::FIELD_CUSTOM);
122 if (is_null($data)) {
123 return null;
124 }
125
126 $this->custom = CustomFieldsDraftModel::of($data);
127 }
128
129 return $this->custom;
130 }
131
138 public function getTransaction()
139 {
140 if (is_null($this->transaction)) {
142 $data = $this->raw(self::FIELD_TRANSACTION);
143 if (is_null($data)) {
144 return null;
145 }
146
147 $this->transaction = MyTransactionDraftModel::of($data);
148 }
149
150 return $this->transaction;
151 }
152
153
157 public function setAmountPlanned(?Money $amountPlanned): void
158 {
159 $this->amountPlanned = $amountPlanned;
160 }
161
166 {
167 $this->paymentMethodInfo = $paymentMethodInfo;
168 }
169
173 public function setCustom(?CustomFieldsDraft $custom): void
174 {
175 $this->custom = $custom;
176 }
177
182 {
183 $this->transaction = $transaction;
184 }
185}
setPaymentMethodInfo(?PaymentMethodInfo $paymentMethodInfo)
__construct(?Money $amountPlanned=null, ?PaymentMethodInfo $paymentMethodInfo=null, ?CustomFieldsDraft $custom=null, ?MyTransactionDraft $transaction=null)