diff --git a/DataLayer/Event/Purchase.php b/DataLayer/Event/Purchase.php index 7a66a60..ef42d55 100644 --- a/DataLayer/Event/Purchase.php +++ b/DataLayer/Event/Purchase.php @@ -55,7 +55,8 @@ public function get(): array 'tax' => $this->priceFormatter->format((float)$order->getTaxAmount()), 'shipping' => $this->priceFormatter->format((float)$order->getShippingAmount()), 'coupon' => $order->getCouponCode(), - 'items' => $this->orderItems->setOrder($order)->get() + 'payment_method' => $order->getPayment()?->getMethod() ?? '', + 'items' => $this->orderItems->setOrder($order)->get(), ] ]; } diff --git a/DataLayer/Event/Refund.php b/DataLayer/Event/Refund.php index ece5ac5..1eb1a3b 100644 --- a/DataLayer/Event/Refund.php +++ b/DataLayer/Event/Refund.php @@ -42,7 +42,8 @@ public function get(): array 'tax' => $this->priceFormatter->format((float)$order->getTaxAmount()), 'shipping' => $this->priceFormatter->format((float)$order->getShippingAmount()), 'coupon' => $order->getCouponCode(), - 'items' => $this->orderItems->setOrder($order)->get() + 'payment_method' => $order->getPayment()?->getMethod() ?? '', + 'items' => $this->orderItems->setOrder($order)->get(), ] ]; } diff --git a/DataLayer/Mapper/OrderDataMapper.php b/DataLayer/Mapper/OrderDataMapper.php index b458503..cd98aae 100644 --- a/DataLayer/Mapper/OrderDataMapper.php +++ b/DataLayer/Mapper/OrderDataMapper.php @@ -61,6 +61,7 @@ public function mapByOrder(OrderInterface $order): array 'coupon' => $order->getCouponCode(), 'date' => date("Y-m-d", strtotime($order->getCreatedAt())), 'paymentType' => $this->getPaymentType($order), + 'payment_method' => $order->getPayment()?->getMethod() ?? '', 'customer' => $this->getCustomerData($order), ]; } diff --git a/DataLayer/Tag/Order/Order.php b/DataLayer/Tag/Order/Order.php index 6aa545d..6bbcd33 100644 --- a/DataLayer/Tag/Order/Order.php +++ b/DataLayer/Tag/Order/Order.php @@ -46,7 +46,8 @@ public function merge(): array 'shipping' => $this->priceFormatter->format((float)$order->getShippingAmount()), 'affiliation' => $this->config->getStoreName(), 'transaction_id' => $order->getIncrementId(), - 'coupon' => $order->getCouponCode() + 'coupon' => $order->getCouponCode(), + 'payment_method' => $order->getPayment()?->getMethod() ?? '', ]; }