One of the main reasons for developing mobile
applications, aside from building cool products and services, is making money.
Developers have been able to monetize apps through a purchase price, in-app
purchases and advertising. However, there are situations, such as dealing with
the sales of physical goods, which are not suitable for in-app
purchases. Stripe is the solution to this problem. Stripe is an
open-source platform that allows app developers to collect payments directly
from users without implementing an in-app purchase system.
One of Stripe’s greatest strengths is how it completes most of the heavy lifting regarding security for you. The Stripe API and their server complete the processing and storage of credit card information, which is all PCI (Payment Card Industry) compliant. This means that all you have to do is gather the necessary information, package it up with your server and send it to Stripe.
To accomplish this, client and server APIs are provided for many common platforms. Stripe is supported on iOS, Android and JavaScript web applications for the client side and several server languages including Ruby, Python and PHP. I used the iOS tools with Ruby on Rails for the server so experiences might vary when implementing on other platforms.
Now, before we dive into the code, let’s talk a bit more about Stripe’s capabilities. With this system, you are able to set up subscriptions for recurring billing and one-click purchases by storing information previously entered by your customer. The best part of this, as mentioned previously, is that Stripe stores and protects this information for you. With your server, you can retrieve customer payment information at a later date. This makes for an improved user experience.
Also, with respect to user experience, Stripe allows you to customize your payment experience. You use Stripe code to process the information but where/when the information is gathered and how the view is designed is up to you. In iOS, a custom view created by Stripe is used to gather and validate the important credit card information. This view can be dropped in anywhere within your app when you’re ready to process the transaction.
I’m sure by now you’re thinking: “Okay, that’s great but what is it going to cost me?” Stripe charges 2.9% + $0.30 per successful transaction for their services. This includes everything, so there aren’t any storage fees for keeping customer information on the server or a monthly fee to use the APIs. The only other fee that you might incur is a $15 fee for a chargeback if one of your customer’s complains to the bank. The transaction fees are automatically taken when a transfer to your bank account occurs.
One of the downsides of this service is that funds are not deposited into your account until 7 days after the transaction was completed. According to the Stripe FAQ, this delay is used to help protect them from various risks associated with the credit card industry. This may not present an issue for your business if you have a steady flow of transactions, but just keep this delay in mind. Another downside is that, at this time, only companies in Canada or the U.S can use Stripe and therefore only Canadian and U.S dollars are supported currencies. However, this restriction only applies to businesses. You can accept payments from international customers as long as they use a Visa, MasterCard or American Express card.
That should provide you with a good idea of what Stripe is and what the system is capable. Let’s take a look at how everything works. The lifecycle of a credit card transaction can be broken down into the following steps:
1. Client side app sends credit card information to the Stripe server
2. Stripe server returns a token representing this card
3. Client side app sends this token plus any necessary information (like name, address, purchase amount) to your server
4. Your server creates a new charge based on this information and sends it to the Stripe server
5. Stripe server charges the card and returns the result
6. Your server returns the result to the client app

The provided APIs handle all contact with the Stripe server. This removes the complexities associated with securely transmitting sensitive credit card information. The only communications that you have to be worried with are the requests between your server and the client app. Stripe recommends you use SSL to complete this part of the transaction.
Now I will outline the general steps required to implement a simple Stripe system. I have created a simple shopping cart type of application on iOS to help illustrate the capabilities of the system. You can find it at:
https://github.com/danielmackenzie/StripeDemo
Client Side (iOS App):
1. Go to https://stripe.com/ and create a new account
2. Download the Stripe iOS bindings and add them to your project
3. Create and programmatically add the STPView to your view controller (your test public key can be found under Account Settings from the online dashboard)
4. Create token by sending information to the Stripe server
5. Send the token and extra information to your server
6. Handle the response
Server Side (Rails server):
1. Install the ‘stripe’ gem and add it to your Gemfile
2. Configure Stripe with your private authentication key (found through the dashboard)
3. (optional) Create a new customer with the provided information
4. Charge the card with the desired amount
5. Return the result to the client
For tutorials on how to write the code to implement this system, take a look at the documentation: https://stripe.com/docs or the example app. They provide detailed instructions on how to download and use the APIs for your platform.
And that’s it! Hopefully you now see how easy it is to get Stripe set up and configured. If you have any questions or concerns, feel free to send me an email at daniel@monolithinteractive.com


