Created
March 29, 2012 23:07
-
-
Save jferguson/2244756 to your computer and use it in GitHub Desktop.
.Net Phaxio Integration : Fax Callback w MVC
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
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