XRechjnungRequest
This commit is contained in:
@@ -8,7 +8,7 @@ namespace BeWo.Data.Models.XRechnung
|
||||
{
|
||||
public class XRInvoicePayment
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public int Type { get; set; }
|
||||
public string Term { get; set; }
|
||||
public string DueDate { get; set; }
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ namespace BeWo.Data.Models.XRechnung
|
||||
{
|
||||
public class XRPosition
|
||||
{
|
||||
public string Quantity { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public string QuantityType { get; set; }
|
||||
public string Text { get; set; }
|
||||
public string Net { get; set; }
|
||||
public string NetTotal { get; set; }
|
||||
public string Tax { get; set; }
|
||||
public string TaxSum { get; set; }
|
||||
public int Net { get; set; }
|
||||
public int NetTotal { get; set; }
|
||||
public decimal Tax { get; set; }
|
||||
public decimal TaxSum { get; set; }
|
||||
public string TaxType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
18
Data/Models/XRechnung/XRechnungRequest.cs
Normal file
18
Data/Models/XRechnung/XRechnungRequest.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Data.Models.XRechnung
|
||||
{
|
||||
public class XRechnungRequest
|
||||
{
|
||||
[JsonProperty("json")]
|
||||
public XRechnung Json { get; set; }
|
||||
|
||||
[JsonProperty("pdf")]
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace BS.Shared.AppSender
|
||||
{
|
||||
client.Encoding = Encoding.UTF8;
|
||||
|
||||
client.Headers.Add(HttpRequestHeader.ContentType, "application/xml");
|
||||
client.Headers.Add(HttpRequestHeader.ContentType, "application/x-www-form-urlencoded");
|
||||
|
||||
response = client.UploadString(url, "POST", dataString);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace XRechnungUnitTest
|
||||
{
|
||||
@@ -24,9 +25,22 @@ namespace XRechnungUnitTest
|
||||
public void SendTest()
|
||||
{
|
||||
var url = "https://test2.evplaner.de/xrg/create";
|
||||
var json = File.ReadAllText("invoicetest.json");
|
||||
|
||||
var response = OwnSoftSender.Send(url, json);
|
||||
var json = File.ReadAllText("invoicetest.json", System.Text.Encoding.UTF8);
|
||||
|
||||
var xr = JsonConvert.DeserializeObject<XRechnung>(json);
|
||||
|
||||
var xrr = JsonConvert.SerializeObject(xr);
|
||||
|
||||
//var req = new XRechnungRequest();
|
||||
|
||||
//req.Json = xr;
|
||||
|
||||
//var txt = JsonConvert.SerializeObject(req);
|
||||
|
||||
var txt = $"json={xrr}";
|
||||
|
||||
var response = OwnSoftSender.Send(url, txt);
|
||||
|
||||
Assert.IsTrue(!string.IsNullOrWhiteSpace(response) && !response.ToLower().Contains("error"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user