/// <summary> /// Initializes the wizard /// </summary> /// <param name="merchantId">The merchant id (DB Table RDN_Merchants)</param> /// <param name="currency"></param> /// <param name="paymentProvider"></param> /// <returns></returns> public InvoiceFactory Initalize(Guid merchantId, string currency, PaymentProvider paymentProvider, PaymentMode mode, ChargeTypeEnum chargeType) { invoice = Invoice.CreateNewInvoice(); try { invoice.FinancialData.BasePriceForItems = 0; invoice.FinancialData.TotalBeforeTax = 0; invoice.FinancialData.ShippingCost = 0.0M; invoice.FinancialData.TaxRate = 0; invoice.FinancialData.Tax = 0; invoice.FinancialData.TotalIncludingTax = 0; invoice.ChargeType = chargeType; invoice.Mode = mode; invoice.Currency = currency; invoice.ShippingType = ShippingType.None; invoice.InvoiceId = Guid.NewGuid(); invoice.PaymentProvider = paymentProvider; invoice.InvoiceStatus = InvoiceStatus.Not_Started; invoice.MerchantId = merchantId; RecalculateTotalAfterTax(); } catch (Exception exception) { ErrorDatabaseManager.AddException(exception, exception.GetType()); } return this; }
public void AdjustAccountBalance(Guid costCentreId, PaymentMode paymentMode, decimal amount,PaymentNoteType type) { tblPaymentTracker tblpn = _ctx.tblPaymentTracker.FirstOrDefault(n => n.CostCenterId == costCentreId && n.PaymentModeId == (int)paymentMode); if(tblpn==null) { Guid id = Guid.NewGuid(); tblPaymentTracker pnsave = new tblPaymentTracker { Balance = 0, CostCenterId = costCentreId, id = id, PaymentModeId = (int) paymentMode, PendingConfirmBalance = 0, }; _ctx.tblPaymentTracker.AddObject(pnsave); _ctx.SaveChanges(); tblpn = _ctx.tblPaymentTracker.FirstOrDefault(n => n.id == id); } if (type==PaymentNoteType.Availabe ) tblpn.Balance += amount; else if (type == PaymentNoteType.Unavailable) tblpn.PendingConfirmBalance += amount; else if (type ==PaymentNoteType.Returns) { tblpn.Balance += -amount; tblpn.PendingConfirmBalance += (-amount); } _ctx.SaveChanges(); }
public override PaymentResult Process(string total, PaymentMode mode, int numParcels, string filiacao, string distribuidor, int numPedido, CreditCard cartao) { filiacao = filiacao ?? "1001734898"; // 1001734898 filiacao de exemplo numParcels = numParcels == 0 ? 1 : numParcels; string paymentNethod = ((mode == PaymentMode.InCash) ? "10" + numParcels.ToString("00") : (mode == PaymentMode.CreditWithInterestStore) ? "20" + numParcels.ToString("00") : (mode == PaymentMode.CreditWithInterestIssuer) ? "30" + numParcels.ToString("00") : "A001"); var html = new StringBuilder(); html.Append("<form action=\"" + Config.Address + "\" method=\"post\" id=\"pay_VBV\">"); // // Número único gerado a cada transação pela Visanet // html.Append("<input type=\"hidden\" name=\"tid\" value=\"" + GenerateTransationId(filiacao, paymentNethod) + " \">"); // // Identificação do pedido na loja // html.Append("<input type=\"hidden\" name=\"orderid\" value=\"" + numPedido.ToString() + "\">"); // // NUmero do banco quando o processo for Visa Electron // html.Append("<input type=\"hidden\" name=\"bank\" value=\"\">"); // // Numero do Cartão // html.Append("<input type=\"hidden\" name=\"bin\" value=\"\">"); // // endereco onde está o arquivo de configuração .ini // html.Append("<input type=\"hidden\" name=\"merchid\" value=\"componentes_vbv/keys/" + filiacao + "\">"); // // Valor da Transação -> R$100,00 // html.Append("<input type=\"hidden\" name=\"damount\" value=\"R$" + total.ToString("f") + ">"); // //Tipo de autenticação // 0: para pedir o CVC2 // 1: para não pedir o CVC2 // html.Append("<input type=\"hidden\" name=\"authenttype\" value=\"0\">"); // // Valor da Transação > R$100,00 -> 10000 html.Append("<input type=\"hidden\" name=\"price\" value=\"" + total.ToString("f").Replace(",", "") + ">"); // //Itens de livre preenchimento // html.Append("<input type=\"hidden\" name=\"free\" value=\"campo livre\">"); html.Append("</form><script>document.getElementById('pay_VBV').submit();</script>"); return new PaymentResult(html.ToString()); }
private BankDetails ReadBankDetails( ) { return(new BankDetails() { ID = -1, TranscationType = PaymentMode.GetPayModeId(CBTranscationType.Text), TranscationRef = TXTTranscationRef.Text, BankRef = TXTBankRef.Text, RefID = "Expenses", BankID = eVM.GetBankDetailsID(CBBankAccount.Text), }); }
public int AddPaymentMode(PaymentMode paymentMode) { try { return(_paymentModeManager.AddPaymentMode(paymentMode)); } catch (Exception ex) { ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message); return(0); } }
public IHttpActionResult Post(PaymentMode applyAt) { if (!ModelState.IsValid) { return BadRequest(ModelState); } _PaymentModeService.Create (applyAt); return Created(applyAt); }
public bool UpdatePaymentMode(PaymentMode paymentMode) { try { return(_paymentModeManager.UpdatePaymentMode(paymentMode)); } catch (Exception ex) { ErrorManager.LogApplicationError(ex.StackTrace, ex.Source, ex.Message); return(false); } }
public async Task <IActionResult> Edit(int id, [FromForm] PaymentMode paymentMode) { if (ModelState.IsValid) { try { bool isCodeExist = _context.PaymentMode.Any(m => m.Code.Equals(paymentMode.Code) && !m.Id.Equals(id)); if (isCodeExist) { ModelState.AddModelError("Code", "Code Already Exists!"); return(View(paymentMode)); //return RedirectToAction(nameof(Index), new { error = "Code exists" }); } PaymentMode db_paymentMode = _context.PaymentMode.FirstOrDefault(m => m.Id.Equals(paymentMode.Id)); if (db_paymentMode == null || id != paymentMode.Id) { return(NotFound()); } OldData oldData = new OldData(); oldData.Code = db_paymentMode.Code; oldData.Name = db_paymentMode.Name; oldData.Remark = db_paymentMode.Remark; oldData.Status = db_paymentMode.Status; string oldJson = JsonConvert.SerializeObject(oldData); string newJson = JsonConvert.SerializeObject(paymentMode); db_paymentMode.Code = paymentMode.Code; db_paymentMode.Name = paymentMode.Name; db_paymentMode.Remark = paymentMode.Remark; db_paymentMode.Status = paymentMode.Status; db_paymentMode.ModifiedBy = _configuration.GetValue <string>("HardcodeValue:Createdby"); db_paymentMode.ModifiedDatetime = DateTime.UtcNow; _context.PaymentMode.Update(db_paymentMode); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Department_MasterExists(paymentMode.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(paymentMode)); }
public object Delete(PaymentMode deleted) { string msgError = ""; bool result = repository.Remove(deleted, ref msgError); object json = new { success = result, message = msgError }; return(json); }
public override void RecievePayment(PaymentMode mode, int amount) { switch (mode) { case PaymentMode.Cheque: Console.WriteLine("Cheques are no longer accepted, Pay by cash, card or Paytm"); break; default: Console.WriteLine("Payment of {0:C} accepted by {1}", amount, mode); break; } }
public override void TakePayment(int amount, PaymentMode mode) { switch (mode) { case PaymentMode.Cash: case PaymentMode.Paytm: case PaymentMode.UPI: Console.WriteLine($"Payment of {amount:C} recieved thro {mode}"); break; } }
private ActionResult Processing_Bank(int claim, PaymentMode payment) { ActionResult result4; if (payment == null) { throw new ArgumentNullException("payment"); } PaymentBeforeProcessingResult result = BookingProvider.BeforePaymentProcessing(UrlLanguage.CurrentLanguage, payment.paymentparam); if (result == null) { throw new Exception("cannot get payment details"); } if (!result.success) { throw new Exception("payment details fail"); } try { List <ReportParam> list = new List <ReportParam>(); ReportParam item = new ReportParam { Name = "vClaimList", Value = claim.ToString() }; list.Add(item); string str = ConfigurationManager.AppSettings["report_PrintInvoice"]; if (string.IsNullOrEmpty(str)) { throw new Exception("report_PrintInvoice is empty"); } ReportResult result2 = ReportServer.BuildReport(str, ReportFormat.pdf, list.ToArray()); if (result2 == null) { throw new Exception("report data is empty"); } MemoryStream fileStream = new MemoryStream(result2.Content); FileStreamResult result3 = new FileStreamResult(fileStream, "application/pdf") { FileDownloadName = string.Format("invoice_{0}.pdf", claim) }; result4 = result3; } catch (Exception exception) { Tracing.ServiceTrace.TraceEvent(TraceEventType.Error, 0, exception.ToString()); throw; } return(result4); }
private PaymentMode MapEFToModel(EF.Models.PaymentMode data) { var paymentMode = new PaymentMode() { Name = data.Name, PaymentModeId = data.PaymentModeId, CreatedOn = data.CreatedOn, TimeStamp = data.TimeStamp, Deleted = data.Deleted, CreatedBy = _userService.GetUserFullName(data.AspNetUser), }; return(paymentMode); }
public IHttpActionResult DeletePaymentMode(long id) { PaymentMode paymentMode = db.PaymentMode.Find(id); if (paymentMode == null) { return(NotFound()); } db.PaymentMode.Remove(paymentMode); db.SaveChanges(); return(Ok(paymentMode)); }
public virtual void TakePayment(int amount, PaymentMode mode) { switch (mode) { case PaymentMode.Cash: case PaymentMode.Paytm: Console.WriteLine($"Payment of {amount:C} recieved thro {mode}"); break; case PaymentMode.UPI: Console.WriteLine("Payment not acceptable"); break; } }
// GET: PaymentModes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PaymentMode paymentMode = db.PaymentModes.Find(id); if (paymentMode == null) { return(HttpNotFound()); } return(View(paymentMode)); }
public async Task <IHttpActionResult> DeletePaymentMode(string id) { PaymentMode paymentMode = await db.PaymentModes.FindAsync(id); if (paymentMode == null) { return(NotFound()); } db.PaymentModes.Remove(paymentMode); await db.SaveChangesAsync(); return(Ok(paymentMode)); }
private CommandResult SaveCardPayment(CardPaymentInfo cardPayment, PaymentMode paymentMode) { CommandResult result = null; cardPayment.PaymentMode = paymentMode; cardPayment.OperatorID = OperatorInfo.CurrentOperator.OperatorName; cardPayment.StationID = WorkStationInfo.CurrentStation.StationName; cardPayment.IsCenterCharge = true; CardBll cbll = new CardBll(AppSettings.CurrentSetting.CurrentMasterConnect); result = cbll.PayParkFee(null, cardPayment, AppSettings.CurrentSetting.CurrentStandbyConnect, false, false); return(result); }
/*******************************************************************************************************/ #region CONSTRUCTOR METHODS public Payment_Form(Type type, Guid id) { InitializeComponent(); if (type == typeof(VendorInvoice)) { _vendorInvoice = new VendorInvoice(id); _paymentMode = PaymentMode.VendorInvoice; } else if (type == typeof(Sale)) { _sale = new Sale(id); _paymentMode = PaymentMode.SaleInvoice; } }
/// <summary> /// Read Ui Fields from Forms and return in Expenses Object /// </summary> /// <returns></returns> protected Expenses ReadFields( ) { Expenses exp = new Expenses() { Amount = double.Parse(TXTAmount.Text), ApprovedBy = CBApprovedBy.Text, ExpensesReason = TXTReason.Text, ID = -1, PaymentModeID = PaymentMode.GetPayModeId(CBPaymentMode.Text), BankDetailsID = vBankDetailsID, ExpensesCategoryID = eVM.GetExpenseCategoryId(CBCategory.Text) }; return(exp); }
private void GetTempDataFromDB(string guid) { var tempData = RMSEntitiesHelper.Instance.RMSEntities.SaleTemps.Where(st => st.Guid == guid); var tempDataFirst = RMSEntitiesHelper.Instance.RMSEntities.SaleTemps.Where(st => st.Guid == guid).FirstOrDefault(); //var tempDataFirst SelectedCustomer = RMSEntitiesHelper.Instance.RMSEntities.Customers.FirstOrDefault(c => c.Id == tempDataFirst.CustomerId.Value); _categoryId = RMSEntitiesHelper.Instance.RMSEntities.Categories.FirstOrDefault(c => c.Id == SelectedCustomer.CustomerTypeId).Id; SelectedCustomerText = SelectedCustomer.Name; _selectedPaymentMode = new PaymentMode(); SelectedPaymentId = char.Parse(tempDataFirst.PaymentMode); RaisePropertyChanged("SelectedCustomer"); //RaisePropertyChanged("SelectedPaymentMode"); OrderNo = tempDataFirst.OrderNo; TranscationDate = tempDataFirst.SaleDate.Value; _guid = guid; var tempTotalAmount = 0.0M; foreach (var saleDetailItem in tempData) { var productPrice = _productsPriceList.Where(p => p.PriceId == saleDetailItem.PriceId).FirstOrDefault(); var saleDetailExtn = new SaleDetailExtn() { Discount = saleDetailItem.DiscountAmount, DiscountPercentage = saleDetailItem.DiscountPercentage.Value, PriceId = saleDetailItem.PriceId.Value, ProductId = saleDetailItem.ProductId.Value, Qty = saleDetailItem.Quantity, OriginalQty = saleDetailItem.Quantity, SellingPrice = saleDetailItem.SellingPrice, CostPrice = productPrice.Price, AvailableStock = productPrice.Quantity, Amount = productPrice.SellingPrice * saleDetailItem.Quantity.Value }; SaleDetailList.Add(saleDetailExtn); SetSaleDetailExtn(productPrice, saleDetailExtn, 0); tempTotalAmount += productPrice.SellingPrice * saleDetailItem.Quantity.Value; } TotalAmount = tempTotalAmount; Title = "Unsaved data "; RMSEntitiesHelper.Instance.AddNotifier(this); RMSEntitiesHelper.Instance.SelectRunningBillNo(_categoryId); }
public async Task <ActionResult> PaymentModesDeleteConfirmed(int id) { try { PaymentMode paymentMode = await db.PaymentModes.FindAsync(id); db.PaymentModes.Remove(paymentMode); await db.SaveChangesAsync(); return(RedirectToAction("PaymentModesIndex")); } catch (Exception ex) { return(View("ErrorNotFound")); } }
public virtual void GetPayment(double amount, PaymentMode mode) { switch (mode) { case PaymentMode.Cash: case PaymentMode.Cheque: _balance += amount; Console.WriteLine("Payment of {0:C} is made by {1}", amount, mode); break; case PaymentMode.Card: case PaymentMode.UPI: Console.WriteLine("Invalid Mode of Payment, not acccepted"); break; } }
// GET: UpdateConsumerBill public IActionResult UpdateConsumerBill(string billNumber, PaymentMode paymentMode) { ConsumerBill bill = _context.ConsumerBills.Include(x => x.Consumer).First(x => x.BillNumber == billNumber); bill.State = BillState.Paid; //_context.Update(bill); //Transaction Transaction transaction = new Transaction( Transaction.TransactionType.Inbound, Transaction.TransactionCategory.BillPayement, paymentMode == PaymentMode.Token ? 0 : bill.OrderAmount, "Paiement de la facture " + bill.BillNumber + " par " + bill.Consumer.Name + "( " + bill.Consumer.Id + " ) en " + EnumHelper<PaymentMode>.GetDisplayValue(paymentMode)); //_context.Add(transaction); //Save // _context.SaveChanges(); return RedirectToAction("Index"); }
public override void GetPayment(double amount, PaymentMode mode) { //base.GetPayment(amount, mode); switch (mode) { case PaymentMode.Cheque: Console.WriteLine("This payment mode is no longer accepted, please pay by Card or UPI or Cash"); break; case PaymentMode.Card: case PaymentMode.UPI: case PaymentMode.Cash: Console.WriteLine("Payment of {0:C} is made by {1}", amount, mode); break; } }
public void TestInitialize() { this.dictionary = new Dictionary <string, object>(); this.cart = new Cart(); this.customer = new Customer(); this.payment = new Payment(); this.orders = new Orders(); this.orderDetails = new OrderDetails(); this.product = new Product(); this.orderStatus = new OrderStatus(); this.paymentMode = new PaymentMode(); this.category = new Category(); this.subCategory = new SubCategory(); this.paymentDetails = new PaymentDetails(); this.shippingAddress = new ShippingAddress(); }
private void _paymentModesCollectionView_CurrentChanged(object sender, EventArgs e) { try { if (_paymentModesCollectionView.CurrentPosition != -1) { string mode = _paymentModesCollectionView.CurrentItem.ToString(); PaymentMode paymentMode = _paymentModes[mode]; _paymentEntity.Mode = paymentMode; } } catch (Exception ex) { Logger.Log(ex); } }
public ActionResult DeleteConfirmed(ReasonViewModel vm) { if (ModelState.IsValid) { //Commit the DB try { List <LogTypeViewModel> LogList = new List <LogTypeViewModel>(); PaymentMode temp = _PaymentModeService.Find(vm.id); int DocTypeId = (int)temp.DocTypeId; LogList.Add(new LogTypeViewModel { ExObj = Mapper.Map <PaymentMode>(temp), }); XElement Modifications = _modificationCheck.CheckChanges(LogList); _PaymentModeService.Delete(vm.id); _logger.LogActivityDetail(logVm.Map(new ActiivtyLogViewModel { DocTypeId = DocTypeId, DocId = temp.PaymentModeId, ActivityType = (int)ActivityTypeContants.Deleted, UserRemark = vm.Reason, DocNo = temp.PaymentModeName, xEModifications = Modifications, DocDate = temp.CreatedDate, })); } catch (Exception ex) { string message = _exception.HandleException(ex); TempData["CSEXC"] += message; return(PartialView("_Reason", vm)); } return(Json(new { success = true })); } return(PartialView("_Reason", vm)); }
public static IPaymentMode Create(PaymentMode paymentMode) { switch (paymentMode) { case PaymentMode.DebitCard: return(new DebitCardPaymentLC()); case PaymentMode.CreditCard: return(new CreditCardPaymentLC()); case PaymentMode.GooglePay: return(new GooglePayLC()); default: return(new DebitCardPaymentLC()); } }
public void SeedPaymentModes() { string[] modes = new string[] { "Cash", "MPesa", "CCard" }; if (db.PaymentModes.ToList().Count() < modes.Count()) { var pm = new PaymentMode(); foreach (var m in modes) { if (db.PaymentModes.FirstOrDefault(e => e.PaymentModeName.Trim().ToLower().Equals(m.ToLower().Trim())) == null) { pm.PaymentModeName = m; db.PaymentModes.Add(pm); db.SaveChanges(); } } } }
public async Task <ActionResult> PaymentModesEdit([Bind(Include = "PaymentModeId,Name")] PaymentMode paymentMode) { try { if (ModelState.IsValid) { db.Entry(paymentMode).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("PaymentModesIndex")); } return(View(paymentMode)); } catch (Exception ex) { return(View("Error")); } }
/// <summary> /// Get all Payment Modes /// </summary> /// <returns></returns> public List <PaymentMode> GetPaymentTypes( ) { List <PaymentMode> listItem = new List <PaymentMode>(); Logs.LogMe("GetPaymentTypes():Calling GetDataForm"); List <SortedDictionary <string, string> > result = DB.GetDataFrom("PaymentMode"); foreach (SortedDictionary <string, string> item in result) { PaymentMode mode = new PaymentMode() { ID = Int32.Parse(item["ID"]), PayMode = item["PayMode"] }; listItem.Add(mode); } return(listItem); }
/// <summary> /// 卡片发行 /// </summary> /// <param name="info"></param> /// <param name="releaseMoney"></param> /// <param name="paymentMode"></param> /// <param name="memo"></param> /// <param name="keepParkingStatus">是否保持卡片运行状态</param> /// <returns></returns> public CommandResult CardRelease(CardInfo info, decimal releaseMoney, PaymentMode paymentMode, string memo, bool keepParkingStatus) { string op = OperatorInfo.CurrentOperator.OperatorName; string station = WorkStationInfo.CurrentStation.StationName; IUnitWork unitWork = ProviderFactory.Create <IUnitWork>(_RepoUri); //工作单元 CardReleaseRecord record = new CardReleaseRecord { CardID = info.CardID, OwnerName = info.OwnerName, CardCertificate = info.CardCertificate, CarPlate = info.CarPlate, ReleaseDateTime = DateTime.Now, CardType = info.CardType, ReleaseMoney = releaseMoney, PaymentMode = paymentMode, Balance = info.Balance, ActivationDate = info.ActivationDate, ValidDate = info.ValidDate, HolidayEnabled = info.HolidayEnabled, Deposit = info.Deposit, OperatorID = op, StationID = station, Memo = memo }; ProviderFactory.Create <ICardReleaseRecordProvider>(_RepoUri).Insert(record, unitWork); info.Release(); ICardProvider icp = ProviderFactory.Create <ICardProvider>(_RepoUri); CardInfo origial = icp.GetByID(info.CardID).QueryObject; if (origial == null) { icp.Insert(info, unitWork); } else if (keepParkingStatus) { UpdateCard(info, unitWork); } else { UpdateCardAll(info, unitWork); } return(unitWork.Commit()); }
/// <summary> /// 根据节点获取节点配置信息 /// </summary> /// <param name="item">节点</param> /// <returns></returns> private static PaymentMode GetPaymentMode(XElement item) { PaymentMode paymentMode = new PaymentMode(); paymentMode.Id = item.Attribute("id").Value; paymentMode.Name = item.Attribute("name").Value; paymentMode.RequestType = GetElementValue(item, "requestType"); paymentMode.ChargeProcessor = GetElementValue(item, "chargeProcessor"); paymentMode.PaymentUrl = GetElementValue(item, "paymentUrl"); paymentMode.PaymentBgCallbackUrl = GetElementValue(item, "paymentBgCallbackUrl"); paymentMode.PaymentCallbackUrl = GetElementValue(item, "paymentCallbackUrl"); paymentMode.RefundUrl = GetElementValue(item, "refundUrl"); paymentMode.RefundCallbackUrl = GetElementValue(item, "refundCallbackUrl"); paymentMode.BankCert = GetElementValue(item, "bankCert"); paymentMode.BankCertKey = GetElementValue(item, "bankCertKey"); paymentMode.CustomConfigs = new Dictionary <string, string>(); foreach (XElement customNode in item.Element("customConfigs").Elements("customConfig")) { paymentMode.CustomConfigs[customNode.Attribute("name").Value] = customNode.Value; } paymentMode.Debug = GetElementValue(item, "debug"); paymentMode.MerchantList = new List <PaymentModeMerchant>(); foreach (XElement node in item.Element("merchants").Elements("merchant")) { PaymentModeMerchant merchant = new PaymentModeMerchant(); merchant.MerchantSysNo = int.Parse(GetElementValue(node, "merchantSysNo")); merchant.MerchantNO = GetElementValue(node, "merchantNO"); merchant.MerchantCert = GetElementValue(node, "merchantCert"); merchant.MerchantCertKey = GetElementValue(node, "merchantCertKey"); merchant.CurCode = GetElementValue(node, "curCode"); merchant.Encoding = GetElementValue(node, "encoding"); merchant.CustomConfigs = new Dictionary <string, string>(); foreach (XElement customNode in node.Element("customConfigs").Elements("customConfig")) { merchant.CustomConfigs[customNode.Attribute("name").Value] = customNode.Value; } paymentMode.MerchantList.Add(merchant); } return(paymentMode); }
public IniciafSitefInterativoModel(string valor, string Operator, string cupomFiscal, PaymentMode paymentMode) { DateTime now = DateTime.Now.ToLocalTime(); var year = now.Year; var month = (now.Month < 10 ? '0' + now.Month.ToString() : now.Month.ToString()); var day = (now.Day < 10 ? '0' + now.Day.ToString() : now.Day.ToString()); var hour = (now.Hour < 10 ? '0' + now.Hour.ToString() : now.Hour.ToString()); var minute = (now.Minute < 10 ? '0' + now.Minute.ToString() : now.Minute.ToString()); var second = (now.Second < 10 ? '0' + now.Second.ToString() : now.Second.ToString()); Valor = new StringBuilder(valor); CupomFiscal = new StringBuilder(cupomFiscal); DataFiscal = new StringBuilder(year + month + day); HoraFiscal = new StringBuilder(hour + minute + second); Operador = new StringBuilder(Operator); PaymentMode = paymentMode; }
public ReceiptLineItem CreateLineItem(decimal amount, string paymentRefId, string mMoneyPaymentType, string notificationId,int lineItemSequenceNo, PaymentMode paymentType, string description, Guid receiptId, bool IsConfirmed) { var li = ReceiptLineItemPrivateConstruct<ReceiptLineItem>(Guid.NewGuid()); li.Value = amount; li.Description = description; li.PaymentRefId = paymentRefId; li.LineItemSequenceNo = 0; li.PaymentType = paymentType; li.MMoneyPaymentType = mMoneyPaymentType; li.NotificationId = notificationId; li.LineItemType = IsConfirmed ? OrderLineItemType.PostConfirmation : OrderLineItemType.DuringConfirmation; if(receiptId !=Guid.Empty) { li.PaymentDocLineItemId = receiptId; } return li; }
public override PaymentResult Process(string total, PaymentMode mode, int numParcels, string filiacao, string distribuidor, int numPedido, CreditCard cartao) { filiacao = filiacao ?? "1001734898"; // 1001734898 filiacao de exemplo numParcels = numParcels == 0 ? 1 : numParcels; // // Pega endereço dos components da Visa // if (Config.Address == null) throw new ProviderException("The Boleto endpoint provider is not configured!"); string paymentNethod = ((mode == PaymentMode.InCash) ? "10" + numParcels.ToString("00") : (mode == PaymentMode.CreditWithInterestStore) ? "20" + numParcels.ToString("00") : (mode == PaymentMode.CreditWithInterestIssuer) ? "30" + numParcels.ToString("00") : "A001"); var html = new StringBuilder(); html.Append("<script>location=\"" + Config.Address + "?saleId=" + numPedido + "\";</script>"); return new PaymentResult(html.ToString()); }
public EzeResult cardTransaction( double amount, PaymentMode mode, OptionalParams options) { EzeResult result = null; Console.WriteLine("...Take Payment <" + mode + ",amount=" + amount + "," + ">"); TxnInput.Types.TxnType txnType = TxnInput.Types.TxnType.CARD_AUTH; if (amount <= 0) throw new EzeException("Amount is 0 or negative"); TxnInput tInput = TxnInput.CreateBuilder() .SetTxnType(txnType) .SetAmount(amount) .Build(); if (null != options) { if (null != options.getReference()) { if (null != options.getReference().getReference1()) tInput = TxnInput.CreateBuilder(tInput).SetOrderId(options.getReference().getReference1()).Build(); if (null != options.getReference().getReference2()) tInput = TxnInput.CreateBuilder(tInput).SetExternalReference2(options.getReference().getReference2()).Build(); if (null != options.getReference().getReference3()) tInput = TxnInput.CreateBuilder(tInput).SetExternalReference3(options.getReference().getReference3()).Build(); } if (0 != options.getAmountCashback()) tInput = TxnInput.CreateBuilder(tInput).SetAmountOther(options.getAmountCashback()).Build(); // if (0 != options.getAamountTip()) tInput = TxnInput.CreateBuilder(tInput).Set(options.getBankCode()).Build(); if (null != options.getCustomer()) { String mobileNumber = options.getCustomer().getMobileNumber(); String emailId = options.getCustomer().getEmailId(); if (null != mobileNumber) tInput = TxnInput.CreateBuilder(tInput).SetCustomerMobile(mobileNumber).Build(); if (null != emailId) tInput = TxnInput.CreateBuilder(tInput).SetCustomerEmail(emailId).Build(); } } ApiInput apiInput = ApiInput.CreateBuilder() .SetMsgType(ApiInput.Types.MessageType.TXN) .SetMsgData(tInput.ToByteString()).Build(); this.send(apiInput); while (true) { result = this.getResult(this.receive()); if (result.getEventName() == EventName.TAKE_PAYMENT) { if (result.getStatus() == Status.SUCCESS) EzeEvent("Payment Successful", new EventArgs()); else EzeEvent("Payment Failed", new EventArgs()); break; } } return result; }
public PaymentNoteLineItem CreateLineItem(decimal amount, PaymentMode paymentMode) { return new PaymentNoteLineItem(Guid.Empty) { Amount = amount, Description = "Payment note test", PaymentMode = paymentMode, LineItemSequenceNo = 0 }; }
public virtual PaymentResult Process(string total, PaymentMode mode, int numParcels, string filiacao, string distribuidor, int numPedido, CreditCard cartao) { throw new NotImplementedException(); }
public void AdjustAccountBalance(Guid costCentreId, PaymentMode paymentMode, decimal amount, PaymentNoteType type) { _paymentTrackerRepository.AdjustAccountBalance(costCentreId, paymentMode, amount, type); }
public override PaymentResult Process(string total, PaymentMode mode, int numParcels, string filiacao, string distribuidor, int numPedido, CreditCard cartao) { XmlNode response; Int32 resultNumber = 0; var provider = new MasterCard.komerci_captureSoapClient(new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress(Config.Address)); string txtmode = (mode == PaymentMode.InCash) ? "04" : (mode == PaymentMode.CreditWithInterestIssuer) ? "06" : (mode == PaymentMode.CreditWithInterestStore) ? "08" : ""; // // 1° requisição : GetAuthorized // Informações passadas pelo usuário: número de parcelas,número do cartão e Portador(nome do cliente) // Informações padrão: total da compra,tipo da transação, filiação, mês e ano correntes, // distribuidor e número do documento1 //Tipo de transação : 04 a vista, 06 parcelada pelo emissor e 08 parcelado pelo estabelecimento //ConfTxn tem o valor S por confirmação da transação da aplicação de ecommerce response = provider.GetAuthorizedTst(total, txtmode, numParcels.ToString("00"), filiacao, numPedido.ToString("00"), cartao.Number, cartao.Cvc2, cartao.ExpirationMonth, cartao.ExpirationYear, cartao.CardHolder, null, "12345", null, null, null, null, null, null, null, null, null, null, null, "S"); if (!String.IsNullOrEmpty(response.FirstChild.InnerText)) resultNumber = Convert.ToInt32(response.FirstChild.InnerText); if (resultNumber != 0) return new PaymentResult(null, response.FirstChild.InnerText); // informações retornadas pela 1° requisição e que precisam ser passadas na segunda // numero do pedido, de autorização, comprovante de venda e uma sequencia de numeros da masterCard var salesNumber = response.ChildNodes[2].InnerText; var authorizationNumber = response.ChildNodes[5].InnerText; var voucherNumber = response.ChildNodes[6].InnerText; var sequenceNumber = response.ChildNodes[7].InnerText; // // 2° requisição : ConfirmTXN // #if DEBUG response = provider.ConfirmTxnTst("", sequenceNumber, voucherNumber, authorizationNumber, numParcels.ToString("00"), txtmode, total, filiacao, distribuidor, numPedido.ToString(), salesNumber, null, null, null, null, null, null, null); #endif if (!String.IsNullOrEmpty(response.FirstChild.InnerText)) resultNumber = Convert.ToInt32(response.FirstChild.InnerText); if (resultNumber != 0) return new PaymentResult(response.FirstChild.InnerText, null); // //3° requisição: Cupom // //Response.Redirect("WebForm2.aspx?voucherNumber=" + voucherNumber.EncryptToHex() + "&cardNumber=" + txtNumCartao.Text.EncryptToHex() + "&authorizationNumber=" + authorizationNumber.EncryptToHex() + "&total=" + txtTotal.Text); #warning ultimo parâmetro não estava sendo passado return new PaymentResult(null, null); }