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)
#1936 by Yvler
24 Sep 2015, 14:48
Hi

Is there a way to extend the "process" function of AI-Payments?
We would like to make an invoice PDF after the payment has been received per order :).
At this moment we're using the Omnipay (Ogone/Ingenico implement) class of AI-Payments to handle all our payments for our orders :)
#1940 by aimeos
24 Sep 2015, 20:08
Yvler wrote:Is there a way to extend the "process" function of AI-Payments?
We would like to make an invoice PDF after the payment has been received per order :).


That's the wrong place because the process method can executed several times due to asynchronous notifications by the payment provider. The best way would be to implement a new subpart for the checkout confirm component or at least add a link there which would generate the PDF.

We would be glad of any PR regarding this ;)
#1946 by Yvler
28 Sep 2015, 10:20
Is there already a function which is called after the payment has been received?
The order doesn't have to be delivered, because we use these invoice pdf's also for packing the orders..
#1952 by aimeos
29 Sep 2015, 15:16
Yvler wrote:Is there already a function which is called after the payment has been received?
The order doesn't have to be delivered, because we use these invoice pdf's also for packing the orders..


If you want to create and store the invoice immediately after the payment notification was received, you could create a decorator for the updateSync() method of the payment provider if it returns the order item. You have to check if the payment status is PAY_AUTHORIZED or PAY_RECEIVED (value >= 5).