Skip to content

Commit 001a04a

Browse files
authored
Merge pull request #166 from magento-commerce/feature/decouple-business-from-sales-extension
decouple Meta_BusinessExtension from Meta_Sales
2 parents 28d8cea + 9258ba6 commit 001a04a

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
namespace Meta\BusinessExtension\Helper;
1919

2020
use CURLFile;
21-
use Meta\Sales\Model\FacebookOrder;
2221
use Meta\BusinessExtension\Model\System\Config as SystemConfig;
2322
use GuzzleHttp\Client;
2423
use GuzzleHttp\Exception\BadResponseException;
@@ -29,6 +28,9 @@ class GraphAPIAdapter
2928
{
3029
const GET_ORDERS_LIMIT = 25;
3130

31+
/** @var string */
32+
private const ORDER_STATE_CREATED = 'STATE_CREATED';
33+
3234
/**
3335
* @var mixed
3436
*/
@@ -375,7 +377,7 @@ public function getOrders($pageId, $cursorAfter = false)
375377
];
376378
$request = [
377379
'access_token' => $this->accessToken,
378-
'state' => FacebookOrder::STATE_CREATED,
380+
'state' => self::ORDER_STATE_CREATED,
379381
'fields' => implode(',', $requestFields),
380382
'limit' => self::GET_ORDERS_LIMIT,
381383
];
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
/* global fbq */
12
define([
23
'jquery'
34
], function ($) {
45
'use strict';
56

67
return function (config) {
7-
8-
var browserEventData = config.browserEventData;
9-
var eventId = crypto.randomUUID();
8+
var browserEventData = config.browserEventData,
9+
eventId = crypto.randomUUID();
1010

1111
config.payload.eventId = eventId;
1212

13-
let browserPayload = config.browserEventData.payload
13+
let browserPayload = config.browserEventData.payload;
14+
1415
browserPayload.source = browserEventData.source;
1516

1617
browserPayload.pluginVersion = browserEventData.pluginVersion;
@@ -24,12 +25,12 @@ define([
2425
$.ajax({
2526
showLoader: true,
2627
url: config.url,
27-
type: "POST",
28+
type: 'POST',
2829
data: config.payload,
29-
dataType: "json",
30+
dataType: 'json',
3031
error: function (error) {
31-
console.log(error)
32+
console.log(error);
3233
}
3334
});
34-
}
35+
};
3536
});

0 commit comments

Comments
 (0)