In this paper, we investigate a two-way communication channel where users can harvest energy from nature and energy can be transferred in one-way from one of the users to the other. Energy required for data transmission is randomly harvested by the users throughout the communication duration and users have unlimited batteries to store energy for future use. In addition, there is a separate wireless energy transfer unit that facilitates energy transfer only in one-way and with efficiency α. We study the energy cooperation made possible by wireless energy transfer in the two-way channel. Assuming that both users know the energy arrivals in advance, we find jointly optimal offline energy management policies that maximize the sum throughput of the users. We show that this problem is a convex optimization problem, and find the solution by a generalized two-dimensional directional water-filling algorithm which transfers energy from one user to another while maintaining that the energy is allocated in the time dimension optimally. Optimal solution equalizes the energy levels as much as possible both among users and among slots, permitted by causality constraints of the energy arrivals and one-way energy transfer.