UltraCart / responsive_checkout

An UltraCart Javascript checkout designed to render well on all displays, especially mobile devices.
13 stars 20 forks source link

Wait! Don't use this library yet!

This entire checkout can be created within a StoreFront using our Visual Builder. Why not try that?

This video shows an entire checkout created in little over an hour.
Imagine how fast you could create UltraCart checkouts after using the Visual Builder a few times?

https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/514064431/Live+Visual+Building+Tru+Energy+Single+Page+Checkout

Introduction

This shopping cart is a vanilla javascript shopping cart using the latest UltraCart API.

Requirements

For development, you will need:

Getting Started

To Use:

  1. Download or clone this project.
  2. From the base directory, run 'npm install'.
  3. Edit index.html and provide your own browser key (for more on this, read the docs). The one provided will not work. You'll find the key around line 536 of index.html. uc.browserKey = "d7f38666b17e60016306f071d41e3700";
  4. Right below the browser key, set your storefront server name. This is needed to provide proper branding for receipts. uc.storeFront = "demo.ultracartstore.com"
  5. From the base directory, run 'gulp'. The default action will build the .js and .css file.
  6. Deploy or test your checkout!
  7. An easy way to add an item to your checkout is by adding ?ADD=YourItemId to the end of the checkout url.

Changes

Version 2.0

Complete overhaul.

Version 1.4
Version 1.3

This release is also a mandatory upgrade. (Sorry guys) To achieve PCI 3.0 Compliance, all credit card numbers and cvv numbers must go through Hosted Fields. This checkout was updated to do that. Prior to this, the storeCard method was used to send sensitive credit card information to the vault (token.ultracart.com). That solution was acceptable for PCI 2.0, but the Hosted Fields must be used for 3.0.

Full list of Changes (all deal with the cart_implementation/backbone):

Version 1.2

This release is considered a mandatory upgrade. Of this release, the changes in the rest_proxy.php script are most important. Please upgrade your rest_proxy.php scripts as soon as possible. Doing so will prevent issues with your site. Additionally, we've added a proxy version header that will allow us to track which merchants might have out of date proxy scripts in the future. This could prove vital to rapidly addressing any compatibility issues that might arise from future server updates.

rest_proxy.php changes:

Version 1.1

An UltraCart Javascript checkout designed to render well on all displays, especially mobile devices.

This checkout using the UltraCart REST API. The documentation for the REST API is found on docs.ultracart.com. http://docs.ultracart.com/display/ucdoc/UltraCart+REST+Checkout+API

backbone cart implementation:

If you aren't using the precompiled handlebar templates, you should upgrade to avoid any issues with the latest round of browsers. See https://github.com/UltraCart/responsive_checkout/blob/master/cart_implementations/backbone/scripts/handlebars/readme_precompiling.txt for tips on setting up the precompiler using nodejs.

Architecture


Everything is fairly standard to a backbone.js/handlebars.js javascript application, with the exception of the Cart model. We created a mix between the DeepModel and a Nested Model. Had we used the standard backbone.js, we would have lost fine-grained management of 1) nested objects such as the Cart.CustomerProfile object and 2) collection properties such as items. We really wanted row level event notification for the items. So, within https://github.com/UltraCart/responsive_checkout/blob/master/scripts/backbone-uc-common-functions-1.3.js you'll see the models defined to give us detailed control of every part of the Cart object.

With a normal backbone.js model, all properties are access via the model.get('property') method. With our model, we follow this convention, but we also map the items as a direct property of the cart.

So, you'll see within the code app.data.cart.get('shipToFirstName') as well as app.data.cart.items where it lives as a backbone collection of CartItems instead of a normal array of CartItems. This allows for event binding, etc.

Just a head's up.

Release Notes:


11/01/2013 We're releasing this software as version 1.0. We've added the login/logout/register functionality, along with fields to display all customer information. Numerous bugs were fixed with the latest commit.