Paymill is a Stripe clone available for those of us in Europe. There’s somecontroversy with the cloning side of things, but either way this is a long awaited opportunity for web businesses here in the Old Continent.
I created a simple rails SaaS site using paymill. You can check out the code on github, or keep reading for more details on using paymill with ruby and rails.
Paymill with ruby
We’ll be using the paymill-ruby gem (github), a ruby wrapper for the Paymill API. Right now it’s in a very early stage, but it works fine for the basics.
To install it: gem install paymill.
The steps for accepting payments are very simple.
Each time we submit the form paymill gives us a new token that we can use in the terminal to do our testing. Tokens are strings beginning with tok_ and are only valid for a single transaction.
Once we have the token supply we can now fire up irb and start testing the API.
For example, making a 10€ transaction with the description “Testing paymill-ruby”:
creating a 10€ transaction
require'paymill'Paymill.api_key="your_private_paymill_key"# private key from paymill settingsPaymill::Transaction.createamount:1000,currency:'EUR',token:'tok_c05cfc4f1e1b8a7cf1f5',description:'Testing paymill-ruby'
Hopefully the transaction will appear immediately in our paymill Dashboard. For more information about what is possible with the API and the gem, check out the Paymill API Reference and the paymill-rubysource code and documentation.
The paymill control panel lets you create Offers, which are how Subscription Plans are called in paymill. Once created, the plans can be used to subscribe clients via the API.
Offers have names beginning with offer_. These are the plan IDs that will be needed to setup the subscription with a client and credit card.
Integrating paymill subscriptions in a rails app is simple. I created a sample app based on
Railscast #288 Billing with stripe (code), but since the APIs are very similar it shouldn’t be difficult to convert some other stripe-based site.
Since iOS 3.2 it’s very easy to use custom fonts in iPhone or iPad Apps. Unfortunately, this method only works with certain font formats (.otf, .ttf), and not with others such as the extension-less, Font Suitcase or PostScript Type 1 outline. But if the font you need happens to be in some other format, there’s some extra work to do.
First, extract the actual font from the resources fork of the file. Fondu can help with that. You can install fondu using homebrew (brew install fondu) or following this easy steps to install from source.
Once fondu is installed we need to extract the font resources:
> fondu path/to/fontfile/..namedfork/rsrc
> fondu path/to/fontfile/..namedfork
> fondu path/to/fontfile
Some people have found that they have to remove the /..namedfork/rsrc or the /rsrc part for it to work, It may depend on the way the font is packaged.
If the extracted font is a .ttf or .otf file, then you are done! In some cases it will be a .pfb or .bdf file, which will have to be converted. There’s a lot of resources for that, I used freefontconverter.com and worked perfectly.