Ejemplo n.º 1
0
        public async Task <IActionResult> Create(PaymentRecordCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                var record = new PaymentRecord()
                {
                    Id              = model.Id,
                    EmployeeId      = model.EmployeeId,
                    FullName        = _employeeService.GetById(model.EmployeeId).Fullname,
                    PayDate         = model.PayDate,
                    Paymonth        = model.Paymonth,
                    TaxYearId       = model.TaxYearId,
                    TaxCode         = model.TaxCode,
                    Hourlyrate      = model.Hourlyrate,
                    HoursWoreked    = model.HoursWoreked,
                    ContrctHours    = model.ContrctHours,
                    OvertimeHours   = ovrtime = _payComputationService.OvertimeHours(model.HoursWoreked, model.ContrctHours),
                    Contrctearning  = contrctearn = _payComputationService.ContractualEarnings(model.ContrctHours, model.HoursWoreked, model.Hourlyrate),
                    Overtimeearning = ovrtimeearn = _payComputationService.OvertimeEarnings(_payComputationService.OvertimeRate(model.Hourlyrate), ovrtime),
                    TotalEarnings   = totalearn = _payComputationService.TotalEarnings(ovrtimeearn, contrctearn),
                    Tax             = tax = _taxService.TaxAmount(totalearn),
                    SLC             = slc = _employeeService.StudentLoanRepaymentAmount(model.EmployeeId, totalearn),
                    TotalDeduction  = totded = _payComputationService.TotalDeduction(tax, slc),
                    NetPay          = _payComputationService.NetPay(totalearn, totded)
                };
                await _payComputationService.CreateAsync(record);

                return(RedirectToAction(nameof(Index)));
            }
            ViewBag.employees = _employeeService.GetAllEmployeesForPayroll();
            ViewBag.taxYears  = _payComputationService.GetAllTaxYear();
            return(View());
        }
 protected override DriverResult Display(PayButtonPart part, string displayType, dynamic shapeHelper)
 {
     if (displayType == "Detail")
     {
         var partSettings = part.Settings.GetModel <PayButtonPartSettings>();
         var tokens       = new Dictionary <string, object> {
             { "Content", part.ContentItem }
         };
         dynamic ci      = part.ContentItem;
         var     payment = new PaymentRecord();
         payment.ContentItemId = part.Id;
         payment.Currency      = partSettings.DefaultCurrency;
         if (string.IsNullOrWhiteSpace(partSettings.CurrencyField) == false)
         {
             payment.Currency = _tokenizer.Replace(partSettings.CurrencyField, tokens);
         }
         payment.Amount = Convert.ToDecimal(_tokenizer.Replace(partSettings.AmountField, tokens), CultureInfo.InvariantCulture);
         if (part.ContentItem.Parts.SingleOrDefault(x => x.PartDefinition.Name == "TitlePart") != null)
         {
             payment.Reason = ci.TitlePart.Title;
         }
         var nonce = _paymentService.CreatePaymentNonce(payment);
         return(ContentShape("Parts_PayButton",
                             () => shapeHelper.Parts_PayButton(Nonce: nonce)));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
 public PaymentContext(
     string nonce, PaymentRecord paymentInfo)
     : this(nonce, paymentInfo.Amount, null)
 {
     PaymentRecord = paymentInfo;
     PurchaseOrder = PaymentRecord.PaymentUniqueKey;
 }
 public StartPaymentMessage(string al, string se, PaymentRecord pr)
     : this(al, se)
 {
     importo  = (pr.Amount * 100).ToString("0");
     divisa   = pr.Currency;
     codTrans = pr.Id.ToString() + "LASER";
 }
        public Task <ProcessRejectedPaymentResponse> Handle(ProcessRejectedPaymentRequest request, CancellationToken cancellationToken = default)
        {
            var merchantKey = _merchantEncryptionKeyGetter.Key(request.Merchant.Id);

            var paymentRecord = new PaymentRecord
            {
                Id     = _guid.NewGuid().ToString(),
                Source = new PaymentRecord.PaymentSource
                {
                    CardExpiryEncrypted = _encrypter.EncryptUtf8(request.Source.CardExpiry, merchantKey),
                    CardNumberEncrypted = _encrypter.EncryptUtf8(request.Source.CardNumber, merchantKey),
                    CvvEncrypted        = _encrypter.EncryptUtf8(request.Source.Cvv, merchantKey)
                },
                Recipient = new PaymentRecord.PaymentRecipient
                {
                    AccountNumberEncrypted = _encrypter.EncryptUtf8(request.Recipient.AccountNumber, merchantKey),
                    SortCodeEncrypted      = _encrypter.EncryptUtf8(request.Recipient.SortCode, merchantKey),
                },
                Currency      = request.Currency,
                Status        = PaymentStatus.Rejected,
                Amount        = request.Amount,
                CreatedAt     = _dateTime.UtcNow(),
                MerchantId    = request.Merchant.Id,
                FailureReason = request.BankResponse.FailureReason,
            };

            _paymentRecordCreator.Add(paymentRecord);

            return(Task.FromResult(new ProcessRejectedPaymentResponse
            {
                Id = paymentRecord.Id
            }));
        }
Ejemplo n.º 6
0
        public void Update(PaymentRecord paymentRecord)
        {
            var existing = _mockDocumentDb.Payments.FirstOrDefault(x => x.Id == paymentRecord.Id);

            _mockDocumentDb.Payments.Remove(existing);
            _mockDocumentDb.Payments.Add(paymentRecord);
        }
        //GET
        protected override DriverResult Editor(OrderPart order, dynamic shapeHelper)
        {
            if (!_orchardServices.Authorizer.Authorize(OrderPermissions.ManageOrders, null, T("Cannot manage orders")))
            {
                return(null);
            }

            PaymentRecord payment = _paymentService.GetPaymentByGuid(order.Charge?.TransactionId);

            return(ContentShape("Parts_Order_PaymentInfo",
                                () => {
                if (payment == null)
                {
                    return null;
                }

                var model = new PaymentInfoViewModel {
                    PosName = payment.PosName,
                    Reason = payment.Reason,
                    Amount = payment.Amount,
                    Currency = payment.Currency,
                    UpdateDate = payment.UpdateDate,
                    Success = payment.Success,
                    Error = payment.Error,
                    TransationId = payment.TransactionId,
                };
                return shapeHelper.EditorTemplate(
                    TemplateName: "Parts/Order.PaymentInfo",
                    Model: model);
            }));
        }
Ejemplo n.º 8
0
        public void ShowObject(object keyValue)
        {
            Payment = keyValue as PaymentRecord;
            PaymentbindingSource.DataSource = Payment;
            if (Payment != null && (Payment.PaymentId == 0 && Payment.PaymentMethod == null))
            {
                Text = @"New Payment Records";
                Payment.PaymentMethod = Convert.ToInt32(PaymentMethods.Cash);
            }
            if (Payment != null && Payment.PaymentId != 0)
            {
                Text = @"Edit Payment Records";
                switch (Payment.PaymentMethod)
                {
                case (int)PaymentMethods.Cheque:
                    checkNoTextBox.Text = Payment.Reference;
                    break;

                case (int)PaymentMethods.BankTransfer:
                    bankTransferTextBox.Text = Payment.Reference;
                    break;

                case (int)PaymentMethods.Other:
                    othersTextBox.Text = Payment.Reference;
                    break;
                }
                //PaymentTotal = PaymentTotal - Convert.ToDouble(Payment.AmountReceived);
            }
        }
        /// <summary>
        /// Salva il pagamento e restituisce il PaymentId.
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        private int SavePaymentInfo(PaymentRecord values)
        {
            PaymentRecord record = null;
            DateTime      now    = DateTime.Now;

            if (values.Id > 0)
            {
                record = _repository.Get(values.Id);
            }
            values.PosName       = GetValidString(values.PosName, 255);
            values.Reason        = GetValidString(values.Reason, 255);
            values.Error         = GetValidString(values.Error, 255);
            values.TransactionId = GetValidString(values.TransactionId, 255);
            // 4000 è la massima lunghezza di stringa che nhibernate riesce a gestire
            values.PosUrl               = GetValidString(values.PosUrl, 4000);
            values.Info                 = GetValidString(values.Info, 4000);
            values.CustomRedirectUrl    = GetValidString(values.CustomRedirectUrl, 4000);
            values.CustomRedirectSchema = GetValidString(values.CustomRedirectSchema, 4000);
            if (record == null)
            {
                values.CreationDate = now;
                values.UpdateDate   = now;
                _repository.Create(values);
            }
            else
            {
                values.UpdateDate = now;
                _repository.Update(values);
            }
            return(values.Id);
        }
Ejemplo n.º 10
0
 public override IEnumerable <dynamic> GetAdditionalOrderMetadataShapes(OrderPart orderPart)
 {
     // I need to avoid showing these shapes if I'm in the backoffice.
     if (!AdminFilter.IsApplied(_workContextAccessor.GetContext().HttpContext.Request.RequestContext))
     {
         var transactionId = orderPart.Charge?.TransactionId;
         if (transactionId != null)
         {
             PaymentRecord payment = _paymentService.GetPaymentByTransactionId(transactionId);
             if (payment != null)
             {
                 var metaShapes = _customPosProviders
                                  .Select(cpp => cpp.GetAdditionalFrontEndMetadataShapes(payment))
                                  .ToList();
                 // metaShapes variable is a list of lists.
                 foreach (var l in metaShapes)
                 {
                     foreach (var shape in l.ToList())
                     {
                         yield return(shape);
                     }
                 }
             }
         }
     }
 }
        public PaymentResponse Post([FromBody] PaymentInformation paymentInformation)
        {
            log.Info("POST-REQUEST:" + JsonConvert.SerializeObject(paymentInformation));
            try
            {
                EncryptedPaymentInformation encryptedPaymentInformation = new EncryptedPaymentInformation();
                //Encrypt data before sending to bank
                encryptedPaymentInformation = EncryptData(paymentInformation);

                PaymentResponse response = _bankService.PaymentRequest(encryptedPaymentInformation);
                using (var context = new PaymentsStorageContext())
                {
                    var paymentRecord = new PaymentRecord()
                    {
                        CardNo     = paymentInformation.CardNo,
                        Expiry     = paymentInformation.Expiry,
                        Status     = response.Status,
                        Identifier = response.Identifier
                    };
                    context.PaymentRecords.Add(paymentRecord);
                    context.SaveChanges();
                }
                log.Info("POST-RESPONSE:" + JsonConvert.SerializeObject(response));
                return(response);
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);

                return(null);
            }
        }
Ejemplo n.º 12
0
 public void InsertPaymentRecord(PaymentRecord record)
 {
     if (record != null)
     {
         _recordRepository.Insert(record);
     }
 }
Ejemplo n.º 13
0
 public void UpdatePaymentRecord(PaymentRecord record)
 {
     if (record != null)
     {
         _recordRepository.Update(record);
     }
 }
 public ActionResult EditPayment(PaymentRecord pr, Invoice invoice)
 {
     db.PaymentRecords.Find(pr.PaymentId).CardRecordId = pr.CardRecordId;
     db.SaveChanges();
     Session["EditInvoice"] = db.Invoices.Find(invoice.Id);
     return(RedirectToAction("Edit"));
 }
        public async Task AddPaymentAsync(PaymentRecord paymentRecord)
        {
            paymentRecord.CardNumber = _encryptor.Encrypt(paymentRecord.CardNumber);
            paymentRecord.CardName   = _encryptor.Encrypt(paymentRecord.CardName);

            await _innerRepository.AddPaymentAsync(paymentRecord);
        }
Ejemplo n.º 16
0
    public bool checkIfExistPayment(PaymentRecord pRec)
    {
        SQL = "select count(payment_no) from customer_payment where elt_account_number = " + elt_account_number + " and payment_no=" + pRec.payment_no;
        Cmd = new SqlCommand(SQL, Con);
        int rowCount = 0;

        try
        {
            Con.Open();
            rowCount = Int32.Parse(Cmd.ExecuteScalar().ToString());
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            Con.Close();
        }
        if (rowCount == 1)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
        protected virtual string InnerChargeAdminUrl(PaymentRecord payment)
        {
            var urlHelper = new UrlHelper(_orchardServices.WorkContext.HttpContext.Request.RequestContext);
            var url       = urlHelper.Action("Info", "Payment", new { area = "Laser.Orchard.PaymentGateway" });

            return(string.Format("{0}?paymentId={1}", url, payment.Id));
        }
        public void GivenAIdIsProvided_WhenTryingToGetThePaymentRecord_ThenItReturnsASuccessfulResponse()
        {
            // Given

            var mockedLogger            = Substitute.For <ILogger <PaymentRetrievalController> >();
            var mockedPaymentRepository = Substitute.For <IPaymentRepository>();

            var realPaymentRetrievalController = new PaymentRetrievalController(mockedLogger, mockedPaymentRepository);

            var id = Guid.NewGuid();

            var paymentRecord = new PaymentRecord
            {
                PaymentGatewayId = id
            };

            mockedPaymentRepository
            .Get(id)
            .Returns(paymentRecord);

            // When

            var response = realPaymentRetrievalController.Get(id.ToString()).GetAwaiter().GetResult();

            // Then

            response.Should().NotBeNull();
            response.Should().BeOfType <OkObjectResult>();
            response.As <OkObjectResult>().Value.Should().BeOfType <PaymentRecord>();
            response.As <OkObjectResult>().Value.As <PaymentRecord>().PaymentGatewayId.Should().Be(id);

            mockedPaymentRepository.Received(1).Get(id);
        }
Ejemplo n.º 19
0
        public void SaveChanges()
        {
            if (!ValidateForm())
            {
                return;
            }
            PaymentbindingSource.EndEdit();
            Payment = (PaymentRecord)PaymentbindingSource.DataSource;
            if (Payment != null)
            {
                switch (Payment.PaymentMethod)
                {
                case 5:
                    Payment.Reference = null;
                    break;

                case 6:
                    Payment.Reference = checkNoTextBox.Text;
                    break;

                case 7:
                    Payment.Reference = bankTransferTextBox.Text;
                    break;

                case 8:
                    Payment.Reference = othersTextBox.Text;
                    break;
                }
            }
            DialogResult = DialogResult.OK;
        }
        public void GivenAPendingPaymentRecordIsProvided_WhenUpsertingIt_ThenItAddsToTheContext()
        {
            // Given

            using var localTestContext = new PaymentContext(new DbContextOptionsBuilder <PaymentContext>()
                                                            .UseInMemoryDatabase(databaseName: $"PaymentDatabase-Test-{Guid.NewGuid()}")
                                                            .Options);

            var mockedLogger        = Substitute.For <ILogger <Domain.PaymentRepository.PaymentRepository> >();
            var mockedDataEncryptor = Substitute.For <IDataEncryptor>();

            var realPaymentRepository = new Domain.PaymentRepository.PaymentRepository(mockedLogger, localTestContext, mockedDataEncryptor);

            var expectedId            = Guid.NewGuid();
            var expectedPaymentRecord = new PaymentRecord
            {
                PaymentGatewayId = expectedId,
                PaymentStatus    = PaymentStatus.Pending
            };

            // When

            realPaymentRepository.Upsert(expectedPaymentRecord).GetAwaiter().GetResult();

            var actualPaymentRecord = realPaymentRepository.Get(expectedId).GetAwaiter().GetResult();

            // Then

            actualPaymentRecord.Should().NotBeNull();
            actualPaymentRecord.Should().BeOfType <PaymentRecord>();
            actualPaymentRecord.PaymentGatewayId.Should().Be(expectedId);
        }
        public void GivenAPaymentRecordIdTheExistsInTheContextIsProvided_WhenGettingIt_ThenItReturnsThePaymentRecord()
        {
            // Given

            using var localTestContext = new PaymentContext(new DbContextOptionsBuilder <PaymentContext>()
                                                            .UseInMemoryDatabase(databaseName: $"PaymentDatabase-Test-{Guid.NewGuid()}")
                                                            .Options);

            var mockedLogger        = Substitute.For <ILogger <Domain.PaymentRepository.PaymentRepository> >();
            var mockedDataEncryptor = Substitute.For <IDataEncryptor>();

            var realPaymentRepository = new Domain.PaymentRepository.PaymentRepository(mockedLogger, localTestContext, mockedDataEncryptor);

            var expectedId = Guid.NewGuid();

            var expectedPaymentRecord = new PaymentRecord {
                PaymentGatewayId = expectedId
            };

            localTestContext.Payments.Add(expectedPaymentRecord);
            localTestContext.SaveChanges();

            // When

            var response = realPaymentRepository.Get(expectedId).GetAwaiter().GetResult();

            // Then

            response.Should().NotBeNull();
            response.Should().BeOfType <PaymentRecord>();
            response.PaymentGatewayId.Should().Be(expectedId);
        }
Ejemplo n.º 22
0
        public async Task AddPaymentAsync(PaymentRecord paymentRecord)
        {
            var payment = _mapper.Map <Payment>(paymentRecord);

            await _context.Payments.AddAsync(payment);

            await _context.SaveChangesAsync();
        }
 public virtual string GetChargeAdminUrl(PaymentRecord payment)
 {
     if (payment.PosName == GetPosName())
     {
         return(InnerChargeAdminUrl(payment));
     }
     return(null);
 }
Ejemplo n.º 24
0
 public PaymentRecord CreatePayment(PaymentRecord payment)
 {
     return(Execute(session =>
     {
         var svc = new MoneySourceService();
         return svc.CreatePayment(payment, null, null);
     }));
 }
Ejemplo n.º 25
0
        public ActionResult DeleteConfirmed(int id)
        {
            PaymentRecord paymentrecord = db.PaymentRecords.Find(id);

            db.PaymentRecords.Remove(paymentrecord);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 26
0
        public void Add(PaymentRecord record)
        {
            if (_mockDocumentDb.Payments.Any(a => a.Id == record.Id))
            {
                throw new ArgumentException(nameof(record));
            }

            _mockDocumentDb.Payments.Add(record);
        }
Ejemplo n.º 27
0
        public void UpdatePayment(PaymentRecord payment, SqlConnection con, SqlTransaction trans)
        {
            var ps = new PaymentRecordService();

            var source = GetById(payment.MoneySourceId);
            var amount = Convert.ToSingle(payment.Amount);

            var original       = ps.GetById(payment.Id);
            var originalAmount = Convert.ToSingle(original.Amount);

            if (payment.Type.Equals("Expense", StringComparison.CurrentCultureIgnoreCase) ||
                payment.Type.Equals("Order-Discount", StringComparison.CurrentCultureIgnoreCase))
            {
                amount = -amount;
            }

            if (original.Type.Equals("Income", StringComparison.CurrentCultureIgnoreCase) ||
                original.Type.Equals("Order-Payment", StringComparison.CurrentCultureIgnoreCase))
            {
                originalAmount = -originalAmount;
            }

            if (payment.Unit.Equals("VND"))
            {
                source.BalanceVND += amount;
            }
            else
            {
                source.BalanceUSD += amount;
            }

            if (original.Unit.Equals("VND"))
            {
                source.BalanceVND += originalAmount;
            }
            else
            {
                source.BalanceUSD += originalAmount;
            }


            if (con != null && trans != null)
            {
                ps.Update(payment, con, trans);

                _adapter.Update(source, con, trans);
            }
            else
            {
                SqlHelper.StartTransaction(ConfigManager.ConnectionString, (connection, transaction) =>
                {
                    ps.Update(payment, connection, transaction);

                    _adapter.Update(source, con, trans);
                });
            }
        }
Ejemplo n.º 28
0
 public HttpResponseMessage UpdatePayment(PaymentRecord payment)
 {
     return(Execute(session =>
     {
         var svc = new MoneySourceService();
         svc.UpdatePayment(payment, null, null);
         return Request.CreateResponse(HttpStatusCode.OK);
     }));
 }
        private async Task <PaymentRequestCompleteResult> ProcessPaymentComplete(IInvokeActivity invoke, PaymentRequestComplete paymentRequestComplete, CancellationToken token = default(CancellationToken))
        {
            var paymentRequest  = paymentRequestComplete.PaymentRequest;
            var paymentResponse = paymentRequestComplete.PaymentResponse;

            paymentRequest.Details = (await this.ProcessShippingUpdate(
                                          new PaymentRequestUpdate()
            {
                Id = paymentRequest.Id,
                Details = paymentRequest.Details,
                ShippingAddress = paymentResponse.ShippingAddress,
                ShippingOption = paymentResponse.ShippingOption
            },
                                          ShippingUpdateKind.Both,
                                          token)).Details;

            PaymentRecord paymentRecord          = null;
            PaymentRequestCompleteResult result  = null;
            Exception paymentProcessingException = null;

            try
            {
                paymentRecord = await this.paymentService.ProcessPaymentAsync(paymentRequest, paymentResponse);

                result = new PaymentRequestCompleteResult("success");
            }
            catch (Exception ex)
            {
                paymentProcessingException = ex;
                // TODO: If payment is captured but not charged this would be considered "unknown" (charge the captured amount after shipping scenario).
                result = new PaymentRequestCompleteResult("failure");
            }

            try
            {
                var message = invoke.RelatesTo.GetPostToBotMessage();
                if (result.Result == "success")
                {
                    // Resume the conversation with the receipt to user
                    message.Text  = paymentRequestComplete.Id;
                    message.Value = paymentRecord;
                }
                else
                {
                    // Resume the conversation with error message
                    message.Text = $"Failed to process payment with error: {paymentProcessingException?.Message}";
                }
                await Conversation.ResumeAsync(invoke.RelatesTo, message, token);
            }
            catch (Exception ex)
            {
                Trace.TraceError($"Failed to resume the conversation using ConversationReference: {JsonConvert.SerializeObject(invoke.RelatesTo)} and exception: {ex.Message}");
            }

            return(result);
        }
Ejemplo n.º 30
0
        public void SaveChanges()
        {
            var iv = _context.Invoices.FirstOrDefault(i => i.Id == _paymentRecord.InvoiceId);

            if (!ValidateForm())
            {
                return;
            }
            var rt = (Convert.ToDouble(_invoiceListInfo.RecievedTotal) + Convert.ToDouble(_paymentRecord.AmountReceived));

            if (rt > Convert.ToDouble(_invoiceListInfo.InvoiceTotal))
            {
                ViewHelper.ShowErrorMessage("the amount of recieved total has exceeded the amount of invoice total?");
                Close();
                return;
            }
            PaymentbindingSource.EndEdit();
            _paymentRecord = (PaymentRecord)PaymentbindingSource.DataSource;
            if (_newMode)
            {
                _context.PaymentRecords.AddObject(_paymentRecord);
            }
            if (rt == Convert.ToDouble(_invoiceListInfo.InvoiceTotal))
            {
                iv.Status = (int)InvoiceStatuses.PaidInFull;
            }
            try
            {
                switch (_paymentRecord.PaymentMethod)
                {
                case 5:
                    _paymentRecord.Reference = null;
                    break;

                case 6:
                    _paymentRecord.Reference = checkNoTextBox.Text;
                    break;

                case 7:
                    _paymentRecord.Reference = bankTransferTextBox.Text;
                    break;

                case 8:
                    _paymentRecord.Reference = othersTextBox.Text;
                    break;
                }
                _context.SaveChanges();
                Close();
            }

            catch (Exception)
            {
                ViewHelper.ShowSaveError();
                return;
            }
        }
Ejemplo n.º 31
0
        public static PaymentDTO AddPayment(string PaymentEmail, string DonorName, string ReceipientEmail, Double amount, string message, string paymentType, Boolean anonymous, DateTime paymentDate, int transactionID, int invoiceID)
        {
            ConvictsContext db = new ConvictsContext();

            PaymentRecord payment = new PaymentRecord();
            payment.PayerEmail = PaymentEmail;
            payment.DonorName = DonorName;
            payment.amount = amount;
            payment.TeamCode = Helper.getTeamCode(ReceipientEmail);
            payment.ConvictEmail = ReceipientEmail;
            payment.PaymentType = paymentType;
            payment.Message = message;
            payment.CreateDate = paymentDate;
            payment.Anonymous = anonymous;
            payment.TransactionID = transactionID;
            payment.InvoiceID = invoiceID;
            string returnStatus = "false";
            string errorMessage = "";

            try
            {
                db.Payments.Add(payment);
                db.SaveChanges();
                returnStatus = "true";

            }
            catch (Exception ex)
            {
                returnStatus = "false";
                errorMessage = ex.Message;
            }

            PaymentDTO returnobj = new PaymentDTO();
            returnobj.status = returnStatus;
            returnobj.errorMessage = errorMessage;

            return returnobj;
        }
Ejemplo n.º 32
0
 private static void WritePaymentInfo(PaymentRecord paymentRecord)
 {
     StringBuilder stringBuilder = new StringBuilder();
     AddComma(paymentRecord.paymentID.ToString(), stringBuilder);
     AddComma(paymentRecord.CreateDate.ToString(), stringBuilder);
     AddComma(paymentRecord.DonorName, stringBuilder);
     AddComma(paymentRecord.PayerEmail, stringBuilder);
     AddComma(paymentRecord.ConvictEmail, stringBuilder);
     AddComma(paymentRecord.PaymentType, stringBuilder);
     AddComma(paymentRecord.amount.ToString(), stringBuilder);
     HttpContext.Current.Response.Write(stringBuilder.ToString());
     HttpContext.Current.Response.Write(Environment.NewLine);
 }