chobo2
chobo2

Reputation: 85765

Ah getting so confused with service layers

Service layers and repository seem so simple on paper but I am getting myself confused.

So here is what I am confused about. I have a service layer for my PayPal service layer with validation logic relating to my PayPal stuff and methods that connect to my paypal repository and return results (and do more logic if needed).

Now on my signin page I need to run some checks to see if the user subscription has expired or not. So I got to check some of my PayPal tables.

Now do I put this logic in the PayPal service layer? Or my sigin service layer?

I am not sure which one is the most appropriate place to put it.

Upvotes: 2

Views: 153

Answers (1)

Jeremy McGee
Jeremy McGee

Reputation: 25200

I'd have the signin layer call the PayPal layer.

It sounds like you're using PayPal for authentication and for payments. So you may want to consider what might happen should you replace PayPal with another method for authentication.

In general there should be no problems with layers calling each other.

Upvotes: 5

Related Questions