Skip to content

Commit

Permalink
STENCIL-3533 Remove gift certificate format validation
Browse files Browse the repository at this point in the history
Before we had a Gift Certificates API for the creation or import of gift certificates from another system, gift certificates in BC were all of a single format, alphanumeric with hyphens like this:

AAA-AAA-AAA-AAA

However, now we have the API and 3rd parties are welcome to import certificates of an arbitrary format.

However, Cornerstone still validates the old format, which will cause these imported certificates to fail.Making this change to fix that and allow any format.
  • Loading branch information
bookernath committed Jun 19, 2017
1 parent b22fb4a commit 2cc4bde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Swaps `writeReview` for `write_review` to fix email link issue [#1017](https://github.com/bigcommerce/cornerstone/pull/1017)
- Maintenance page stylesheet fix [#1016](https://github.com/bigcommerce/cornerstone/pull/1016)
- Restore four products per row on category pages when sidebar is empty. [#1018](https://github.com/bigcommerce/cornerstone/pull/1018)
- Remove gift certificate format validation [#1026](https://github.com/bigcommerce/cornerstone/pull/1026)

## 1.8.1 (2017-05-05)
- Bug fix for category sidebar [#1006](https://github.com/bigcommerce/cornerstone/pull/1006)
Expand Down
3 changes: 2 additions & 1 deletion assets/js/theme/common/gift-certificate-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export default function (cert) {
return false;
}

return /^[A-Z0-9]{3}\-[A-Z0-9]{3}\-[A-Z0-9]{3}\-[A-Z0-9]{3}$/.exec(cert);
// Add any custom gift certificate validation logic here
return true;
}

0 comments on commit 2cc4bde

Please sign in to comment.