fix(payment): update JSON serialization settings and enhance request data structure
- Changed PropertyNamingPolicy in TwentyCardPaymentService from SnakeCaseLower to CamelCase for improved consistency in JSON serialization. - Added JsonPropertyName attributes for Authority and RedirectUrl properties in TwentyCardRequestData to ensure correct JSON mapping.
This commit is contained in:
@@ -23,7 +23,7 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
|||||||
|
|
||||||
private static readonly JsonSerializerOptions JsonOptions = new()
|
private static readonly JsonSerializerOptions JsonOptions = new()
|
||||||
{
|
{
|
||||||
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
|
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||||
PropertyNameCaseInsensitive = true,
|
PropertyNameCaseInsensitive = true,
|
||||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
||||||
};
|
};
|
||||||
@@ -281,7 +281,10 @@ public class TwentyCardPaymentService : IPaymentGatewayService
|
|||||||
|
|
||||||
private sealed class TwentyCardRequestData
|
private sealed class TwentyCardRequestData
|
||||||
{
|
{
|
||||||
|
[JsonPropertyName("authority")]
|
||||||
public string? Authority { get; set; }
|
public string? Authority { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("redirectUrl")]
|
||||||
public string? RedirectUrl { get; set; }
|
public string? RedirectUrl { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user