MacBooks (and Pros) are notorious for having multiple part variations and it is not advised to purchase a replacement of this nature without confirming that it matches all of the following identification criteria:
Year (or portion thereof): Usually stated as Early/Mid/Late 20XX - as in your post, Mid 2012 (note that Retina models are different as well)
Processor: For example, 'Core i5 - 2.4GHz'
Apple order/part number: For example, ' MD101LL/A'
Hardware identifier: A1278 as you have stated.
Model identifier: Takes the form ModelName[number1],[number2], e.g. MacBookPro9,2. This can be found using the System Information utility (accessible from 'Applications > Utilities' or 'Apple Menu > About This Mac') in Mac OS X.
The best place to look for all the Apple identification parameters in a searchable database is http://www.everymac.com/. If you have a couple, such as those you've already stated, it should be easy to find the rest.
Only when you are satisfied that all of these particulars in the replacement part description match your machine should you consider acquiring. That's not to say that some parts are not interchangeable amongst models, but generally multiple models will be accounted for in the part description, so use this in conjunction with your machine's details to be certain it's the right part.