Php script update needed on article directory

We need a small update on our existing php credit system on our website. Basically the way our article directory works, is when new users signup, they are given 10 free credits to submit articles using their account. Everything is working perfectly.

All users are tracked and signup using amember. What we have done now is added a product in amember so instead of offering our article submissions free, we made it paid.

Its simple, All I would like someone to do is update the user credit php script, which is one php file, and update it to add 20 free credits to the users account when they order this product.

There is a table for users credits already, and what I was thinking is basically having the script check the orders table for new users order and add this credits to the users account so they can submit more articles.

The credits will increment based on the number of credits they currently have, and it will decrease with each submission. this is already coded on the submission page in users account.