Tip:
Highlight text to annotate it
X
Welcome. This video discusses how to define your products within the Facebook Local Currency
Payments system.
One of the first things you need to consider when designing your local currency payments
implementation is exactly what products you are going to offer to the user. It sounds
obvious, but there are a number of nuances that require thought before diving in.
The Facebook payments system broadly divides products for sale into two categories, In-app
currency and in-app items.
These are defined in largely the same way. You create an opengraph object on the web
with details about your product. Facebook will then cache it, so we can provide a really
fast checkout experience for the user.
The primary difference between an in-app currency and an in-app item however, is that with an
in-app currency, you additionally provide the *quantity* you are selling at the point
of purchase.
Facebook uses this quantity, combined with details you've provided about an individual
unit of your currency, to establish the final price charged to the user.
To better illustrate this, let's look at an example:
This is our sample game Friend Smash, and I'm working on building a payments solution
into the game. Within the game, we wish to sell an in-app
currency, 'Friend Smash Coins'. The user can use these in exchange for power ups, which
help them in the game. So, the first step to be able to sell these coins is to define
an og:product object for the coin, and check it's valid with Facebook.
By the way, all this code, for Friend Smash and this payments solution is fully open source
and available for you to download. Checkout the fbsamples github page for more information.
So, If we jump into a text editor, you can see the HTML markup which defines the Friend
Smash Coin. The og:product works like any other Open Graph
object. You create a publicly accessible web-page, and provide within it meta-tags for Facebook,
to understand what the object represents.
Here, we're indicating it's a product object, We provide a title, a plural title, because
we're selling more than one, an image, and a description.
We also need to provide the canonical url for this object on the public internet.
Then, we define some properties that are specific to an og:product object. The local currency
payment system allows you to explicitly price your items for regional markets. So here you
can see a list of currency/amount tuples. Each one carries with it the internationally
standarised 3 letter code for the currency, and the assosicated price of this product
in that currency.
So here we can see a Friend Smash coin costs 0.10 US cents, and 0.06 UK pence. Remember,
this is just the price for one coin. The number will be multiplied by the quantity we're looking
to sell at the time of purchase, to generate the final price.
We keep an up to date list of all our supported currencies on the developer site.
Once we've created this object, we need to upload it to a publicly accessible uri on
the web.
To ensure Facebook can see the the object, and that Facebook's cache is up to date, you
can take advantage of our Debug Tool. Navigate to developers.facebook.com/tools/debug
Enter the URL of your object into the form and click Debug. If your object is accessible,
you'll see a response like this. This indicates Facebook successfully fetched your object,
and added it to its cache. Now, when you come to sell your product, Facebook can render
the pay dialog instantly, without having to contact your server, this makes the checkout
experience for the user as fast as it can be.
Providing a price directly in the product object meta data like this, is known as Static
Pricing. This is our recommended pricing method, as it provides the fastest experience for
the user. However, we know it can sometimes be useful to vary the price at the time of
checkout. Typically this is for cases where you want to run a flash sale, or offer a user
a loyalty discount. The Local Currency Payment system supports this, through what we call
Dynamic Pricing.
The way this works is pretty simple, if Facebook doesn't find any pricing information for your
og:product at the time of purchase, we will contact your server to get it.
So, if we go back to our Friend Smash coin object, we can delete the currency pricing
information, save, re-upload, and re-scrape to ensure Facebook's cache is up to date.
Now Facebook doesn't know how much a Friend Smash Coin is worth, so is required to contact
the our server to find out. The callback Facebook will hit is defined in the Payments section
of your app details on the developer site.
Facebook will contact your server and let you know the product and quantity the user
wishes to buy, along with the user's preferred currency. An example of this data is shown
here.
You then respond, confirming the product and currency and additionally providing the critical
'amount' field. Facebook then uses this to generate the final price.
For more details on defining your products, please see the documentation at the url below.
Thanks