[Updated] Having fun with Docker, Stripe and Kill Bill

[Updated] Having fun with Docker, Stripe and Kill Bill

One of our most popular blog posts is Having fun with Docker, Stripe and Kill Bill, where we showed how easy it is to leverage the powerful subscription engine offered by Kill Bill while delegating payments to Stripe. A lot has happened over the past 18 months: tools like docker-machine and docker-compose have become better and recent releases of Kill Bill have removed the need to edit various configuration files post-installation. Let’s take a look at how simpler the installation process has become. I assume you already have Docker installed and created a Stripe account. The first step is to create a machine to run your containers. On a mac, you would typically use the virtualbox driver: docker-machine create -d virtualbox killbill eval $(docker-machine env killbill) Note that to deploy Kill Bill to the cloud, the steps are similar (simply replace the driver with your provider’s, such as Microsoft Azure for example). Next, create a docker-compose file similar to the one below: and run: docker-compose up 3 containers will start: one for MariaDB (shared database), one for Kill Bill itself and one for Kaui (Kill Bill admin UI). You can then explore Kill Bill APIs by going to http://192.168.99.100:8080/api.html or log-in to Kaui by going to http://192.168.99.100:9090 (username: admin, password: password) to create your tenant. Note: make sure to replace 192.168.99.100 with the IP of your machine which you can retrieve via docker-machine ip killbill The final step is to configure your Stripe credentials. Create a configuration file stripe.yml: :stripe: :api_secret_key: 'sk_test_aaaabbbbccccdddd' and upload it via Kaui at http://192.168.99.100:9090/admin_tenants/1:     That’s it! To test your installation, you can run our sample Sinatra app,...
Kill Bill on Microsoft Azure

Kill Bill on Microsoft Azure

The open-source Kill Bill platform provides advanced subscription management as well as payment APIs. Businesses of any size, from the 2-person startup to public companies, rely on it for their e-commerce recurring billing and shopping cart payment needs. Lots of SaaS companies have similar offerings. Choosing the right partner from the get go is critical however, as migrations are error-prone and difficult. If you are a young startup, you probably want something simple, cheap and low-maintenance, which can adapt to your needs as you grow. Kill Bill combined with Microsoft Azure BizSpark for startups gives you just that, which probably explains the uptick of requests we’ve had recently regarding integration with Microsoft Azure. Thanks to our Docker images, this is quite easy – this tutorial will show you how to deploy Kill Bill integrated with Stripe in a few commands. Pre-requisites Create a Microsoft Azure account Write down your subscription id: log-in to https://portal.azure.com, click on the account dropdown, then “My permissions” Install the latest version of docker-machine VM setup Create the VM using docker-machine: docker-machine create -d azure \ --azure-ssh-user ops \ --azure-subscription-id AZURE_SUBSCRIPTION_ID \ --azure-open-port 8080 \ --azure-open-port 3000 \ azure You should see it running at https://portal.azure.com/#blade/HubsExtension/BrowseAllResourcesBlade. Write down the IP of the machine by running docker-machine ip azure Configure your shell for the rest of the tutorial: eval $(docker-machine env azure) Database setup For this tutorial, we will simply run a MySQL database in a Docker container on the same host: docker run -tid \ --name db \ -p 3306:3306 \ -e MYSQL_ROOT_PASSWORD=root \ -e MYSQL_DATABASE=killbill \ mariadb Modify the database to make sure it...
Kill Bill GO client library

Kill Bill GO client library

We are quite excited to announce that we created a new client library to interact with Kill Bill in GO. GO is becoming an important new player: We are seeing more and more successful projects (e.g Docker written in GO), or startups like CloudFlare embracing this new language. The declarative syntax is a bit of a pain at first, and the structure and naming of the packages is also something i am not really sold on, but the language itself is a good middle point between low level C programming and more modern code (where one does not need to think about allocating and freeing memory for instance). One of the main asset of GO are the goroutine (along with the channels), a lightweight thread abstraction that can be used to write highly concurrent programs. Our motivation (besides providing a new way to connect to Kill Bill) is based on the use of these goroutines to write Kill Bill load tests. At this stage, we only implemented a limited number of APIs, but we hope the community can pick-up the work as the need...
Having fun with Docker, Stripe and Kill Bill

Having fun with Docker, Stripe and Kill Bill

Note! An updated version of this tutorial can be found here.   Kill Bill has been dockerized! In this post, I’m going to show you how to get started with your own Kill Bill installation, integrated with Stripe, running on Docker.   Setup Start by installing Docker if you don’t have it yet. You will also need a Stripe api key. To get one: Create a free account at Stripe.com Go to your API Key Settings Write down the Test Secret Key   Deep dive into the Kill Bill container Our Docker image is based off the ubuntu:14.04 one. It comes with Tomcat and KPM (the Kill Bill package manager). Kill Bill is not yet present in the image: it is the role of KPM to fetch the Kill Bill war and its plugins. The first time the container is started, KPM will look at its configuration file (/etc/killbill/kpm.yml) and lay down the bits accordingly. The reason for this deferred step is to let you customize the image if you want to (Kill Bill version, plugins, etc.). You can start Kill Bill by running: docker run -tid --name killbilltest -p 8080:8080 killbill/killbill --name killbilltest assigns a name to the container, to be able to reference it easily later on -p 8080:8080 exports the port from the container, to access it from the host Here are some useful commands: docker logs -f killbilltest to tail the Kill Bill logs docker exec -ti killbilltest /bin/bash to log-in to the container docker exec -ti killbilltest cat /etc/killbill/killbill.properties to explore the Kill Bill configuration docker exec -ti killbilltest cat /etc/killbill/kpm.yml to explore the KPM...