コード例 #1
0
        public static void Main(string[] args)
        {
            string store_id  = "monusqa006";
            string api_token = "qatoken";
            string amount    = "1.00";
            string xid       = "12345678910111214005";
            string MD        = xid + "mycardinfo" + amount;
            String PaRes     = "eJzFV2mTokoW/SsVNR+JbhZB5AXli2QHZd/9hoKAgKis+usHtau6Xk/NRM9MTAwRhsnxrnnPTW/Sf45V+dInlyavj2+v6Hfk9SU57uo4P6Zvr64jfFu8/rmkney"
                               + "SJJyd7LpLsqTVpGmiNHnJ47dXjCIwEpmT6ILCqZ8PiS0QnCIQ8nVJG8BKmocwupiTGDafzSb0h8/l5PI7RsPvr5Pxyy6Lju2SjnZnRtaWOIoiM4qGf7zSVXKRueVnvzT8xGj"
                               + "4p7LR3VfNFO2Yx0vdKYhPn5l6SAeNK1CV273R8F2CjqM2WWIISiAEMn9B8T8w8g98CuyB06e7OVDV3WQbnVEUgtDwZ4yeduYybdx1ucCnnz7e6GQ81cdkkphMfaxp+Gd4p+i"
                               + "4RD49BE5MCd1R2gmWdJtXn8NavIf1wOmmjdquWQIa/rGid1HfL1kAWCZ32ZJISwvPhdRcBeD5TOk+ROhkly+R+RTU9P3QAmVaX/I2q+6h/hWg4Xso8KOQS9rO0+Pk7JK8TNw"
                               + "5Nm+vWdue/oDhYRi+D7Pv9SWFsSkRGKHgSSBu8vRvr0+tJJaP+/rfUmOjY33Md1GZ36J2IoiatFkdv3zE9pUZx7pbQmGLZ79Npr7tUPz47Y4gM5SYbMJfG/2U2e94+TXYSxN"
                               + "9a7IIvTv4xdCStpJ9cmdE8uJa8tvr3z53ApenSdP+Jy7f3X228G7Pi8ouWbJcxHDIcZM0M7NrESU8pkRQYUJX4m/vek9JGv6I8UcCz2p92pWnoG5TSAjjJ7QqBH0O6YszlfD"
                               + "jWefIa+VpkGQY3VGVxEVnVvJikBW3ENuVt0dX/BrcCP9annzC2swP5P6MxkmxjrS+h6rY7Ap/a1RjHG30VWRr0ZCaF0Y/bvak585xHFx0iCN9yc+puQifAYiUlcrHqSI7N+w"
                               + "MYgYnUPscMnssZDrSvdRCrb59qsSPLFfJ9ZlVQCAUF7XRc8UmlzbfT5SYml2VZdY8sCyIGpY12UyNgkV22wepAzQmLc5ZkYvUgDDAdAXAAUg1m4E1Q84zTZEfFM+98aYKcBG"
                               + "gLj9pSyYmXEPfynY3XlVB/cRHlXP50lXNxcA9dTl+2AxRYLYhxg9SttNUxxzUG8AmyUF35NF/YMUdQz+wA8scOH6tguJhl8lU1vPUkXeAwaSax4DUYXmt34rUPYZetdJBSB/"
                               + "+JH6g5MiP660odBtJTd1K6EIsHTkHrJ+6tcMIG8VF+HF9A+0Taxyl3Jx2GJ/aPoFsAqULA+u0xYhsyzLO9I5FvlbKvHDbYdQh8gUk8qlOtcDApe95xpOehuzEElFlca8CRGT"
                               + "ts2jL2xln8vd9BdP2aYCbDjFzxaQm11znvRTm/R4zj0S0SlbuWlcJCUopXU4knedPbbobczwYJRhvZvrQwnnIGYY9Cj0BLtUNQiFhEDdMDjmZtdptvAGKG2k+6wxPdwuJE4/"
                               + "4NjEwKbLay9WZBeT5qDrZIZDS/dFL3LN8Qhcby3DyUFuHh34Gn1s7JmzzPDeDcSeQUWoUJYs5tilzwATMrzkxz5wYoErS+nYqGUMuTbbW6g1GttymXTCiL4bRdmVceV4EbGA"
                               + "QRIB2M21R8mhPVgLpVIhGmEaKzoZrQYVbptbhCmadvR6avaSI1G4OowiBQYHYujOl08r8tMUzR9Bwbl7MN9TarWwYNj24RWbhaAgMac9atusCsXBlpEKUfVHuT6671dthqKq"
                               + "speFfO+PLVjneplZJ8xQM8sQ2WQFathPhqSxDS321DSoPRvYGlCedQgeUnvOJHquJHlwYKNlGFG6qOQzsE1/zg2banvmJ2qrDSswpZtHrFqMQlcEDzuERlVMH7QAQjQtvGlp"
                               + "PmPzAprZ5xwbj8EXLcED/oD0yJVEJRRioI8eB1Tv1AcooHscb97zuumBUxTuN176W/SaV7cVQdIIr4EUU5ZG9hixi7kXFDe2mkz8UzjBfB8ptbQ8IaCN/gSZSx2bXZEEGKSc"
                               + "aQQd4tt6uLPRUk4eq6kkNrc51OcbrtgU1sZIvPpXo2hyCoZmNt3LRrS5naO6tnetoE21FShM286RUj7rwvAFDzI62cJY74dB0h6yBgmDsB6ariWZ4UrnGxfyRG/PIOeZS02c"
                               + "Y2050GJz6GJZDo85AKqFyzNvaCV5xzHDfL8lW+chhjul0KmgUvnc10zriZ51s7EPQnnwptsg8EvgTLw/mV0fY79fDUsHivR7yox6B0m9n9nR8c8ToNrNK7k/+DaiPuCyVZ5z"
                               + "p4DYl+J+2KdsGDNK3JQKZrttLYlkv0jM7HA7ZwK1PEeZZTRl1zUpsF7hfGnmAOBLGnMcKvlXGlTloxy7wRaky8VUqVOcIsRMBBXsDDmfAT3gFzJU6ORCLo4hklzm707fjhYU"
                               + "GoFoGJ5drSYcI1LweTppASSxUYPPt6EanTYN5PoyddsacrFpTugZ5aP5mm9bOvU3PP9vUOAr2LQlzqNz+P9tUvbmjKvy1TX9g/yNamEO6efzrKqt6I2f9TgOPnMGUGgImqiv"
                               + "TnzQDViIZ59GFM1OUdA9Vr0SNJNgHPzPiLQVTp2DT+2DV7ajhfD5ws2PvzgeoU9pQFs4a3gcsdCjIpMA9gTz0BSfMLATZH6VyPuhet7+ZpQBIyAxOvqOKzXZ+vQ5ZoA7edqc"
                               + "vOhTfiR48QoSXDIWTXjxre96UeiBXSVlqvY/uG4WQctvbS4vkWoJUZQAQD2kkP3KT7hOFhegME/KCVsxmGWWijLjPa7IbV1qClWGMSp2iSuDR0vJgnVQxAf9KtnbtwjxM1fx"
                               + "vph2LH7jhfQrIHtPOrqL6WP6Vj8MjLn4wBXXqWrD/h3oJz3rxQE42mzYwzyWzQvAIS/NKLGo4WmOhPw07GYJfnRV0GEi9UGDXjwGakgtXKQj44igURpBUXhOXplpLgQd1/m7"
                               + "uX+ayoONgP+ZmD4k+bEwz2qnDqXqR9NTV6cOobhaBgd9iV8etJmAG6hJanW3geo+1+mpl1JWurKOtTUzsK9m6K0gSh0eHf/uiVeGfcyj8MZv+nFofd9rHbft+Cft8C/876Vc"
                               + "YIw==";
            string processing_country_code = "US";
            bool   status_check            = false;

            MpiAcs resMpiAcs = new MpiAcs();

            resMpiAcs.SetPaRes(PaRes);
            resMpiAcs.SetMD(MD);

            //************************OPTIONAL VARIABLES***************************

            HttpsPostRequest mpgReq = new HttpsPostRequest();

            mpgReq.SetProcCountryCode(processing_country_code);
            mpgReq.SetTestMode(true); //false or comment out this line for production transactions
            mpgReq.SetStoreId(store_id);
            mpgReq.SetApiToken(api_token);
            mpgReq.SetTransaction(resMpiAcs);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            /**********************   REQUEST  ************************/

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("MpiMessage = " + receipt.GetMpiMessage());
                Console.WriteLine("MpiSuccess = " + receipt.GetMpiSuccess());

                if (receipt.GetMpiSuccess() == "true")
                {
                    Console.WriteLine("Cavv = " + receipt.GetMpiCavv());
                }
                else
                {
                    Console.WriteLine("Message = " + receipt.GetMessage());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            string store_id  = "moneris";
            string api_token = "hurgle";
            string amount    = "1.00";
            string xid       = "12345678910111214005";
            string MD        = xid + "mycardinfo" + amount;
            string PaRes     = "eJzFV9mSoloW/ZWMvI9EXQZBpIL0xmEGZR4E3xAREBCUUb++USuzsupWd1R3R0fnS8KKPa2z1z5u6L/Gsnjp40uTVae3V/RP5PUlPkXVPj" +
                               "slb6+uI3xZvP61pJ30EsecHUfdJV7Satw0YRK/ZPu3VwSZIRiCEHOcwhcogRAohZLYHSVIDEOw2euSNoAVNw9rdDGnJssFPqHfki6nnH9iNPz+OkW/RGl" +
                               "4apd0GJ0ZWVviBDqloOFvr3QZX2Ru+UNiGn6CNPzd2+juT81U75jtl6rjDprDE6oTXVUO3FTOnalHeVCP6hsN3y3ofdjGSwx5knhBya8Y8hWZ0fADp+t7" +
                               "OFBW3RQbR9Ap5WeEnk7mMh3cdYliOA1/vNHxWFeneLKYKH480/D34urwNHH54Y+cYk8o7fhLus3KT0Vh6FeU+opNBg+cbtqw7ZoloOFvT3QU9v2SBYBlA" +
                               "i1IU6XW0q2ceJkInn8T2YcJHUfZEplPRU3/H16gSKpL1qblvdQfARq+lwI/+rik7Sw5Tcku8cuknVPz9pq2bf0Vhodh+HOY/VldEnhqDAIjFDwZ7Jss+e" +
                               "P16RXv5dOh+rfc2PBUnbIoLLJb2E76UOM2rfYvH7X9Koxj3SOhsMWzX6ZQXyIUP325I8gMJaaY8K+DfmL2O1l+LvbShF+aNETvCX4KtKSt+BDfFRG/uJb" +
                               "89vrH50HgsiRu2v8k5Xu6zxHe43lh0cVLSBkQUgoUXdYySPQCIyBr1oUvuZu/vfs9LWn4o8ZvBJ7d+nQqT8N8pQSx54bCWHhJeOocSE9lS41nyhHgInZe" +
                               "7zkgQ/rBcZu8QGxd4wU/hGfMQkyrdQz0tDypK6iKdH4V9OeE7HZMVpE3I93nPHk9x3V1rKKqKeJTQ2pJQe3anjxdVi65VnT8Il4gUolLVcsuoXYFm4Tik" +
                               "7OuFcKVt1A3qRoijFUTwTw26/i3T534xnIVX5+sfAKhuLANn09sfGmzwySJadRVWWbNI8uCsGFZk03V0F+kt4OfOEBjkvyc5plIDQgDTFcAHIBUsxlYM+" +
                               "A80xT5QfHcG2+q01EA1OUnb8nEhGuwsdLoxqsqqJ74OF1AfOGq5mLgnr4cP2yH0DfbAOMHKY001TEH9QawyXLQHXncPLD8jqEf2JFljhy/VkH+iMukKut" +
                               "56sg7wGASzWNA4rC81u9E6l5Dr1rJICSPfBI/UHK42Vc7Uei2kpq4pdAFWDJyDlg/fSuHEbaKi/Dj+gbaJ9Y4SrGtI4xP7A2BbH2lC3yr3mFEumMZZ3rH" +
                               "wo1WyLxwizDqGG4EJNxQnWqBgUveee4nPw2JxAJRZfGgAkRk7bNoy7sZZ/L3cwXT8WmAY5nMXDGJyTXXeS8FWX/AzBMRruKVu9ZVQoISSpdjSef5uk2iM" +
                               "cP9UYLxZqYPLZwFnGHYo9AT4FLeIBQSBnHLZJCTWqto6w3QvpHms87wdDeXOPGE72IDk0KrvVydmU+eT6qTHn0pOZy82D3LNbrYWoaTBdo6OPYz+Nzae8" +
                               "I2z3PTHyOBDBMjL1jMsU2ZAyZgfubEPDkxQJWk9a0uGEMuTLbSqi1Gtty2XTDiRgzC3cq48rwIWN8gCB/tZtqi4NGeLAXSKRGNMI0EnQ3XnAp2TKXDJcw" +
                               "6Bz0we0kRqWgOowiBQb7YujOl04qs3uGpI2g4N8/nW2rtljYMmx7cIrNgNASGtGct23W+mLsyUiLKIS8Otevu9HYYyjJtafjnyfjlqJxu06gkWQIGeVKb" +
                               "rAAtjUR4asvQUr86BpUHI3sDylNOgQMKz/kkj9UkDy7wlXQrCjfVHAb2ia/5QTNtz/wkbdVhJabes+h1h1GIyuA+5/CIyqmDdgSIxgU3Da0mTH5g09i8Y" +
                               "4Nx/MXIcED/kD0ykSiFPPDVkePA6l36AGUUj+ONO6+7LxhV8S7j9UZLf1PK9mLIO8EV8DwMs9BeQxYx98L8hnbTzR8IZ5ivfOW2tgcEtOFmgcZSx6bXeE" +
                               "H6CScafgd4ttqtLLSuyGNZ9qSGlueqGPfrtgUVsZIvGyrWtTkEQzMbb+W8W13O0NxbO9fRJtqSlCZs5kmJHnbBeQuGPTvawlnuhGPTHdMG8v2xH5iuIpr" +
                               "hKeUKF7MHN+bBec8l5oZhbDvWYVD3e1gOjCoFiYTKe97WanjFMcP9vCRb5UOHOSXTraBR+MHVTOuEn3WysY9+W2+kvUVmocDXvDyYv7rCfr8flgoW7/2Q" +
                               "H/3wlX43s6frmyNGt5mVcl9vbkB91GWpPONMF7cpwf90TNnWZ5C+LRDIdN1eEotqkZzZ4XhMB25dh5hnNUXYNSuxXeCbwsh8xJEw5jyW8K00rsxRO3X+R" +
                               "pRKE18lQnkOETsWUHAw4GAGNjGvgLlSxUdicRKR9DJnI303XlhoAKplcHKxlnSIQM3rsdYESmKhHJvvRjestw3mbWCsjow5WbamdPWzwPzNMa2c+5iev4" +
                               "+pcRLsWxxkULH7f46penNHVfhxTL9h/yNZmEOyffzqKqtqK6d9pIEHZzBRQ8AkdWX6kWbASiT3WXjhzAQl3WPZK2EjCfZxkxr7HQVTtb/tN2DVRdRwPh+" +
                               "52al35wPUKW0gC2cN730WOuZknOOeQB77nBNmFoIcTlIxH3SvO9zMQgAkZPr1xlHFZje/XofUVwdvF+mLDsUj0YNHiPDiIXeSi2ftzttC9+UyLgqt36CH" +
                               "RiGkzPYO0iK+FiBRGQDEYxLKD27SfaOwEJ1hAl7Q8tkspUyUEQ/TntWNKy3GimCPSp2iSuAx0vJg1aoYg39lW7l2bh6nbv43247FD9zwvgWkj20nKql+L" +
                               "/+sx+FRFz+YgjpNLTj8rV/Cs188kOPttvXNc8GsEDzEkqwU8woO11iwmZadFMGvzgo6DqSeK7C72QM0IReukhPwxVEojCCprCIuTbmWfA/qNtF8c5nLgo" +
                               "6Dw5iZPSRuYGPa0eoOp6pF3FNXpw/Cqln4Bn7buzpuNT4zUJfA6mwD13us1Vcroyp1ZR3ubGJSX8FWXU6SODw693X0b6MKf99D4Y/d9PvW+viifXxt3z/" +
                               "CPn+F/wPBKRo1";
            string processing_country_code = "CA";
            bool   status_check            = false;

            MpiAcs resMpiAcs = new MpiAcs();

            resMpiAcs.SetPaRes(PaRes);
            resMpiAcs.SetMD(MD);

            //************************OPTIONAL VARIABLES***************************

            HttpsPostRequest mpgReq = new HttpsPostRequest();

            mpgReq.SetProcCountryCode(processing_country_code);
            mpgReq.SetTestMode(true); //false or comment out this line for production transactions
            mpgReq.SetStoreId(store_id);
            mpgReq.SetApiToken(api_token);
            mpgReq.SetTransaction(resMpiAcs);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            /**********************   REQUEST  ************************/

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("MpiMessage = " + receipt.GetMpiMessage());
                Console.WriteLine("MpiSuccess = " + receipt.GetMpiSuccess());

                if (receipt.GetMpiSuccess() == "true")
                {
                    Console.WriteLine("Cavv = " + receipt.GetMpiCavv());
                    Console.WriteLine("Crypt Type = " + receipt.GetMpiEci());
                }
                else
                {
                    Console.WriteLine("Message = " + receipt.GetMessage());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }