public Action BuildSearchLogix(RefID query) { Slot logix = mainSlot.AddSlot("Search logix"); Network.GET_String getString = logix.AttachComponent <Network.GET_String>(); ValueRegister <string> url = logix.AttachComponent <ValueRegister <string> >(); url.Value.Value = "https://better-lightning-crate.glitch.me/"; FormatString formatString = logix.AttachComponent <FormatString>(); ValueField <string> type = logix.AttachComponent <ValueField <string> >(); ValueField <string> format = logix.AttachComponent <ValueField <string> >(); format.Value.Value = "{0}/{1}/{2}"; formatString.Format.Value = format.Value.ReferenceID; formatString.Parameters.Add(); formatString.Parameters.Add(); formatString.Parameters.Add(); formatString.Parameters[0].Value = url.Value.ReferenceID; formatString.Parameters[1].Value = type.Value.ReferenceID; formatString.Parameters[2].Value = query; getString.URL.Value = formatString.Str.ReferenceID; Actions.WriteValueNode <string> writeResponse = logix.AttachComponent <Actions.WriteValueNode <string> >(); ValueRegister <string> response = logix.AttachComponent <ValueRegister <string> >(); searchResponse = response; writeResponse.Value.Value = getString.Content.ReferenceID; writeResponse.Target.Value = response.Value.ReferenceID; getString.OnResponse.Target = writeResponse.Write; //writeResponse.Target.OwnerNode.RemoveAllLogixBoxes(); //LogixHelper.MoveUnder(writeResponse.Target.OwnerNode, logix, true); //getString.Request(); return(getString.Request); }
/// <summary> /// Returns boolean indicating whether payment has been accepted by zarinpal /// </summary> /// <param name="authority">36digit long code</param> /// <param name="status">status code</param> /// <returns>true - accepted; false - not accepted.</returns> public bool VerifyPayment(string authority, string status) { try { var query = from or in _orderRepository.Table where or.AuthorizationTransactionCode == authority select or; _logger.InsertLog(LogLevel.Debug, "in verify1 :" + query.Count()); ZarinPalService.PaymentGatewayImplementationService zps = new ZarinPalService.PaymentGatewayImplementationService(); _logger.InsertLog(LogLevel.Debug, "in verify2 : merch code: " + _zarinPalPaymentSettings.MerchantCode + " %% authority code: " + authority + " %% order total: " + query.FirstOrDefault().OrderTotal); if (zps.PaymentVerification(_zarinPalPaymentSettings.MerchantCode, authority, Convert.ToInt32(query.FirstOrDefault().OrderTotal / 10), out long RefID).Equals(100)) { _logger.InsertLog(LogLevel.Debug, "in verify3"); query.FirstOrDefault().AuthorizationTransactionResult = RefID.ToString(); _logger.InsertLog(LogLevel.Debug, "in verify4"); _orderRepository.Update(query.FirstOrDefault()); _logger.InsertLog(LogLevel.Debug, "in verify5"); return(true); } else { _logger.InsertLog(LogLevel.Debug, "in verify: verification failed"); return(false); } } catch (Exception ex) { _logger.InsertLog(LogLevel.Debug, "in verify: " + ex.Message); return(false); } }
protected override void InitData() { base.InitData(); if (MasterBindingSource.Current != null) { var fixedAssetArmortizationId = ((FixedAssetArmortizationModel)MasterBindingSource.Current).RefId; KeyValue = fixedAssetArmortizationId.ToString(CultureInfo.InvariantCulture); _keyForSend = KeyValue; RefId = long.Parse(KeyValue); } else { _keyForSend = RefID.ToString(); } _fixedAssetsPresenter.DisplayByActiveWithFixedAssetCurrency(false); _budgetItemsPrensenter.Display(3, true); _cboCurrencyCode.Items.Add(CurrencyLocal); if (CurrencyLocal != CurrencyAccounting) { _cboCurrencyCode.Items.Add(CurrencyAccounting); } _fixedAssetArmortizationPresenter.Display(long.Parse(KeyValue)); CurrencyCode = CurrencyLocal; cboCurrency.EditValue = CurrencyLocal; }
public override TreeNode PopulateTreeNode() { base.PopulateTreeNode(); TreeNode ThisNode = new TreeNode(); ThisNode.Text = string.Format("Type4: {0}", Unk1); ThisNode.Name = RefID.ToString(); ThisNode.Tag = this; return(ThisNode); }
public override TreeNode PopulateTreeNode() { base.PopulateTreeNode(); TreeNode ThisNode = new TreeNode(); ThisNode.Text = "Type7"; ThisNode.Name = RefID.ToString(); ThisNode.Tag = this; return(ThisNode); }
public ActionResult Verify(int id) { //پیدا کردن sum var order = _repoOr.GetOrder(id); //Status == Ok || NOK //Authority == كد يكتاي شناسه مرجع درخواست if (Request.QueryString["Status"] != "" && Request.QueryString["Status"] != null && Request.QueryString["Authority"] != "" && Request.QueryString["Authority"] != null) { //اگر وضعیت پرداخت اوکی بود if (Request.QueryString["Status"].ToString().Equals("OK")) { //jame tamame maghadir onja save hastesh int Amount = order.TotalPrice; long RefID; ServicePointManager.Expect100Continue = false; PaymentGatewayImplementationServicePortTypeClient zp = new PaymentGatewayImplementationServicePortTypeClient(); int Status = zp.PaymentVerification("YOUR-ZARINPAL-MERCHANT-CODE", Request.QueryString["Authority"].ToString(), Amount, out RefID); if (Status == 100) { Session["ShoppingCart"] = null; Session["Count"] = null; ViewBag.IsSuccess = true; ViewBag.RefId = RefID; _repoOr.UpdateIsFinaly(order.Id, RefID.ToString()); } else { ViewBag.Status = Status; } } else { ViewBag.Status = "Error! Authority: " + Request.QueryString["Authority"].ToString() + " Status: " + Request.QueryString["Status"].ToString(); } } else { Response.Write("Invalid Input"); } return(View()); }
internal Transaction ZarinPalCallBackPayRequest(Guid transId, string status, string authority) { var transaction = PaymentComponenets.Instance.TransactionFacade.Get(transId); if (transaction == null) { return(null); } string value = transaction.AdditionalData; string deValue = StringUtils.Decrypt(value); var data = deValue.Split('#'); if (status.Equals("OK")) { int Amount = ((int)transaction.Amount) / 10; long RefID; string merchantId = data[0]; System.Net.ServicePointManager.Expect100Continue = false; ZarinPalService.PaymentGatewayImplementationServicePortTypeClient zarinPalService = new ZarinPalService.PaymentGatewayImplementationServicePortTypeClient(); int Status = zarinPalService.PaymentVerification(merchantId, authority, Amount, out RefID); transaction.RefId = RefID.ToString(); transaction.Status = Status; if (Status == 100) { transaction.Done = true; } if (!PaymentComponenets.Instance.TransactionFacade.Update(transaction)) { return(null); } return(transaction); } else { //انصراف توسط کاربر یا عدم موفقیت پرداخت transaction.Status = 404; if (!PaymentComponenets.Instance.TransactionFacade.Update(transaction)) { return(null); } return(transaction); } }
public override TreeNode PopulateTreeNode() { base.PopulateTreeNode(); TreeNode ThisNode = new TreeNode(); ThisNode.Text = "Type1 Group"; ThisNode.Name = RefID.ToString(); ThisNode.Tag = this; foreach (IType AIPoint in AIPoints) { ThisNode.Nodes.Add(AIPoint.PopulateTreeNode()); } return(ThisNode); }
public override int GetHashCode() { int hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this hashCode = hashCode * 23 + Id.GetHashCode(); hashCode = hashCode * 23 + (Fid == null ? 0 : Fid.GetHashCode()); hashCode = hashCode * 23 + (EnableDate == null ? 0 : EnableDate.GetHashCode()); hashCode = hashCode * 23 + (DisableDate == null ? 0 : DisableDate.GetHashCode()); hashCode = hashCode * 23 + Dr.GetHashCode(); hashCode = hashCode * 23 + Ts.GetHashCode(); hashCode = hashCode * 23 + (CreateBy == null ? 0 : CreateBy.GetHashCode()); hashCode = hashCode * 23 + (CreateDate == null ? 0 : CreateDate.GetHashCode()); hashCode = hashCode * 23 + (CreateName == null ? 0 : CreateName.GetHashCode()); hashCode = hashCode * 23 + (UpdateBy == null ? 0 : UpdateBy.GetHashCode()); hashCode = hashCode * 23 + (UpdateDate == null ? 0 : UpdateDate.GetHashCode()); hashCode = hashCode * 23 + (UpdateName == null ? 0 : UpdateName.GetHashCode()); hashCode = hashCode * 23 + (TableName == null ? 0 : TableName.GetHashCode()); hashCode = hashCode * 23 + (ColName == null ? 0 : ColName.GetHashCode()); hashCode = hashCode * 23 + (ColComment == null ? 0 : ColComment.GetHashCode()); hashCode = hashCode * 23 + (ColDefault == null ? 0 : ColDefault.GetHashCode()); hashCode = hashCode * 23 + (ColType == null ? 0 : ColType.GetHashCode()); hashCode = hashCode * 23 + ColProperty.GetHashCode(); hashCode = hashCode * 23 + ColLength.GetHashCode(); hashCode = hashCode * 23 + DisplayWidth.GetHashCode(); hashCode = hashCode * 23 + ColOrder.GetHashCode(); hashCode = hashCode * 23 + ColPrecision.GetHashCode(); hashCode = hashCode * 23 + NullAble.GetHashCode(); hashCode = hashCode * 23 + ShowAble.GetHashCode(); hashCode = hashCode * 23 + IsDefaultCol.GetHashCode(); hashCode = hashCode * 23 + (CtrlType == null ? 0 : CtrlType.GetHashCode()); hashCode = hashCode * 23 + (RefTable == null ? 0 : RefTable.GetHashCode()); hashCode = hashCode * 23 + (RefID == null ? 0 : RefID.GetHashCode()); hashCode = hashCode * 23 + (RefCode == null ? 0 : RefCode.GetHashCode()); hashCode = hashCode * 23 + (RefName == null ? 0 : RefName.GetHashCode()); hashCode = hashCode * 23 + (RefCondition == null ? 0 : RefCondition.GetHashCode()); hashCode = hashCode * 23 + (RefCols == null ? 0 : RefCols.GetHashCode()); hashCode = hashCode * 23 + (RefType == null ? 0 : RefType.GetHashCode()); hashCode = hashCode * 23 + (MainTable == null ? 0 : RefType.GetHashCode()); hashCode = hashCode * 23 + (MainTableCol == null ? 0 : MainTableCol.GetHashCode()); hashCode = hashCode * 23 + (CalculationExpr == null ? 0 : CalculationExpr.GetHashCode()); return(hashCode); }
public async Task <IHttpActionResult> ZarinpalPaid(long id, string Authority, string Status) { if (string.IsNullOrEmpty(Authority) || string.IsNullOrEmpty(Status)) { return(BadRequest()); } if (Status != "OK") { return(InternalServerError(new Exception("Zarinpal gateway error, Authority:" + Authority + ", Status:" + Status))); } var invoice = await db.DepositInvoices.FindAsync(id); if (invoice == null) { return(NotFound()); } System.Net.ServicePointManager.Expect100Continue = false; Zarinpal.PaymentGatewayImplementationServicePortTypeClient zp = new Zarinpal.PaymentGatewayImplementationServicePortTypeClient(); long RefID; int verStatus = zp.PaymentVerification("YOUR-ZARINPAL-MERCHANT-CODE", Authority, invoice.Amount, out RefID); if (verStatus == 100) { invoice.ReferenceNumber = RefID.ToString(); //1) Create an account for the payer according to AccountName //2) Create two journal entries to debit the campaign and credit the user //3) Create the related transaction } else { return(InternalServerError(new Exception("Zarinpal gateway error, status:" + verStatus.ToString()))); } db.Entry(invoice).State = EntityState.Modified; await db.SaveChangesAsync(); return(StatusCode(HttpStatusCode.NoContent)); }
private List <CheckInService.IdcProperty> GetCustomDocMetaData(DocumentM doc) { List <CheckInService.IdcProperty> customDocMetaData = new List <CheckInService.IdcProperty>(); int RefID; customDocMetaData.Add(new CheckInService.IdcProperty() { name = "xProfileTrigger", value = ConfigurationManager.AppSettings["xProfileTrigger"] }); customDocMetaData.Add(new CheckInService.IdcProperty() { name = "xIdcProfile", value = ConfigurationManager.AppSettings["xIdcProfile"] }); customDocMetaData.Add(new CheckInService.IdcProperty() { name = "xAgencyDepartment", value = ConfigurationManager.AppSettings["xAgencyDepartment"] }); customDocMetaData.Add(new CheckInService.IdcProperty() { name = "xDivision", value = ConfigurationManager.AppSettings["xDivision"] }); var refIDResult = _commonService.GetDocReferenceID(doc); if (refIDResult.status.Status == StatusEnum.Success) { RefID = refIDResult.result; } else { RefID = 6312; } customDocMetaData.Add(new CheckInService.IdcProperty() { name = "xReferenceType", value = RefID.ToString() }); return(customDocMetaData); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns>A hash code for the current <see cref="Hemrika.SharePresence.Html5.WebControls.ForControl" />.</returns> public override int GetHashCode() { return(RefID.GetHashCode()); }
public ActionResult Verify() // public void Verify() { try { if (Request.QueryString["Status"] != "" && Request.QueryString["Status"] != null && Request.QueryString["Authority"] != "" && Request.QueryString["Authority"] != null) { if (Request.QueryString["Status"].ToString().Equals("OK")) { string json = ""; string json2 = ""; using (var client = new WebClient()) { json = client.DownloadString("http://supectco.com/webs/textile/getorderamount.php?auth=" + Request.QueryString["Authority"]); } var log2 = JsonConvert.DeserializeObject <List <AUTHModel> >(json); int Amount = Convert.ToInt32(log2[0].TotalPrice); long RefID; System.Net.ServicePointManager.Expect100Continue = false; ServiceReference1.PaymentGatewayImplementationServicePortTypeClient zp = new ServiceReference1.PaymentGatewayImplementationServicePortTypeClient(); int Status = zp.PaymentVerification("9e9d57bc-07e1-11e8-ad17-000c295eb8fc", Request.QueryString["Authority"].ToString(), Amount, out RefID); if (Status == 100) { string device = RandomString(); string code = MD5Hash(device + "ncase8934f49909"); string result2 = ""; using (WebClient client = new WebClient()) { var collection2 = new NameValueCollection(); collection2.Add("device", device); collection2.Add("code", code); collection2.Add("auth", Request.QueryString["Authority"]); collection2.Add("amount", Amount.ToString()); collection2.Add("token", GlobalVariables.token); collection2.Add("refID", RefID.ToString()); byte[] response = client.UploadValues("http://supectco.com/webs/textile/Main/handler/doFinalCheck.php", collection2); result2 = System.Text.Encoding.UTF8.GetString(response); } //using (var client = new WebClient()) //{ // json = client.DownloadString("http://supectco.com/webs/textile/getorderdetail.php?auth=" + Request.QueryString["Authority"]); //} //var log = JsonConvert.DeserializeObject<List<OrderIdModel>>(json); //ViewBag.message = "موفق"; //ViewBag.message2 = RefID; //ViewBag.message3 = log[0].ID; //HttpCookie productides = new HttpCookie("cartmodel"); //productides = Request.Cookies["cartmodel"]; //List<ProductDetail> data = JsonConvert.DeserializeObject<List<ProductDetail>>(productides.Value); //foreach (var item in data) //{ // using (var client = new WebClient()) // { // json2 = client.DownloadString("http://supectco.com/webs/textile/addOrderProduct.php?orderid=" + log[0].ID + "&productid=" + item.productid + "&quantity=" + item.quantity); // } //} //Response.Cookies["cartmodel"].Expires = DateTime.Now.AddDays(-1); HttpCookie myCookie = new HttpCookie("cartmodel"); myCookie.Expires = DateTime.Now.AddDays(-1d); Response.Cookies.Add(myCookie); ViewBag.message = "موفق"; ViewBag.message2 = RefID; } else { ViewBag.message = "عدم موفقیت خرید"; ViewBag.message2 = "شماره پیگیری:" + RefID; } } else { Response.Write("some thing wrong with payment"); } } else { Response.Write("Invalid Input"); } } catch (Exception e) { Response.Write(e.Message); } return(View()); }