Skip to content

Commit b893b00

Browse files
Refactor documentation comments and add device and network classes for enhanced risk assessment (#478)
1 parent 2307ed7 commit b893b00

File tree

11 files changed

+114
-16
lines changed

11 files changed

+114
-16
lines changed

src/CheckoutSdk/Forward/Requests/DestinationRequest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ namespace Checkout.Forward.Requests
22
{
33
public class DestinationRequest
44
{
5-
/// <summary>
6-
/// The URL to forward the request to (Required, max 1024 characters) </summary>
5+
/// <summary> The URL to forward the request to (Required, max 1024 characters) </summary>
76
public string Url { get; set; }
87

98
/// <summary> The HTTP method to use for the forward request (Required) </summary>
@@ -15,7 +14,8 @@ public class DestinationRequest
1514
/// <summary>
1615
/// The HTTP message body to include in the forward request. If you provide source.id or source.token, you can specify
1716
/// placeholder values in the body. The request will be enriched with the respective payment details from the token or
18-
/// payment instrument you specified. For example, {{card_number}} (Required, max 16384 characters) </summary>
17+
/// payment instrument you specified. For example, {{card_number}} (Required, max 16384 characters)
18+
/// </summary>
1919
public string Body { get; set; }
2020
}
2121
}

src/CheckoutSdk/Forward/Requests/ForwardRequest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public class ForwardRequest
1414
/// <summary> The parameters of the forward request (Required) </summary>
1515
public DestinationRequest DestinationRequest { get; set; }
1616

17-
/// <summary>
18-
/// The unique reference for the forward request (Optional, max 80 characters) </summary>
17+
/// <summary> The unique reference for the forward request (Optional, max 80 characters) </summary>
1918
public string Reference { get; set; }
2019

2120
/// <summary>

src/CheckoutSdk/Forward/Requests/Headers.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ namespace Checkout.Forward.Requests
44
{
55
public class Headers
66
{
7-
/// <summary>
8-
/// The raw headers to include in the forward request (Required, max 16 characters) </summary>
7+
/// <summary> The raw headers to include in the forward request (Required, max 16 characters) </summary>
98
public IDictionary<string, string> Raw { get; set; } = new Dictionary<string, string>();
109

1110
/// <summary>
12-
/// The encrypted headers to include in the forward request, as a JSON object with string values encrypted with JSON
13-
/// Web Encryption (JWE) (Optional, max 8192 characters) </summary>
11+
/// The encrypted headers to include in the forward request, as a JSON object with string values encrypted
12+
/// with JSON Web Encryption (JWE) (Optional, max 8192 characters)
13+
/// </summary>
1414
public string Encrypted { get; set; }
1515
}
1616
}

src/CheckoutSdk/Forward/Requests/Sources/IdSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Checkout.Forward.Requests.Sources
22
{
33
public class IdSource : AbstractSource
44
{
5-
/// <summary>Initializes a new instance of the IdSource class.</summary>
5+
/// <summary> Initializes a new instance of the IdSource class. </summary>
66
public IdSource() : base(SourceType.Id) { }
77

88
/// <summary> The unique identifier of the payment instrument (Required, pattern ^(src)_(\w{26})$) </summary>

src/CheckoutSdk/Forward/Requests/Sources/TokenSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Checkout.Forward.Requests.Sources
22
{
33
public class TokenSource : AbstractSource
44
{
5-
/// <summary>Initializes a new instance of the TokenSource class.</summary>
5+
/// <summary> Initializes a new instance of the TokenSource class. </summary>
66
public TokenSource() : base(SourceType.Token) { }
77

88
/// <summary> The unique Checkout.com token (Required, pattern ^(tok)_(\w{26})$) </summary>

src/CheckoutSdk/Forward/Responses/GetForwardResponse.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ public class GetForwardResponse : HttpMetadata
1313
/// <summary> The parameters of the HTTP request forwarded to the destination (Required) </summary>
1414
public DestinationRequest DestinationRequest { get; set; }
1515

16-
/// <summary>
17-
/// The date and time the forward request was created, in UTC (Required)
18-
/// </summary>
16+
/// <summary> The date and time the forward request was created, in UTC (Required) </summary>
1917
public DateTime? CreatedOn { get; set; }
2018

2119
/// <summary> The unique reference for the forward request (Optional) </summary>

src/CheckoutSdk/Payments/Contexts/PaymentContextsProcessing.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class PaymentContextsProcessing
2222

2323
public UserAction? UserAction { get; set; }
2424

25-
public PartnerCustomerRiskData PartnerCustomerRiskData { get; set; }
25+
public IList<PartnerCustomerRiskData> PartnerCustomerRiskData { get; set; }
2626

2727
public IList<string> CustomPaymentMethodIds { get; set; }
2828

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
namespace Checkout.Payments.Request
2+
{
3+
public class Device
4+
{
5+
/// <summary> The contents of the HTTP User-Agent request header. This field is required to process the device
6+
/// with the risk engine (Optional, max 2048 characters) </summary>
7+
public string UserAgent { get; set; }
8+
9+
/// <summary> Details of the device network. Either ipv4 or ipv6 is required field (Optional) </summary>
10+
public Network Network { get; set; }
11+
12+
/// <summary> Details of the device ID provider (Optional) </summary>
13+
public Provider Provider { get; set; }
14+
15+
/// <summary> The UTC date and time the payment was performed as reported by the device. Format – ISO 8601 code
16+
/// This field is required to process the device with the risk engine (Optional) </summary>
17+
public string Timestamp { get; set; }
18+
19+
/// <summary> The time difference between UTC time and the local time reported by the browser, in minutes. This
20+
/// field is required to process the device with the risk engine (Optional, [ 1 .. 5 ] characters </summary>
21+
public string Timezone { get; set; }
22+
23+
/// <summary> Specifies if the device is running in a virtual machine (Optional) </summary>
24+
public bool? VirtualMachine { get; set; }
25+
26+
/// <summary> Specifies if the browser is in incognito mode (Optional) </summary>
27+
public bool? Incognito { get; set; }
28+
29+
/// <summary> Specifies if the device is jailbroken (Optional) </summary>
30+
public bool? Jailbroken { get; set; }
31+
32+
/// <summary> Specifies if the device is rooted (Optional) </summary>
33+
public bool? Rooted { get; set; }
34+
35+
/// <summary> Specifies if the browser has the ability to execute Java, as reported by the browser's
36+
/// navigator.javaEnabled property (Optional) </summary>
37+
public bool? JavaEnabled { get; set; }
38+
39+
/// <summary> Specifies if the browser has the ability to execute Javascript, as reported by the browser's
40+
/// navigator.javascriptEnabled property. Only required for 3D Secure authentications processed with 3DS 2.2. If
41+
/// the payment is processed with an older 3DS version, this field is ignored (Optional) </summary>
42+
public bool? JavascriptEnabled { get; set; }
43+
44+
/// <summary> The browser language, as reported by the browser's navigator.language property. Format – IETF
45+
/// BCP47 language tag (Optional, [ 1 .. 12 ] characters) </summary>
46+
public string Language { get; set; }
47+
48+
/// <summary> The bit depth of the color palette for displaying images in bits per pixel, as reported by the
49+
/// browser's screen.colorDepth property (Optional, [ 2 .. 1 ] characters) </summary>
50+
public string ColorDepth { get; set; }
51+
52+
/// <summary> The total height of the device screen in pixels, as reported by the browser's screen.height
53+
/// property (Optional, [ 1 .. 6 ] characters, [ 1 .. 6 ]) </summary>
54+
public string ScreenHeight { get; set; }
55+
56+
/// <summary> The total width of the device screen in pixels, as reported by the browser's screen.width property
57+
/// (Optional, [ 1 .. 6 ] characters) </summary>
58+
public string ScreenWidth { get; set; }
59+
}
60+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace Checkout.Payments.Request
2+
{
3+
public class Network
4+
{
5+
/// <summary> The device's IPV4 address. Not required if you provide the ipv6 field (Optional) </summary>
6+
public string Ipv4 { get; set; }
7+
8+
/// <summary> The device's IPV6 address. Not required if you provide the ipv4 field (Optional) </summary>
9+
public string Ipv6 { get; set; }
10+
11+
/// <summary> Specifies if the Tor network was used in the browser session (Optional) </summary>
12+
public bool? Tor { get; set; }
13+
14+
/// <summary> Specifies if a virtual private network (VPN) was used in the browser session (Optional) </summary>
15+
public bool? Vpn { get; set; }
16+
17+
/// <summary> Specifies if a proxy was used in the browser session (Optional) </summary>
18+
public bool? Proxy { get; set; }
19+
20+
}
21+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace Checkout.Payments.Request
2+
{
3+
public class Provider
4+
{
5+
/// <summary> The unique identifier for the device (Optional) </summary>
6+
public string Id { get; set; }
7+
8+
/// <summary> The name of the provider that generated the device identifier (Optional) </summary>
9+
public string Name { get; set; }
10+
11+
}
12+
}

0 commit comments

Comments
 (0)