How can I make a payment page in my payment system ?

Feb 24 2019 7:12 AM

I am working on an  payment system using mvc 5, And i almost finished a large part of the work such as the transfer of funds and the proportion of fees, etc.

But I'm having a problem now - the payment page for purchases from e-commerce sites,

And how a system api receives information from the customer, such as the price and account, and the name of merchant , That is, when the customer moves from the shopping cart to the payment page directly and the purchase information is converted to the payment confirmation page,

I tried to convert url information to the payment confirmation page but I did not succeed, and I hope to find help or code source  mvc5 with it and how to secure that page the transfer of this information.
 
 
  1. public class Transaction  
  2.     {  
  3.         [Key]  
  4.         [DatabaseGenerated(DatabaseGeneratedOption.Identity)]  
  5.         public int Id { getset; }  
  6.   
  7.         //foreign key of eBankingUser  
  8.         //hear userName will be assigned because GUID may not unique   
  9.         [Required]  
  10.         [Display(Name="User")]  
  11.         public string UserId { getset; }  
  12.   
  13.         //foreign key of transection table  
  14.        // [Required]  
  15.         public string OperationNumber { getset; }  
  16.   
  17.                   
  18.         [NotMapped]  
  19.         public string CountryName { getset; }  
  20.   
  21.         [NotMapped]  
  22.         public string CurrencyISO { getset; }  
  23.   
  24.         //[Required]  
  25.         public int? PinId { getset; }  
  26.    //     public int? PinCode { get; set; }  
  27.   
  28.         //Local amount that is inserted to transfer or recharge or top up  
  29.         public decimal? InsertedAmount { getset; }  
  30.   
  31.         //USD  
  32.         public decimal? AmountIN { getset; }  
  33.   
  34.         //USD  
  35.         public decimal? AmountOut { getset; }  
  36.   
  37.           
  38.         public int? RatePlanId { getset; }  
  39.   
  40.         public int? Status { getset; }  
  41.   
  42.         public DateTime? TransactionDate { getset; }  
  43.   
  44.   
  45.         [Display(Name = "Recepient User")]  
  46.         public string ToUser { getset; }  
  47.   
  48.         public string FromUser { getset; }  
  49.   
  50.         public DateTime? UpdateDate { getset; }  
  51.   
  52.         public string Remarks { getset; }  
  53.   
  54.         [NotMapped]  
  55.         public string ServiceName { getset; }  
  56.   
  57.   
  58.         [Display(Name="Reference")]  
  59.         public string ReferenceId { getset; }  
  60.   
  61.         [NotMapped]  
  62.         public bool IsCheck { getset; }  
  63.         public DateTime? TimeOut { getset; }  
  64.         public bool IsTimeOut { getset; }  
  65.         public int ClientId { getset; }  
  66.         public int VendorId { getset; }  
  67.         public decimal? UserBalance { getset; }  
  68.          
  69.     }  
  70.   
  71. //Repository  
  72.  public bool CreditTransferDbEntry(Transaction tIn, Transaction tOut, string fromUser, string toUser)  
  73.         {  
  74.             ITransactionRepository transaction_repo = new TransactionRepository(db);  
  75.             using(var contextTransaction = db.Database.BeginTransaction())  
  76.             {  
  77.                 try  
  78.                 {  
  79.                     var fee = tren_rep.GetById(1).MRP; /*ConstMessage.ConstFee_ID;*/  
  80.                     tOut.UserBalance = transaction_repo.UserBalanceUpdate(fromUser, -(decimal)tOut.AmountOut);  
  81.                     transaction_repo.Add(tOut);  
  82.                     tIn.UserBalance = transaction_repo.UserBalanceUpdate(toUser, (decimal)tOut.AmountOut - ((decimal)tOut.AmountOut * ((decimal)fee /100)));  
  83.                     transaction_repo.Add(tIn);  
  84.                     //UserUpdate(fromUser);  
  85.                     //UserUpdate(toUser);  
  86.   
  87.                     contextTransaction.Commit();  
  88.                     return true;  
  89.                 }  
  90.                 catch (Exception)   
  91.                 {  
  92.                     contextTransaction.Rollback();  
  93.                 }  
  94.             }  
  95.               
  96.             return false;  
  97.         }