Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Robinson 40 posts 61 karma points
    Jun 11, 2013 @ 12:24
    Martin Robinson
    0

    OrderFinalized event no longer triggering

    Hi,

    I've recently upgraded to TC 2.1.2 and I've noticed that my OrderFinalized event is no longer being called.

    I don't recall making any changes to the code that registers the event (this is being called by the way) and I have placed debug logging (log4net) across the various methods I'm using. I can see that other events are being triggered and handled - but not OrderFinalized.

    I am able to get to the PayPal payment page, make the payment and return to a fully populated confirmation page.

    However, without the OrderFinalized method being called I am unable to do all the useful things I need to do when an order has been placed.

    Any ideas? Anyone with the same issue?

    Cheers,
    Martin

  • Martin Robinson 40 posts 61 karma points
    Jun 11, 2013 @ 12:51
    Martin Robinson
    0

    Just in case you ask...

    I am running on the live server with the actual domain and this has previously worked with orders being finalized.

    I have checked the following posts:

    http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/21879-Problem-Finalizing-Orders
    - my OrderFinalized callback handler isn't being called (I have placed debug logging as first line) so it can't be an exception happening in the callback handler.

    http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/23544-Paypal-standard-order-set-as-initial
    - I don't think this refers to TC2 and besides my PayPal settings haven't been altered since it was previously working.

    http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/23544-Paypal-standard-order-set-as-initial
    - this seems to refer to an older version of TC.

    http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/30806-Order-status-and-confirmation-email
    - this seems to refer to an older version of TC

    For extra info, I can see the newly created Order in the "New" list and I'm able to select that and manually choose to send the confirmation email. However, since the orderfinalized event isn't triggered my confirmation email cannot refer to all the information it needs.

    I have also checked that my TeaCommerce package is still licenced (it shows my domain as one of the valid domains) in case the recent upgrade had messed with the licence (since I recall that an unlicenced TC package is limited in the number of orders - that one caught me out some time back!).

    I hope that helps.

    Cheers,
    Martin

     

  • Anders Burla 2560 posts 8256 karma points
    Jun 11, 2013 @ 17:09
    Anders Burla
    0

    Hi Martin

    Just checked the finalized event of the order in the notification center and it fires correctly. Have you done any extension to Tea Commerce in Visual Studio? Then try and build using the latest Tea Commerce dll files.

    Does the order have a finalized date in the DB? It it has, then the order is correctly finalized. If your event isnt called - then maybe there is an error happening that causes your event code not to call. Did you update Umbraco and did you rebuild your project using the latest dll files from Umbraco?

    Kind regards
    Anders

  • Martin Robinson 40 posts 61 karma points
    Jun 11, 2013 @ 17:22
    Martin Robinson
    0

    Hi Anders,

    I upgrade TC by installing the package as I read that was the way to do it. I then manually updated the references to my extension project to include the most recent DLLs (including the TC and Umbraco DLLs). However, I didn't *upgrade* Umbraco - should I have done?! The "about" screen tells me I am at Umbraco v6.0.5 (assembly version: 1.0.4869.18012).

    I can see that the DateFinalized is being set (I've just pushed through a new test order) but my OrderFinalized event handler doesn't appear to have been called (the log4net debug lines haven't written anything to the log, whereas there are two log4net log lines from a previous event in the same order for VAT checking when the order custom fields were updated).

    If I have to update Umbraco then what's the process to do that without deleting all my hard work so far?

    Cheers,
    Martin

  • Anders Burla 2560 posts 8256 karma points
    Jun 11, 2013 @ 17:31
    Anders Burla
    0

    You are not forced to update Umbraco - so just use the current version.

    If the order finalized date is set then the order finalized event is also called. Maybe there is an error in the confirmation email being send or an other event that you have hooked into that fails and then the order finalized event isnt triggerede because of a .NET exception. Do you recieve an confirmation email? If not - properly something is wrong with that.

    Kind regards
    Anders

  • Martin Robinson 40 posts 61 karma points
    Jun 11, 2013 @ 18:01
    Martin Robinson
    0

    Hi Anders,

    Thanks for the clarification. I'm a bit confused - is the confirmation email generated/sent before or after the OrderFinalized event is triggered?

    My confirmation email references custom order line properties that are generated within the OrderFinalized event (I generate a software licence code, for example). So assuming that the event triggers before the email is generated (which definitely used to be the case) then I can't see how an error in the confirmation email would cause the event not to trigger.

    I am not receiving the confirmation email automatically (although I do get a populated confirmation page after returning from PayPal). But I can use the manual "Send email" button in the back-end and this delivers the email.

    Does that information help to track things down?

    Cheers,
    Martin

  • Martin Robinson 40 posts 61 karma points
    Jun 13, 2013 @ 17:25
    Martin Robinson
    0

    Nudge.

    Cheers,
    Martin

  • Anders Burla 2560 posts 8256 karma points
    Jun 17, 2013 @ 11:03
    Anders Burla
    0

    The confirmation email is send as the last action in the finalize method of the order. But you are right - an error in your email template wont affect the order from finalizing. But your custom code would be able to fail the order from saving - but if the order finalized date is set in the DB then the order is saved. How do you hook into the notification center? I know that Umbraco has changed some of the ApplicationBase stuff. See this link: http://our.umbraco.org/documentation/Reference/Events/application-startup

    Kind regards
    Anders

  • Martin Robinson 40 posts 61 karma points
    Jun 20, 2013 @ 18:25
    Martin Robinson
    0

    Hi Anders,

    Big apology due to you - I have made a full redeploy and the event is now triggering. I must have made some sort of erroneous partial when updating Umbraco and TC. I will be more careful from now on.

    Many thanks,
    Martin

  • Anders Burla 2560 posts 8256 karma points
    Jun 21, 2013 @ 11:52
    Anders Burla
    0

    Hi Martin

    Ahh great you solved the problem after all - and glad there was no bug in the Tea Commerce software :)

    Kind regards
    Anders

  • Peter Rombouts 71 posts 265 karma points
    Jul 02, 2013 @ 14:29
    Peter Rombouts
    0

    I have the exact same problem, on a fresh Umbraco install and fresh TeaCommerce install.

    @Martin: Any idea what the culprit was?
    I cannot seem to get it working

  • Martin Robinson 40 posts 61 karma points
    Jul 02, 2013 @ 15:43
    Martin Robinson
    0

    Hi Peter,

    I'll try to help!

    Can you describe your system in more detail:

    Which version of Umbraco? Which version of TeaCommerce? What platform are you using?

    Do you have a payment gateway set up - if so, which one and with which parameters?

    Are you able to hit a breakpoint on the application start event (just to give you confidence that you've wired up your events correctly)? If not sure then paste your event wiring code here also.

    Cheers,
    Martin

  • Peter Rombouts 71 posts 265 karma points
    Jul 02, 2013 @ 16:11
    Peter Rombouts
    0

    - I've got Umbraco 6.1.2, TeaCommerce 2.1.2 and have my own payment provider setup.
    - I have no custom code, no custom events, so I cannot simply add a breakpoint or something like that
    - If I look at the orders in the database, they all have a finalized date, everything looks fine, but the mail has not been sent.

    Manually sending the e-mail in the backend works fine.

    Very strange behaviour, and nothing shows up in the logs either...

    I think I'm going to implement the OrderFinalized to check if it hits.

  • Martin Robinson 40 posts 61 karma points
    Jul 02, 2013 @ 17:09
    Martin Robinson
    0

    Hi Peter,

    I believe that you do need to have some sort of custom code in order to wire up your Order Finalized email sending - I may be wrong - but that's how I have it set up.

    So far it looks as though you have a good combination of Umbraco and TeaCommerce - and the evidence that you can manually send the email from the backend is a good sign that your SMTP has been set up correctly.

    If the finalized status of the orders is being set then this does indicate that the finalisation event/script is running.

    Have you checked this post for more info: http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/41257-Best-Starter-Kit-for-software-license-webshop?p=0

    PS: Can I also ask if this is the first deployment of Umbraco/TeaCommerce you've done - or whether you have patched a previous deployment?

    Cheers,
    Martin

     

  • Peter Rombouts 71 posts 265 karma points
    Jul 02, 2013 @ 17:15
    Peter Rombouts
    0

    Hi Martin,

    This is not a fresh install; We've started with 2.1.1 but since this problem popped up, we've upgraded to 2.1.2 because there were some notification fixes. This obviously did not fix anything :(

    Thanks for your link; It is very hard to find documentation for v2, as all other links are using the v1 API, which is very different...

    I don't think you should need to handle the email, because it is all set by default, but I will implement it to see if I can add logging and make more sense of this problem.

    Kind regards,
    Peter Rombouts

  • Martin Robinson 40 posts 61 karma points
    Jul 02, 2013 @ 17:26
    Martin Robinson
    0

    Hi Peter,

    The reason I asked about the fresh install is because I suspect my issue was related to not deploying all the necessary updated libraries. You may want to take a backup of what you've deployed already and then try redeploying the 2.1.2 umbraco libraries and the 6.1.2 TC libraries.

    I share your pain regarding documentation - the main issue has been that the "old" documentation wasn't marked as such and so tended to waste a lot of time until you found out that it was only relevant to older versions. There is a growing documentation portal here: http://documentation.teacommerce.net/frontpage/ - but with some obvious omissions (including basic principles and .Net API details) which I hope will be resolved since it's very much a case of detective work to make the most of TC at the moment.

    I estimated a couple of days to get things integrated - especially as I could see an online exampled of exactly what I wanted to achieve and I'd already been on the Umbraco Level 1 and 2 courses and was getting on well with that. It then turned out that the TC online example was for an old version of TC - and the new version had changed considerably - plus I encountered a number of other newbie pitfalls which significantly increased the dev/integration time. Luckily ours is an internal project - which is always best for trying out new tools/techs - less chance of risking company reputation!

    I've had some great support on this forum - it's saved the project and meant that the cost of buying TC wasn't wasted - I actually think it's good value *provided* that some new, clear starter site examples can be published with source code. My nightmare now would be if there's another major/breaking update of TC/Umbraco.

    Cheers,
    Martin

  • Peter Rombouts 71 posts 265 karma points
    Jul 02, 2013 @ 17:34
    Peter Rombouts
    0

    Hi Martin,

    Thanks for your open response.
    The deployment of packages cannot be the issue, as the fresh install had the exact same issue.
    This was a simple install, right off of the repository.

    For debugging reasons I'll try to make a clean install, and check if that has the same issues.
    If that is the case, I'll manually copy all DLLs over to my non-working install.

    I will post my findings here tomorrow; worst case scenario I'll write my own temporary mailer.
    An external party does all shipping and handling, so I've built some extra handlers and a simple API for them.
    That API could also mail status updates et cetera, so I can build a workaround, but would rather have TC working properly.

    Kind regards,
    Peter Rombouts

  • Anders Burla 2560 posts 8256 karma points
    Jul 02, 2013 @ 20:46
    Anders Burla
    0

    Hi Peter and Martin

    Sorry for not getting back ealier today - but had a client B2C and B2B site that needed to launch.

    By the way - we did release Tea Commerce 2.1.3. It wont have anything to do with your problem - but just minor bug fixing.

    This case sounds indeed weird if you have it in a fresh Umbraco install. One thing I can think of is that when the order is saved and does have a finalize date - then the order xml cache is updated in the App_Data/tea-commerce folder. If the site doesnt have modify permissions then this would fail and then the confirmation email would properly not be send because of an exception. Dont know if this is the case - but just an idea.

    About the documentation - we are in the process of this - but it takes time :) The documentation portal will be the backbone of our Tea Commerce certification training so rest asure that the documentation will be written and updated.

    Kind regards
    Anders

  • Martin Robinson 40 posts 61 karma points
    Jul 02, 2013 @ 20:50
    Martin Robinson
    0

    Hi Anders,

    I hope the launch went well :)

    That's a very good point regarding folder permissions. Worth having a "Typical Issues" page in the documentation portal perhaps with a checklist.

    Would internal exceptions like this be visible in a log somewhere?

    Cheers,
    Martin

  • Anders Burla 2560 posts 8256 karma points
    Jul 02, 2013 @ 21:07
    Anders Burla
    0

    All exceptions in Tea Commerce that happens from client side should be visible to the client - all exceptions is catched by Umbraco and added to the log file or database table "umbracoLog". Tea Commerce doesnt hide exceptions.

    Kind regards
    Anders

  • Peter Rombouts 71 posts 265 karma points
    Jul 03, 2013 @ 15:39
    Peter Rombouts
    0

    Hi guys,

    It gets stranger by the minute.
    I've added the following events:

    NotificationCenter.EmailTemplate.MailSending += EmailTemplate_MailSending
    NotificationCenter.EmailTemplate.MailSend += EmailTemplate_MailSend; NotificationCenter.Order.OrderFinalizing += Order_OrderFinalizing; NotificationCenter.Order.OrderFinalized += Order_OrderFinalized;

    But only the Order_OrderFinalizing is being hit.
    There is no exception in the log, nor in the database.
    So something must go wrong during finalizing of the order, but with no logging, this is a real pain to find.

    Please note that the order *is* finalized, because the finalize date is set, and if I call 'getfinalizedorders' it will return the correct one.

    EDIT 1: I found out that there was no 'teacommerce' folder in the App_Data folder.
    I'm working on that right now, but I'm confused why this does not generate any errors in the database.

    EDIT 2: I've added the finalized-orders-xml-cache-1.xml file to the App_Data/tea-commerce folder, and put all the correct rights into place, but TeaCommerce still is not updating the cache XML.

    Any ideas anyone?

    Regards,
    Peter Rombouts

  • Peter Rombouts 71 posts 265 karma points
    Jul 03, 2013 @ 16:32
    Peter Rombouts
    0

    More debugging in action with procmon: (click on image for better resolution)

    Ignore the path not found errors, those are callbacks of the creditcard company.

    As you can see, TeaCommerce touches the file, but does not write to it.
    As I cannot go any deeper; Anders, do you have any clue?

    When does the file get created? Maybe I can trigger this again? Is this during installation of the package?

    Kind regards,
    Peter Rombouts

  • Anders Burla 2560 posts 8256 karma points
    Jul 03, 2013 @ 17:14
    Anders Burla
    0

    When the order is saved - order.Save() - then Tea Commerce looks if the order.IsFinalized - if it is then it will create/update the order in the orders xml cache. If the xml file doesn't exist at this point - then it creates the file and retrieves all finalized orders from the database and add them to the file. So you can just delete the file and save a finalized order. That should create the file again.

    I might indicate that the file permissions isnt right?

    Kind regards
    Anders

  • Peter Rombouts 71 posts 265 karma points
    Jul 04, 2013 @ 08:34
    Peter Rombouts
    0

    SOLVED:

    First of all; The problem arose when TeaCommerce tried to update the orders xml cache.
    But; it was no rights issue, but a serialization issue.

    The following custom fields were added by me:

    The problem is, that some aliases had spaces after the comma.
    Unfortunately TeaCommerce does not trim these aliases, so the propertynames were prefixed with a space in the database:

    When removing the spaces, everything worked fine:
    - Cache was updated
    - All events fire normally
    - Mail is sent

    @Anders; I advise you to trim these aliases, or add some warning that no spaces may be used.
    It was a hell of a search, but finally it has been resolved :)

    Martin and Anders, thanks for your help, and hopefully someone can use this info if they have the same issues.

    Kind regards,
    Peter Rombouts

  • Anders Burla 2560 posts 8256 karma points
    Jul 04, 2013 @ 10:33
    Anders Burla
    1

    Hi Peter

    GREAT you got it solved. I have already added a fix to the source code.

    Kind regards
    Anders

  • Martin Robinson 40 posts 61 karma points
    Jul 04, 2013 @ 10:57
    Martin Robinson
    0

    A good bit of detective work, Peter, well done!
    Cheers,
    Martin

  • Martin Robinson 40 posts 61 karma points
    Oct 01, 2013 @ 09:49
    Martin Robinson
    0

    Hi Anders and Rune,

    Just to finish this thread by letting you know that the site has gone live at www.attachaware.com

    This is an Umbraco/TeaCommerce site with EU VAT Number checking, custom order finalization with custom properties, software licence generation and management (including single, multiple and domain licences) and custom email templates.

    I feel now as though I have a platform on which to launch other software-based products.

    It's still early days - just launched - so I will be happy to receive any bug reports etc.

    PS: Please excuse me if I paste this to complete the various forum threads I started over the past few months!

    Cheers,
    Martin

Please Sign in or register to post replies

Write your reply to:

Draft