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

Update README.md #408

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Changes from all commits
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
55 changes: 45 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

[![GitHub last release](https://img.shields.io/github/release-date/guibranco/VTEX-SDK-dotnet.svg?style=flat)](https://github.com/guibranco/VTEX-SDK-dotnet) [![Github All Releases](https://img.shields.io/github/downloads/guibranco/VTEX-SDK-dotnet/total.svg?style=flat)](https://github.com/guibranco/VTEX-SDK-dotnet)

Download the latest zip file from the [Release](https://github.com/GuiBranco/VTEX-SDK-dotnet/releases) page.
Download the latest `.zip` file from the [Releases](https://github.com/GuiBranco/VTEX-SDK-dotnet/releases) page.

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 112 Warning

Expected: 80; Actual: 112

### Nuget package manager

Expand All @@ -57,35 +57,70 @@

## Features

Implements all features of VTEX API available at [VTEX Developer Docs](https://developers.vtex.com/)
- Full implementation of VTEX API.
- Refer to [VTEX Developer Docs](https://developers.vtex.com/) for more information.

---

## Usage

Use your VTEX platform API keys.
Follow this tutorial on how to: [Creating appKeys and appTokens to authenticate integrations](https://help.vtex.com/tutorial/creating-appkeys-and-apptokens-to-authenticate-integrations--43tQeyQJgAKGEuCqQKAOI2)
### Dependency Injection (IoC)

```cs
Register the VTEX Service using the `CrispyWaffle` toolkit's [Service Locator](https://guibranco.github.io/CrispyWaffle/user-guide/serviceLocator/):

```csharp
var connectionVtex = new Connection(); // Fill in your details
ServiceLocator.Register(() => new VTEXContext(connectionVtex), LifeStyle.Singleton);
```

#### Constructor Injection

```csharp
public class MyClass
{
private readonly VTEXContext _vtexContext;

public MyClass(VTEXContext vtexContext)
{
_vtexContext = vtexContext ?? throw new ArgumentNullException(nameof(vtexContext));
}
}
```

#### Manual Resolution

```csharp
var vtexContext = ServiceLocator.Resolve<VTEXContext>();
```

Check warning

Code scanning / Markdownlint (reported by Codacy)

Fenced code blocks should be surrounded by blank lines Warning

Fenced code blocks should be surrounded by blank lines
---

### Authentication

Authenticate with VTEX platform API keys. Refer to this [tutorial](https://help.vtex.com/tutorial/creating-appkeys-and-apptokens-to-authenticate-integrations--43tQeyQJgAKGEuCqQKAOI2).

```csharp
var vtex = new VTEXContext("store name", "app-key-xyz", "app-token-secret-hash");
var order = vtex.GetOrder("V-123456789-01");
Console.WriteLine("Sequence: {1} | Value: {0} | ", order.Value, order.Sequence);

Console.WriteLine($"Sequence: {order.Sequence} | Value: {order.Value}");
```

---

## Support

Please [open an issue](https://github.com/guibranco/VTEX-SDK-dotnet/issues/new) for support.
If you need help, feel free to [open an issue](https://github.com/guibranco/VTEX-SDK-dotnet/issues/new).

---

## Contributing

Refer to [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to contribute to this project!
Contributions are welcome! Check out the [CONTRIBUTING.md](CONTRIBUTING.md) guide for details.

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 94 Warning

Expected: 80; Actual: 94

---

## Contributors

### Contributors
Thanks to all contributors! πŸ’™

<!-- readme: collaborators,contributors,snyk-bot/- -start -->
<table>
Expand Down
Loading