<commit_before># Requirements

* Xero Account
* BitPay Account

# Installation

```bash
git clone URL path/to
cd path/to
composer install
vagrant up
```

# Configuration

See `config/prod.php` for settings. You will also need to configure
Xero and create a private app.

# Usage

```bash
vagrant share
```<commit_msg>Added lots of detail in the README file<commit_after>This silex application shows a simple way to integrate Xero and BitPay to
allow customers to pay with Bitcoins.

# Requirements

* [Xero Account](https://www.xero.com/us/)
* [BitPay Account](https://bitpay.com/)
* [Vagrant Cloud Account](https://vagrantcloud.com/)

# Installation

```bash
git clone https://github.com/JoshuaEstes/xero-silex-app.git
cd xero-silex-app
composer install
vagrant up
vagrant share
```

# Configuration

If you have not already done so, make sure you have run `vagrant up` and
`vagrant share` as you will need the URL.

## Step 1

### Xero

* Log into your Xero Account, Goto `Settings > General Settings`
* Click on `Invoice Settings`
* Click on `Payment Services`
* Click on `Add Payment Service > Custom Payment URL`
* Put `Bitcoin` for name and `[VagrantShare URL]/xero/invoice?invoiceNo=[INVOICENUMBER]&currency=[CURRENCY]&amount=[AMOUNTDUE]&shortCode=[SHORTCODE]` for custom URL

### BitPay

* Log into your BitPay account and click on `API`
  * **NOTE** You can get a test account from https://test.bitpay.com
* Click on `API Access Keys`
* Click on `Add New API Key`
  * This key is used in `config/prod.php`

## Set 2

### Xero

* Head over to http://developer.xero.com and click on `My Applications`
* Click `Add Application`
* Select `Private` for your application. Enter the information required.
  * The certs that you generate should be put into the `config/certs` directory of this project.
  * Make note of the `Consumer Key` and `Consumer Secret`

## Set 3

Enter the keys that you acquired in `config/prod.php`

# Complete

If you have followed the Configuration steps, you are done and are ready to test
you app.
{'fraction_non_alphanumeric': 0.10004928536224741, 'fraction_numerical': 0.0014785608674223755, 'mean_word_length': 4.328083989501312, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 5, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2573242', 'n_tokens_mistral': 657, 'n_tokens_neox': 634, 'n_words': 260}