Esempio n. 1
0
        public void TestWellNoOrderJson()
        {
            string json = "{ \"state\":\"processed\",\"checkout\":{ \"checkout_id\":\"11079313-chre4e360a97da7-fe02d82fe7\",\"image_url\":\"\",\"title\":\"ClivesApp1\"},\"order\":{ },\"receipt_url\":\"\",\"has_locker\":false,\"customer\":{ \"email\":\"[email protected]\"},\"is_subscription\":false},\"lockers\":[{\"locker_id\":2178001,\"product_id\":519714,\"product_name\":\"ClivesApp1\",\"license_code\":\"C64235AD-7ACC3BBF-39275213-B41FEE3B-32BCED11\",\"download\":\"http://www.paddle.com\",\"instructions\":\"\"}]}";

            ProcessStatus ps            = new ProcessStatus();
            ProcessStatus processStatus = ps.MapResponse(json);
        }
Esempio n. 2
0
        public void TestWellNoLockerJson()
        {
            string json = "{ \"state\":\"processed\",\"checkout\":{ \"checkout_id\":\"11079313-chre4e360a97da7-fe02d82fe7\",\"image_url\":\"\",\"title\":\"ClivesApp1\"},\"order\":{ \"order_id\":2221626,\"total\":\"0.00\",\"currency\":\"USD\",\"formatted_total\":\"US$0.00\",\"completed\":{ \"date\":\"2017-11-09 10:25:53.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"receipt_url\":\"\",\"has_locker\":false,\"customer\":{ \"email\":\"[email protected]\"},\"is_subscription\":false},\"lockers\":[]}";

            ProcessStatus ps            = new ProcessStatus();
            ProcessStatus processStatus = ps.MapResponse(json);

            string OrderID       = ps.OrderID;
            string CustomerEmail = ps.CustomerEmail;
            string LicenseCode   = ps.LicenseCode;
            string LockerID      = ps.LockerID;

            Assert.AreEqual(OrderID, "2221626");
            Assert.AreEqual(CustomerEmail, "*****@*****.**");
            Assert.IsNull(LicenseCode);
            Assert.IsNull(LockerID);
        }
Esempio n. 3
0
        public void TestWellFormedJson()
        {
            string json = "{ \"state\":\"processed\",\"checkout\":{ \"checkout_id\":\"11079313-chre4e360a97da7-fe02d82fe7\",\"image_url\":\"\",\"title\":\"ClivesApp1\"},\"order\":{ \"order_id\":2221626,\"total\":\"0.00\",\"currency\":\"USD\",\"formatted_total\":\"US$0.00\",\"completed\":{ \"date\":\"2017-11-09 10:25:53.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"receipt_url\":\"\",\"has_locker\":true,\"customer\":{ \"email\":\"[email protected]\"},\"is_subscription\":false},\"lockers\":[{\"locker_id\":2178001,\"product_id\":519714,\"product_name\":\"ClivesApp1\",\"license_code\":\"C64235AD-7ACC3BBF-39275213-B41FEE3B-32BCED11\",\"download\":\"http://www.paddle.com\",\"instructions\":\"\"}]}";

            ProcessStatus ps            = new ProcessStatus();
            ProcessStatus processStatus = ps.MapResponse(json);

            string OrderID       = ps.OrderID;
            string CustomerEmail = ps.CustomerEmail;
            string LicenseCode   = ps.LicenseCode;
            string LockerID      = ps.LockerID;

            Assert.AreEqual(OrderID, "2221626");
            Assert.AreEqual(CustomerEmail, "*****@*****.**");
            Assert.AreEqual(LicenseCode, "C64235AD-7ACC3BBF-39275213-B41FEE3B-32BCED11");
            Assert.AreEqual(LockerID, "2178001");
        }