mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 50 forks source link

[ISSUE] Base Mollie Payment Fee & Tax not added to Order Data with plugin #660

Closed WouterSteen closed 11 months ago

WouterSteen commented 1 year ago

Describe the bug In this file: AddPaymentFeeToOrder.php the mollie_payment_fee is added to the order data with an afterGet plugin in this file: . I think it should be the case that we also add the base_mollie_payment_fee and base_mollie_payment_fee_tax. Or am I missing something here? :)

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Do an orderGetById
  2. Check the data

Expected behavior

object(Magento\Sales\Api\Data\OrderExtension)[2638]
  protected '_data' => 
    array (size=9)
----- removed stuff -----
      'mollie_payment_fee' => string '2.6500' (length=6)
      'mollie_payment_fee_tax' => string '0.0000' (length=6)
      'base_mollie_payment_fee' => string '2.6500' (length=6)
      'base_mollie_payment_fee_tax' => string '0.0000' (length=6)

Actual behavior

object(Magento\Sales\Api\Data\OrderExtension)[2638]
  protected '_data' => 
    array (size=9)
----- removed stuff -----
      'mollie_payment_fee' => string '2.6500' (length=6)
      'mollie_payment_fee_tax' => string '0.0000' (length=6)

Temp patched it by doing this:

    private function addMolliePaymentFeeTo(OrderInterface $entity)
    {
        $extensionAttributes = $this->getExtensionAttributes($entity);
        $extensionAttributes->setMolliePaymentFee($entity->getData('mollie_payment_fee'));
        $extensionAttributes->setMolliePaymentFeeTax($entity->getData('mollie_payment_fee_tax'));

        $extensionAttributes->setBaseMolliePaymentFee($entity->getData('base_mollie_payment_fee'));
        $extensionAttributes->setBaseMolliePaymentFeeTax($entity->getData('base_mollie_payment_fee_tax'));

        $entity->setExtensionAttributes($extensionAttributes);
    }
Frank-Magmodules commented 1 year ago

Hello, @WouterSteen! I appreciate you bringing up this issue. I will discuss your comment with the development team and provide a prompt response soon. Thank you!

Frank-Magmodules commented 11 months ago

Hello, @WouterSteen! I am happy to inform you that we have recently launched the latest version, v2.29.0, which includes a solution for the reported issue. For the time being, I will mark the issue as closed. However, if you encounter any further problems related to this topic, please don't hesitate to reopen it. Thank you for your patience!

WouterSteen commented 10 months ago

Nice thanks !