Exemple #1
0
        public async Task <bool> EditCustomer(CustomerFacadeDto customer)
        {
            if (ValidConfigStrings() && customer != null)
            {
                HttpClient httpClient = await _handler.GetClient(customerAuthUrl,
                                                                 customerApi, customerScope);

                if (httpClient == null)
                {
                    return(false);
                }
                string uri = customerUri + "/" + customer.CustomerId;
                if ((await httpClient.PutAsJsonAsync <CustomerFacadeDto>(uri, customer)).IsSuccessStatusCode)
                {
                    return(true);
                }
            }
            return(false);
        }
 private void SetupCustomer()
 {
     customer = new CustomerFacadeDto
     {
         CustomerId      = 1,
         CustomerAuthId  = "fakeAuthId",
         GivenName       = "Fake",
         FamilyName      = "Name",
         AddressOne      = "Address 1",
         AddressTwo      = "Address 2",
         Town            = "Town",
         State           = "State",
         AreaCode        = "Area Code",
         Country         = "Country",
         EmailAddress    = "*****@*****.**",
         TelephoneNumber = "07123456789",
         CanPurchase     = true,
         Active          = true
     };
 }
 public async Task <bool> EditCustomer(CustomerFacadeDto editedCustomer)
 {
     Customer = editedCustomer;
     return(Succeeds);
 }