public void Pair_SuccessfullyPairWithInvoice() { // Arrange var invoice = CreateInvoice(); _invoiceId = invoice.Id; var model = new BankStatementPairingPostModel { Amount = 150, AccountNumber = "2102290124", BankCode = "2700", PartnerAccountNumber = invoice.PartnerAddress.AccountNumber, PartnerBankCode = invoice.PartnerAddress.BankCode, VariableSymbol = invoice.VariableSymbol, MovementType = MovementType.Entry, CurrencyCode = "CZK", Tags = new List <int> { Tag1Id } }; // Act var data = _bankStatementClient.Pair(model).AssertResult(); _bankStatementId = data.CreatedBankStatement.Id; // Assert Assert.IsTrue(data.WasPaired); Assert.AreEqual(invoice.Id, data.PairedInvoiceId); var item = data.CreatedBankStatement.Items.First(); Assert.AreEqual(invoice.VariableSymbol, item.VariableSymbol); Assert.AreEqual(invoice.Prices.TotalWithVat, item.Prices.PaidAmount); Assert.IsNotNull(data.CreatedBankStatement.Tags.FirstOrDefault(t => t.TagId == Tag1Id)); }
/// <inheritdoc cref="Pair"/> public Task <ApiResult <BankStatementPairingResult> > PairAsync(BankStatementPairingPostModel model, CancellationToken cancellationToken = default) { var resource = $"{ResourceUrl}/Pair"; return(PostAsync <BankStatementPairingPostModel, BankStatementPairingResult>(resource, model, cancellationToken)); }
/// <summary> /// Pairs a model with an invoice according to the variable symbol and currency. /// </summary> /// <param name="model">Model.</param> /// <returns><see cref="ApiResult{TData}"/> instance containing pairing result.</returns> public ApiResult <BankStatementPairingResult> Pair(BankStatementPairingPostModel model) { var resource = $"{ResourceUrl}/Pair"; return(Post <BankStatementPairingPostModel, BankStatementPairingResult>(resource, model)); }