The credit could be easily checked over USSD command directly on the module. Connect to the gateway by using HyperTerminal or Putty and send at command at&gXX=XTDussd, where XX stands for number of GSM module and ussd for the command.
Example: you want to check credit on GSM module g08 and the command is *101#. You will enter following at&g08=XTD*101#