Skip to content

Unable to validate coupon codes that are longer than 3 parts #4

@gee-forr

Description

@gee-forr

Hi there,

Firstly - thank you for your gem - it's really appreciated. I"m having an issue with getting validation working with codes that are longer than three parts.

Here's how to reproduce:

working = CouponCode.generate # => "HRVE-2BAU-P2JD"
CouponCode.validate(working) # => "HRVE-2BAU-P2JD"

not_working = CouponCode.generate(parts: 4) # => "XTVE-A8KF-6PVL-EH6M"
CouponCode.validate(not_working) # => nil

Any ideas? I hope you can help :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions