diff options
-rw-r--r-- | epirts.js | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -57,6 +57,12 @@ var Stripe = Epirts = (function() { }()); pub.setPublishableKey = function(key) { + if (typeof key !== 'string') { + throw new Error('Invalid publishable key'); + } + if (!key.match(/^pk_[A-Za-z0-9_]+/)) { + throw new Error('Invalid publishable key'); + } _key = key; }; |