@@ -15,6 +15,12 @@ class Insights implements \JsonSerializable
1515 */
1616 public readonly BillingAddress $ billingAddress ;
1717
18+ /**
19+ * @var Phone an object containing minFraud data related to the billing
20+ * phone used in the transaction
21+ */
22+ public readonly Phone $ billingPhone ;
23+
1824 /**
1925 * @var CreditCard an object containing minFraud data about the credit
2026 * card used in the transaction
@@ -81,6 +87,12 @@ class Insights implements \JsonSerializable
8187 */
8288 public readonly ShippingAddress $ shippingAddress ;
8389
90+ /**
91+ * @var Phone an object containing minFraud data related to the shipping
92+ * phone used in the transaction
93+ */
94+ public readonly Phone $ shippingPhone ;
95+
8496 /**
8597 * @var array This array contains \MaxMind\MinFraud\Model\Warning objects
8698 * detailing issues with the request that was sent, such as
@@ -108,11 +120,13 @@ public function __construct(array $response, array $locales = ['en'])
108120 $ this ->warnings = $ warnings ;
109121
110122 $ this ->billingAddress = new BillingAddress ($ response ['billing_address ' ] ?? []);
123+ $ this ->billingPhone = new Phone ($ response ['billing_phone ' ] ?? []);
111124 $ this ->creditCard = new CreditCard ($ response ['credit_card ' ] ?? []);
112125 $ this ->device = new Device ($ response ['device ' ] ?? []);
113126 $ this ->email = new Email ($ response ['email ' ] ?? []);
114127 $ this ->ipAddress = new IpAddress ($ response ['ip_address ' ] ?? [], $ locales );
115128 $ this ->shippingAddress = new ShippingAddress ($ response ['shipping_address ' ] ?? []);
129+ $ this ->shippingPhone = new Phone ($ response ['shipping_phone ' ] ?? []);
116130 }
117131
118132 public function jsonSerialize (): array
@@ -124,6 +138,11 @@ public function jsonSerialize(): array
124138 $ js ['billing_address ' ] = $ billingAddress ;
125139 }
126140
141+ $ billingPhone = $ this ->billingPhone ->jsonSerialize ();
142+ if (!empty ($ billingPhone )) {
143+ $ js ['billing_phone ' ] = $ billingPhone ;
144+ }
145+
127146 $ creditCard = $ this ->creditCard ->jsonSerialize ();
128147 if (!empty ($ creditCard )) {
129148 $ js ['credit_card ' ] = $ creditCard ;
@@ -163,6 +182,11 @@ public function jsonSerialize(): array
163182 $ js ['shipping_address ' ] = $ shippingAddress ;
164183 }
165184
185+ $ shippingPhone = $ this ->shippingPhone ->jsonSerialize ();
186+ if (!empty ($ shippingPhone )) {
187+ $ js ['shipping_phone ' ] = $ shippingPhone ;
188+ }
189+
166190 if (!empty ($ this ->warnings )) {
167191 $ warnings = [];
168192 foreach ($ this ->warnings as $ warning ) {
0 commit comments