magento2
magento2 copied to clipboard
Notice: Array to string conversion when using order rest API
Preconditions
Magento EE 2.1.2 / Magento CE 2.1.2
Steps to reproduce
- Make an order using PayPal Express as a payment method and then pay by entering credit card information within Paypal
- Try to access this particular order via Magento REST api : /rest/V1/orders
Expected result
- The API returns a JSON response of corresponding order
Actual result
- You get the following error : Notice: Array to string conversion in vendor/magento/framework/Reflection/TypeCaster.php on line 34
PR : https://github.com/magento/magento2/pull/8311
Hi, @fxdegroot, thanks for reporting.
Do you have payment with enabled Vault feature?
We are closing this issue because it hasn’t been updated in more than two weeks.
If you still can reproduce the issue, please, be free to reopen it.
I'm trying to integrate Magento 2.1 with a third party accounting/inventory/pos software and I'm getting the same error, here is the whole error message:
{"message":"Notice: Array to string conversion in \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/Reflection\/TypeCaster.php on line 34","trace":"
#0 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/Reflection\/TypeCaster.php(34): Magento\\Framework\\App\\ErrorHandler->handler(8, 'Array to string...', '\/var\/www\/live\/p...', 34, Array)\n
#1 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/Reflection\/DataObjectProcessor.php(115): Magento\\Framework\\Reflection\\TypeCaster->castValueToType(Array, 'string')\n
#2 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/Reflection\/DataObjectProcessor.php(107): Magento\\Framework\\Reflection\\DataObjectProcessor->buildOutputDataArray(Object(Magento\\Sales\\Model\\Order\\Payment\\Interceptor), '\\\\Magento\\\\Sales\\\\...')\n
#3 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/Reflection\/DataObjectProcessor.php(113): Magento\\Framework\\Reflection\\DataObjectProcessor->buildOutputDataArray(Object(Magento\\Sales\\Model\\Order), '\\\\Magento\\\\Sales\\\\...')\n
#4 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/Webapi\/ServiceOutputProcessor.php(107): Magento\\Framework\\Reflection\\DataObjectProcessor->buildOutputDataArray(Object(Magento\\Sales\\Model\\ResourceModel\\Order\\Collection), '\\\\Magento\\\\Sales\\\\...')\n
#5 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/Webapi\/ServiceOutputProcessor.php(59): Magento\\Framework\\Webapi\\ServiceOutputProcessor->convertValue(Object(Magento\\Sales\\Model\\ResourceModel\\Order\\Collection), '\\\\Magento\\\\Sales\\\\...')\n
#6 \/var\/www\/live\/public_html\/magento2\/app\/code\/Magento\/Webapi\/Controller\/Rest.php(308): Magento\\Framework\\Webapi\\ServiceOutputProcessor->process(Object(Magento\\Sales\\Model\\ResourceModel\\Order\\Collection), 'Magento\\\\Sales\\\\A...', 'getList')\n
#7 \/var\/www\/live\/public_html\/magento2\/app\/code\/Magento\/Webapi\/Controller\/Rest.php(216): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n
#8 \/var\/www\/live\/public_html\/magento2\/var\/generation\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(37): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n
#9 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/App\/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n
#10 \/var\/www\/live\/public_html\/magento2\/lib\/internal\/Magento\/Framework\/App\/Bootstrap.php(258): Magento\\Framework\\App\\Http->launch()\n
#11 \/var\/www\/live\/public_html\/magento2\/pub\/index.php(37): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n
#12 {main}"}
We were able to sync products but not orders. Is this a bug? Cheers.