Skip to content

Magento\Sales\Model\Order\Payment is missing implementation of method getEntityId() #40342

@rikinpatel

Description

@rikinpatel

Magento\Sales\Model\Order\Payment is missing implementation of method getEntityId()

Preconditions

  • Magento version : 2.4.7

Steps to reproduce

  1. Place an order.
  2. add event sales_order_payment_place to trigger some code.
  3. Attempt to retrieve the entity_id from the sales_order_payment table using the following method in any class:
    $order->getPayment()->getEntityId() from any class.

Expected result

The method should return the actual entity_id value from thesales_order_payment table.

Actual result

It returns NULL

Root Cause

Upon investigation, I found that:

The interface \Magento\Sales\Api\Data\OrderPaymentInterface declares the method getEntityId().

Image

However, there is no implementation of this method in the class Magento\Sales\Model\Order\Payment.

For comparison:

The \Magento\Sales\Api\Data\OrderAddressInterface interface also declares getEntityId(), and its implementation exists in the class \Magento\Sales\Model\Order\Address.

Image

Request

Could you please review this and consider adding the missing implementation for getEntityId() in Magento\Sales\Model\Order\Payment?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions