コード例 #1
0
        private bool AuthorizationReversalsAreEquivalent(AuthorizationReversal rev1, AuthorizationReversal rev2)
        {
            if (!rev1.Id().Equals(rev2.Id()) ||
                !rev1.MerchantRefNum().Equals(rev2.MerchantRefNum()) ||
                !rev1.TxnTime().Equals(rev2.TxnTime()) ||
                !rev1.Amount().Equals(rev2.Amount()) ||
                !rev1.Status().Equals(rev2.Status()))
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
        public async Task When_I_lookup_a_reversal_using_a_merchant_refNum_Then_it_should_return_a_valid_reversal_async()
        {
            _auth = await _cardService.AuthorizeAsync(_auth);

            AuthorizationReversal authReversal = AuthorizationReversal.Builder()
                                                 .MerchantRefNum(_auth.MerchantRefNum())
                                                 .Amount(6666)
                                                 .AuthorizationId(_auth.Id())
                                                 .Build();

            authReversal = await _cardService.ReverseAuthAsync(authReversal);

            Pagerator <AuthorizationReversal> authReversals = await _cardService.GetAuthReversalsAsync(AuthorizationReversal.Builder()
                                                                                                       .MerchantRefNum(authReversal.MerchantRefNum())
                                                                                                       .Build());


            var authRevList = authReversals.GetResults();

            Assert.That(authRevList.Count, Is.EqualTo(1));
            Assert.That(AuthorizationReversalsAreEquivalent(authReversal, authRevList[0]));
        }