Event Notifications

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
derekz
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 38
Joined: Mon Nov 03, 2008 3:13 pm

Event Notifications

Post by derekz » Mon Nov 03, 2008 3:20 pm

I know that Able Commerce has event driven notifications that send out emails. (i.e., Order Shipped, Payment Capture Failed, etc). I'm wondering if there is a similar notification that would call a web service to perform a certain task. For instance, once an order is place, an event will fire off a web service (identified in the web.config file or something). That web service can be written to pretty much do anything you want. Fire off some code that talks with a fulfillment center, etc...

Does this functionally exist?

Thanks

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

Re: Event Notifications

Post by mazhar » Tue Nov 04, 2008 7:58 am

AbleCommerce back end makes use of these events internally and don't expose a way to register them in order to fire custom code against them. If you want to fire your custom code order is placed then there is another place which can be used for this purpose. You can register the Checkout/PaymentForms/CreditCardPaymentForm control's CheckedOut event and fire your code against that event.

derekz
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 38
Joined: Mon Nov 03, 2008 3:13 pm

Re: Event Notifications

Post by derekz » Tue Nov 04, 2008 2:59 pm

K...I've looked around, and can't find information on how to get started looking for registering the Checkout/PaymentForms/CreditCardPaymentForm control's Checkout.

Can you point me to any documentation explaining this?

Thanks

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

Re: Event Notifications

Post by mazhar » Wed Nov 05, 2008 8:51 am

Edit the ConLib/OnPageChekcout.ascx.cs class and add a custom handler as below

Code: Select all

protected void MyCustomHandler(Object sender, CheckedOutEventArgs e)
    {
        //Your custom code here, you can get the Order Id from the event args like e.OrderId
    }
Now register this custom handler with the CreditCard payment form control. For this locate the following line in the ConLib/OnPageChekcout.ascx.cs file.

Code: Select all

cardPaymentForm.ValidationSummaryVisible = false;
and make it look like

Code: Select all

cardPaymentForm.ValidationSummaryVisible = false;
                    cardPaymentForm.CheckedOut += new CheckedOutEventHandler(MyCustomHandler);
Now when ever an order will be place by customer your custom handler will be notified about that and making the newly placed order id available to you.

Post Reply