I'm looking simple and correct way to run my process when payment is finish - captured, cancelled. I think it's a typical requirement.
I don't want to do this in done page - it in my payment method is pending and its user fired. I want when payment gate sends payment finish - background way.
But this is not easy in this bundle.
Events are not fired - so 1 . Add Symfony Events https://github.com/Payum/Payum/blob/master/docs/event-dispatcher.md
payum.extension.event_dispatcher:
class: Payum\Core\Bridge\Symfony\Extension\EventDispatcherExtension
arguments: ["@event_dispatcher"]
public: true
tags:
- { name: payum.extension, all: true, prepend: true }
documentation has an error - when prepend is true it works when false - here is my error report
https://github.com/Payum/Payum/issues/821
I cannot found the correct event name - we have only 3 events
const GATEWAY_PRE_EXECUTE = 'payum.gateway.pre_execute';
const GATEWAY_EXECUTE = 'payum.gateway.execute';
const GATEWAY_POST_EXECUTE = 'payum.gateway.post_execute';
I add listener PayumEvents::GATEWAY_POST_EXECUTE
I see that almost every operation in this bundle executes some action so before user finish payment my event is fired many times.
in ExecuteEvent I don't know what is happen - i get_class $event->getContext()->getRequest() and have 7 times event fired
Payum\Core\Request\GetHttpRequest
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\SetExpressCheckout
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\GetExpressCheckoutDetails
Payum\Core\Request\Sync
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\AuthorizeToken
Payum\Core\Request\Capture
Payum\Core\Request\Capture
im just moved to paypal website....
ok i make payment - get next 10 times listener fired ?
Payum\Core\Request\GetHttpRequest
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\GetExpressCheckoutDetails
Payum\Core\Request\Sync
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\DoExpressCheckoutPayment
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\GetExpressCheckoutDetails
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\GetTransactionDetails
Payum\Core\Request\Sync
Payum\Core\Request\Capture
Payum\Core\Request\Capture
Payum\Paypal\ExpressCheckout\Nvp\Request\Api\GetExpressCheckoutDetails
uggh...
please help me - in how I can make a decision when i really get paymentDetails status change.
I just need to fire my process when user paid or cancel payment ...