Skip to content

Commit

Permalink
Update README.md (#408)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
guibranco and sourcery-ai[bot] authored Dec 27, 2024
1 parent 9e922e1 commit 7b0e7f0
Showing 1 changed file with 45 additions and 10 deletions.
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.

### Nuget package manager

Expand All @@ -57,35 +57,70 @@ Download the latest zip file from the [Release](https://github.com/GuiBranco/VTE

## 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>();
```
---

### 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.

---

## Contributors

### Contributors
Thanks to all contributors! 💙

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

0 comments on commit 7b0e7f0

Please sign in to comment.