SHOW:
|
|
- or go back to the newest paste.
| 1 | - | //Simple routine to add QBD customer |
| 1 | + | //Add QBD Customer with Billing Address |
| 2 | - | //Documentation: http://goo.gl/XGNz4 |
| 2 | + | //Documentation: http://goo.gl/1GCXg |
| 3 | ||
| 4 | - | var oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey,consumerSecret); |
| 4 | + | var oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret); |
| 5 | var context = new ServiceContext(oauthValidator, realmId, IntuitServicesType.QBD); | |
| 6 | var commonService = new DataServices(context); | |
| 7 | - | |
| 7 | + | |
| 8 | - | var cust = new Intuit.Ipp.Data.Qbd.Customer() |
| 8 | + | Intuit.Ipp.Data.Qbd.Customer qbdCustomer = new Intuit.Ipp.Data.Qbd.Customer(); |
| 9 | - | {
|
| 9 | + | qbdCustomer.Name = "Shawn Carter"; |
| 10 | - | Name = "John Smith", |
| 10 | + | PhysicalAddress physicalAddress = new PhysicalAddress(); |
| 11 | - | }; |
| 11 | + | physicalAddress.Line1 = "123 Main St."; |
| 12 | physicalAddress.Line2 = "Apt. 12"; | |
| 13 | - | var custResponse = commonService.Add(cust); |
| 13 | + | physicalAddress.City = "Mountain View"; |
| 14 | physicalAddress.CountrySubDivisionCode = "CA"; | |
| 15 | physicalAddress.Country = "USA"; | |
| 16 | physicalAddress.PostalCode = "94043"; | |
| 17 | physicalAddress.Tag = new string[] { "Billing" };
| |
| 18 | qbdCustomer.Address = new PhysicalAddress[] { physicalAddress };
| |
| 19 | Intuit.Ipp.Data.Qbd.Customer customerAdded = commonService.Add(qbdCustomer); |