Preheat the oven to 350°F (175°C) and line a 12-cup muffin tin with paper liners.
In a medium bowl whisk together the flour, baking powder, and salt, then set aside.
In a large bowl beat the softened butter and sugar with a mixer until light and fluffy, about 2 to 3 minutes.
Add the eggs one at a time, beating well after each addition, then mix in the vanilla extract.
Add the dry ingredients to the butter mixture in two additions, alternating with the milk, beginning and ending with dry ingredients, mixing just until combined.
Divide the batter evenly among the 12 liners, filling each about two-thirds full.
Bake the cupcakes for 18 to 20 minutes, or until a toothpick inserted in the center comes out clean.
Transfer the pan to a wire rack and let the cupcakes cool in the pan for 5 minutes, then remove them to the rack to cool completely.
While the cupcakes bake, start the pastry cream by heating the milk in a medium saucepan over medium heat until steaming but not boiling.
In a medium bowl whisk together the egg yolks, sugar, and cornstarch until smooth and pale.
Slowly whisk about half of the hot milk into the yolk mixture to temper it, whisking constantly.
Pour the tempered yolk mixture back into the saucepan with the remaining milk while whisking.
Cook over medium heat, whisking constantly, until the mixture thickens and just starts to bubble, 1 to 3 minutes.
Remove from heat and whisk in the butter, vanilla extract, and salt until smooth.
Transfer the pastry cream to a small bowl, press plastic wrap directly onto the surface, and chill in the refrigerator for at least 1 hour.
For the ganache, place the chocolate chips in a small heatproof bowl.
Heat the heavy cream in a small saucepan over medium heat until just simmering, then remove from heat.
Pour the hot cream over the chocolate chips, let sit for 2 minutes, then add corn syrup if using and whisk until smooth and glossy.
Let the ganache cool to room temperature until it thickens slightly but is still pourable, about 15 to 20 minutes.
Once the cupcakes are completely cool, use a small knife or the end of a piping tip to cut a small cone-shaped hole in the center of each cupcake, reserving the tops.
Fill a piping bag or zip-top bag with the chilled pastry cream and pipe it into each cavity, filling nearly to the top.
Trim the reserved cake plugs and gently place a thin piece back over each filled center to seal.
Spoon or dip the top of each cupcake into the cooled ganache, allowing excess to drip off, then place back on the rack.
Let the ganache set at room temperature for at least 20 to 30 minutes before serving.