This week we're going to handle Stripe integration for a fictional subscription service. Today, we'll be integrating with Stripe.js to generate a token from a credit card form. Let's get started.

I'm starting on the elm_web_components_playground project, tagged before this episode.

Since the last episode, I've just added a basic BillingModel and corresponding Msg and Update functions. Let's have a look briefly:

vim src/Model.elm
module Model exposing ( Model , BillingModel -- <-- , CreditCardModel -- <-- , initialBillingModel -- <-- , initialCreditCardModel -- <-- ) -- ... type alias Model = { -- ... , billing : BillingModel } -- Our BillingModel keeps track of a potential token response from the server, -- and a credit card we're building in the form. type alias BillingModel = { token : Maybe String , creditCard : CreditCardModel } -- The credit card has typical fields type alias CreditCardModel = { name : String , ccNumber : String , cvc...