Jaana Metsamaa is the head of engineering at Fortumo, the mobile payments company that powers in-app payments for game developers such as Rovio, Gameloft, Vostu and Zeptolab. The company covers 80 countries through 300 operators and lets users make payments on the web and in Android, Windows 8 and Windows Phone apps.
Fortumo recently added Corona SDK support for their Android and NOOK in-app payments via a Corona Plugin. In this post, Jaana walks developers through the integration process for adding mobile payments into their Android apps built with Corona.
Mobile payments give end-users a way to make in-app payments by charging purchases to their phone bill. Mobile payments work for literally anyone who has a mobile phone, whereas credit card payments are available to only those that have a credit card. In most countries (especially emerging markets such as Brazil and China) phones outnumber credit cards by up to ten times. This means adding mobile payment capability into your app will significantly increase the number of potential paying users.
On top of that, mobile payments are significantly faster than credit card payments – users do not need to sign up, fill out forms or enter their credit card credentials. You can see an example of Fortumo’s one-click mobile payment flow in the Angry Birds’ screenshot to the right. It’s a one-click solution from the first payment, requires no sign up or registration, and ultimately leads to higher conversion rates and revenue.
Developers using Corona SDK can now integrate Fortumo’s payments and start billing in any Android app store, including Google Play, NOOK Apps, Amazon Appstore and other 3rd party app stores. Integration should only take about an hour. Here’s how to get started:
- Service Setup via Fortumo homepage: Create an account on our homepage and navigate to the Dashboard. On the Dashboard, create a new service for in-app purchasing on Android or NOOK. After creating the service, you will need to integrate the Fortumo Corona Plugin into your app.
- Configuring the SDK: In order to use the Fortumo plugin, you need to add the following to your “build.settings” file. Note that the Corona simulator will automatically include the Android permissions that the plugin needs to the built APK.
- Making a payment: Configuring payments with Fortumo is simple:
- Setting up server side receipt verification (optional): Receipt verification is a convenient way to stream payment data to your servers and for integrating in-app purchases with users online profile so that purchases and users’ virtual items can be kept track of online. Receipt verification works by making a HTTP GET request to your server after each payment. Here you can read about how to get your service backend to talk to Fortumo.
-- key is the name passed to Lua's require()
publisherId = "com.fortumo",
-- enable Fortumo plugin
local fortumo = require("plugin.fortumo")
-- initiate Fortumo payment object
local request = fortumo.newPaymentRequest();
-- set the product name to be displayed to the user
request:setDisplayString("Super Powers #1");
-- associate the payment with your Fortumo account
request:setService("service id", "app secret");
-- set unique product identifier
-- non-consumable products (by product name) can be restored even after app uninstall
-- launch the payment flow
-- And once the payment has been completed, we’ll receive the payment result
print("complete=" .. response.billingStatus);
onPaymentComplete may return fortumo.BILLING_STATUS_PENDING if the UI is hidden before the payment is completed. If it’s a non-consumable product then it will return fortumo.BILLING_STATUS_BILLED the next time makePayment is called. Alternatively, it’s possible to use fortumo.setStatusChangeListener() method to get notified as soon as possible in the background.
The full Fortumo Lua API documentation for more details about the APIs and access to the sample project can be found at http://docs.coronalabs.com/daily/plugin/fortumo.
After testing and making sure that payments work, you’re good to go!
We are excited to be working with Corona developers and are looking forward to bringing you additional revenue from users without credit cards. If you have any questions or need help with the integration, please let us know at firstname.lastname@example.org.