public class NotifyWarehouse : IPipelineTask<PurchaseOrder> {
#region IPipelineTask<T> Members
public PipelineExecutionResult Execute(PurchaseOrder order) {
//connect with 3rd party warehouse here //throw new Exception("hello world"); return 0; //success code? }
#endregion
} }
This is where I hope to connect with the 3rd party warehousing that we are using, to notify them that the order has been taken. I have modified the Checkout.config to look like this:
I've set up my SagePay method to use the Checkout pipeline. I don't really quite understand this bit, or whether that's correct, but that's what I've done:
When I run though the sagepay simulator, sagepay get's this response back from the payment processor:
[HandlerException: Can't create component 'Checkout' as it has dependencies to be satisfied.
Checkout is waiting for the following dependencies:
Keys (components with specific keys)
- Checkout.NotifyWarehouse which was not registered.
It's saying that it can't find your pipeline task. Most probably due to the location in app_code, which requires a different way of registering your code.
Classes in app_code are compiled into a new assembly at runtime called: App_Code. Basically uCommerce is looking for your type in an assembly called MyShopName.Pipelines when in fact type is in the App_Code assembly.
Thanks Søren - I did think of trying it as a seperate assembly. I did that and added it to the bin and referenced it correctly, but I still get the same error:
Exception Details: Castle.MicroKernel.Handlers.HandlerException: Can't create component 'Checkout' as it has dependencies to be satisfied. Checkout is waiting for the following dependencies:
Keys (components with specific keys) - Checkout.NotifyWarehouse which was not registered.
I've double checked that I'm using the correct syntax for the type in the pipeline task section
do you have any other idea why this may be happening?
I completely missed the obvious: The ids don't match. In the values an id called Checkout.NotifyWarehouse is used, but the component is registered with name Checkout.SendWarehouseXml. Change one or the other and you should be fine.
Thanks for that - I did spot and correct it before I ran the last test, as I thought that might cause the problem; however, I still get the same error.
My steps:
Created a seperate project and added dll to umbraco bin folder
namespace MyLibrary.Pipelines { public class NotifyWarehouseTask : IPipelineTask {
#region IPipelineTask Members
public PipelineExecutionResult Execute(PurchaseOrder order) { //throw new Exception("hi"); return 0; }
#endregion
} }
I've checked the type in Reflector, which gives me:
The UCommerce.Entities namespace is only avaialble in uCommerce 1.0 - 1.5. From uCommerce 2 UCommerce.EntitiesV2 replaces the old API adding richer querying capabilities and a much clearer object model to work with.
But I am getting the same error as seen ealier in the post, and I cannot seem to figure out whats wrong. The XML seems correct, and I can not use Entities as suggested because I am on the newest version of uCommerce. The error I am getting in UmbracoLog is:
Can't create component 'Checkout' as it has dependencies to be satisfied.
Checkout is waiting for the following dependencies:
Keys (components with specific keys)
- Checkout.MoveOrderToERP which was not registered.
Hope you guys can point me to what I am doing wrong.
Can't create component 'Checkout' as it has dependencies to be satisfied.
That line tell's me that you have Services injected into the constructor that Castle windsor doesn't know what to do with. Is that correct? All injected components must be registered along with their dependencies and so forth.
Whenever you register a new component in Castle windsor it will be able to find it and use it (which it does whenever you execute a pipeline.).
However it might be that your constructor isn't empty. If so, you need to register those task in the components file just like you did with UCommerceTransferOrder. That is what the error is trying to tell you.
It looks like it is a component with id 'Checkout' that needs a component "MoveOrderToERP" which you did not register.
Well all I have in UCommerceOrderHandler is what I have taken from the ealier example
using UCommerce.EntitiesV2;using UCommerce.Pipelines; namespace UCommerceOrderHandler{ public class UCommerceTransferOrder : IPipelineTask<PurchaseOrder> { #region IPipelineTask<T> Members public PipelineExecutionResult Execute(PurchaseOrder order) { //throw new Exception("hello world"); return 0; } #endregion }}
ehh.. I guess it is time to leave the Pc for a while... I just found out I have been copying the dlls to a different test Umbraco installation I was messing around with. After placing the DLLs in the correct bin folder everything is working!
Sorry for wasting your time Morten, and thanks for using your time to help me out.
Problem with custom pipeline task
Hey,
I have the following class in my App_Code:
This is where I hope to connect with the 3rd party warehousing that we are using, to notify them that the order has been taken. I have modified the Checkout.config to look like this:
I've set up my SagePay method to use the Checkout pipeline. I don't really quite understand this bit, or whether that's correct, but that's what I've done:
When I run though the sagepay simulator, sagepay get's this response back from the payment processor:
Perhaps I need to register this pipeline somewhere?
Hi Zac,
It's saying that it can't find your pipeline task. Most probably due to the location in app_code, which requires a different way of registering your code.
Classes in app_code are compiled into a new assembly at runtime called: App_Code. Basically uCommerce is looking for your type in an assembly called MyShopName.Pipelines when in fact type is in the App_Code assembly.
Try changing the reg to the following:
Hope this helps.
Thanks once again Søren
I still seem to be getting the error. I've tried
as per what I read here: http://blog.wouterdeboer.nl/archive/2007/03/26/31.aspx
Any other ideas?
You can always compile the class into a property assembly and put in /bin. That'll definitely work.
Thanks Søren - I did think of trying it as a seperate assembly. I did that and added it to the bin and referenced it correctly, but I still get the same error:
Exception Details: Castle.MicroKernel.Handlers.HandlerException: Can't
create component 'Checkout' as it has dependencies to be satisfied.
Checkout is waiting for the
following dependencies:
Keys (components with specific keys)
- Checkout.NotifyWarehouse
which was not registered.
I've double checked that I'm using the correct syntax for the type in the pipeline task section
do you have any other idea why this may be happening?
Thanks
Hi Zac,
I completely missed the obvious: The ids don't match. In the values an id called Checkout.NotifyWarehouse is used, but the component is registered with name Checkout.SendWarehouseXml. Change one or the other and you should be fine.
Sorry I didn't catch that earlier.
Thanks for that - I did spot and correct it before I ran the last test, as I thought that might cause the problem; however, I still get the same error.
My steps:
Created a seperate project and added dll to umbraco bin folder
I've checked the type in Reflector, which gives me:
in checkout.config, i've added
and
But it still errors with the dependency problem
Thanks for your help
sorry, double posted the last entry
Hi Søren,
Any further ideas on this issue?
Thanks
Could you send me the code and config file so I can take a closer look? [email protected]
To close this off, there were two further problems:
1) The XML wasn't correctly formatted in the config file (a silly mistake), so the component was within another xml tag that wasn't self-closing.
2) I was using
instead of
when implementing
Thanks for putting the final solution here for everyone to see. Appreciate it.
PurchaseOrder doesnt exist for me while using the name space UCommerce.Entities. I have to use UCommerce.EntiriesV2 ???
The UCommerce.Entities namespace is only avaialble in uCommerce 1.0 - 1.5. From uCommerce 2 UCommerce.EntitiesV2 replaces the old API adding richer querying capabilities and a much clearer object model to work with.
Hello
Sorry for starting this older thread up, but I am having a issue like this.
I have put a dll in the bin folder with:
using UCommerce.EntitiesV2;using UCommerce.Pipelines; namespace UCommerceOrderHandler{ public class UCommerceTransferOrder : IPipelineTask { #region IPipelineTaskMembers public PipelineExecutionResult Execute(PurchaseOrder order) { } #endregion }}In the Checkout config file I have put:
${Checkout.MoveOrderToERP} service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerceOrderHandler.UCommerceTransferOrder, UCommerceOrderHandler" />But I am getting the same error as seen ealier in the post, and I cannot seem to figure out whats wrong. The XML seems correct, and I can not use Entities as suggested because I am on the newest version of uCommerce. The error I am getting in UmbracoLog is:
Can't create component 'Checkout' as it has dependencies to be satisfied.
Checkout is waiting for the following dependencies:
Keys (components with specific keys)
- Checkout.MoveOrderToERP which was not registered.
Hope you guys can point me to what I am doing wrong.
Can't create component 'Checkout' as it has dependencies to be satisfied.
That line tell's me that you have Services injected into the constructor that Castle windsor doesn't know what to do with. Is that correct? All injected components must be registered along with their dependencies and so forth.
Hello Morten
I am certainly doing somthing wrong, since it does not work. I posted what I have done in my ealier post, but can you give me a clue what to look for.
Whenever you register a new component in Castle windsor it will be able to find it and use it (which it does whenever you execute a pipeline.).
However it might be that your constructor isn't empty. If so, you need to register those task in the components file just like you did with UCommerceTransferOrder. That is what the error is trying to tell you.
It looks like it is a component with id 'Checkout' that needs a component "MoveOrderToERP" which you did not register.
Hey again Morten
In the Checkout.config I have:
<component id="Checkout" service="UCommerce.Pipelines.IPipeline`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Checkout.CheckoutPipeline, UCommerce.Pipelines"><parameters><tasks><array><value>${Checkout.ValidatePaymentsMadeAgainstOrderTotal}</value><value>${Checkout.AssignOrderNumber}</value><value>${Checkout.CreateCustomer}</value><value>${Checkout.CreateMemberForCustomer}</value><value>${Checkout.ConvertBasketToPurchaseOrder}</value><value>${Checkout.AddAuditTrailForCurrentOrderStatus}</value><value>${Checkout.SetVoucherUses}</value><value>${Checkout.ClearBasketInformation}</value><value>${Checkout.SavePurchaseOrder}</value><value>${Checkout.SendConfirmationEmail}</value> <value>${Checkout.SendWebshopInfoEmail}</value> <value>${Checkout.MoveOrderToERP}</value> </array></tasks></parameters></component>And further down I have:
<component id="Checkout.MoveOrderToERP" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerceOrderHandler.UCommerceTransferOrder, UCommerceOrderHandler" />Allrighty - that looks right. And does MoveOrderToERP have anything in it's constructor, or is it empty ?
Well all I have in UCommerceOrderHandler is what I have taken from the ealier example
using UCommerce.EntitiesV2;using UCommerce.Pipelines; namespace UCommerceOrderHandler{ public class UCommerceTransferOrder : IPipelineTask<PurchaseOrder> { #region IPipelineTask<T> Members public PipelineExecutionResult Execute(PurchaseOrder order) { //throw new Exception("hello world"); return 0; } #endregion }}ehh.. I guess it is time to leave the Pc for a while... I just found out I have been copying the dlls to a different test Umbraco installation I was messing around with. After placing the DLLs in the correct bin folder everything is working!
Sorry for wasting your time Morten, and thanks for using your time to help me out.
is working on a reply...