# Validate coupon codes

**URL:** https://meta.discourse.org/t/validate-coupon-codes/193181
**Category:** Feature
**Tags:** subscriptions
**Created:** [June 8, 2021, 3:18am UTC](https://meta.discourse.org/t/validate-coupon-codes/193181 "2021-06-08T03:18:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Kchalk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kchalk/32/226787_2.png) [@Kchalk](https://meta.discourse.org/u/Kchalk)
#### Post date: [June 8, 2021, 3:18am UTC](https://meta.discourse.org/t/validate-coupon-codes/193181/1 "2021-06-08T03:18:01Z")

</div>

Played around with the coupon function, it is working perfectly. 👍

I have a concern though, on promo code validation, or lack of.

To repro:

1. Entered a valid test CC
2. Entered a random promo code that doesn’t exist in my coupon configuration
3. Transaction was completed
4. The full price was charged without any discounts

System-wise, this is expected behaviour, don’t get me wrong. But I am hoping to get consensus that step 2 requires some form of user intervention, The process should be halted and the user prompted if an invalid promo code is entered.

By allowing the transaction to go through, the user expects a discounted price but will be surprised at the full charge. The occurrence of typos is real, I have seen users fumbling with even the simplest copy-paste instructions.

Some considerations if this can be repro by all:

- Introduce validation checking of promo codes
- Ability to prefill the promo code field through hardcoded URL parameters to minimize manual typing e.g. /s/productname`?promo_code=awesomesupporter`

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [June 8, 2021, 11:55am UTC](https://meta.discourse.org/t/validate-coupon-codes/193181/2 "2021-06-08T11:55:19Z")

</div>

> [@Kchalk](#):
>
> System-wise, this is expected behaviour, don’t get me wrong. But I am hoping to get consensus that step 2 requires some form of user intervention, The process should be halted and the user prompted if an invalid promo code is entered.

Good catch! I’ll add this to the list of improvements to make.

---

<div class="post-metadata">

### Author: ![Kchalk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kchalk/32/226787_2.png) [@Kchalk](https://meta.discourse.org/u/Kchalk)
#### Post date: [June 8, 2021, 2:13pm UTC](https://meta.discourse.org/t/validate-coupon-codes/193181/3 "2021-06-08T14:13:47Z")

</div>

Thank you Justin, really appreciate of the work put into this.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [June 14, 2021, 5:22pm UTC](https://meta.discourse.org/t/validate-coupon-codes/193181/5 "2021-06-14T17:22:17Z")

</div>

> [@Kchalk](#):
>
> By allowing the transaction to go through, the user expects a discounted price but will be surprised at the full charge. The occurrence of typos is real, I have seen users fumbling with even the simplest copy-paste instructions.

Coupon code validation is implemented in this PR:  
[https://github.com/discourse/discourse-subscriptions/pull/74](https://github.com/discourse/discourse-subscriptions/pull/74)

EDIT: Merged.

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [June 16, 2021, 5:57pm UTC](https://meta.discourse.org/t/validate-coupon-codes/193181/6 "2021-06-16T17:57:25Z")

</div>


