Route [aimeos_page] not defined

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
nvdid
Posts: 15
Joined: 14 Feb 2024, 20:56

Route [aimeos_page] not defined

Post by nvdid » 05 Mar 2024, 19:39

Hi dear Aimeos team

I'm working with the aimeos headless project. I created a payment provider so I can simply redirect the user to a payment gateway outside my website. The order is created ok. But opening the return url ($this->getConfigValue(array('payment.url-success'))) shows the error Route [aimeos_page] not defined:

Code: Select all

{
    "message": "Route [aimeos_page] not defined.",
    "exception": "Spatie\\LaravelIgnition\\Exceptions\\ViewException",
    "file": "/var/www/aimeos/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php",
    "line": 477,
    "trace": [
        {
            "file": "/var/www/aimeos/vendor/aimeos/aimeos-laravel/src/helpers.php",
            "line": 30,
            "function": "route",
            "class": "Illuminate\\Routing\\UrlGenerator",
            "type": "->"
        },
        {
            "file": "/var/www/aimeos/vendor/aimeos/aimeos-laravel/views/base.blade.php",
            "line": 89,
            "function": "airoute"
        },
        {
            "file": "/var/www/aimeos/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php",
            "line": 124,
            "function": "require"
        },
...
Aimeos: 2023.10
PHP: 8.1.2
Env: Linux

Gagik
Posts: 38
Joined: 05 Dec 2023, 06:58

Re: Route [aimeos_page] not defined

Post by Gagik » 06 Mar 2024, 05:31

Hi.

By default in Aimeos doesn't exist route with the name 'aimeos_page'. You can check more details about your project routes using 'php artisan route:list' in the terminal..

User avatar
nvdid
Posts: 15
Joined: 14 Feb 2024, 20:56

Re: Route [aimeos_page] not defined

Post by nvdid » 06 Mar 2024, 16:36

Gagik wrote: 06 Mar 2024, 05:31 Hi.

By default in Aimeos doesn't exist route with the name 'aimeos_page'. You can check more details about your project routes using 'php artisan route:list' in the terminal..
Can you please hint more on this?

I tried to define the routes as said in https://github.com/aimeos/ai-cms-grapesjs#laravel:

Code: Select all

Route::match(['GET', 'POST'], '{cmspath?}', '\Aimeos\Shop\Controller\PageController@indexAction')
    ->name('aimeos_page')->where( 'cmspath', '.*' );
I don't know if it was effective but now I am getting the error:

Code: Select all

Spatie\LaravelIgnition\Exceptions\ViewException: Route [aimeos_shop_account] not defined.
I can't connect the dots. I am working on the headless project. What I need eventually is being able to somehow run the updateSync and other methods defined in the payment provider to finalize the payment. Also I want to write a simple thank you page by myself and being the lowest involved with the html templates. Couldn't find documentation on the matter about headless projects. I don't know what is missing in my project.

Thanks for your help

User avatar
nvdid
Posts: 15
Joined: 14 Feb 2024, 20:56

Re: Route [aimeos_page] not defined

Post by nvdid » 07 Mar 2024, 19:07

Reading Stripe Payment Gateway:
If you are using the Aimeos headless distribution, you can't use any of the Omnipay drivers as they need the HTML frontend. For pure PWA JS applications, you have to use JS-only solutions like Stripe JS, which you have to add to your PWA yourself.
makes me think if the value url-success is ever intended to work with the headless project. If so, how can I call the service provider methods in some laravel controller of mine, and isn't it against the pattern?

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Route [aimeos_page] not defined

Post by aimeos » 08 Mar 2024, 08:23

No, the Stripe payment provider implementation requires the HTML frontend and doesn't work in headless environments like described in the docs. You need your own JS only implementation using the Stripe API.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
nvdid
Posts: 15
Joined: 14 Feb 2024, 20:56

Re: Route [aimeos_page] not defined

Post by nvdid » 08 Mar 2024, 11:38

aimeos wrote: 08 Mar 2024, 08:23 No, the Stripe payment provider implementation requires the HTML frontend and doesn't work in headless environments like described in the docs. You need your own JS only implementation using the Stripe API.
Right. I'm not trying to use Stripe. What I need in my headless project is to simply redirect the user to an external gateway website after the order is created, then dealing with the result when user is back to the return url, by setting the order status to either PAY_RECEIVED or whatever.

url-success seems to not make sense in headless. Please tell me the correct way to do the following:
1- For sending the user to the external gateway.. should I use a custom return url (and manage stuff in a laravel controller), or url-success would work.
2- When the user is sent back to the return url, I don't want the aimeos-html stuff for that, just a simple thank you page that I can write somewhere in my extension or project. So how can I have my own html page, and also invoke necessary methods of the payment provider (like updateSync) so the order status is updated.

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Route [aimeos_page] not defined

Post by aimeos » 12 Mar 2024, 08:31

Like said, you have to use the StripeJS API in your PWA yourself. Parts of the Aimeos Stripe service payment provider may helpful but you have to adapt it and remove most of the code that is referencing the HTML frontend and it's URLs.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply