MenzzoReviewService
in package
Table of Contents
Properties
- $container : mixed
- $logger : mixed
Methods
- __construct() : mixed
- MenzzoReviewService constructor.
- onSaleConfirmed() : mixed
- onSaleProductsShipped() : mixed
- Handles the SaleProductsShippedEvent to trigger a webhook call if the store ID is 3 (Menzzo.fr).
- sendReviewWebhook() : mixed
- Sends a POST request to the review webhook with customer and order information.
Properties
$container
private
mixed
$container
$logger
private
mixed
$logger
Methods
__construct()
MenzzoReviewService constructor.
public
__construct(ContainerInterface $container, LoggerInterface $logger) : mixed
Parameters
- $container : ContainerInterface
- $logger : LoggerInterface
onSaleConfirmed()
public
onSaleConfirmed(mixed $event) : mixed
Parameters
- $event : mixed
onSaleProductsShipped()
Handles the SaleProductsShippedEvent to trigger a webhook call if the store ID is 3 (Menzzo.fr).
public
onSaleProductsShipped(SaleProductsShippedEvent $event) : mixed
This method is called when the mz.sale.products.shipped event is dispatched. It checks if the webhook functionality is enabled in the configuration. For each sale product in the event, if the store ID is 3, it sends the customer's details and order information to the review webhook.
Parameters
- $event : SaleProductsShippedEvent
sendReviewWebhook()
Sends a POST request to the review webhook with customer and order information.
public
sendReviewWebhook(string $customerFullName, string $customerEmail, string $orderIncrementId, string $locale, string $domain, string $orderType) : mixed
This method uses the configured webhook URL and authorization token to send customer details, including full name, email, and order ID, as a JSON payload.
Parameters
- $customerFullName : string
- $customerEmail : string
- $orderIncrementId : string
- $locale : string
- $domain : string
- $orderType : string