Player.IO

Build fun, powerful & scalable online and mobile games with the reliable backend your users expect

Sign Up | Sign In
  • Supports Buying Coins: GetBuyCoinsInfo()
  • Supports Direct Purchase: GetBuyDirectInfo()

Facebook PayVault Provider

If you distribute your game as a Facebook IFrame application, you can allow your players to buy items and coins in your game for Facebook Credits. Getting your game on Facebook can be pretty complicated if you do it all by yourself, but is really simple if you use our other services such as Sitebox and QuickConnect.

From the perspective of PayVault, Facebook Credits are treated as a real-world currency with the currency code FBC. This means that if you want to sell items directly you need to set the property 'PriceFBC' to the price in Facebook Credits, just like you normally would set the property 'PriceUSD' on an item that has a price in US Dollars.

Setting up your Facebook app

  1. Sign up for Facebook on http://www.facebook.com/
  2. Create a Facebook app for your game by going to https://developers.facebook.com/apps
  3. Click on Edit settings for your app, and on the Basic settings page, add 'playerio.com' to the App Domains field.
  4. After that, navigate to the Payments settings. In this section, you need to choose or register your company with Facebook for receiving your payments, and you need to specify your contact email.
  5. On this page you also need to enter a Payments Callback URL. This URL is specific per game, and you can find it on the Payvault configuration page in the Player.IO Admin Panel for your game.

Configuring PayVault on Player.IO

  1. Enable Facebook in the PayVault admin panel for your game.
  2. Enter the Facebook Application Id and App Secret. You can find these values on your app overview page on Facebook.
  3. If you want to allow coin purchases through Facebook, you need to add one or more coin price points also. Each price point is just a way of telling Player.IO that the user can buy X coins for Y Facebook Credits.

    You specify price points as string in the form of [credits]FBC=[coins], with multiple price points separated with comma.

    For example, the string: '10FBC=100,100FBC=1200' means that users can buy 100 coins for 10 Facebook Credits, or 1200 coins for 100 Facebook Credits.

Buying Coins: GetBuyCoinsInfo()

Example of buying coins with Facebook in ActionScript 3:

Required GetBuyCoinsInfo() Arguments
coinamount The amount of Coins to purchase. The coinamount must have defined price point in the PayVault setup.
title The title of the purchase that will be shown in the Facebook payment flow.
description The description of the purchase that will be shown in the Facebook payment flow.
image_url A url to an image of the purchase that will be shown in the Facebook payment flow.
product_url A url to a page where the purchase is displayed to the user.
Result Values
method These values need to be passed straight to the Facebook API function.
order_info
purchase_type

In-app Currency Offers: GetBuyCoinsInfo()

You can read more about in-app offers on Facebook here: https://developers.facebook.com/docs/credits/offers/.

This function can also be used to get the data needed to open the In-app Currency Offer popup. This allows your players to complete offers and earn your currency directly, instead of Facebook Credits. You need to perform the same setup as for a direct purchase of coins, but the first pricepoint in your PayVault configuration will be converted to an exchange rate, and that exchange rate will be applied to all offers that are presented.

For example, if your first pricepoint is '10FBC=100', it means that an offer that would normally award the user 1 Facebook Credit will instead award the user 10 coins directly.

Example of in-app offers on Facebook in ActionScript 3:

Required GetBuyCoinsInfo() Arguments
action Must be set to 'earn_currency'.
title The plural name of your in-app currency.
description A short description of your in-app currency.
image A url to a 50x50px image of your in-app currency.
Result Values
method These values need to be passed straight to the Facebook API function.
action
product

Buying Items: GetBuyDirectInfo()

Example of buying an item directly with Facebook in ActionScript 3:

Required GetBuyDirectInfo() Arguments
coinamount The amount of Coins to purchase. The coinamount must have defined price point in the PayVault setup.
title The title of the purchase that will be shown in the Facebook payment flow.
description The description of the purchase that will be shown in the Facebook payment flow.
image_url A url to an image of the purchase that will be shown in the Facebook payment flow.
product_url A url to a page where the purchase is displayed to the user.
Result Values
method These values need to be passed straight to the Facebook API function.
order_info
purchase_type