Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eng 6888 dotnet 3.0.x documentation #409

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tokenize
  • Loading branch information
greathouse committed Jul 1, 2024
commit b1abdbde7509651adf73f6b14e370960b1aec286
186 changes: 112 additions & 74 deletions docs/api/tokens/tokenize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,21 @@ const token = await bt.tokenize({
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.Tokenize;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

var client = new TokenizeClient("<API_KEY>");
Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var token = await client.TokenizeAsync(new {
first_name = "John",
last_name = "Doe"
});
var apiInstance = new TokenizeApi(config);
var body = new {
first_name = "John",
last_name = "Doe"
};

Object result = apiInstance.Tokenize(body);
```

</TabItem>
Expand Down Expand Up @@ -201,21 +208,31 @@ const token = await bt.tokenize({
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.Tokenize;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

var client = new TokenizeClient("<API_KEY>");
Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var token = await client.TokenizeAsync(new Token {
Type = "token",
Data = "Sensitive Value",
Metadata = new Dictionary<string, string> {
{ "nonSensitiveField", "Non-Sensitive Value" }
},
SearchIndexes = new List<string> {
"{{ data }}"
},
FingerprintExpression = "{{ data }}"
});
var apiInstance = new TokenizeApi(config);
var body = new Token
{
Type = "token",
Data = "Sensitive Value",
Metadata = new Dictionary<string, string>
{
{ "nonSensitiveField", "Non-Sensitive Value" }
},
SearchIndexes = new List<string>
{
"{{ data }}"
},
FingerprintExpression = "{{ data }}"
};

Object result = apiInstance.Tokenize(body);
```

</TabItem>
Expand Down Expand Up @@ -372,22 +389,29 @@ const token = await bt.tokenize({
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.Tokenize;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

var client = new TokenizeClient("<API_KEY>");
Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var token = await client.TokenizeAsync(new Token {
Type = "card",
Data = new {
number = "4242424242424242",
expiration_month = 12,
expiration_year = 2025,
cvc = "123"
},
Metadata = new Dictionary<string, string> {
{ "nonSensitiveField", "Non-Sensitive Value" }
}
});
var apiInstance = new TokenizeApi(config);
var body = new Token {
Type = "card",
Data = new {
number = "4242424242424242",
expiration_month = 12,
expiration_year = 2025,
cvc = "123"
},
Metadata = new Dictionary<string, string> {
{ "nonSensitiveField", "Non-Sensitive Value" }
}
};

Object result = apiInstance.Tokenize(body);
```

</TabItem>
Expand Down Expand Up @@ -565,27 +589,34 @@ const token = await bt.tokenize([
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.Tokenize;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

var client = new TokenizeClient("<API_KEY>");
Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var token = await client.TokenizeAsync(new object[] {
"John",
"Doe",
new Token {
Type = "card",
Data = new {
number = "4242424242424242",
expiration_month = 12,
expiration_year = 2025,
cvc = "123"
var apiInstance = new TokenizeApi(config);
var body = new object[] {
"John",
"Doe",
new Token {
Type = "card",
Data = new {
number = "4242424242424242",
expiration_month = 12,
expiration_year = 2025,
cvc = "123"
}
},
new Token {
Type = "token",
Data = "Sensitive Value"
}
},
new Token {
Type = "token",
Data = "Sensitive Value"
}
});
};

Object result = apiInstance.Tokenize(body);
```

</TabItem>
Expand Down Expand Up @@ -795,30 +826,37 @@ const token = await bt.tokenize({
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.Tokenize;

var client = new TokenizeClient("<API_KEY>");

var token = await client.TokenizeAsync(new {
first_name = "John",
last_name = "Doe",
primary_card = new Token {
Type = "card",
Data = new {
number = "4242424242424242",
expiration_month = 12,
expiration_year = 2025,
cvc = "123"
}
},
sensitive_tags = new object[] {
"preferred",
new Token {
Type = "token",
Data = "vip"
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var apiInstance = new TokenizeApi(config);
var body = new {
first_name = "John",
last_name = "Doe",
primary_card = new Token {
Type = "card",
Data = new {
number = "4242424242424242",
expiration_month = 12,
expiration_year = 2025,
cvc = "123"
}
},
sensitive_tags = new object[] {
"preferred",
new Token {
Type = "token",
Data = "vip"
}
}
}
});
};

Object result = apiInstance.Tokenize(body);
```

</TabItem>
Expand Down