anchor.diff:  
   This process can take up to 48 hours. In the meantime, while you will be able to test one-time purchases, you won't be able to test recurring transactions in PayPal.
   
  -[[initial-setup]]
  -=== Initial setup
  -
  -==== MySQL
  -
  -As stated in the requirements, we're assuming you already have MySQL installed with a killbill database. You need to populate the database with the tables for Kill Bill, and its plugins.
  +[[mysql]]
  +=== MySQL
  +
  +As stated in the requirements, we're assuming you already have MySQL installed with a killbill database. You need to populate the database with the tables for the two plugins (Stripe and PayPal).
   
   Assuming the server is located at 127.0.0.1 and the username/password to connect to it are killbill/killbill, run:
   
   [source,java]
   ----
  -curl http://killbill.io/wp-content/uploads/2014/11/killbill-0.12.0.ddl | mysql -h 127.0.0.1 -ukillbill -pkillbill killbill
   curl https://raw.githubusercontent.com/killbill/killbill-stripe-plugin/master/db/ddl.sql | mysql -h 127.0.0.1 -ukillbill -pkillbill killbill
   curl https://raw.githubusercontent.com/killbill/killbill-paypal-express-plugin/master/db/ddl.sql | mysql -h 127.0.0.1 -ukillbill -pkillbill killbill
   ----
   
  -==== Tomcat
  -
  -We will use the Tomcat container to run Kill Bill as a Web application. If you are not familiar with Java containers, don't worry, the process is pretty straightforward:
  -
  -* Download the Tomcat container https://s3.amazonaws.com/kb-binaries/apache-tomcat-7.0.42.tar.gz[here]
  -* Un-tar the archive. We will assume it is at /var/tmp/tomcat in the rest of this tutorial
  -* Remove all files and directories under webapps/
  -* Create a configuration file for Kill Bill: mkdir -p conf/Catalina/localhost && echo '<Context></Context>' > conf/Catalina/localhost/ROOT.xml
  -
  -The final step is to point it to your MySQL installation. Add this to conf/catalina.properties, updating the parameters as necessary (note that Kill Bill has two JDBC pools, one for the core and one of OSGI plugins):
  -
  -[source,java]
  -----
  -org.killbill.billing.osgi.dao.url: jdbc:mysql://127.0.0.1:3306/killbill
  -org.killbill.billing.osgi.dao.user: killbill
  -org.killbill.billing.osgi.dao.password: killbill
  -org.killbill.dao.url: jdbc:mysql://127.0.0.1:3306/killbill
  -org.killbill.dao.user: killbill
  -org.killbill.dao.password: killbill
  -----
  -
  -[[killbill-installation]]
  -=== Kill Bill installation
  -
  -We will use https://github.com/killbill/killbill-cloud/tree/master/kpm[KPM] (the Kill Bill Package Manager) to simplify the installation of Kill Bill and its plugins.
  -
  -Create a kpm.yml file with the following content:
  -
  -[source,ruby]
  -----
  -killbill:
  -  version: 0.12.1
  -  webapp_path: /var/tmp/tomcat/webapps/ROOT.war
  -  plugins_dir: /var/tmp/bundles
  -  plugins:
  -    ruby:
  -      - name: paypal-express-plugin
  -        version: 1.8.1
  -      - name: stripe-plugin
  -        version: 1.0.0
  -----
  -
  -This instructs kpm to install Kill Bill version 0.12.1 in the Tomcat webapps directory, as well as two payment plugins, one for Stripe and one for PayPal. To start the installation, run:
  -
  -[source,bash]
  -----
  -kpm install kpm.yml
  -----
  -
  -Once KPM is done, you should see the war at /var/tmp/tomcat/webapps/ROOT.war as well as various files and directories under /var/tmp/bundles.
  +[[plugins-installation]]
  +=== Plugins installation
  +
  +Go to the Kaui http://127.0.0.1:8080/kaui/kpm/plugins[plugins page] and click the install button next to Stripe and PayPal. The process takes a few minutes to download and setup the binaries on the filesystem.
   
   Plugins are installed under /var/tmp/bundles/plugins. You should see one sub-directory per plugin. If you work with Ruby, the directory structure should be familiar, as it is simply a gem cache. If you don't, don't worry. Just know that each plugin is independent and has all of its dependencies, hence the large number of files and directories.
   
  -The /var/tmp/bundles/platform/ directory is used for non Kill Bill specific OSGI plugins. For convenience, it installed a recommended set of useful plugins to interact with OSGI, enhance logging, etc. If you don't know what OSGI is, don't worry about it, these plugins will just make your life easier down the line. There is one important file in that directory however: /var/tmp/bundles/platform/jruby.jar. This file makes it possible for Kill Bill to run Ruby plugins. While you could delete all other files in that directory, without jruby.jar, none of the payment plugins installed will start!
  -
   ==== Stripe setup
   
  -Configure the Stripe plugin by create the configuration file at /var/tmp/bundles/plugins/ruby/killbill-stripe/1.0.0/stripe.yml (replace your credentials accordingly):
  +Create the Stripe configuration file (replace your credentials accordingly):
   
   [source,ruby]
   ----
   :stripe:
     :api_secret_key: 'sk_test_aaaabbbbccccdddd'
     :test: true
  -
  -----
  +----
  +
  +Then upload it to Kill Bill by going to your http://127.0.0.1:8080/kaui/admin_tenants/1[tenant configuration page] and selecting the "Plugin Config" file at the bottom (the plugin name is killbill-stripe).
   
   ==== PayPal setup
   
  -Configure the Stripe plugin by create the configuration file at /var/tmp/bundles/plugins/ruby/killbill-paypal-express/1.8.1/paypal_express.yml (replace your credentials accordingly):
  +Configure the Stripe configuration file (replace your credentials accordingly):
   
   [source,ruby]
   ----
  
