PlayerIO

The fastest way to build online games without breaking a sweat.

  • Supports Buying Coins:
    GetBuyCoinsInfo()
  • Supports Direct Purchase:
    GetBuyDirectInfo()

Facebook PayVault Provider

Setting up your Facebook app

  1. Sign up for Facebook on https://www.facebook.com/
  2. Go to https://developers.facebook.com/apps, click on Add a new App and fill out the initial form.
  3. Next, add the product Canvas Payments to your app. This should take you to the Canvas Payments Settings page, where you first need to choose or register your company with Facebook for receiving your payments.
  4. After that, enable the Webhook for Payments Object.
    • In the Callback URL input box, enter your Facebook Payments Object Callback URL. This URL is specific per game, and you can find it on the Payvault Configuration tab in the PayVault section for your game.
    • In the Verification Token input box, enter "playerio".
    • Press the Test Callback URL button, and it should show a success dialog.
    • Finally, click the Save Changes button at the bottom.

Configuring PayVault on PlayerIO

  1. Enable Facebook in the PayVault Control Panel for your game.
  2. Enter the Facebook App Id and App Secret. You can find these values on the Dashboard page for your app 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 PayVault that the user can buy X coins for [minor units] in [currency] with Facebook.

    You specify price points as a string in the form of [minor units][currency]=[coins] with multiple price points separated by a comma.

    For example, the string: 100USD=50,75EUR=50 means that users can buy 50 coins for either $1.00 USD or €0.75 EUR with Facebook.

Game Payments on Facebook

The most important thing about game payments on Facebook is that users will always see the price of coins and items in their preferred currency.

If your game supplies a price in the user's preferred currency, either through the Coin price points, or by adding a 'Price' property to the PayVaultItem, then your price will be displayed to the user, and the user will be charged that exact price.

If your game does not supply a price in the user's preferred currency, Facebook will use the first currency you specify in the API call as a base currency, and convert the price in that currency to the user's currency and display that based on current exchange rates. This price will therefore fluctuate and not be a nice round number, which is why you might want to specify fixed, good, reasonable prices for your most important non-US markets.

Note that all payouts from Facebook to you are in US Dollars, and any amounts captured by Facebook in other currencies will be converted by them to USD before paid out to you.

We recommend that you set prices for everything you sell in USD as a starting point, use that as your base currency, and then expand to other currencies as needed.

Buying Coins: GetBuyCoinsInfo()

Example of buying coins with Facebook in ActionScript 3:

Required GetBuyCoinsInfo() Arguments
coinamount The amount of Coins to purchase. The coin amount must have defined price points in the PayVault setup for the currencies you supply below.
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 A url to an image of the purchase that will be shown in the Facebook payment flow.
currencies A comma-separated list of currencies that you want Facebook to be able to select from when presenting the payment dialog to the user.

If the user's local currency is present, that price will be presented.

If not, Facebook will convert the price of the coins in the first currency supplied to the user's local currency and present that.
Result Values
method These values need to be passed straight to the Facebook API function.
action
product
request_id

Buying Items: GetBuyDirectInfo()

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

Required GetBuyDirectInfo() Arguments
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 A url to an image of the purchase that will be shown in the Facebook payment flow.
currencies A comma-separated list of currencies that you want Facebook to be able to select from when presenting the payment dialog to the user.

If the user's local currency is present, that price will be presented.

If not, Facebook will convert the item's price in the first currency supplied to the user's local currency and present that.
Result Values
method These values need to be passed straight to the Facebook API function.
action
product
request_id