Page 1 of 2

updateSync Function Route Address

Posted: 21 Jun 2021, 13:07
by Kappa.yahyya
Hi



Iam working on aimeos/laravel version (on php 7.4).



I need to verify payments on web application after SCA payment is done by client(ReactJs).
So I have to call a Webservice to tell Aimeos to change the payment status .

Aimeos has a function called updateSync on payment providers for this .



But my problem is I could not find a Route Address or a Function calling it.
I don’t know how should i call it .

 Searched docs but did't help.

Much appreciated your time and if this is not Aimeos related - please feel free to point out at the concept or relevant documentation.

Re: updateSync Function Route Address

Posted: 22 Jun 2021, 07:33
by aimeos
The updatePush() method might be more suitable as there's a route for that. The updateSync() method is automatically called if the user opens the checkout confirmation page in his browser.

Re: updateSync Function Route Address

Posted: 24 Jun 2021, 09:07
by akropivko
aimeos wrote: 22 Jun 2021, 07:33 The updatePush() method might be more suitable as there's a route for that.
Could you please clarify what route is for the updatePush() method?
To be more clear, what URL I can use to call the updatePush() of my service decorator?

Re: updateSync Function Route Address

Posted: 26 Jun 2021, 06:57
by aimeos
Here's the route for the checkout update component that will call updatePush():
https://github.com/aimeos/aimeos-larave ... #L140-L150

You can use this to generate the URL for this route:

Code: Select all

route('aimeos_shop_update')

Re: updateSync Function Route Address

Posted: 25 Jul 2021, 11:37
by akropivko
aimeos wrote: 26 Jun 2021, 06:57 You can use this to generate the URL for this route:

Code: Select all

route('aimeos_shop_update')
ok, I finally did the updatePush method for my project. I can update the Aimeos documentation with a quick step-by-step example if you need. What is the best way to do this?

Re: updateSync Function Route Address

Posted: 25 Jul 2021, 12:01
by aimeos

Re: updateSync Function Route Address

Posted: 16 Mar 2022, 04:10
by MattWoodward
Currently looking for an example of using UpdatePush where this can be called externally and have variables passed in (e.g. order_id, status etc) - was the above example ever provided? I cant see a PR in GitHub for it?

Re: updateSync Function Route Address

Posted: 16 Mar 2022, 06:42
by aimeos
There was no PR yet. Also "route('aimeos_shop_update')" is Laravel specific if the URL should be generated from outside of Aimeos. Within an Aimeos payment service provider, the "update" URL is automatically injected here:
https://github.com/aimeos/aimeos-core/b ... #L124-L143

Re: updateSync Function Route Address

Posted: 16 Mar 2022, 08:29
by MattWoodward
Fair enough, thanks for updating. When I echo'd the route it appears this is the root of the site by default.

Code: Select all

	'routes' => [
		// Docs: https://aimeos.org/docs/latest/laravel/extend/#custom-routes
		// Multi-sites: https://aimeos.org/docs/latest/laravel/customize/#multiple-shops
		'admin' => ['domain' => '{site}', 'prefix' => 'admin', 'middleware' => ['web']],
		'jqadm' => ['domain' => '{site}', 'prefix' => 'admin/jqadm', 'middleware' => ['web', 'auth']],
		'jsonadm' => ['domain' => '{site}', 'prefix' => 'admin/jsonadm', 'middleware' => ['web', 'auth']],
		'jsonapi' => ['domain' => '{site}', 'prefix' => 'jsonapi', 'middleware' => ['web', 'api']],
		'account' => ['domain' => '{site}', 'prefix' => 'profile', 'middleware' => ['web', 'auth']],
		'default' => ['domain' => '{site}', 'prefix' => 'shop', 'middleware' => ['web']],
		'update' => ['domain' => '{site}'],
	],
So would a PSR-7 HTTP POST request (to the root site address) (and all variables / content) simply be routed directly to the UpdatePush implementation within all providers?

Re: updateSync Function Route Address

Posted: 17 Mar 2022, 05:35
by MattWoodward
Or am I reading this wrong, and the "update page" is actually at:

https:<site root>/shop/checkout/update

If so, is this where the HTTP POST request should be sent from the delivery provider?