Is a contribution always a donation or could it be a receipt from other(s) to one Member or contact?
Hard to be sure I quite get the question but you can apply a Soft Credit to imply that a payment came in from one contact  but should be recorded for another.

Also, you can have one Contact purchase a membership "on behalf of" an organisation.

Best that you clarify what you are trying to do by editing your question of neither of my points are helpful.