Skip to content

\Magento\Quote\Model\Quote\Payment\ToOrderPayment Failure if payment has additionalData #37295

Open
@thomas-kl1

Description

@thomas-kl1

Preconditions and environment

  • Any version of Magento
  • Anything else that would help a developer reproduce the bug

Steps to reproduce

  • Add additionalInformation to the \Magento\Quote\Api\Data\PaymentInterface object in place order action
  • When placing order, Magento copy quote payment to order payment
  • \Magento\Quote\Model\Quote\Payment\ToOrderPayment::convert
  • \Magento\Framework\DataObject\Copy::getDataFromFieldset
  • This method is used:
case $source instanceof DataObject:
    $value = $source->getDataUsingMethod($code);
    break;

\Magento\Quote\Api\Data\PaymentInterface & \Magento\Sales\Api\Data\OrderPaymentInterface shares the same definition for additional property:

    /**
     * Get payment additional details
     *
     * @return string[]|null
     */
    public function getAdditionalData();

    /**
     * Set payment additional details
     *
     * @param string $additionalData
     * @return $this
     */
    public function setAdditionalData($additionalData);

Obviously, copying array to string will impact the save action of the order. When the order is saved, the payment relation is processed and throws an error of array to string conversion.

Expected result

Order is placed.

Actual result

An error occurred and the order is not placed.

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkComponent: QuoteIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions