Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/content type #109

Merged
merged 11 commits into from
Mar 6, 2023
Prev Previous commit
Next Next commit
Fix Issue Json request content type
SwAeyrton committed Mar 3, 2023
commit bc41e999fbda9e37f7a40513a8fcedbea3183c3d
12 changes: 8 additions & 4 deletions SW-sdk-45/Services/Issue/BaseJson.cs
Original file line number Diff line number Diff line change
@@ -23,7 +23,8 @@ public virtual StampResponseV1 TimbrarJsonV1(string json)
try
{
var headers = GetHeaders();
StringContent content = new StringContent(json, Encoding.UTF8, "application/jsontoxml");
StringContent content = new StringContent(json, Encoding.UTF8);
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/jsontoxml");
var proxy = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort);
return handler.GetPostResponse(this.Url,
string.Format("v3/cfdi33/{0}/{1}/{2}",
@@ -43,7 +44,8 @@ public virtual StampResponseV2 TimbrarJsonV2(string json)
try
{
var headers = GetHeaders();
StringContent content = new StringContent(json, Encoding.UTF8, "application/jsontoxml");
StringContent content = new StringContent(json, Encoding.UTF8);
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/jsontoxml");
var proxy = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort);
return handler.GetPostResponse(this.Url,
string.Format("v3/cfdi33/{0}/{1}/{2}",
@@ -62,7 +64,8 @@ public virtual StampResponseV3 TimbrarJsonV3(string json)
try
{
var headers = GetHeaders();
StringContent content = new StringContent(json, Encoding.UTF8, "application/jsontoxml");
StringContent content = new StringContent(json, Encoding.UTF8);
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/jsontoxml");
var proxy = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort);
return handler.GetPostResponse(this.Url,
string.Format("v3/cfdi33/{0}/{1}/{2}",
@@ -81,7 +84,8 @@ public virtual StampResponseV4 TimbrarJsonV4(string json)
try
{
var headers = GetHeaders();
StringContent content = new StringContent(json, Encoding.UTF8, "application/jsontoxml");
StringContent content = new StringContent(json, Encoding.UTF8);
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/jsontoxml");
var proxy = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort);
return handler.GetPostResponse(this.Url,
string.Format("v3/cfdi33/{0}/{1}/{2}",
2 changes: 1 addition & 1 deletion Test_SW-sdk-45/Resources/fileXmlpagos20.xml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
</cfdi:Conceptos>
<cfdi:Complemento>
<pago20:Pagos Version="2.0">
<pago20:Totales TotalTrasladosBaseIVA16="5843.11" TotalTrasladosImpuestoIVA16="934.90" TotalTrasladosBaseIVA0="0.00" MontoTotalPagos="6778.00" />
<pago20:Totales TotalTrasladosBaseIVA16="5843.11" TotalTrasladosImpuestoIVA16="934.90" MontoTotalPagos="6778.00" />
<pago20:Pago FechaPago="2022-09-09T17:33:38" FormaDePagoP="01" MonedaP="MXN" TipoCambioP="1" Monto="6778.00">
<pago20:DoctoRelacionado IdDocumento="b7c8d2bf-cb4e-4f84-af89-c68b6731206a" Serie="FA" Folio="N0000216349" MonedaDR="MXN" EquivalenciaDR="1" NumParcialidad="2" ImpSaldoAnt="6777.41" ImpPagado="6777.41" ImpSaldoInsoluto="0.00" ObjetoImpDR="02">
<pago20:ImpuestosDR>
2 changes: 1 addition & 1 deletion Test_SW-sdk/Resources/fileXmlpagos20.xml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
</cfdi:Conceptos>
<cfdi:Complemento>
<pago20:Pagos Version="2.0">
<pago20:Totales TotalTrasladosBaseIVA16="5843.11" TotalTrasladosImpuestoIVA16="934.90" TotalTrasladosBaseIVA0="0.00" MontoTotalPagos="6778.00" />
<pago20:Totales TotalTrasladosBaseIVA16="5843.11" TotalTrasladosImpuestoIVA16="934.90" MontoTotalPagos="6778.00" />
<pago20:Pago FechaPago="2022-09-09T17:33:38" FormaDePagoP="01" MonedaP="MXN" TipoCambioP="1" Monto="6778.00">
<pago20:DoctoRelacionado IdDocumento="b7c8d2bf-cb4e-4f84-af89-c68b6731206a" Serie="FA" Folio="N0000216349" MonedaDR="MXN" EquivalenciaDR="1" NumParcialidad="2" ImpSaldoAnt="6777.41" ImpPagado="6777.41" ImpSaldoInsoluto="0.00" ObjetoImpDR="02">
<pago20:ImpuestosDR>