Make the pastry according to instructions. Blind bake until golden and crisp in a 180°C/350°F oven then remove from the oven and allow to cool.
To make the filling, combine the milk, cream, sugar, vanilla and coffee in a saucepan and bring to boiling point.
In a separate bowl, combine the corn starch flour, cocoa powder, egg yolks and salt and mix well to form a smooth paste. If the mixture is very thick, simply whisk in a few tablespoons of the milk mixture until it smooths out.
When the milk has reached boiling point, remove from the heat.
Whisk a ladle full of the hot milk into the corn starch mixture to temper the eggs.
Pour the liquid back into the saucepan and over low-medium heat, whisk continuously until the filling is thick and glossy.
Pour the mixture through a sieve to make sure there is no lumps. Whisk in the butter and pour the smooth filling into the prepared pie case.
Spray a piece of parchment paper with cooking spray then press onto the surface of the custard to prevent a skin from forming.
Allow to set in the fridge for at least 4 hours but ideally overnight.
When you are ready to serve, whip the cream with the icing sugar and swirl onto the pie. Top with chocolate shavings and serve.