Skip to content

Instantly share code, notes, and snippets.

@jferguson
Created March 29, 2012 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jferguson/2244756 to your computer and use it in GitHub Desktop.
Save jferguson/2244756 to your computer and use it in GitHub Desktop.
.Net Phaxio Integration : Fax Callback w MVC
public class FaxController : Controller
{
public void Receipt(FormCollection faxreceipt)
{
var direction = faxreceipt["direction"];
var isTest = faxreceipt["is_test"];
var faxData = faxreceipt["fax"];
var fax = JsonConvert.DeserializeObject<Fax>(faxData);
//do something w/ fax
}
}
public class Recipient
{
public string number { get; set; }
public string status { get; set; }
}
public class Fax
{
public int id { get; set; }
public int num_pages { get; set; }
public int cost { get; set; }
public string direction { get; set; }
public string status { get; set; }
public string is_test { get; set; }
public int requested_at { get; set; }
public List<Recipient> recipients { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment