Beispiel #1
0
        //https://webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier/serialNumber
        public async Task <HttpResponseMessage> Post(string version, string deviceLibraryIdentifier, string passTypeIdentifier, string serialNumber, HttpRequestMessage message)
        {
            string authorizationToken = message.Headers.Authorization.Parameter;

            string jsonBody = await message.Content.ReadAsStringAsync();

            JObject json      = JObject.Parse(jsonBody);
            string  pushToken = json["pushToken"].Value <string>();

            PassRegistrationResult result = PassRegistrationResult.SuccessfullyRegistered;

            //this.handler.RegisterPass(version, deviceLibraryIdentifier, passTypeIdentifier, serialNumber, pushToken, authorizationToken, out result);

            HttpStatusCode resultCode = HttpStatusCode.InternalServerError;

            switch (result)
            {
            case PassRegistrationResult.SuccessfullyRegistered:
                resultCode = HttpStatusCode.Created;
                break;

            case PassRegistrationResult.UnAuthorized:
                resultCode = HttpStatusCode.Unauthorized;
                break;

            case PassRegistrationResult.AlreadyRegistered:
                resultCode = HttpStatusCode.OK;
                break;
            }

            return(new HttpResponseMessage(resultCode));
        }
 public void RegisterPass(string version, string deviceLibraryIdentifier, string passTypeIdentifier, string serialNumber, string pushToken, string authorizationToken, out PassRegistrationResult result)
 {
     // Implement your custom handler here.
     result = PassRegistrationResult.SuccessfullyRegistered;
 }
 public void RegisterPass(string version, string deviceLibraryIdentifier, string passTypeIdentifier, string serialNumber, string pushToken, string authorizationToken, out PassRegistrationResult result)
 {
   // Implement your custom handler here.
   result = PassRegistrationResult.SuccessfullyRegistered;
 }