views:

36

answers:

0

I have a commerce application, asp.net mvc.

I want it to be extensible in the sense others can create other payment providers, as long as they adhere to the interfaces.

/blah.core
/blah.web
/blah.Authorize.net  (Implementation of a payment provider using interfaces Ipaymentconfig and paymentdata class)

Now the problem is this:

/blah.core 
- PaymentData
/blah.core.interfaces
- IPaymentConfig

where Payment Data looks like:

using blah.core;
public class PaymentData
{
     public Order Order {get;set;}
}

IPayment data contains classes from blah.core like the Order class.

Now I want to use the actual Authorize.net implementation, so when I tried to reference it in the blah.core project I got a circular dependency error.

How could I solve this problem? Many have said to break out the interfaces into their own project, but the problem is PaymentData references entities that are found in blah.core also, so there doesn't seem to be a way around this (in my head anyhow).

How can I redesign this?