コード例 #1
0
        public HostedActionRequest LowerAmount(LowerAmount lowerAmount)
        {
            var xml = string.Format(@"<?xml version=""1.0"" encoding=""UTF-8""?>
                <loweramount>
                <transactionid>{0}</transactionid>
                <amounttolower>{1}</amounttolower>
                </loweramount>", lowerAmount.TransactionId, lowerAmount.AmountToLower);

            return(new HostedActionRequest(xml, CountryCode, MerchantId, ConfigurationProvider, "/loweramount"));
        }
コード例 #2
0
        public void TestLowerAmountResponseFailure()
        {
            var responseXml = new XmlDocument();

            responseXml.LoadXml(@"<?xml version='1.0' encoding='UTF-8'?>
                        <response>
                            <statuscode>107</statuscode>
                        </response>");
            LowerAmountResponse response = LowerAmount.Response(responseXml);

            Assert.That(response.TransactionId, Is.Null);
            Assert.That(response.CustomerRefNo, Is.Null);
            Assert.That(response.ClientOrderNumber, Is.Null);
            Assert.That(response.StatusCode, Is.EqualTo(107));
            Assert.That(response.Accepted, Is.False);
            Assert.That(response.ErrorMessage, Is.EqualTo("Transaction rejected by bank."));
        }
コード例 #3
0
        public void TestLowerAmountResponse()
        {
            var responseXml = new XmlDocument();

            responseXml.LoadXml(@"<?xml version='1.0' encoding='UTF-8'?>
                        <response>
                            <transaction id=""598972"">
                                <customerrefno>1ba66a0d653ca4cf3a5bc3eeb9ed1a2b4</customerrefno>
                            </transaction>
                            <statuscode>0</statuscode>
                        </response>");
            LowerAmountResponse response = LowerAmount.Response(responseXml);

            Assert.That(response.TransactionId, Is.EqualTo(598972));
            Assert.That(response.CustomerRefNo, Is.EqualTo("1ba66a0d653ca4cf3a5bc3eeb9ed1a2b4"));
            Assert.That(response.ClientOrderNumber, Is.EqualTo("1ba66a0d653ca4cf3a5bc3eeb9ed1a2b4"));
            Assert.That(response.StatusCode, Is.EqualTo(0));
            Assert.That(response.Accepted, Is.True);
            Assert.That(response.ErrorMessage, Is.Empty);
        }