Affiliate code on registration

Can anyone explain how to use the affiliate plugin so I can do the following?

I want to ask for an affiliate code on the registration/payment page. However, if the person was not referred by anyone then I want an option for them to pay without entering an affiliate code.

Is this possible?