Skip to content

Commit 8b32826

Browse files
authored
Parse buyer phone number from Meta Commerce API (#713)
1 parent 55a4c6a commit 8b32826

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Meta/BusinessExtension/Helper/GraphAPIAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ public function getOrders($ordersRootId, $cursorAfter = false, $filterType = "")
617617
{
618618
$requestFields = [
619619
'id',
620-
'buyer_details',
620+
'buyer_details{name, email, email_remarketing_option, phone_number}',
621621
'channel',
622622
'created',
623623
'estimated_payment_details',

app/code/Meta/Sales/Model/Mapper/OrderMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ private function getOrderBillingAddress(array $data): Order\Address
321321
'street' => $street,
322322
'city' => $data['shipping_address']['city'],
323323
'email' => $data['buyer_details']['email'],
324-
'telephone' => 'N/A', // is required by magento
324+
'telephone' => $data['buyer_details']['phone_number'] ?? 'N/A',
325325
'country_id' => $data['shipping_address']['country'] // maps 1:1
326326
];
327327

0 commit comments

Comments
 (0)