Page 1 of 1
Event Notifications
Posted: Mon Nov 03, 2008 3:20 pm
by derekz
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
Re: Event Notifications
Posted: Tue Nov 04, 2008 7:58 am
by mazhar
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.
Re: Event Notifications
Posted: Tue Nov 04, 2008 2:59 pm
by derekz
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
Re: Event Notifications
Posted: Wed Nov 05, 2008 8:51 am
by mazhar
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.