GitXplorerGitXplorer
l

elm-cart

public
3 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
50f8a2d505c68671b97d7c157618973abec00f28

Add success view when checkout is complete

llsimoneau committed 8 years ago
Unverified
00b31a254b924b2a2fb4deee919a01c10035a6f5

Style shopping cart view

llsimoneau committed 8 years ago
Unverified
bd24fcc892d14dd7de7019d58c3da6e4f82781cd

Add total to cart model

llsimoneau committed 8 years ago
Unverified
a5c2e891ff41fef74dde5ed804877ad602981162

Update navigation cart count with a port

llsimoneau committed 8 years ago
Unverified
ff8c4ad16fd1cb01854f1bdf7e3b48c66b218955

Fix formatting and rename checkout to checkingOut

llsimoneau committed 8 years ago
Unverified
68f13b4541d6d566eb90a483a54e0c856ac66674

Extract View into a module

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.