Coupon Code and Affiliate Code

Hi, WPMUDEV Team!

I am using both Membership & Affiliates plugins.
How can I use the coupon code as the affiliate code? Whenever a visitor subscribes, he has to enter a coupon for a discount (of course this case is affiliate code).
Please advice.
Mike.