static void Main(string[] args) { //Create voguepay merchant instance Merchant merchantinfo = new Merchant(); merchantinfo.MerchantID = "6359-0000000"; merchantinfo.Username = "******"; merchantinfo.Email = "*****@*****.**"; //Create voguepay instance (Parameters "live" or "demo", default is demo) Voguepay voguepay = new Voguepay("live"); voguepay.Init(merchantinfo); //Create customer instance Customerinfo customer = new Customerinfo(); customer.Name = "Sam Great"; customer.Phone = "20339922"; customer.Email = "*****@*****.**"; customer.City = "Allen"; customer.Country = "NGA"; customer.State = "Ikeja"; customer.ZipCode = "23401"; customer.Address = "3 Drive view estate"; //Create a hosted payment transaction HostedPayment hostedPayment = new HostedPayment(); hostedPayment.Amount = 250.3333; hostedPayment.Reference = "MyRef123"; hostedPayment.Memo = "Sample payment"; hostedPayment.Currency = "NGN"; hostedPayment.StoreID = "293330002"; //optional hostedPayment.SuccessURL = "https://sample.com/success"; hostedPayment.FailureURL = "https://sample.com/fail"; hostedPayment.NotificationURL = "https://sample.com/notify"; string jsonResult = voguepay.Pay(hostedPayment, customer); Console.WriteLine(jsonResult); Console.ReadKey(); }
static void Main(string[] args) { //Create voguepay merchant instance Merchant merchantinfo = new Merchant(); merchantinfo.MerchantID = "6359-0000000"; merchantinfo.Username = "******"; merchantinfo.Email = "*****@*****.**"; merchantinfo.CommandAPIToken = "ZnHzcbxKVbvF5d3J5JvZqZe587Rna"; //Create voguepay instance (Parameters "live" or "demo", default is demo) Voguepay voguepay = new Voguepay("live"); voguepay.Init(merchantinfo); //Query Transaction Transaction transaction = new Transaction(); transaction.TransactionID = "5d041a2843bd8"; string jsonResult = voguepay.Query(transaction); Console.WriteLine(jsonResult); Console.ReadKey(); }
static void Main(string[] args) { //Create voguepay merchant instance Merchant merchantinfo = new Merchant(); merchantinfo.MerchantID = "6359-0000000"; merchantinfo.Username = "******"; merchantinfo.Email = "*****@*****.**"; merchantinfo.CommandAPIToken = "ZnHzcbxKVbvF5d3J5JvZqZe587Rna"; merchantinfo.PublicKeyFile = @"C:\Users\Rock\public.txt"; //URL path to saved public key //Create voguepay instance (Parameters "live" or "demo", default is demo) Voguepay voguepay = new Voguepay("live"); voguepay.Init(merchantinfo); //Create customer instance Customerinfo customer = new Customerinfo(); customer.Name = "Sam Great"; customer.Phone = "20339922"; customer.Email = "*****@*****.**"; customer.City = "Allen"; customer.Country = "NGA"; customer.State = "Ikeja"; customer.ZipCode = "23401"; customer.Address = "3 Drive view estate"; DirectPayment directpayment = new DirectPayment(); directpayment.version = 2; directpayment.Amount = 100.22; directpayment.Currency = "USD"; directpayment.Reference = "MY_UNIQUE_REF"; directpayment.Memo = "Sample payment"; directpayment.RedirectURL = "https://sample.com/redirect"; directpayment.ReferralURL = "https://sample.com/referral"; directpayment.ResponseURL = "https://sample.com/notify/"; directpayment.StoreID = "5a33c3933ca"; //optional directpayment.CardName = "Steve"; directpayment.CardPan = "5389830123937029"; directpayment.CardExpiryMonth = 5; directpayment.CardExpiryYear = 21; directpayment.CardCVV = 170; directpayment.ServerPublicIP = "192.333.44.33"; directpayment.ServerWebsiteURL = "www.google.com"; directpayment.CustomerReferringIP = "10.22.333.33"; directpayment.CustomerReferringWebsite = "www.shades.com"; directpayment.DescriptorCompanyName = "Sparks"; directpayment.DescriptorCountryAddress = "Sparks Street"; directpayment.DescriptorCityAddress = "Califonia"; directpayment.DescriptorCountryAddress = "USA"; //country or 3 letter ISO // directpayment.CardToken = "5a344439203"; // directpayment.CardTokenize =true; string jsonResult = voguepay.Pay(directpayment, customer); Console.WriteLine(jsonResult); Console.ReadKey(); }