As per OOP's comments, the AI was only informational. It didn't actually create a discount of any kind:
Code wasn't accepted. He copy/pasted his code into the order comments section when he paid his deposit. He demanded the figures be adjusted for his discount code.