Website Monetization: Simplified

A way to move forward

You have built a shopping app using rails.

You have installed a one of a kind gem called bullet that ensures that you do not hit your database unnecessarily.

Your app is working at optimal level and you are now able to debug at a faster rate due to the improve syntax Rubocop gives you.

Users are ecstatic at the functionalities you have implemented to your website and the reviews you are receiving are mostly positive.

After all the time that you have spent on working it’s time to monetize your website…

How??? You ask??

We’re going to go over a brief guide into the ins and outs of adding a payment system to your website. You can use this payment system for the products your sell or the services you render. The endpoint is that the payment will be made on your website. It is a valuable knowledge and a skill that will forever come handy.

Lets get started!

First you must sign up for an API key on the simplify website. The simplify website is run by MasterCard and therefore has all the functionality and security you would expect from a major credit card system.

After receiving your API key from the website which is a simple one minute process. You must install the simplify gem:

gem 'simplify', '~> 1.1.2'

Of course you don’t want your keys don’t go into the wild, and get used by some unfounded member of the hacker community.

To prevent that we are going to use the figaro gem. Figaro allows you to define configuration values without exposing them to outside predators.

All you need to do to use the figaro gem is to put it in your gemfile and bundle install it.

gem 'figaro'

Once you have install the figaro gem you need to make the functionality you add the keys to your application.yml which will be initialized out of the configure once your app is launched.

You will than need to initialize those keys by creating a simplify.rb in the config/initializers folder. Those keys will inherit from the ENV folder and keep your public and private keys in a safe space.

Once you have your keys entered and protected you are ready to move on to the next phase of the process.

You need to create a credit card form that you’re users will be able to fill in.

For this project I created the validations directly into the form. This was recommended and I find it easier to connect where each validation belong.

After building your form you need to create the card token for your website that will safely transfer the card details of your customers. This can be obtained from the simply website.

Once obtained you add the code below to the coffee script file in the javascript folder of your rails app.

1st source code from
2nd source code from

Once you have written the source codes . You will need to create a pay method in your controller that will take in the payment information that your user filled out.

Once those params are passed in you need to ensure that you redirect the user accordingly. Once this is done you have the functionality your app working.

End Product!

Simplify ensures that the information your users has entered is safe and that the amount is debited from their account directly into yours.

You are done! You have monetize your app and are can sell product online.

Sage Pay: Pass the development phase

This was a brief intro into using payment systems. I hope to do more research and report the best system at the lowest cost for all to use and enjoy!

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.