Skip to content

Commit 1bc0874

Browse files
oschwaldclaude
andcommitted
fixup! Convert all model and response classes to C# records
fixup! Convert all model and response classes to C# records Update README examples to use object initializer syntax instead of deprecated constructors. Fix Last4Digits -> LastDigits in example. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d52ea3b commit 1bc0874

1 file changed

Lines changed: 25 additions & 21 deletions

File tree

README.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,20 @@ Create a new `Transaction` object. This represents the transaction that you
6969
are sending to minFraud:
7070

7171
```csharp
72-
var transaction = new Transaction(
73-
device: new Device(
74-
ipAddress: System.Net.IPAddress.Parse("152.216.7.110"),
75-
userAgent: "Mozilla/5.0 (X11; Linux x86_64)",
76-
acceptLanguage: "en-US,en;q=0.8"
77-
),
78-
account:
79-
new Account(
80-
userId: "3132",
81-
username: "fred"
82-
)
83-
);
72+
var transaction = new Transaction
73+
{
74+
Device = new Device
75+
{
76+
IPAddress = System.Net.IPAddress.Parse("152.216.7.110"),
77+
UserAgent = "Mozilla/5.0 (X11; Linux x86_64)",
78+
AcceptLanguage = "en-US,en;q=0.8"
79+
},
80+
Account = new Account
81+
{
82+
UserId = "3132",
83+
Username = "fred"
84+
}
85+
};
8486
```
8587

8688
After creating the request object, send a non-blocking minFraud Score request
@@ -168,14 +170,16 @@ If a transaction was scored incorrectly or you received a chargeback, you may
168170
report it to MaxMind. To do this, create a new `TransactionReport` object:
169171

170172
```csharp
171-
var report = new TransactionReport(
172-
tag: TransactionReportTag.Chargeback,
173-
chargebackCode: "BL",
174-
ipAddress: IPAddress.Parse("104.16.148.244"),
175-
maxmindId: "abcd1234",
176-
minfraudId: new Guid("01c25cb0-f067-4e02-8ed0-a094c580f5e4"),
177-
notes: "Suspicious account behavior",
178-
transactionId: "txn123");
173+
var report = new TransactionReport
174+
{
175+
Tag = TransactionReportTag.Chargeback,
176+
ChargebackCode = "BL",
177+
IPAddress = IPAddress.Parse("104.16.148.244"),
178+
MaxMindId = "abcd1234",
179+
MinFraudId = new Guid("01c25cb0-f067-4e02-8ed0-a094c580f5e4"),
180+
Notes = "Suspicious account behavior",
181+
TransactionId = "txn123"
182+
};
179183
```
180184

181185
A valid `tag` and at least one of the following are required parameters:
@@ -304,7 +308,7 @@ public class MinFraudExample
304308
BankPhoneNumber = "123-456-1234",
305309
AvsResult = 'Y',
306310
CvvResult = 'N',
307-
Last4Digits = "7643",
311+
LastDigits = "7643",
308312
Token = "123456abc1234",
309313
Was3DSecureSuccessful = true
310314
},

0 commit comments

Comments
 (0)