GitXplorerGitXplorer
l

elm-cart

public
3 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
a760d8da5a51f2217b719368aa41786cc13aa4db

Handle stripe error cases

llsimoneau committed 8 years ago
Unverified
9af3754b6f105bb2bf606eab0876b57a734dd9f1

"Finished" the front-end part of the stripe integration

llsimoneau committed 8 years ago
Unverified
34bed4c7566b7657227ace1d2842b70084a9ff17

Finish out checkout form content

llsimoneau committed 8 years ago
Unverified
5bdeb896db970ee33d2e400232848f4383a6b324

Add checkout form with basic stuff

llsimoneau committed 8 years ago
Unverified
d13125304d6f2171b077f1bf5f014ba9bea619d4

Refactor cart to a list of items

llsimoneau committed 8 years ago
Unverified
d94476f30eb1f2c770283a7f0f2a42f409adff06

Switch to my fork of the elm-rails gem for better dep mgmt

llsimoneau committed 8 years ago

README

The README file for this repository.

README

This is a demo eCommerce application to show how you can integrate Elm with Rails

Pre-requisites

  • Postgres
  • Ruby 2.3 (may work with earlier versions, but not tested)
  • Elm 0.18

Setup

Assuming you have all the above, you can first create your database and populate it with some products:

rake db:setup

Start your server with:

rails s

Then visit localhost:3000 in your browser and you should be able to start adding items to your cart.

Application Layout

The elm files are located in app/assets/elm.

Elm tests

Elm tests are located in spec/elm.

First install the headless test runner:

npm install -g elm-test

Then run elm-test spec/elm/Main.elm from the project root.

Stripe

While you will be able to add and remove items from the cart, the checkout form depends on integration with Stripe. If you create an account with Stripe and get test keys, you'll be able to use the checkout form by providing your API keys to the application as environment variables (remember to use TEST keys when playing with the app in development):

STRIPE_PUBLISHABLE_KEY="<Your publishable key>" STRIPE_KEY="<Your API key>" rails s

Stripe provides some test credit cards that will behave in a predictable way when using TEST API keys:

  • 4242424242424242 : Successful payment (use a valid expiry date in the future and any CVC code)
  • 4000000000000002 : Card declined

Others can be found in the Stripe documentation.