GitXplorerGitXplorer
l

elm-cart

public
3 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
056dd7667a226428a1f37c75830f0eecb00c16cd

Add MIT license

llsimoneau committed 8 years ago
Unverified
28b094ba33c100a4033af5a4fd5c8f5be19af423

Add instructions to the README

llsimoneau committed 8 years ago
Unverified
c6057e4422950978a28633cb713fa4763a7cab82

Add seed data and remove description from product table

llsimoneau committed 8 years ago
Unverified
95d14b1572b5086979a52cb4defacaf1cf3fbd29

Use latest release of elm-rails

llsimoneau committed 8 years ago
Unverified
1dacee7a6cb0c2940e9d5a10be3aa483048e539a

Fix elm tests and improve formatting

llsimoneau committed 8 years ago
Unverified
e8bf907592eda4854471fede3435d5b6e78d4154

Handle card token errors from Stripe

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.