Notes about IISNode, NodeJS, Stripe, WebHub integration

Stripe

Create your ecommerce payment gateway account at stripe.com.

IISNode

IISNode lets you use NodeJS together with IIS in a way that makes it reasonably convenient to serve the static files over IIS yet have NodeJS respond for selected URLs.

Download from IISNode Releases.  Install. You will end up with files in C:\Program Files\iisnode and you do not control the path.

The README for IISNode is not optional.  READ IT.

NodeJS expects to run in the root of a (sub)domain. If you want it on a virtualpath in your IIS site, make sure you are ready to put in the relevant url rewrite rules.  The IISNode docs explain about this in detail. 

NodeJS

Download: https://nodejs.org/en/download/   and install for win64.  It will install to C:\Program Files\nodejs\ by default.



NodeJS Express with Stripe, Pug and BodyParser


Reference: stripe.com docs about NodeJS with Express

After you have installed NodeJS, which includes NPM, you can install the libraries that make it easy to use stripe.

You go to a CMD prompt in the folder where you want NodeJS to operate within your IIS site.  You can then run this type of syntax to install features that your NodeJS app can take advantage of.  I did not end up using pug on production, but it was very cute and useful during initial testing. 

npm install stripe express pug body-parser


web.config

You must get the web.config precise.
Reference: Good Question; see the answer talking about "IISNode Web.config Template."
Download web.config template directly.


WebHub

To start testing, you can use a whpage definition like this:

<whpage pageid="pgStartStripe" desc="-Start Stripe Charge">
<h1>ok</h1>
<pre>
(~waStripeCharge.Execute|~)
<hr>
(~stringvars~)
### end ###
</pre>
</whpage>

And the waStripeCharge webaction can use ucHttps to talk to the NodeJS url.  This requires an extra https request/response, but adds security because you can then limit network access to the NodeJS that talks to stripe.

WebHub Licensed Here



Comments

Popular Posts