private static async Task <IAggregatePartner> GetPartner() { if (_partner == null) { _partner = await PcAuthHelper.GetPartnerCenterOps(); } return(_partner); }
public static async void UpdateCustomer(MyCustomer customer) { var partner = await PcAuthHelper.GetPartnerCenterOps(); // convert customer to PC customer var pcCustomer = ConvertCustomer(customer); partner.Customers.ById(customer.Id).Profiles.Billing.Update(pcCustomer.BillingProfile); return; }
public static async Task <MyCustomer> GetCustomer(string customerId) { var partner = await PcAuthHelper.GetPartnerCenterOps(); // get customer from PC & convert to local model var pcCustomer = await partner.Customers.ById(customerId).GetAsync(); var customer = ConvertCustomer(pcCustomer); return(customer); }
public static async Task <List <MyCustomer> > GetCustomers() { var partner = await PcAuthHelper.GetPartnerCenterOps(); // get list of customers from PC var pcCustomers = partner.Customers.Get(); // convert customers to local model var customers = new List <MyCustomer>(); foreach (var pcCustomer in pcCustomers.Items) { var customer = ConvertCustomer(pcCustomer); customers.Add(customer); } return(customers.ToList()); }