Skip to content

Commit a8b45e2

Browse files
authored
Merge pull request #54 from BitBagCommerce/1.1
1.1
2 parents fad51a1 + 89aecce commit a8b45e2

24 files changed

+346
-38
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ jobs:
6161
-
6262
name: Output PHP version for Symfony CLI
6363
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
64-
65-
-
66-
name: Install certificates
67-
run: symfony server:ca:install
68-
64+
6965
-
7066
name: Run Chrome Headless
7167
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &

behat.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ default:
2020

2121
Behat\MinkExtension:
2222
files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"
23-
base_url: "https://127.0.0.1:8080/"
23+
base_url: "http://127.0.0.1:8080/"
2424
default_session: symfony
2525
javascript_session: panther
2626
sessions:

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@
5353
"dealerdirect/phpcodesniffer-composer-installer": false,
5454
"phpstan/extension-installer": true,
5555
"symfony/flex": true
56+
},
57+
"audit": {
58+
"ignore": [
59+
"PKSA-gs8r-6kz6-pp56",
60+
"PKSA-gnn4-pxdg-q76m",
61+
"PKSA-yhcn-xrg3-68b1",
62+
"PKSA-2wrf-1xmk-1pky",
63+
"PKSA-4g5g-4rkv-myqs"
64+
]
5665
}
5766
},
5867
"extra": {

config/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ parameters:
22
user_com.frontend_api_key: '%env(USER_COM_FRONTEND_API_KEY)%'
33
user_com.encryption_key: '%env(USER_COM_ENCRYPTION_KEY)%'
44
user_com.encryption_iv: '%env(USER_COM_ENCRYPTION_IV)%'
5-
5+
user_com.cookie_domain: '%env(USER_COM_COOKIE_DOMAIN)%'
6+
67
twig:
78
globals:
89
user_com_frontend_api_key: '%user_com.frontend_api_key%'

config/services/api.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@
2121
<argument type="service" id="monolog.logger.user_com"/>
2222
<argument type="service" id="bit_bag.sylius_user_com_plugin.manager.user_com_api_token_manager"/>
2323
</service>
24+
25+
<service id="bit_bag.sylius_user_com_plugin.openapi.factory" class="BitBag\SyliusUserComPlugin\OpenApi\OpenApiFactory" decorates="api_platform.openapi.factory">
26+
<argument type="service" id="bit_bag.sylius_user_com_plugin.openapi.factory.inner" />
27+
</service>
2428
</services>
2529
</container>

config/services/cookie.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
4+
<services>
5+
<defaults autowire="false" autoconfigure="false"/>
6+
<service id="bit_bag.sylius_user_com_plugin.cookie.cookie_queue" class="BitBag\SyliusUserComPlugin\Cookie\CookieQueue" />
7+
</services>
8+
</container>

config/services/event_subscriber.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,13 @@
1515
<argument type="service" id="monolog.logger.user_com"/>
1616
<tag name="kernel.event_subscriber"/>
1717
</service>
18+
19+
<service id="bit_bag.sylius_user_com_plugin.event_subscriber.cookie_flusher_subscriber" class="BitBag\SyliusUserComPlugin\EventSubscriber\CookieFlusherSubscriber">
20+
<argument type="service" id="bit_bag.sylius_user_com_plugin.cookie.cookie_queue" />
21+
<tag name="kernel.event_listener"
22+
event="kernel.response"
23+
method="onResponse"
24+
priority="0"/>
25+
</service>
1826
</services>
1927
</container>

config/services/manager.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
>
1010
<argument type="service" id="request_stack"/>
1111
<argument type="service" id="security.token_storage"/>
12+
<argument type="service" id="bit_bag.sylius_user_com_plugin.cookie.cookie_queue"/>
13+
<argument>%user_com.cookie_domain%</argument>
1214
</service>
1315

1416
<service

doc/adjustments.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ There is designated validator to check if request payload contains required fiel
1010
If there will be any field added by User.com, you can adjust this validator to check if this field is present in request payload.
1111
Also, in `BitBag\SyliusUserComPlugin\Assigner\AgreementsAssigner` you can adjust existing logic to assign agreements to customer in a way that suits your needs.
1212

13+
The endpoint is exposed in `Swagger` under `UserComAgreements`, making it easy to test and explore directly from the API documentation.
14+
15+
>If you use several channels, remember to select one of the available channels using the get method and parameters before using the API:
16+
`?_channel_code=CHANNEL_CODE`
17+
1318
```php
1419
public function assign(CustomerInterface $customer, array $agreements): void
1520
{

doc/functionalities.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ The **BitBagSyliusUserComPlugin** integrates **User.com** with Sylius-based stor
2222
### 4. Event-Driven System
2323
- Each customer interaction generates an **event**, which is stored and sent to **User.com** for automation and reporting.
2424

25-
### 5. Product Persistence & Feed Generation
25+
### 5. Product Persistence
2626
- **Persists products** within the system for accurate data reporting.
27-
- Generates a **product feed** that can be used for marketing and analytics purposes.
2827

2928
### 6. Tag Manager Script Injection
3029
- Allows users to **inject custom scripts** via **Tag Manager**.
3130
- Enables integration with **third-party tracking tools**.
3231

3332
### 7. User information object
3433
- you can use `user_com_customer_info` in browser console to check currently logged in customer data
34+
35+
### 8. Webhook Endpoint: Updating User Marketing Consents
36+
- Exposes a dedicated endpoint for handling User.com webhooks (`UserComAgreements` in `Swagger`),
37+
allowing the update of user marketing consents. By default, it manages the `subscribedToNewsletter` flag,
38+
but the mechanism is fully extensible to support additional types of consents.”

0 commit comments

Comments
 (0)