Setting Up Client-Side Stripe

First off, we need to set things up. We need to add the Stripe.js library to our application. Many JavaScript libraries commonly used with Rails have been bundled into Ruby gems so that they can be added to the manifest file of the Rails asset pipeline. Stripe.js is not most JavaScript libraries. In particular, it is important for PCI compliance purposes that you retrieve the Stripe JavaScript file directly from Stripe and not from your own server or a content-delivery system. The most common practice is to directly include the library directly in the HTML header of your layout template, like so:

 = stylesheet_link_tag(​"application"​,
 media: ​​"all"​, ​ ...

Get Take My Money now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.