I have a
User model which has "
Payments" in quotes because depending on the user, there could be multiple sources of payments, like
BraintreePayments. Instead of writing all the business logic inside the
User model via something like a
getPayment() method, I'd like to delegate it out to another layer. The business logic entails retrieving only, and the retrieved data could be of a single payment source or mixed.
At my company, "repositories" have been used for this kind of stuff, but I feel the pattern is misused, and I'd like to know if there's another suitable pattern. This is something I would've traditionally put into the service layer or even a helper, if I couldn't find a place for it.
Any suggestions on this? I'm using PHP and Laravel for this.