Skip to content

API REST and Reserved Order Id #19101

Closed
Closed
@davidlhoumaud

Description

@davidlhoumaud

Preconditions (*)

  1. Magento CE 2.2.6 without sample data is installed
  2. PHP 7.0.1

Steps to reproduce (*)

  1. PUT REQUEST
  2. http://magento.host/rest/V1/carts/mine
  3. in the cart you must add a reserved_order_id (for example: 000000653)

Expected result (*)

Update the cart with a reserved order number with the left pad 0 eg: 000000651

Actual result (*)

Can not update cart with a reserved order number

My temporary solution

in the file CartInterface.php
There is a typing error Doctrine
The type should be a string of characters and not integer

/**
     * Returns the reserved order ID for the cart.
     *
     * @return int|null Reserved order ID. Otherwise, null.
     */
    public function getReservedOrderId();

    /**
     * Sets the reserved order ID for the cart.
     *
     * @param int $reservedOrderId
     * @return $this
     */
    public function setReservedOrderId($reservedOrderId);

We must replace the comments Doctrine by here

/**
     * Returns the reserved order ID for the cart.
     *
     * @return string|null Reserved order ID. Otherwise, null.
     */
    public function getReservedOrderId();

    /**
     * Sets the reserved order ID for the cart.
     *
     * @param string $reservedOrderId
     * @return $this
     */
    public function setReservedOrderId($reservedOrderId);

I make the patch with the following SED command
cat vendor/magento/module-quote/Api/Data/CartInterface.php" | sed -e "s/int\|null Reserved order ID/string\|null Reserved order ID/g" -e "s/int \$reservedOrderId/string \$reservedOrderId/g"

Metadata

Metadata

Labels

Component: QuoteFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions