Modifying Triggers

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
simtay
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Mon Mar 12, 2012 2:48 am

Modifying Triggers

Post by simtay » Wed Mar 21, 2012 7:35 am

Hi there I want to send a message to another web service when the payment captured.

Where do you think it is best to put my code and send a notification my web service when this trigger is fired? Where is the Payment Captured trigger? I cannot find it.

Thanks for your help

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Modifying Triggers

Post by jmestep » Wed Mar 21, 2012 7:42 am

Payment captured is based on your payement gateway settings- whether you have them set for authorize or authorize and capture. In most places, the best place I have found to do something special is on the receipt page because by then you know the payment status on the order. For example, I send special emails from there.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

simtay
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Mon Mar 12, 2012 2:48 am

Re: Modifying Triggers

Post by simtay » Wed Mar 21, 2012 7:55 am

Yes I agree with the receipt page but sometimes receipt page wont be called.

When a customer use paypal for payment method customer might not be able to go to the receipt page. There is a trigger in email templates called "Payment was fully captured" where can I find this trigger in the code?

Can't I modify it?

Thanks a lot

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Modifying Triggers

Post by mazhar » Wed Apr 18, 2012 9:06 am

There can be two places. First either you do this in suitable payment form user control under Website/checkout/PaymentForms or you handle this in CheckedOut event handler of ConLib/OnePageCheckout.ascx.cs file. I think I will preffer CheckedOut event handler of OnePageCheckout.ascx.cs file becuase this event handler is already registered on all out of the box payment forms so I don't have to replicate the code in different payment forms but its up to you both locations can workout. So in CheckedOut event handler if checkout was a scuccess you may try doing something like

Code: Select all

if (response.Success)
{
            ..............................................
            ..............................................
            
            // LOAD NEWLY CREATED ORDER
            OrderDataSource order = OrderDataSource.Load(e.OrderId);
            if(order != null)
            {
                    // THE CODE TO NOTIFY YOUR CUSTOM SERVICE GOES HERE
            }
}

Post Reply