qenta-cee / magento2-qcp

QENTA Checkout Page extension for Magento 2
GNU General Public License v2.0
12 stars 10 forks source link

Treat ReservedOrderId as String #21

Closed mwr closed 7 years ago

mwr commented 7 years ago

the Magento reserved_order_id field is not to be treated as a numeric field. It should be treated as a string because it can contain characters.

By using sprintf('%010d', $orderId) the reserved_order_id will be treated incorrectly. The Magento reserved_order_id field does not contain an actual integer value. Moreover it cotains the order_increment_id which is the human readable order reference send to the customer. Magento allows this increment_id to have Characters so an increment_id like this ORDER-10000005 is totally possible.

jakubpolomsky commented 7 years ago

Hello, thank you for your input. I reviewed your pull request but I have to close it. I will do an update as well. Better approach would be to change the %010d into %010s so that the format remains. Possibly even %.010s so that the length of the order reference doesn't exceed 10 chars. If you look at the Optional request parameters and to be precise orderReference here you can see there indeed are some payment methods not allowing longer or shorter strings.

Thanks once again!