Integrate SDK and send invoice after order is created

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!
fadeeva05
Posts: 8
Joined: 18 Mar 2021, 10:38

Integrate SDK and send invoice after order is created

Post by fadeeva05 » 18 Mar 2021, 10:48

Hi, I'm new with Aimeos, I use it with Laravel and what I'm trying to achieve is to integrate QuickBooks SDK, so when the order is created after the user finish the checkout process I can use this sdk and order info and send info to quickbook via their API. So if I understood correctly I need to create my new own extension, right? I used the Aimeos extension builder, unzipped it to /ext folder. Please tell me what should be my next steps, I'm really confused since the docs is really unclear on this topic?

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

Re: Integrate SDK and send invoice after order is created

Post by aimeos » 19 Mar 2021, 06:31

Create a delivery service provider for pushing orders to QuickBooks:
https://aimeos.org/docs/latest/providers/service/

You need to configure it afterwards so it will be used during the checkout as delivery option (instead of "Manual"):
https://aimeos.org/docs/latest/manual/service-details/

The delivery service provider will be executed by the order/service/delivery job controller, you have to set up a cronjob for (e.g. for Laravel):
https://aimeos.org/docs/latest/laravel/setup/#cronjobs
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

fadeeva05
Posts: 8
Joined: 18 Mar 2021, 10:38

Re: Integrate SDK and send invoice after order is created

Post by fadeeva05 » 19 Mar 2021, 21:12

I need to use QuickBook SDK to make an api call just to create an invoice on my quickbook account using order information. I still want user to choose between delivery options, so I'm not sure if your suggested option is approachable.

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

Re: Integrate SDK and send invoice after order is created

Post by aimeos » 20 Mar 2021, 14:20

A delivery service provider is not the same as a delivery option. You can create multiple delivery options using the same delivery service provider. The provider is only responsible for connecting to the ERP or accounting service after the order has been completed.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

fadeeva05
Posts: 8
Joined: 18 Mar 2021, 10:38

Re: Integrate SDK and send invoice after order is created

Post by fadeeva05 » 23 Mar 2021, 17:07

Ok, I created service provider class in my aimeos extension, it looks like this:

Code: Select all

class QuickBookLink
    extends \Aimeos\MShop\Service\Provider\Delivery\Base
	implements \Aimeos\MShop\Service\Provider\Delivery\Iface
{
    /**
	 *
	 * @param \Aimeos\MShop\Order\Item\Iface $order Order instance
	 * @return \Aimeos\MShop\Order\Item\Iface Updated order item
	 */
	public function process( \Aimeos\MShop\Order\Item\Iface $order ) : \Aimeos\MShop\Order\Item\Iface
	{

	}
}
When the checkout process will be completed it will automatically call "process" function in my delivery service class? And there I can use $order variable and push the order to quickbook?
Last edited by fadeeva05 on 23 Mar 2021, 18:33, edited 1 time in total.

fadeeva05
Posts: 8
Joined: 18 Mar 2021, 10:38

Re: Integrate SDK and send invoice after order is created

Post by fadeeva05 » 23 Mar 2021, 18:20

Also, when I configured it as you said:
You need to configure it afterwards so it will be used during the checkout as delivery option (instead of "Manual"):
https://aimeos.org/docs/latest/manual/service-details/
this delivery provider is shown as delivery option for customers during the checkout process. Maybe I configured it wrong?

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

Re: Integrate SDK and send invoice after order is created

Post by aimeos » 24 Mar 2021, 18:19

fadeeva05 wrote: 23 Mar 2021, 17:07 When the checkout process will be completed it will automatically call "process" function in my delivery service class? And there I can use $order variable and push the order to quickbook?
Yes, if you execute the "order/service/delivery" job controller via a cronjob regularly.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

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

Re: Integrate SDK and send invoice after order is created

Post by aimeos » 24 Mar 2021, 18:19

fadeeva05 wrote: 23 Mar 2021, 18:20 this delivery provider is shown as delivery option for customers during the checkout process. Maybe I configured it wrong?
Please share a screenshot of your configuration.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

fadeeva05
Posts: 8
Joined: 18 Mar 2021, 10:38

Re: Integrate SDK and send invoice after order is created

Post by fadeeva05 » 25 Mar 2021, 15:35

Here it is, I'll specify service-specific configuration later (api key, etc.)
Снимок экрана 2021-03-25 в 17.32.33.png
Снимок экрана 2021-03-25 в 17.32.33.png (69.74 KiB) Viewed 2204 times

fadeeva05
Posts: 8
Joined: 18 Mar 2021, 10:38

Re: Integrate SDK and send invoice after order is created

Post by fadeeva05 » 25 Mar 2021, 15:42

aimeos wrote: 24 Mar 2021, 18:19
fadeeva05 wrote: 23 Mar 2021, 17:07 When the checkout process will be completed it will automatically call "process" function in my delivery service class? And there I can use $order variable and push the order to quickbook?
Yes, if you execute the "order/service/delivery" job controller via a cronjob regularly.

What regularity do you mean? Like every minute or second?

Post Reply