Page 1 of 1

AI-Payments extent

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

Re: AI-Payments extent

Posted: 24 Sep 2015, 20:08
by aimeos
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 ;)

Re: AI-Payments extent

Posted: 28 Sep 2015, 10:20
by Yvler
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..

Re: AI-Payments extent

Posted: 29 Sep 2015, 15:16
by aimeos
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).