Considering Germany and Finland were allies for a time it seems like that they must have discussed to what happend to Finland in 1939 especially in regards the timing of the winter war. So did Germany sell out Finland there or what exactly was the plan here?
Finland was briefly mentioned in the Molotov-Ribbentrop pact. In article 1 of the secret additional protocol:
In the event of a territorial and political rearrangement in the areas belonging to the Baltic States (Finland, Estonia, Latvia, Lithuania), the northern boundary of Lithuania shall represent the boundary of the spheres of influence of Germany and U.S.S.R.
The original negotiations began with a proposal that divided Latvia between the German and Soviet spheres of influence; Stalin wanted all of Latvia. Thus, the boundary in the pact was the Lithuanian-Latvian border.
A month later (about a week after the Soviet invasion of Poland), there were further negotiations: Stalin wanted Lithuania. With Germany now at war with the western Allies, Stalin had more negotiating power, and got Lithuania in exchange for some Polish territory.
As the Soviet Union turned Estonia, Latvia, and Lithuania into de facto Soviet protectorates, Finland watched. When the Soviets made similar demands - "mutual protection" and basing of Soviet troops in Finland - and territorial demands in Karelia, Finland feared the same fate as the Baltic states, and sought to negotiate a different agreement. Stalin sought his demands by force, and the Winter War began. Germany dutifully blocked military aid to Finland (primarily from Italy, since aid from the Allies wasn't going through Germany, and aid from Sweden couldn't be blocked).
After the Winter War, Germany was rather unpopular in Finland. Germany had been their second-greatest enemy during the Winter War - while not attacking Finland, Germany had hindered Finland's war effort. However, Germany's conquest of Norway effectively cut off Finland from any realistic prospect of support from the western Allies, and Germany became an essential trading partner and a prospective source of aid against the Soviets. The urgency of a local strong ally become greater as the Soviet Union forces changes of government on the Baltic states in the days after the German occupation of Paris. The new governments were effectively appointed by the Soviets, and unsurprising asked for admission to the Soviet Union.
Finland featured in Soviet war planning in 1940. Soviet forces were positioned for defence against a German attack (ineffectively, as Barbarossa would show, but in large numbers), and it was considered likely that Finland would join in if Germany attacked. It also appears that the Soviets still intended to bring Finland into the Soviet Union - they had not given up the idea of restoring the former Russian Empire. Certainly, offensive plans were being made in late 1940. However, the German decision to attack the Soviet Union, made at the end of July 1940, quickly led to German arms sales to Finland, and military agreements allowing the transit of German soldiers through Finland to Norway, and thus the presence of German troops in Finland. In November, Molotov met with Hitler in Berlin, and the "Finnish question" was discussed. Molotov basically said that the plan was to eat up Finland as the Baltic states had been eaten. Hitler said no, not in the near future: while Finland was in the Soviet sphere of influence, a war in the Baltic at this time was not acceptable to Germany. Whether this stopped war isn't clear, since we don't know whether the Soviets would have attacked Finland before Barbarossa. Soviet pressure on Finland didn't go away, and Finland felt even more need of German support. At the same time, planning for the attack on the Soviet Union was proceeding in Germany, and Germany wanted Finnish support and participation in the attack. The Soviets saw more and more Germans in Finland, and increasing cooperation between Germany and Finland, and took steps to try to keep Finland away from Germany (e.g., Stalin meeting Paasikivi in person, food shipments to Finland, etc.) but it was too late -Finland was committed to the upcoming war with the Soviets.
To not leave that story hanging: Finland actively participated in the planning for Barbarossa, and knew it was coming, despite their government's denial. The Finnish government was cautious, and professed neutrality when Germany invaded the Soviet Union on 22nd June 1941. Ready to attack the Soviets themselves, they waited and only attacked when the Soviets bombed Finland and declared war on Finland. They maintained an official position of "co-belligerency" as opposed to fighting as an ally of Germany. Certainly, Finland fought for its own war aims, sometimes to the detriment of the German war effort, such as when the halted their drive towards the Murmansk railroad (to avoid antagonising the UK and USA), and refusing to attack Leningrad, both acts which left them better positioned politically at the end of the war.
As for the Winter War, the common Finnish view was that Germany had sold them out. The division of the region into German and Soviet spheres of influence was secret, but suspected considering the Soviet participation in the carving up of Poland after the German invasion. From the Finnish perspective, Germany was preserving its alliance with the Soviets by blocking aid to Finland, and goodwill from friendly interwar German-Finnish relations and trade, and in some circles, from German military aid and participation with the Whites during the Finnish Civil War, evaporated. Finland's participation in the attacks on the Soviet Union alongside Germany was not based on any love for Germany, but of fear of the Soviet Union, the impossibility of assistance from other than Germany, and restoration of territory lost in the Winter War. For some, there were also dreams of Suursuomi, "Greater Finland", incorporating at least Russian Karelia (East Karelia), and perhaps Ingria, Estonia, and Kola.
Further reading:
The secret protocols of the Molotov-Ribbentrop Pact: https://en.wikisource.org/wiki/Molotov%E2%80%93Ribbentrop_Pact#Secret_Additional_Protocol
Good coverage of German-Finnish relations before, during, and after the Winter War: Olli Vehviläinen, Finland in the Second: World War Between Germany and Russia, Palgrave, 2002.