Skip to content

Commit dcce777

Browse files
oschwaldclaude
andcommitted
Use explicit variables for account ID and license key in minFraud examples
Make the parameters passed to client constructors more explicit by declaring them as named variables before use, improving code clarity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 7e65563 commit dcce777

File tree

2 files changed

+42
-12
lines changed

2 files changed

+42
-12
lines changed

content/minfraud/evaluate-a-transaction.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,29 +115,44 @@ will need
115115
{{< codeset >}}
116116

117117
```csharp
118-
var client = new WebServiceClient(10, "LICENSEKEY");
118+
int accountId = 10;
119+
string licenseKey = "LICENSEKEY";
120+
121+
var client = new WebServiceClient(accountId, licenseKey);
119122
```
120123

121124
```java
122-
WebServiceClient client = new WebServiceClient.Builder(10, "LICENSEKEY").build();
125+
int accountId = 10;
126+
String licenseKey = "LICENSEKEY";
127+
128+
WebServiceClient client = new WebServiceClient.Builder(accountId, licenseKey).build();
123129
```
124130

125131
```javascript
126-
const client = new minFraud.Client('10', 'LICENSEKEY');
132+
const accountId = '10';
133+
const licenseKey = 'LICENSEKEY';
134+
135+
const client = new minFraud.Client(accountId, licenseKey);
127136
```
128137

129138
```php
130-
$client = new MinFraud(10, 'LICENSEKEY');
139+
$accountId = 10;
140+
$licenseKey = 'LICENSEKEY';
141+
142+
$client = new MinFraud($accountId, $licenseKey);
131143
```
132144

133145
```python
134146
from minfraud import Client, AsyncClient
135147

148+
account_id = 10
149+
license_key = 'LICENSEKEY'
150+
136151
# If you want to use synchronous requests
137-
client = Client(10, 'LICENSEKEY')
152+
client = Client(account_id, license_key)
138153

139154
# Or if you want to use asynchronous requests
140-
async_client = AsyncClient(10, 'LICENSEKEY')
155+
async_client = AsyncClient(account_id, license_key)
141156
```
142157

143158
```ruby

content/minfraud/report-a-transaction.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ help us understand context are extremely helpful.
106106
{{< codeset >}}
107107

108108
```csharp
109-
var client = new WebServiceClient(10, "LICENSEKEY");
109+
int accountId = 10;
110+
string licenseKey = "LICENSEKEY";
111+
112+
var client = new WebServiceClient(accountId, licenseKey);
110113

111114
var report = new TransactionReport
112115
{
@@ -125,7 +128,10 @@ await client.ReportAsync(report);
125128
```
126129

127130
```java
128-
WebServiceClient client = new WebServiceClient.Builder(10, "LICENSEKEY").build();
131+
int accountId = 10;
132+
String licenseKey = "LICENSEKEY";
133+
134+
WebServiceClient client = new WebServiceClient.Builder(accountId, licenseKey).build();
129135

130136
TransactionReport transaction = new TransactionReport.Builder(InetAddress.getByName("1.1.1.1"), Tag.Chargeback)
131137
// The following key/values are not mandatory but are encouraged
@@ -142,7 +148,10 @@ client.reportTransaction(transaction);
142148
```javascript
143149
import * as minFraud from '@maxmind/minfraud-api-node';
144150

145-
const client = new minFraud.Client('10', 'LICENSEKEY');
151+
const accountId = '10';
152+
const licenseKey = 'LICENSEKEY';
153+
154+
const client = new minFraud.Client(accountId, licenseKey);
146155

147156
const transactionReport = new minFraud.TransactionReport({
148157
ipAddress: '1.1.1.1',
@@ -163,7 +172,10 @@ client.reportTransaction(transactionReport).then(() => ...);
163172
require_once 'vendor/autoload.php';
164173
use MaxMind\MinFraud\ReportTransaction;
165174

166-
$rt = new ReportTransaction(10, 'LICENSEKEY');
175+
$accountId = 10;
176+
$licenseKey = 'LICENSEKEY';
177+
178+
$rt = new ReportTransaction($accountId, $licenseKey);
167179

168180
$rt->report(
169181
ipAddress: '1.1.1.1',
@@ -180,7 +192,10 @@ $rt->report(
180192
```python
181193
from minfraud import Client
182194

183-
client = Client(10, 'LICENSEKEY')
195+
account_id = 10
196+
license_key = 'LICENSEKEY'
197+
198+
client = Client(account_id, license_key)
184199

185200
transaction_report = {
186201
'ip_address': '1.1.1.1',
@@ -199,7 +214,7 @@ client.report(transaction_report)
199214
import asyncio
200215
from minfraud import AsyncClient
201216

202-
async_client = AsyncClient(10, 'LICENSEKEY')
217+
async_client = AsyncClient(account_id, license_key)
203218

204219
async def report():
205220
transaction_report = {

0 commit comments

Comments
 (0)