subscribepro / subscribepro-magento2-ext

Subscribe Pro Magento 2 Integration Extension
MIT License
24 stars 22 forks source link

Error "bad request" when updating qty, frequency, ship date on native My Subscriptions page w/ Magento 2.4.4 #148

Closed garthbrantley closed 2 years ago

garthbrantley commented 2 years ago

https://robert.sp1.dev//rest/V1/swarming_subscribepro/me/subscriptions/update-next-order-date curl 'https://robert.sp1.dev/rest/V1/swarming_subscribepro/me/subscriptions/update-next-order-date' -X POST -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:103.0) Gecko/20100101 Firefox/103.0' -H 'Accept: /' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: https://robert.sp1.dev' -H 'Connection: keep-alive' -H 'Referer: https://robert.sp1.dev/subscribepro/customer/subscriptions/' -H 'Cookie: AMCV_8F99160E571FC0427F000101%40AdobeOrg=-1124106680%7CMCIDTS%7C19231%7CMCMID%7C56197231418945290903654937056138844783%7CMCAAMLH-1662132547%7C7%7CMCAAMB-1662132547%7C6G1ynYcLPuiQxYZrsz_pkqfLG9yMXBpb2zX5dvJdYQJzPXImdj0y%7CMCOPTOUT-1661534947s%7CNONE%7CMCSYNCSOP%7C411-19236%7CvVersion%7C5.2.0; private_content_version=490f5c4ffe34c3d0ccd62d0ba8e2bd69; PHPSESSID=2579d3d9bc3375e6eebff182ade96047; form_key=KBfpjK3KXWFQrzzX; mage-cache-storage=%7B%7D; mage-cache-storage-section-invalidation=%7B%7D; mage-messages=; recently_viewed_product=%7B%7D; recently_viewed_product_previous=%7B%7D; recently_compared_product=%7B%7D; recently_compared_product_previous=%7B%7D; product_data_storage=%7B%7D; section_data_ids=%7B%22cart%22%3A1661529104%2C%22directory-data%22%3A1661528904%2C%22customer%22%3A1661527649%2C%22captcha%22%3A1661529104%2C%22last-ordered-items%22%3A1661529104%2C%22instant-purchase%22%3A1661529104%7D; login_redirect=https%3A%2F%2Frobert.sp1.dev%2Fcheckout%2F; X-Magento-Vary=9bf9a599123e6402b85cde67144717a08b817412; form_key=KBfpjK3KXWFQrzzX; mage-cache-sessid=true; AMCVS_8F99160E571FC0427F000101%40AdobeOrg=1' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers' --data-raw '{"subscriptionId":248787,"nextOrderDate":"2022-08-31"}' { "message": "An error occurred while updating next order date.", "trace": "#0 [internal function]: Swarming\SubscribePro\Service\SubscriptionManagement->updateNextOrderDate(2, 248787, '2022-08-31')\n#1 /var/www/html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)\n#2 /var/www/html/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))\n#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->callParent('dispatch', Array)\n#5 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#6 /var/www/html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->callPlugins('dispatch', Array, Array)\n#7 /var/www/html/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#8 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()\n#9 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()\n#10 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#11 {main}" }

0 [internal function]: Swarming\SubscribePro\Service\SubscriptionManagement->updateNextOrderDate(2, 248787, '2022-08-31')

1 /var/www/html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)

2 /var/www/html/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))

3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))

4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)

5 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

6 /var/www/html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)

7 /var/www/html/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

8 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()

9 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()

10 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))

11 {main}

Please enter a first name. Field: firstName Value: Exception Class SP\Core\Exception\Customer\CustomerManagerException Hidden Error Message Please enter a first name. Field: firstName Value: Stack Trace

0 /app/vendor/subscribepro/platform-core/src/Service/Customer/CustomerManager.php(345): SP\Core\Service\Customer\CustomerManager->handleValidatorErrors(Object(Symfony\Component\Validator\ConstraintViolationList))

1 /app/vendor/subscribepro/platform-core/src/Service/Customer/CustomerManager.php(395): SP\Core\Service\Customer\CustomerManager->createOrUpdateCustomerAddress(Object(Proxies__CG__\SP\Core\Entity\Regional\Customer\Customer), Object(SP\Core\Entity\Regional\Customer\Address))

2 /app/src/SFC/SubscriptionsApiBundle/Helper/SubscriptionHelper.php(357): SP\Core\Service\Customer\CustomerManager->createOrUpdateCustomerAddressFromArray(Object(Proxies__CG__\SP\Core\Entity\Regional\Customer\Customer), Array)

3 /app/src/SFC/SubscriptionsApiBundle/Helper/SubscriptionHelper.php(251): SFC\SubscriptionsApiBundle\Helper\SubscriptionHelper->mapSubscriptionAssociations(Object(SP\Core\Entity\Regional\ProductSubscription\Subscription), Array)

4 /app/src/SFC/SubscriptionsApiBundle/Controller/Api/SubscriptionController.php(544): SFC\SubscriptionsApiBundle\Helper\SubscriptionHelper->updateSubscriptionFromApiRequest(Object(SP\Core\Entity\Regional\ProductSubscription\Subscription), Array, Array)

5 /app/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(135): SFC\SubscriptionsApiBundle\Controller\Api\SubscriptionController->postUpdateAction(Object(Symfony\Component\HttpFoundation\Request), '248787')

6 /app/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(57): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)

7 /app/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php(67): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

8 /app/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(183): Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

9 /app/web/app.php(26): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))

10 {main}

garthbrantley commented 2 years ago

Not reproducible.