PlayerIO

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

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

Google Wallet PayVault Provider

Setting up your app in Google Wallet

  1. Log on to the Google Wallet Settings page with your Google account at
    https://checkout.google.com/customer/gadget/inapp/settings.html.
  2. If your account isn't yet a Google Wallet Merchant account, you will be prompted for the required information at this point.
  3. At the settings page, you can see your seller identifier, your seller secret, and you can specify a postback url. Enter this url and save:
    http://api.playerio.com/payvault/googlewallet/postback
  4. For testing purposes, you may wish to complete the above steps in the sandbox:
    https://sandbox.google.com/checkout/customer/gadget/inapp/settings.html
  5. When testing, you need to make the test purchases from a different Google account than your merchant account, and you can use these test credit cards:
    https://developers.google.com/commerce/wallet/digital/docs/testing

Configuring PayVault on PlayerIO

  1. Enable Google Wallet in the PayVault Control Panel for your game.
  2. Enter your seller identifier and seller secret. You can find these on your Google Wallet Settings page.
  3. When testing the payments, use the seller identifier and secret from the sandbox settings page.

Using the Google JavaScript API

To use Google Wallet in your game, you need to host it in an HTML page where the Google JS API library has been loaded. You need to set up JS callbacks that pass info along into your game, and you need to set up a JS function that can be called from your game and passed some parameters.

If you're using SiteBox to host your game, here's a barebones example using the sandbox:

Important: To make live payments, you need to switch the Google JS API to production config, and change your settings in the PayVault Control Panel using the seller identifier and secret from the live Google Wallet Settings page:

Buying Coins: GetBuyCoinsInfo()

Example of buying coins with Google Wallet in ActionScript 3:

Required GetBuyCoinsInfo() Arguments
coinamount The amount of Coins to purchase. The combination of coin amount and currency must be a defined price point in the PayVault setup.
currency The currency you wish to use for this purchase. The currency must be supported by Google Wallet.
name A short description of the purchase as it should be presented to the user
Optional GetBuyCoinsInfo() Arguments
description A longer description of the purchase that will be presented to the user.
Result Values
jwt The jwt that you should pass to the goog.payments.inapp.buy() method on the surrounding page.

Buying Items: GetBuyDirectInfo()

Example of buying an item directly with Google Wallet in ActionScript 3:

Required GetBuyDirectInfo() Arguments
currency The currency you wish to use for this purchase. The currency must be supported by Google Wallet.
name A short description of the purchase as it should be presented to the user
Optional GetBuyDirectInfo() Arguments
description A longer description of the purchase that will be presented to the user.
Result Values
jwt The jwt that you should pass to the goog.payments.inapp.buy() method on the surrounding page.