positive.code:   :login: 'your-username-facilitator.something.com'
    :password: 'your-password'
    :test: true
  
  :database:
    :adapter: 'jdbcmysql'
    :jndi: 'killbill/osgi/jdbc'
    :connection_alive_sql: 'select 1'
    :pool: 25
  ----
  
  ==== Testing
  
  That's it! Kill Bill should be ready to use. Let's try to start Kill Bill:
  
  [source,bash]
  ----
  ./bin/catalina.sh run
  ----
  
  One the startup sequence is done, you should see Kill Bill running at http://127.0.0.1:8080/index.html[http://127.0.0.1:8080/index.html].
  
  Test your installation by creating a tenant:
  
  [source,bash]
  ----
  curl -v \
       -X POST \
       -u admin:password \
       -H 'Content-Type: application/json' \
       -H 'X-Killbill-CreatedBy: admin' \
       -d '{"apiKey": "bob", "apiSecret": "lazar"}' \
       "http://127.0.0.1:8080/1.0/kb/tenants"
  ----
  
  Tenants lets you namespace accounts and all associated data (subscriptions, invoices, payments, etc.) in Kill Bill. This is especially useful for testing: create a new tenant, try a few things out and when you are done, delete the data associated with this tenant (the rest of the data will be preserved).
  
  At this point, we're ready to integrate Kill Bill with your application.
  
  [[integration]]
  == Shopping cart integration
  
negative.code: [[gateways-setup]]
  === Payment gateways setup
  
  To accept credit cards, we will integrate with https://stripe.com[Stripe]: they offer free sandbox accounts and provide a nice dashboard to follow what's going on. Choosing your payment processor is critical however, you need to make sure it offers the features you need (international payments, etc.) while minimizing your costs (see this http://killbill.io/blog/choosing-payment-gateway/[blog post] for more details on the topic). Luckily, there are thousands of vendors available and Kill Bill can integrate with pretty much any of them, so make sure to do your research.
  
  ==== Stripe
  
  