I'm using node js, jade, and drywall (account management system) and I'm including a stripe
script in my views/signup/index.jade
file, like this:
extends ../../layouts/default
block head
title Sign Up
block neck
link(rel='stylesheet', href='/views/signup/index.min.css?#{cacheBreaker}')
block feet
script(src='/views/signup/index.min.js?#{cacheBreaker}')
script(src='src="https://js.stripe.com/v2/"')
script
Stripe.setPublishableKey('pk_test_4ZVxtJ6e1uJJxWi2L6QWL8Hq');
And in my public/views/index.js
file I'm calling this function
Stripe.card.createToken($form, stripeResponseHandler);
However, I get the error Stripe is not defined.
(meaning that the Stripe script
I imported isn't being acccesed in the file that I'm in). So I thought to move the script tag to my layouts/default.jade
file and put it in the head so it would appear in the head of every document, but still no luck. Any ideas on what I'm doing wrong?