discount coupon and payment gateway

With the latest update of membership (which I updated to earlier) if I create a discount coupon for say 20% and a user inputs this discount code while signing up to our product does the 20% get deducted from the price in my payment gateway (PayPal) automatically? or how does this work??

Any advice greatly appreciated. thank you!