82 $this->config = $scopeConfig;
92 if ($this->config->getValue(
'rss/order/status', \
Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
103 $this->order = $this->getOrder();
104 if ($this->order ===
null) {
105 throw new \InvalidArgumentException(
'Order not found.');
107 return array_merge($this->
getHeader(), $this->getEntries());
115 $order = $this->getOrder();
120 return 'rss_order_status_data_' . $key;
134 protected function getOrder()
141 $json = base64_decode((
string)$this->request->getParam(
'data'));
143 $data = json_decode($json,
true);
145 if (!is_array(
$data)) {
149 if (!isset(
$data[
'order_id']) || !isset(
$data[
'increment_id']) || !isset(
$data[
'customer_id'])) {
154 $order = $this->orderFactory->create();
157 if (
$order->getIncrementId() !==
$data[
'increment_id'] ||
$order->getCustomerId() !==
$data[
'customer_id']) {
170 protected function getEntries()
187 .
__(
'Comment: %1<br/>',
$result[
'comment']) .
'</p>';
188 $url = $this->urlBuilder->getUrl(
189 'sales/order/' . $urlAppend,
190 [
'order_id' => $this->order->getId()]
195 $title =
__(
'Order #%1 created at %2', $this->order->getIncrementId(), $this->localeDate->formatDate(
196 $this->order->getCreatedAt()
198 $url = $this->urlBuilder->getUrl(
'sales/order/view', [
'order_id' => $this->order->getId()]);
199 $description =
'<p>' .
__(
'Current Status: %1<br/>', $this->order->getStatusLabel()) .
200 __(
'Total: %1<br/>', $this->order->formatPrice($this->order->getGrandTotal())) .
'</p>';
204 return [
'entries' => $entries];
214 $title =
__(
'Order # %1 Notification(s)', $this->order->getIncrementId());
215 $newUrl = $this->urlBuilder->getUrl(
'sales/order/view', [
'order_id' => $this->order->getId()]);
217 return [
'title' =>
$title,
'description' =>
$title,
'link' => $newUrl,
'charset' =>
'UTF-8'];