Пример #1
0
        public void Test_Initialize_Transaction_Successful_Message()
        {
            connectionClient = new ConnectionClient(BASEURL,
                                                    Util.getHeader(PUBLICKEY, MERCHANTID));
            cashout = new Cashout(connectionClient);

            SortedDictionary <String, Object> param = new SortedDictionary <String, Object>();

            param.Add("reference", Util.generateTransactionRefrenceNo());
            param.Add("mchShortName", "Jerry's shop");
            param.Add("productName", "Apple AirPods Pro");
            param.Add("productDesc", "The best wireless earphone in history");
            param.Add("userPhone", "+2349876543210");
            param.Add("userRequestIp", "123.123.123.123");
            param.Add("amount", "100");
            param.Add("currency", "NGN");
            param.Add("payMethods", new String[] { "account", "qrcode", "bankCard", "bankAccount" });
            param.Add("payTypes", new String[] { "BalancePayment", "BonusPayment", "OWealth" });
            param.Add("callbackUrl", "https://you.domain.com/callbackUrl");
            param.Add("returnUrl", "https://you.domain.com/returnUrl");
            param.Add("expireAt", "10");

            JObject response = cashout.initializeTransaction(param).Result;

            transactionCheckStatusInput = (JObject)response.GetValue("data");
            Assert.AreEqual("SUCCESSFUL", response.GetValue("message").ToString());
        }
Пример #2
0
        public void Test_Transaction_Close_Successful()
        {
            // Sorted in Alphabetic Order
            SortedDictionary <String, Object> param = new SortedDictionary <String, Object>();

            param.Add("orderNo", transactionCheckStatusInput.GetValue("orderNo").ToString());
            param.Add("reference", transactionCheckStatusInput.GetValue("reference").ToString());

            String paramString = Util.mapToJsonString(param);
            String signature   = Util.calculateHMAC(paramString, PRIVATEKEY);

            connectionClient = new ConnectionClient(BASEURL,
                                                    Util.getHeader(signature, MERCHANTID));
            cashout = new Cashout(connectionClient);

            JObject response = cashout.closeTransaction(param).Result;
            String  message  = response.GetValue("message").ToString();

            Assert.AreEqual(message, "SUCCESSFUL");
        }