@@ -14,13 +14,13 @@ class PaymentTransaction
14
14
public ?string $ description ;
15
15
public PaymentTransactionRedirect $ redirects ;
16
16
public PaymentTransactionCustomer $ customer ;
17
- public PaymentTransactionAddress $ billing ;
18
- public PaymentTransactionAddress $ shipping ;
17
+ public ? PaymentTransactionAddress $ billing ;
18
+ public ? PaymentTransactionAddress $ shipping ;
19
19
/**
20
20
* @var PaymentTransactionCartItem[]|null
21
21
*/
22
22
public ?array $ cart ;
23
- public \DateTimeImmutable $ paidAt ;
23
+ public ? \DateTimeImmutable $ paidAt ;
24
24
public ?\DateTimeImmutable $ expiresAt ;
25
25
public \DateTimeImmutable $ createdAt ;
26
26
public \DateTimeImmutable $ updatedAt ;
@@ -34,10 +34,10 @@ private function __construct(
34
34
?string $ description ,
35
35
PaymentTransactionRedirect $ redirects ,
36
36
PaymentTransactionCustomer $ customer ,
37
- PaymentTransactionAddress $ billing ,
38
- PaymentTransactionAddress $ shipping ,
37
+ ? PaymentTransactionAddress $ billing ,
38
+ ? PaymentTransactionAddress $ shipping ,
39
39
?array $ cart ,
40
- \DateTimeImmutable $ paidAt ,
40
+ ? \DateTimeImmutable $ paidAt ,
41
41
?\DateTimeImmutable $ expiresAt ,
42
42
\DateTimeImmutable $ createdAt ,
43
43
\DateTimeImmutable $ updatedAt
@@ -76,8 +76,8 @@ public static function createFromResponse(array $data): self
76
76
$ data ['description ' ],
77
77
PaymentTransactionRedirect::createFromResponse ($ data ['redirect ' ]),
78
78
PaymentTransactionCustomer::createFromResponse ($ data ['customer ' ]),
79
- PaymentTransactionAddress::createFromResponse ($ data ['billing ' ]),
80
- PaymentTransactionAddress::createFromResponse ($ data ['shipping ' ]),
79
+ empty ( $ data [ ' billing ' ]) ? null : PaymentTransactionAddress::createFromResponse ($ data ['billing ' ]),
80
+ empty ( $ data [ ' shipping ' ]) ? null : PaymentTransactionAddress::createFromResponse ($ data ['shipping ' ]),
81
81
$ cartItems ,
82
82
new \DateTimeImmutable ($ data ['paid_at ' ]),
83
83
new \DateTimeImmutable ($ data ['expires_at ' ]),
0 commit comments