A. Create a constant: #DISCOUNT_CODE_HASH
B. Value: "12345" (you will change this in a later step)
C. Description: Enter the discount code's hash in quotes.
Step 6
A. Create a constant: #DISCOUNT_CODE_DELETE_ME
B. Value: "test" (use you're real secrete code)
C. Description: Enter the discount code (in quotes) your members will enter.
(Deleting this constant is a key security step in step TBD)
Step 7
A. Create a TEXT field on your form. MemberEntersCode
B. Instructions: Do you have a discount code? Enter your discount code here:
C. Label the field: Discount Code
Step 8
A. Create a CALCRESULT FIELD on your form: ShowDiscountCodeTotal
B. Label the field: Discount Code: $
C. Calculation Result Name: DiscountCodeTotal
D. Decimal Places: 2
Step 9 (optional)
A. Create a RICHTEXTHTML FIELD. This text will appear if an incorrect code is entered. DisplayIncorrectCodeMessage
B. Initially Hidden is checked.
D. Hide/Unhide Calculation: {DiscountCodeTotal}==0 && strlen(MemberEntersCode)>0
E. Enter your message: We're sorry. You've entered an incorrect code.
Step 10
A. Preview your application using the preview tab.
B. Scroll to bottom calculations area and find: HashHere
C. Copy (CTRL-C) the value.
D. Go to your constant tab.
E. Edit the constant #DISCOUNT_CODE_HASH
F. Paste (CTRL-V) into the value. Paste it between the quotes.
G. Click SAVE
Step 11
A. Delete the constant: #DISCOUNT_CODE_DELETE_ME
(Deleting this constant is a key security step)
Step 12
Test your code in the Preview Tab
Test using the wrong code.
- Key security steps to ensure bots don't figure out and post codes.
Security Tips
- Don't skip step 1 & step 11. These steps allow you to remove the actual code. If your code is "test", the text "test" should not be found in any field, calculation, or constant.
- Don't choose easy to guess codes. Humans may not be able to guess SAVE 10, 5 OFF, BOARD MEMBER, etc. However, AI and Bots can.
- The more random the code, the more secure.
- Change your codes often. Redo steps 6, 10, & 11 often.