We have one product, payment is by PayPal. Before going to PayPal need to apply a discount. We want to create a system where people can enter a gift certificate code to get
"Do not need entire shopping cart just the discount code parts.."
This is a really broad question with no specific answer. Accomplishing what you're talking about requires a lot of integration that would be specific to exactly what you're working on. If you publish your code to Github or somewhere and are having a specific problem, try re-posting any difficulties you run into.
If you're just looking for some examples of this being done, check out http://www.oscommerce.com/community/contributions,4269 and see if reading the source code gives you some implementation ideas.