public static bool VerifyBooking(SendBookingModel booking, string certifiedUrl, string signature) { string publicKey = GetUrlSslPublicKey(certifiedUrl); string input = JsonConvert.SerializeObject(booking); return(VerifySignature(input, publicKey, signature)); }
public static string SignBooking(SendBookingModel booking, string privateKey) { string input = JsonConvert.SerializeObject(booking); string signature = GetSignature(privateKey, input); return(signature); }
public async Task <SendBookingResponse> SendBookingAsync(SendBookingModel sendBookingModel, string bookingUri, string messageHash = "") { /* var headers = new Dictionary<string, string>() * { * { "X-Message-Hash", messageHash } * };*/ string input = JsonConvert.SerializeObject(sendBookingModel); return(await WindingTreeSender.SendPostRequest <SendBookingResponse>(bookingUri, CREATE_BOOKING, input)); }
private static async Task <SendBookingResponse> SendBooking(string hotelId, DateTime from, DateTime to) { var windingTreeModule = new WindingTreeModule(); var hotels = await windingTreeModule.GetAllHotels(); var hotel = hotels.Items.Where(x => x.Id == hotelId).FirstOrDefault(); var booking = new SendBookingModel() { HotelId = hotelId, Customer = CreateCustomer(), Pricing = CreatePricing(), Booking = CreateBooking(hotel, from, to) }; return(await windingTreeModule.SendBookingAsync(booking, hotel.BookingUri)); }