NOTE: This is for September 12, 2013 breaking changes local currency payments documentation.
Migration
- To migrate your old payment system first of all follow step 1 of Development guide and create url's for each selling item.
- Then change your frontend JS accordingly to the sample provided in the link https://developers.facebook.com/docs/howtos/payments/paymentflow/#paydialog
- Finally callback flow is quite different however the most similar to previous method is Real Time Updates via Graph API. The docs are solid here and it's there is little of benefit from my text. Just follow https://developers.facebook.com/docs/howtos/payments/fulfillment/#overview
Development
Step 1 - Define your Items
If you want to make dynamic prices for things such as flash sales - don't provide the price, but that defeats the purpose of Facebook cached HTML views IMO, probably just a reason to push `og`. In this case on each popup Facebook will ask your backend the exact price. Request/Response after the image:
https://developers.facebook.com/docs/howtos/payments/definingproducts/#pricing_dynamic
List of supported currencies: https://developers.facebook.com/docs/concepts/payments/currencies/
You can debug your views by pasting your item link to https://developers.facebook.com/tools/debug/
Step 2 - Add JavaScript
In this step you have to create JS method that will be called in the frontend in order to call up the payment popup.
It's easy and nothing much to add here. Just look up this https://developers.facebook.com/docs/howtos/payments/paymentflow/#paydialog
It's easy and nothing much to add here. Just look up this https://developers.facebook.com/docs/howtos/payments/paymentflow/#paydialog
Step 3 - Create Callback
Here is the meat of the callback: https://developers.facebook.com/docs/howtos/payments/fulfillment/#jscallback
In the overview you'll see a graph and explanation below it, all you care at this point is what happens on step 8 and after. This is the callback logic. The best thing about it that docs are pretty solid here, also for rather quick rundown on logic video is great too.
So here you have two options (or both): you can confirm purchase via frontend (this is good for notification of payments for the user) and backend and technically you don't need both (technically!), and better one is via real time callback (backend) true graph api since it's more secure and will update in cases where JavaScript might fail (video explains this quite well).
So frontend docs are here: https://developers.facebook.com/docs/howtos/payments/fulfillment/#orderfulfillment
And Real Time docs: https://developers.facebook.com/docs/howtos/payments/fulfillment/#asynchronousconfirmation
Not much else to drop from this.
Have fun.
In the overview you'll see a graph and explanation below it, all you care at this point is what happens on step 8 and after. This is the callback logic. The best thing about it that docs are pretty solid here, also for rather quick rundown on logic video is great too.
So here you have two options (or both): you can confirm purchase via frontend (this is good for notification of payments for the user) and backend and technically you don't need both (technically!), and better one is via real time callback (backend) true graph api since it's more secure and will update in cases where JavaScript might fail (video explains this quite well).
So frontend docs are here: https://developers.facebook.com/docs/howtos/payments/fulfillment/#orderfulfillment
And Real Time docs: https://developers.facebook.com/docs/howtos/payments/fulfillment/#asynchronousconfirmation
Not much else to drop from this.
Have fun.