public async Task When_I_refund_a_pending_settlement_Then_it_should_throw_RequestDeclinedException_async() { _auth = await _cardService.AuthorizeAsync(_auth); Settlement settle = Settlement.Builder() .MerchantRefNum(_auth.MerchantRefNum()) .AuthorizationId(_auth.Id()) .Build(); settle = await _cardService.SettlementAsync(settle); Assert.ThrowsAsync <Paysafe.Common.RequestDeclinedException>(async() => await _cardService.RefundAsync(Refund.Builder() .MerchantRefNum(settle.MerchantRefNum()) .SettlementId(settle.Id()) .Build())); }
public void When_I_refund_a_pending_settlement_Then_it_should_throw_RequestDeclinedException_sync() { _auth = _cardService.Authorize(_auth); Settlement settle = Settlement.Builder() .MerchantRefNum(_auth.MerchantRefNum()) .AuthorizationId(_auth.Id()) .Build(); settle = _cardService.Settlement(settle); Assert.Throws <Paysafe.Common.RequestDeclinedException>(() => _cardService.Refund(Refund.Builder() .MerchantRefNum(settle.MerchantRefNum()) .SettlementId(settle.Id()) .Build())); }