public void MakeDSTVPayment(DSTVTransaction transaction) { try { DatabaseHandler dp = new DatabaseHandler(); dp.SaveRequestlog(transaction.VendorCode, transaction.UtilityCode, "POSTING", transaction.CustRef, transaction.Password); PostResponse resp = new PostResponse(); var paymentFactory = new PaymentFactory(); var payment = paymentFactory.initialisePayment(transaction.UtilityCode); var response = payment.pay(transaction); Console.WriteLine(resp.Serialize(response)); Console.ReadLine(); } catch (SqlException) { Console.WriteLine("Failed to log request!!!"); } catch (Exception) { Console.WriteLine("GENERAL ERROR AT PEGPAY!!!"); } }
public DSTVTransaction GetDSTVTransaction() { DSTVTransaction transaction = new DSTVTransaction(); transaction.CustRef = new Random().Next(1, int.MaxValue).ToString(); transaction.CustName = "KONGAI VERONICAKATUSIIME"; transaction.CustomerType = "2"; transaction.Area = "TOP_UP"; transaction.PaymentDate = "31/07/2020"; transaction.TransactionAmount = "129000"; transaction.TransactionType = "CASH"; transaction.VendorCode = "STANBIC_VAS"; transaction.Password = "******"; transaction.CustomerTel = "256772212675"; transaction.Reversal = "0"; transaction.Teller = "10533030358"; transaction.Offline = "0"; transaction.DigitalSignature = "cihstY9+yp0rPEF6H0kmX+/wWiCpmSw3vNySiDwkDCsnxG+b8gneSkGot0Shdz4uamXJbaYhIJHUGDUf9m1ynW7AAOk68ZR2jrDRpOoSIVjdOvarbyxn+eoA7/ZAxMtJ0LbNJGxGZJNtky+gR+3IbG3/A6E4Fvc6r59ZKUqIhgp5i0EqiJ6FJVw5jlGm5lDJQKqvlC5hldVpT4Rv7TTQ1WKWKi84/J5yDtYH95UWViK25cMaVHJSuo6TzWnzFVKepYVBbyxhlHjNV4nNU0SXDPLXeTv9vpaGkS4tZKNXDyizZVjFVOyID+EG3VFLIK7wGPBnomYwsqoWoytCtUFSHw=="; transaction.Narration = "CUSTOMER NAME-KONGAI VERONICA KATUSIIME:CUSTOMER ID-KONGAVERONICACONSUMER CODE-10533030358:REFERENCE ID-17753995:VAS REQUEST AMOUNTUGX|129000.0"; transaction.VendorTransactionRef = new Random().Next(1, int.MaxValue).ToString(); transaction.UtilityCode = "DSTV"; return(transaction); }