Forums / General Questions / Trying to find event that means "Payment Complete"

Trying to find event that means "Payment Complete"

Views: 908

Results 1 to 2 of 2
16 Apr 2011, 6:54 PM
#1
fuhrysteve avatar

fuhrysteve

New Zenner

Join Date:
Apr 2011
Posts:
1
Plugin Contributions:
0

Trying to find event that means "Payment Complete"

I'm doing some mods on a zen cart install and am trying to figure out where to fire an event after payment has cleared (so I know I can send the customer an email with some custom stuff).

I originally thought the after_process() method in the payment class (which calls the after_process method in whichever payment module you happen to be using) would accomplish this, but it seems that method is fired before the payment has been processed (after_process appears to mean the order has been processed -- not that the payment is complete).

How can I determine that an order has been paid for and paypal / whoever has cleared their payment?

17 Apr 2011, 5:21 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Trying to find event that means "Payment Complete"

after_process() does indeed fire after the order has been paid and saved and emails sent
You could optionally hook the NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL notifier point and run your event at that stage too, which fires just before after_process() is called.

NOTE: If you're using some sort of remote-hosted payment processing service that requires some sort of special handling upon return to the cart, other than the normal direct flow, then those execution points would be useless and you'd have to create your own additional custom means of hooking them. Some such cases might include PayPal IPN or Authorize.net SIM. Using PayPal EC or Authorize.net AIM modules would use the normal built-in flow.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.