Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Kentico E-commerce: New "Order notification" emails are being sent even when the status is "payment failed" View modes: 
User avatar
Certified Developer 12
Certified Developer 12
mschmidt-bizstream - 1/5/2011 8:30:16 AM
   
Kentico E-commerce: New "Order notification" emails are being sent even when the status is "payment failed"
I am trying to figure out how to stop emails from being sent to the customer and the site admin when a payment fails. To each of the email recipients, it looks like the order went though (they get the invoice email). Even though on the website the end-user/customer sees that the payment failed and the Site Admin sees the order status set to "payment failed".

Any ideas where to start looking for a solution to this?

Notes:
1. Under CMS Desk > Tools > E-Commerce > Configuration > Order Statuses
I have "payment failed" set to NOT send notifications.

2. Authorize.NET IS properly setting the payment to declined and setting the order status to "payment failed"

Any other ideas?

Thanks. Everyone at BizStream LOVES Kentico!

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 1/13/2011 6:06:22 PM
   
RE:Kentico E-commerce: New "Order notification" emails are being sent even when the status is "payment failed"
Hello,

I'd like to post a reply here as well (apart from our email conversation).
Thanks again for the nice feedback, we really appreciate it!

My colleague Helena solved similar question in this forum thread: http://devnet.kentico.com/Forums.aspx?forumid=36&threadid=17441

The Order is always created before payment.
To decide whether the notification should or shouldn't be sent, you could use custom e-commerce provider - CustomOrderInfoProvider.
There are methods: SendOrderStatusNotificationToAdministrator and SendOrderStatusNotificationToCustomer.

Similarly as Helena advised there, if you test whether the payment result was Ok or Failed, you can decide to call nothing in one of these methods and it will not send the appropriate notification.

Hope this will help for your aim.

Regards,
Zdenek