Aimeos Headless - Route [aimeos_shop_confirm] not defined.
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Aimeos Headless - Route [aimeos_shop_confirm] not defined.
Hi,
I am exploring the package for an upcoming project. Aimeos Headless is freshly pulled via composer aimeos/aimeos-headless, without any modification.
I am trying to complete an order via API calls. These steps have been successfully completed: Add product to basket; Add address to basket; Add payment to basket; Save/Complete the basket.
Next, while posting to jsonapi/order to create an order invoice, it responds an error of "#54 main
Route [aimeos_shop_confirm] not defined."
May I know if anything is misconfigured or if I have mistaken the ordering flow.
Thanks.
I am exploring the package for an upcoming project. Aimeos Headless is freshly pulled via composer aimeos/aimeos-headless, without any modification.
I am trying to complete an order via API calls. These steps have been successfully completed: Add product to basket; Add address to basket; Add payment to basket; Save/Complete the basket.
Next, while posting to jsonapi/order to create an order invoice, it responds an error of "#54 main
Route [aimeos_shop_confirm] not defined."
May I know if anything is misconfigured or if I have mistaken the ordering flow.
Thanks.
Re: Aimeos Headless - Route [aimeos_shop_confirm] not defined.
Seems like a problem due to the disabled standard routes in the headless distribution. The route is used in the JSON API implementation as target for redirects if you use an external payment service provider which doesn't provide a JS client like Stripe. Can you please add these lines to your ./routes/web.php and see if it fixes the problem?
Code: Select all
Route::group( ['prefix' => 'shop', 'middleware' => ['web']], function() {
Route::match( array( 'GET', 'POST' ), 'confirm/{code?}', array(
'as' => 'aimeos_shop_confirm',
'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction'
) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
});
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Aimeos Headless - Route [aimeos_shop_confirm] not defined.
It worked at the first place. But then I wanted to try payment, and pulled "aimeos/ai-payments omnipay/stripe". I guess ai-payments has recently updated, and is incompatible with the headless distribution. It crashed something, and indeed showed a message like "unrecoverable error". (Likely crashed some routes. I could no longer logging into the admin dashboard again, always 404.)aimeos wrote: ↑05 Apr 2023, 13:42 Seems like a problem due to the disabled standard routes in the headless distribution. The route is used in the JSON API implementation as target for redirects if you use an external payment service provider which doesn't provide a JS client like Stripe. Can you please add these lines to your ./routes/web.php and see if it fixes the problem?
Code: Select all
Route::group( ['prefix' => 'shop', 'middleware' => ['web']], function() { Route::match( array( 'GET', 'POST' ), 'confirm/{code?}', array( 'as' => 'aimeos_shop_confirm', 'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction' ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); });
So, I started again with a fresh headless distribution. But the route fix does not work this time. It returns 404 saying empty basket.
This also brings me more questions:
- Should I use aimeos/aimeos or aimeos/aimeos-laravel instead? Seems they are more up-to-date. I have also tested on the aimeos/aimeos distribution, where I don't find the routing issue on 'aimeos_shop_confirm not found'.
- What does aimeos/ai-payments actually does? I don't seem seeing it handling anything for me with Stripe.
Re: Aimeos Headless - Route [aimeos_shop_confirm] not defined.
I have figured out the empty basket issue. It is fixed by changing the APP_URL.
Re: Aimeos Headless - Route [aimeos_shop_confirm] not defined.
If you use the headless distribution, the ai-payments extension isn't suitable at all because it requires the HTML frontend. You have to integrate Stripe using the Stripe JS API directly in your SPA instead.spider wrote: ↑05 Apr 2023, 17:41 It worked at the first place. But then I wanted to try payment, and pulled "aimeos/ai-payments omnipay/stripe". I guess ai-payments has recently updated, and is incompatible with the headless distribution. It crashed something, and indeed showed a message like "unrecoverable error". (Likely crashed some routes. I could no longer logging into the admin dashboard again, always 404.)
The headless distribution is newer than the other two options but fully supported and always at the same version level. The Aimeos standalone distribution is the easiest to install and you don't have to code your own frontend (or adapt the Vue or React frontends offered by Skynet). The Aimeos Laravel package is best if you already have an existing Laravel application and want to integrate e-commerce features.
Like said, not in the headless distribution. You can only use it in combination with the standalone distribution or the Laravel package (both provide the HTML frontend).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Aimeos Headless - Route [aimeos_shop_confirm] not defined.
Thank you for the clarification.
P.S. It would be appreciated if Aimeos documentation could have explained in more details.
P.S. It would be appreciated if Aimeos documentation could have explained in more details.
Re: Aimeos Headless - Route [aimeos_shop_confirm] not defined.
We've added a note about this in the docs:
https://aimeos.org/docs/latest/manual/services/#payment
https://aimeos.org/docs/latest/manual/services/#payment
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star