Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6742369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:50:07+00:00 2026-05-26T11:50:07+00:00

I’m trying to create a Facebook Mobile Application using asp.net and MVC3 and integrate

  • 0

I’m trying to create a Facebook Mobile Application using asp.net and MVC3 and integrate Facebook Credits as a payment method. First of all, taking the recent annoucements into consideration, is it now possible to have a mobile web application that accepts Facebook Credits?

If so, I’ve taken the example provided in the following post

http://www.m-webs.com/blog_facebookcredits.html

And implemented the following Controller action:

public JsonResult CallBack()
{
    string fborder_info = Request.Form["order_info"];
    string fborder_id = Request.Form["order_id"];
    string fbmethod = Request.Form["method"];



    if (fbmethod == "payments_get_items")
    {

        fborder_info = fborder_info.Substring(1, (fborder_info.Length - 2)); // remove the quotes 

        ulong credscost = 2; // Price of purchase in facebook credits 

        var theItem = new FacebookBuyItem()
        {
            item_id = 123456789,
            description = "Own yours today!",
            price = credscost,
            title = "Digital Unicorn",
            product_url = "http://www.facebook.com/images/gifts/21.png",
            image_url = "http://www.facebook.com/images/gifts/21.png"
        };

        var res = new Dictionary<string, object>();
        res["method"] = fbmethod;
        res["order_id"] = fborder_id;
        res["content"] = new object[] { theItem };
        var jss = new JavaScriptSerializer();
        var ob = jss.Serialize(res);
        ob = ob.Replace("#$", @"\/".Replace("//", @"\/"));

        return Json(ob, JsonRequestBehavior.AllowGet);
    }

    return null;
}

I’ve verified that the callback is being requested by facebook, and I’ve also captured the response being sent back, which appears to contain all of the required information to display the purchase dialog, but I’m still getting the following error message:

API Error Code: 1151
API Error Description: Sorry, but this app may not be eligible to accept Facebook Credits. If this app has accepted credits before, please try again.
Error Message: Invalid Application

and when tested from a mobile browser:

Sorry, but we’re having trouble processing your payment. You have not been charged for this transaction. Please try again.

I’ve also noticed that my callback is being requested twice which doesn’t seem right either.

Any insight into how to get my integration up and running would be greatly appreciated. My Facebook AppId is 177876855621874

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:50:07+00:00Added an answer on May 26, 2026 at 11:50 am

    Update: So I played around with the examples given and reverted back to webforms in order to test the example given at http://www.m-webs.com/blog_facebookcredits.html. In order to get this solution working in an asp.net MVC3 application I had to change the action type to HttpResponse instead of JsonResult which makes sense as the JsonResult leaves elements out that would normally be included in a HttpResponse.

    So the Controller Action ended up looking like this:

    [HttpPost]
    public HttpResponse CallBack()
    {
        if (Request.Form["signed_request"] != null)
        {
            var decodeFbSignedRequest = FacebookSignedRequest.Parse(FacebookApplication.Current.AppSecret,
                                                                Request.Form["signed_request"]);
    
            LogHelper.MicroLogMsg("SIGNED REQUEST DECODE:: " + decodeFbSignedRequest.Data);
        }
    
        string fborder_id = Request.Form["order_id"];
        string fbmethod = Request.Form["method"];
        string fborder_info = Request.Form["order_info"];  // Use this to look up a product on the database..
    
        if (fbmethod == "payments_get_items")
        {
            int credscost = 2; // Price of purchase in facebook credits 
    
            var theItem = new FacebookBuyItem()
            {
                item_id = "123456AA",
                description = "[Test Mode] Own yours today!",
                price = credscost,
                title = "[Test Mode] Digital Unicorn",
                product_url = @"http:\/\/www.facebook.com\/images\/gifts\/21.png",
                image_url = @"http:\/\/www.facebook.com\/images\/gifts\/21.png"
            };
    
            // Return the initial response to FB 
            //------------------------------------------ 
            var res = new Dictionary<string, object>();
            res["method"] = fbmethod;
            res["content"] = new object[] { theItem };
    
            var jss = new JavaScriptSerializer();
            string ob = jss.Serialize(res);
    
            LogHelper.MicroLogMsg(ob);
    
            Response.ContentType = "application/json";
            Response.Write(ob);
            Response.End();
        }
    
        return null;
    }
    

    I hope this helps out anyone doing an MVC3 implementation for Facebook Credits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.