Skip to content

Commit 205c661

Browse files
Refactor properties to nullable types for improved flexibility in authentication models (#495)
1 parent aae9c52 commit 205c661

File tree

28 files changed

+95
-93
lines changed

28 files changed

+95
-93
lines changed

src/CheckoutSdk/Authentication/Standalone/Common/AccountInfo/AccountInfo.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class AccountInfo
1313
/// [Optional]
1414
/// [ 0 .. 9999 ]
1515
/// </summary>
16-
public double PurchaseCount { get; set; }
16+
public long? PurchaseCount { get; set; }
1717

1818
/// <summary>
1919
/// The length of time that the payment account was enrolled in the cardholder's account.
@@ -26,7 +26,7 @@ public class AccountInfo
2626
/// [Optional]
2727
/// [ 0 .. 999 ]
2828
/// </summary>
29-
public double AddCardAttempts { get; set; }
29+
public long? AddCardAttempts { get; set; }
3030

3131
/// <summary>
3232
/// Indicates when the shipping address used for this transaction was first used.
@@ -38,21 +38,21 @@ public class AccountInfo
3838
/// Indicates if the Cardholder Name on the account is identical to the shipping Name used for this transaction.
3939
/// [Optional]
4040
/// </summary>
41-
public bool AccountNameMatchesShippingName { get; set; }
41+
public bool? AccountNameMatchesShippingName { get; set; }
4242

4343
/// <summary>
4444
/// Indicates whether suspicious activity on the cardholder account has been observed.
4545
/// [Optional]
4646
/// </summary>
47-
public bool SuspiciousAccountActivity { get; set; }
47+
public bool? SuspiciousAccountActivity { get; set; }
4848

4949
/// <summary>
5050
/// The number of transactions (successful and abandoned) for the cardholder account across all payment accounts
5151
/// in the previous 24 hours
5252
/// [Optional]
5353
/// [ 0 .. 999 ]
5454
/// </summary>
55-
public double TransactionsToday { get; set; }
55+
public long? TransactionsToday { get; set; }
5656

5757
/// <summary>
5858
/// [DEPRECATED]
@@ -77,7 +77,7 @@ public class AccountInfo
7777
/// [Optional]
7878
/// <date-time>
7979
/// </summary>
80-
public DateTime AccountChange { get; set; }
80+
public DateTime? AccountChange { get; set; }
8181

8282
/// <summary>
8383
/// The amount of time since the cardholder’s account information with the 3DS Requestor was last changed.
@@ -94,15 +94,15 @@ public class AccountInfo
9494
/// [Optional]
9595
/// <date-time>
9696
/// </summary>
97-
public DateTime AccountDate { get; set; }
97+
public DateTime? AccountDate { get; set; }
9898

9999
/// <summary>
100100
/// The UTC date and time the cardholder’s account with the 3DS Requestor was last reset or had a password
101101
/// change, in ISO 8601 format.
102102
/// [Optional]
103103
/// <date-time>
104104
/// </summary>
105-
public DateTime AccountPasswordChange { get; set; }
105+
public DateTime? AccountPasswordChange { get; set; }
106106

107107
/// <summary>
108108
/// The amount of time since the cardholder’s account with the 3DS Requestor was last reset or had a password
@@ -119,23 +119,23 @@ public class AccountInfo
119119
/// <= 3
120120
/// <= 999
121121
/// </summary>
122-
public int TransactionsPerYear { get; set; }
122+
public long? TransactionsPerYear { get; set; }
123123

124124
/// <summary>
125125
/// The UTC date and time the payment account was enrolled in the cardholder’s account with the 3DS Requestor,
126126
/// in ISO 8601 format.
127127
/// [Optional]
128128
/// <date-time>
129129
/// </summary>
130-
public DateTime PaymentAccountAge { get; set; }
130+
public DateTime? PaymentAccountAge { get; set; }
131131

132132
/// <summary>
133133
/// The UTC date and time the shipping address used for the transaction was first used with the 3DS Requestor,
134134
/// in ISO 8601 format.
135135
/// [Optional]
136136
/// <date-time>
137137
/// </summary>
138-
public DateTime ShippingAddressUsage { get; set; }
138+
public DateTime? ShippingAddressUsage { get; set; }
139139

140140
/// <summary>
141141
/// The type of account, in the case of a card product with multiple accounts.

src/CheckoutSdk/Authentication/Standalone/Common/AccountInfo/ThreeDsRequestorAuthenticationInfo/ThreeDsRequestorAuthenticationInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ThreeDsRequestorAuthenticationInfo
1919
/// [Optional]
2020
/// <date-time>
2121
/// </summary>
22-
public DateTime ThreeDsReqAuthTimestamp { get; set; }
22+
public DateTime? ThreeDsReqAuthTimestamp { get; set; }
2323

2424
/// <summary>
2525
/// Data that documents and supports a specific authentication process.

src/CheckoutSdk/Authentication/Standalone/Common/Installment/Installment.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ public class Installment
1717
public int NumberOfPayments { get; set; }
1818

1919
/// <summary>
20-
/// Default: 1 Indicates the minimum number of days between authorisations. If no value is specified for an
20+
/// Default: 1 Indicates the minimum number of days between authorisations. If no value is specified for an
2121
/// installment authentication type the default value will be used.
2222
/// [Optional]
2323
/// </summary>
24-
public int DaysBetweenPayments { get; set; } = 1;
24+
public int? DaysBetweenPayments { get; set; } = 1;
2525

2626
/// <summary>
27-
/// Default: 99991231 Date after which no further authorisations are performed in the format yyyyMMdd. If no
27+
/// Default: 99991231 Date after which no further authorisations are performed in the format yyyyMMdd. If no
2828
/// value is specified for an installment authentication type the default value will be used.
2929
/// [Optional]
3030
/// </summary>

src/CheckoutSdk/Authentication/Standalone/Common/MerchantRiskInfo/MerchantRiskInfo.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Checkout.Common;
12
using System;
23

34
namespace Checkout.Authentication.Standalone.Common.MerchantRiskInfo
@@ -26,13 +27,13 @@ public class MerchantRiskInfo
2627
/// date.
2728
/// [Optional]
2829
/// </summary>
29-
public bool IsPreorder { get; set; }
30+
public bool? IsPreorder { get; set; }
3031

3132
/// <summary>
3233
/// Indicates whether the cardholder is reordering previously purchased merchandise.
3334
/// [Optional]
3435
/// </summary>
35-
public bool IsReorder { get; set; }
36+
public bool? IsReorder { get; set; }
3637

3738
/// <summary>
3839
/// Indicates the shipping method chosen for the transaction. Please choose an option that accurately describes
@@ -59,7 +60,7 @@ public class MerchantRiskInfo
5960
/// [Optional]
6061
/// <date-time>
6162
/// </summary>
62-
public DateTime PreOrderDate { get; set; }
63+
public DateTime? PreOrderDate { get; set; }
6364

6465
/// <summary>
6566
/// The total purchase amount, in major units. For example, the major unit amount for a gift card purchase of
@@ -75,7 +76,7 @@ public class MerchantRiskInfo
7576
/// [Optional]
7677
/// 3 characters
7778
/// </summary>
78-
public string GiftCardCurrency { get; set; }
79+
public Currency? GiftCardCurrency { get; set; }
7980

8081
/// <summary>
8182
/// The total number of individual prepaid cards, gift cards, or gift codes purchased. Only applicable for

src/CheckoutSdk/Authentication/Standalone/Common/Recurring/Recurring.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ namespace Checkout.Authentication.Standalone.Common.Recurring
88
public class Recurring
99
{
1010
/// <summary>
11-
/// Default: 1 Indicates the minimum number of days between authorisations. If no value is specified for a
11+
/// Default: 1 Indicates the minimum number of days between authorisations. If no value is specified for a
1212
/// recurring authentication type the default value will be used.
1313
/// [Optional]
1414
/// </summary>
15-
public int DaysBetweenPayments { get; set; } = 1;
15+
public int? DaysBetweenPayments { get; set; } = 1;
1616

1717
/// <summary>
18-
/// Default: 99991231 Date after which no further authorisations are performed in the format yyyyMMdd. If no
18+
/// Default: 99991231 Date after which no further authorisations are performed in the format yyyyMMdd. If no
1919
/// value is specified for a recurring authentication type the default value will be used.
2020
/// [Optional]
2121
/// </summary>

src/CheckoutSdk/Authentication/Standalone/Common/Responses/Card/Metadata/Metadata.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Checkout.Common;
2+
13
namespace Checkout.Authentication.Standalone.Common.Responses.Card.Metadata
24
{
35
/// <summary>
@@ -28,7 +30,7 @@ public class Metadata
2830
/// The two letter alpha country code of the card issuer.
2931
/// [Optional]
3032
/// </summary>
31-
public string IssuerCountry { get; set; }
33+
public CountryCode? IssuerCountry { get; set; }
3234

3335
/// <summary>
3436
/// The issuer/card scheme product identifier.

src/CheckoutSdk/Authentication/Standalone/Common/Responses/Certificates/Certificates.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public class Certificates
3131
/// server (ACS). Each array element is a Base64 URL-encoded DER-encoded X.509 certificate.
3232
/// [Optional]
3333
/// </summary>
34-
public IList<object> CaPublicAll { get; set; }
34+
public IList<string> CaPublicAll { get; set; }
3535
}
3636
}

src/CheckoutSdk/Authentication/Standalone/Common/Responses/GoogleSpa/Token/Token.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ public class Token
1616
/// Expiry month of the token
1717
/// [Optional]
1818
/// </summary>
19-
public double ExpiryMonth { get; set; }
19+
public int? ExpiryMonth { get; set; }
2020

2121
/// <summary>
2222
/// Expiry year of the token
2323
/// [Optional]
2424
/// </summary>
25-
public double ExpiryYear { get; set; }
25+
public int? ExpiryYear { get; set; }
2626
}
2727
}

src/CheckoutSdk/Authentication/Standalone/Common/Responses/Optimization/Optimization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class Optimization
1212
/// Indicates if any optimization has been applied
1313
/// [Optional]
1414
/// </summary>
15-
public bool Optimized { get; set; }
15+
public bool? Optimized { get; set; }
1616

1717
/// <summary>
1818
/// The optimization framework applied

src/CheckoutSdk/Authentication/Standalone/Common/Responses/PreferredExperiences/GoogleSpa/GoogleSpa.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public class GoogleSpa
1717
/// Reason(s) why processing the experience was unsuccessful.
1818
/// [Optional]
1919
/// </summary>
20-
public IList<object> Reason { get; set; }
20+
public IList<string> Reason { get; set; }
2121
}
2222
}

0 commit comments

Comments
 (0)