<commit_before>[![Compatibility](https://img.shields.io/badge/spree%20compatibility-3.0-pink.svg)](https://github.com/halo/spree_digital/blob/master/Versionfile)
[![Build Status](https://travis-ci.org/halo/spree_digital.png?branch=master)](https://travis-ci.org/halo/spree_digital)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://github.com/halo/spree_digital/blob/master/LICENSE.md)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/halo/spree_digital)

# Spree Digital

This is a spree extension to enable downloadable products (ebooks, MP3s, videos, etc).

In the [Versionfile](https://github.com/halo/spree_digital/blob/master/Versionfile) you can see which
[spree_digital branch](https://github.com/halo/spree_digital/branches/all?query=stable) supports which
[Spree version](https://github.com/spree/spree/branches/all?query=stable).
The master branch is not considered stable and corresponds to the [spree master branch](https://github.com/spree/spree).

This documentation is not complete and possibly out of date in some cases.
There are features that have been implemented that are not documented here, please look at the source for complete documentation.

The idea is simple.
You attach a file to a Product (or a Variant of this Product) and when people buy it, they will receive a link via email where they can download it once.
There are a few assumptions that spree_digital (currently) makes and it's important to be aware of them.

* The table structure of spree_core is not touched.
  Spree digital lives parallel to spree_core and does change the existing database, except adding two new tables.
* The download links will be sent via email in the order confirmation (or "resend" from the admin section).
  The links do *not* appear in the order "overview" that the customer sees.
  Adding download buttons to `OrdersController#show` is easy, [check out this gist](https://gist.github.com/3187793#file_add_spree_digital_buttons_to_invoice.rb).
* Once the order is checked-out, the download links will immediately be sent (i.e. in the order confirmation).
  You'll have to modify the system to support 'delayed' payments (like a billable account).
* You should create a ShippingMethod based on the Digital Delivery calculator type.
  The default cost for digital delivery is 0, but you can define a flat rate (creating a per-item digital delivery fee would be possible as well).
  Checkout the [source code](https://github.com/halo/spree_digital/blob/master/app/models/spree/calculator/digital_delivery.rb) for the Digital Delivery calculator for more information.
* One may buy several items of the same digital product in one cart.
  The customer will simply receive several links by doing so.<commit_msg>Update badges for new repo<commit_after>[![Compatibility](https://img.shields.io/badge/spree%20compatibility-3.0-pink.svg)](https://github.com/spree-contrib/spree_digital/blob/3-0-stable/Versionfile)
[![Build Status](https://travis-ci.org/spree-contrib/spree_digital.png?branch=3-0-stable)](https://travis-ci.org/spree-contrib/spree_digital)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://github.com/spree-contrib/spree_digital/blob/3-0-stable/LICENSE.md)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/spree-contrib/spree_digital)

# Spree Digital

This is a spree extension to enable downloadable products (ebooks, MP3s, videos, etc).

In the [Versionfile](https://github.com/spree-contrib/spree_digital/blob/3-0-stable/Versionfile) you can see which
[spree_digital branch](https://github.com/spree-contrib/spree_digital/branches/all?query=stable) supports which
[Spree version](https://github.com/spree/spree/branches/all?query=stable).

This documentation is not complete and possibly out of date in some cases.
There are features that have been implemented that are not documented here, please look at the source for complete documentation.

The idea is simple.
You attach a file to a Product (or a Variant of this Product) and when people buy it, they will receive a link via email where they can download it once.
There are a few assumptions that spree_digital (currently) makes and it's important to be aware of them.

* The table structure of spree_core is not touched.
  Spree digital lives parallel to spree_core and does change the existing database, except adding two new tables.
* The download links will be sent via email in the order confirmation (or "resend" from the admin section).
  The links do *not* appear in the order "overview" that the customer sees.
  Adding download buttons to `OrdersController#show` is easy, [check out this gist](https://gist.github.com/3187793#file_add_spree_digital_buttons_to_invoice.rb).
* Once the order is checked-out, the download links will immediately be sent (i.e. in the order confirmation).
  You'll have to modify the system to support 'delayed' payments (like a billable account).
* You should create a ShippingMethod based on the Digital Delivery calculator type.
  The default cost for digital delivery is 0, but you can define a flat rate (creating a per-item digital delivery fee would be possible as well).
  Checkout the [source code](https://github.com/halo/spree_digital/blob/master/app/models/spree/calculator/digital_delivery.rb) for the Digital Delivery calculator for more information.
* One may buy several items of the same digital product in one cart.
  The customer will simply receive several links by doing so.
{'fraction_non_alphanumeric': 0.09442527692028328, 'fraction_numerical': 0.006900308698020701, 'mean_word_length': 5.013100436681222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 25, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3035804', 'n_tokens_mistral': 1629, 'n_tokens_neox': 1556, 'n_words': 595}