Skip to content

Commit

Permalink
setup response for payments_get_items call
Browse files Browse the repository at this point in the history
  • Loading branch information
nov committed Jul 22, 2011
1 parent 03c3470 commit 97e6cd1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions app/controllers/credits_controller.rb
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

0 comments on commit 97e6cd1

Please sign in to comment.