static public LiqPayP2PFormModel GetLiqPayRefund(Payment payment) { // Заповнюю дані для їх передачі для LiqPay var signature_source = new LiqPayRefund() { public_key = _public_key, version = 3, action = "refund", amount = (decimal)payment.amount, currency = "UAH", ip = HttpContext.Current.Request.UserHostAddress, order_id = payment.order_id, //sandbox = 1, result_url = "https://elifeweb.azurewebsites.net/Reception/CancelReception" }; var json_string = JsonConvert.SerializeObject(signature_source); var data_hash = Convert.ToBase64String(Encoding.UTF8.GetBytes(json_string)); var signature_hash = GetLiqPaySignature(data_hash); // Данні для передачі у в'ю var model = new LiqPayP2PFormModel(); model.Data = data_hash; model.Signature = signature_hash; return(model); }
/// <summary> /// Сформувати дані для LiqPay (data, signature) /// </summary> /// <param name="order_id">Номер замовлення</param> /// <returns></returns> static public LiqPayP2PFormModel GetLiqPayModel(Payment payment, TypeOfService typeOfService, ApplicationUser Patient) { // Заповнюю дані для їх передачі для LiqPay var signature_source = new LiqPayP2P() { public_key = _public_key, version = 3, action = "p2p", amount = typeOfService.Price / 2, receiver_card = typeOfService.Doctor.DoctorInform.Clinic.BankCard, currency = "UAH", description = "Оплата замовлення", ip = HttpContext.Current.Request.UserHostAddress, order_id = payment.order_id, sandbox = 0, language = "uk", result_url = "https://elifeweb.azurewebsites.net/DoctorInforms/AppointmentResult" }; var json_string = JsonConvert.SerializeObject(signature_source); var data_hash = Convert.ToBase64String(Encoding.UTF8.GetBytes(json_string)); var signature_hash = GetLiqPaySignature(data_hash); // Данні для передачі у в'ю var model = new LiqPayP2PFormModel(); model.Data = data_hash; model.Signature = signature_hash; return(model); }