cfPaymill: A ColdFusion interface to the Paymill API

Fed up with PayPal? Frustrated with SagePay? Why not try Paymill?

Paymill is a new generation Payment Service Provider (PSP) that offers an innovative solution to the question of PCI compliance for online retailers.

Interfacing to the Paymill API is simple for Adobe ColdFusion and Railo developers with the cfPaymill component.

Take a look at the getting started guide and you'll see how easy it is to integrate Paymill into your shopping cart with the cfPaymill ColdFusion component.

I've created a Twitter account, cfPaymill to handle any initial questions you may have. In time there will be a blog and forum to discuss the project.

In June 2013 I gave a Lightning Talk at the Scotch on the Rocks ColdFusion conference in Edinburgh and I have uploaded the slides here.

Enjoy!

getting started

First you'll need an account with Paymill. It's free to sign up and you'll get both public and private test API keys which you'll need later on.

Then build your payment form. You could use the Paymill example as a starter. Don't forget to replace the public key in the example with the one given to you when you signed up. Also change the form action value to point to the ColdFusion page that will process the request.

Visit the cfPaymill page on GitHub, download the latest version (currently 0.3.2), then drop the component cfPaymill.cfc into the webroot of your website.

Finally, in your form action processing page, you just need add...

<cfset cfPaymill=createObject("component", "cfPaymill").init(privateKey="8a4d1230504c19caf55d02f150730afa", publicKey="148466278085160bc9d8ee20b29d279f",
apiEndpoint="https://api.paymill.com/v2/")>
<cfset transaction=cfPaymill.addTransaction(card-amount-int,card-currency,form.paymilltoken)>

Where my-private-key is replaced with the value given in your account. The values of card-amount-int and card-currency come from your server-side shopping cart and match those hidden fields on the credit card details form. The value of the form scoped variable form.paymillToken is returned from the Paymill Javascript Bridge service.

What you'll get back in the variable transaction is a structure that contains the data returned from the Paymill API. Try the Demonstration page and see the result returned.

And that's basically it. Not hard eh!

Now, of course, there's a lot more that can be done to make your code more efficient and integrated with your chosen development framework. So come back soon and hopefully there'll be more content and examples as time goes on.

Requirements

Paymill account, Adobe ColdFusion 9.0+, Railo 3.3+