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.
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 | |
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 | |
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 | |