@@ -115,11 +115,11 @@ public function __construct(
115
115
*/
116
116
public function pullOrders (int $ storeId , $ cursorAfter = false )
117
117
{
118
- $ ordersRootId = $ this ->systemConfig ->getCommerceAccountId ($ storeId ) ?: $ this ->systemConfig ->getPageId ($ storeId );
119
118
$ this ->graphAPIAdapter
120
119
->setDebugMode ($ this ->systemConfig ->isDebugMode ($ storeId ))
121
120
->setAccessToken ($ this ->systemConfig ->getAccessToken ($ storeId ));
122
121
122
+ $ ordersRootId = $ this ->systemConfig ->getCommerceAccountId ($ storeId ) ?: $ this ->systemConfig ->getPageId ($ storeId );
123
123
$ ordersData = $ this ->graphAPIAdapter ->getOrders ($ ordersRootId , $ cursorAfter );
124
124
125
125
$ this ->ordersPulledTotal += count ($ ordersData ['data ' ]);
@@ -158,14 +158,14 @@ public function pullOrders(int $storeId, $cursorAfter = false)
158
158
* @return array Associative array containing the refund details with Facebook Order IDs as keys.
159
159
* @throws GuzzleException
160
160
*/
161
- public function pullRefundOrders (int $ storeId )
161
+ public function pullRefundOrders (int $ storeId ): array
162
162
{
163
- $ ordersRootId = $ this ->systemConfig ->getCommerceAccountId ($ storeId ) ?: $ this ->systemConfig ->getPageId ($ storeId );
164
163
$ this ->graphAPIAdapter
165
164
->setDebugMode ($ this ->systemConfig ->isDebugMode ($ storeId ))
166
165
->setAccessToken ($ this ->systemConfig ->getAccessToken ($ storeId ));
167
166
168
167
// Pull orders with refunds
168
+ $ ordersRootId = $ this ->systemConfig ->getCommerceAccountId ($ storeId ) ?: $ this ->systemConfig ->getPageId ($ storeId );
169
169
$ ordersWithRefunds = $ this ->graphAPIAdapter ->getOrders (
170
170
$ ordersRootId ,
171
171
false ,
@@ -202,14 +202,14 @@ public function pullRefundOrders(int $storeId)
202
202
* @return array Associative array containing the cancellation details with Facebook Order IDs as keys.
203
203
* @throws GuzzleException
204
204
*/
205
- public function pullCancelledOrders (int $ storeId )
205
+ public function pullCancelledOrders (int $ storeId ): array
206
206
{
207
- $ ordersRootId = $ this ->systemConfig ->getCommerceAccountId ($ storeId ) ?: $ this ->systemConfig ->getPageId ($ storeId );
208
207
$ this ->graphAPIAdapter
209
208
->setDebugMode ($ this ->systemConfig ->isDebugMode ($ storeId ))
210
209
->setAccessToken ($ this ->systemConfig ->getAccessToken ($ storeId ));
211
210
212
211
// Pull orders with cancellations
212
+ $ ordersRootId = $ this ->systemConfig ->getCommerceAccountId ($ storeId ) ?: $ this ->systemConfig ->getPageId ($ storeId );
213
213
$ ordersWithCancellations = $ this ->graphAPIAdapter ->getOrders (
214
214
$ ordersRootId ,
215
215
false ,
0 commit comments