-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup response for payments_get_items call
- Loading branch information
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
class CreditsController < ApplicationController | ||
def create | ||
# TODO | ||
render :nothing => true | ||
auth = Facebook.auth.from_signed_request(params[:signed_request]) | ||
transaction = auth.data[:credits] | ||
case transaction[:method] | ||
when 'payments_get_items' | ||
render :json => { | ||
:content => [{ | ||
:title => "[Test Mode] Unicorn", | ||
:description => "[Test Mode] Own your own mythical beast!", | ||
:price => 2, | ||
:image_url => "http://www.facebook.com/images/gifts/21.png", | ||
:product_url => "http://www.facebook.com/images/gifts/21.png" | ||
}], | ||
:method => "payments_get_items" | ||
} | ||
when 'payments_status_update' | ||
render :nothing => true | ||
end | ||
end | ||
end | ||
end |