mjhea0 / node-stripe-charge

node + stripe + express + bootstrap 4 (used for one time charges)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

You must change the publishable key in main.js

RonAlmog opened this issue · comments

the example did not work for me, with some error like 'the token 123xvxsdfsdf does not exist!'.
i had to dive into the code and find that regardless of the config file, you manually set the publishable key in client/js/main.js. when i changed it to my key, the thing started to work.

btw, i'm not sure what's going on there. upon submit, you call stripe ** from the client ** asking for a token, and canceling the submit. Only then when stripe calls you back, you embed the stripeToken in a hidden field, and initiate a submit.

Why not just do all this work from server side?
why not simply submit the information to the server, and in the server get the token, do the charge, etc.
is this possible or i'm missing something?

Thank you, great example!

I update the readme to include info on updating the key in main.js. Sorry!

Also, the workflow that I am using is part of Stripe.js => https://stripe.com/docs/stripe.js?

wow, you're quick. thanks!