- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
custom webapi routing
Hi
I'm writing a webservice as part of a hosted payment page solution for magento2
I need the web service to be called as part of the checkout process, after placeOrder.
I'm having problems getting control of the routing.
My initial url was within cart (rest/default/V1/carts/mine/myservice) , but that led to problems with the forced parameter card_id, and the fact the cart is cleared by placeOrder.
So I think I need the url to be in my own space, like rest/default/V1/hostedservice/myservice
I can't get this url to have a recognised route.
I've configured webapi.xml, the interface that implements the method to be called, and the corresponding class and method.
I'm unclear whether routes.xml should play a role in the solution...
<store-url>/<store-code>/<front-name>/<controller-name>/<action-name>
This pattern doesn't seem to match the url pattern generated client side by module-checkout/view/frontend/web/js/model/url-builder.js
/var/www/html/magento/generated/code/Magento/Quote/Model/Webapi/ParamOverriderCartId/Proxy.php
which causes a 404
Martin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: custom webapi routing
The problem was I had left this configuration in webapi.xml...
<data> <parameter name="cartId" force="true">%cart_id%</parameter> </data>