Hello, 
Thanks for the query to H.C.M. Forum. 
As you stated that there is 
severe pain in the stomach ( GERD) , heart burn, gastritis. 
Every symptoms are there and it is due to Hyper acidity. 
Since you have not mentioned that from how many days you are having these sort of symptoms, so very difficult to say about exact depth of disease. 
Here possibility is of 
peptic ulcer disease or 
Hiatus hernia. 
Diagnosis can be confirmed by upper G I endoscopy. 
Try rising the head of your bed about 4 inches with blocks. It also might help to avoid eating or drinking for two hours  before you lie down. 
To help control the stomach acid , one should not drink alcohol or drinks with caffeine in them or eat chocolate or spicy food or greasy food. 
Also take some antacid ( the best would be if it contains local oxetacaine ), but if symptoms  are severe then you may need 
proton pump inhibitors ( as 
pantoprazole  in your case). 
Side effects of pantoprazole are many as gynaecomatia ,
dizziness, pruritus, edema, insomnia, hyperlipaedimia, 
flatulence, flu like symptoms.
Now  option is consult a gastro enterologist and get his opinion and treatment . 
Good luck. 
Dr. HET