updateSync Function Route Address

Help for integrating the Laravel package
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!
Kappa.yahyya
Posts: 11
Joined: 14 Jun 2021, 05:59

updateSync Function Route Address

Post by Kappa.yahyya » 21 Jun 2021, 13:07

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.

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

Re: updateSync Function Route Address

Post by aimeos » 22 Jun 2021, 07:33

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

akropivko
Posts: 36
Joined: 20 Jan 2021, 12:49

Re: updateSync Function Route Address

Post by akropivko » 24 Jun 2021, 09:07

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?

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

Re: updateSync Function Route Address

Post by aimeos » 26 Jun 2021, 06:57

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')
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

akropivko
Posts: 36
Joined: 20 Jan 2021, 12:49

Re: updateSync Function Route Address

Post by akropivko » 25 Jul 2021, 11:37

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?

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

Re: updateSync Function Route Address

Post by aimeos » 25 Jul 2021, 12:01

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
MattWoodward
Posts: 20
Joined: 03 Mar 2022, 04:15

Re: updateSync Function Route Address

Post by MattWoodward » 16 Mar 2022, 04:10

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?

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

Re: updateSync Function Route Address

Post by aimeos » 16 Mar 2022, 06:42

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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
MattWoodward
Posts: 20
Joined: 03 Mar 2022, 04:15

Re: updateSync Function Route Address

Post by MattWoodward » 16 Mar 2022, 08:29

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?

User avatar
MattWoodward
Posts: 20
Joined: 03 Mar 2022, 04:15

Re: updateSync Function Route Address

Post by MattWoodward » 17 Mar 2022, 05:35

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?

Post Reply