starkbank 0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package starkbank --version 0.0.2                
NuGet\Install-Package starkbank -Version 0.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="starkbank" Version="0.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add starkbank --version 0.0.2                
#r "nuget: starkbank, 0.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install starkbank as a Cake Addin
#addin nuget:?package=starkbank&version=0.0.2

// Install starkbank as a Cake Tool
#tool nuget:?package=starkbank&version=0.0.2                

Stark Bank .NET SDK Beta

Welcome to the Stark Bank .NET SDK! This tool is made for .NET developers who want to easily integrate with our API. This SDK version is compatible with the Stark Bank API v2.

If you have no idea what Stark Bank is, check out our website and discover a world where receiving or making payments is as easy as sending a text message to your client!

Supported .NET Versions

This library supports the following .NET versions:

  • .NET Standard 2.1+

Stark Bank API documentation

If you want to take a look at our API, follow this link.

Versioning

This project adheres to the following versioning pattern:

Given a version number MAJOR.MINOR.PATCH, increment:

  • MAJOR version when the API version is incremented. This may include backwards incompatible changes;
  • MINOR version when breaking changes are introduced OR new functionalities are added in a backwards compatible manner;
  • PATCH version when backwards compatible bug fixes are implemented.

Setup

1. Install our SDK

StarkBank`s .NET SDK is available on NuGet as starkbank 0.0.2.

1.1 To install the Package Manager:

Install-Package starkbank -Version 0.0.2

1.2 To install the .NET CLI:

dotnet add package starkbank --version 0.0.2

1.3 To install by PackageReference:

<PackageReference Include="starkbank" Version="0.0.2" />

1.4 To install with Paket CLI:

paket add starkbank --version 0.0.2

2. Create your Private and Public Keys

We use ECDSA. That means you need to generate a secp256k1 private key to sign your requests to our API, and register your public key with us so we can validate those requests.

You can use one of following methods:

2.1. Check out the options in our tutorial.

2.2. Use our SDK:

(string privateKey, string publicKey) = StarkBank.Key.Create();

# or, to also save .pem files in a specific path
(string privateKey, string publicKey) = StarkBank.Key.Create("file/keys");

NOTE: When you are creating a new Project, it is recommended that you create the keys inside the infrastructure that will use it, in order to avoid risky internet transmissions of your private-key. Then you can export the public-key alone to the computer where it will be used in the new Project creation.

3. Create a Project

You need a project for direct API integrations. To create one in Sandbox:

3.1. Log into Starkbank Sandbox

3.2. Go to Menu > Usuários (Users) > Projetos (Projects)

3.3. Create a Project: Give it a name and upload the public key you created in section 2.

3.4. After creating the Project, get its Project ID

3.5. Use the Project ID and private key to create the object below:

// Get your private key from an environment variable or an encrypted database.
// This is only an example of a private key content. You should use your own key.
string privateKeyContent = "-----BEGIN EC PARAMETERS-----\nBgUrgQQACg==\n-----END EC PARAMETERS-----\n-----BEGIN EC PRIVATE KEY-----\nMHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK\noUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1\nIF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==\n-----END EC PRIVATE KEY-----"

StarkBank.Project project = new StarkBank.Project(
    environment: "sandbox",
    id: "5656565656565656",
    privateKey: privateKeyContent
);

NOTE 1: Never hard-code your private key. Get it from an environment variable or an encrypted database.

NOTE 2: We support 'sandbox' and 'production' as environments.

NOTE 3: The project you created in sandbox does not exist in production and vice versa.

4. Setting up the user

There are two kinds of users that can access our API: Project and Member.

  • Member is the one you use when you log into our webpage with your e-mail.
  • Project is designed for integrations and is the one meant for our SDK.

There are two ways to inform the user to the SDK:

4.1 Passing the user as argument in all functions:

StarkBank.Balance balance = StarkBank.Balance.Get(user: project);

4.2 Set it as a default user in the SDK:

StarkBank.User.Default = project;

StarkBank.Balance balance = StarkBank.Balance.Get();

Just select the way of passing the project user that is more convenient to you. On all following examples we will assume a default user has been set.

Testing in Sandbox

Your initial balance is zero. For many operations in Stark Bank, you"ll need funds in your account, which can be added to your balance by creating a Boleto.

In the Sandbox environment, 90% of the created Boletos will be automatically paid, so there"s nothing else you need to do to add funds to your account. Just create a few and wait around a bit.

In Production, you (or one of your clients) will need to actually pay this Boleto for the value to be credited to your account.

To see the full README, check out our GitHub page.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.13.0 1,236 7/2/2024
2.12.0 766 3/19/2024
2.11.0 3,657 12/29/2023
2.10.0 2,514 9/18/2023
2.9.0 1,345 5/15/2023
2.8.0 417 4/11/2023
2.7.0 699 3/22/2023
2.6.4 13,211 8/22/2022
2.6.3 2,466 5/12/2022
2.6.2 8,346 11/11/2021
2.6.1 385 11/5/2021
2.6.0 588 9/4/2021
2.5.0 1,466 7/27/2021
2.4.0 669 1/21/2021
2.3.0 428 1/16/2021
2.2.4 441 12/29/2020
2.2.3 1,040 11/18/2020
2.2.2 748 11/17/2020
2.2.1 451 11/17/2020
2.2.0 444 11/16/2020
2.2.0-beta 388 11/11/2020
2.1.0 518 10/28/2020
2.0.0 505 10/20/2020
0.10.3-beta 304 9/10/2020
0.10.2-beta 344 9/7/2020
0.10.1-beta 471 8/15/2020
0.10.0-beta 406 8/12/2020
0.9.0 674 8/12/2020
0.8.0 553 6/5/2020
0.7.0 503 5/27/2020
0.6.0 501 5/13/2020
0.5.1 496 5/12/2020
0.5.0 498 5/12/2020
0.4.0 523 5/5/2020
0.3.1 540 4/29/2020
0.3.0 515 4/29/2020
0.2.0 531 4/18/2020
0.1.0 512 4/17/2020
0.0.3 514 4/17/2020
0.0.2 520 4/16/2020
0.0.1 502 4/15/2020