starkbank v0.0.2 StarkBank View Source

SDK to facilitate Elixir integrations with the Stark Bank API v2.

Link to this section Summary

Functions

Creates a Project struct

The Project struct is the main authentication entity for the SDK. All requests to the Stark Bank API must be authenticated via a project, which must have been previously created at the Stark Bank website [https://sandbox.web.starkbank.com] or [https://web.starkbank.com] before you can use it in this SDK. Projects may be passed as a parameter on each request or may be defined as the default user at the start (See README).

Link to this section Functions

Link to this function

project(environment, id, private_key, name \\ "", allowed_ips \\ nil)

View Source
project(:production | :sandbox, binary(), binary(), binary(), [binary()] | nil) ::
  StarkBank.User.Project.t()

Creates a Project struct

The Project struct is the main authentication entity for the SDK. All requests to the Stark Bank API must be authenticated via a project, which must have been previously created at the Stark Bank website [https://sandbox.web.starkbank.com] or [https://web.starkbank.com] before you can use it in this SDK. Projects may be passed as a parameter on each request or may be defined as the default user at the start (See README).

Parameters (required):

  • environment [string]: environment where the project is being used. ex: "sandbox" or "production"
  • id [string]: unique id required to identify project. ex: "5656565656565656"
  • private_key [string]: PEM string of the private key linked to the project. ex: "-----BEGIN PUBLIC KEY----- MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEyTIHK6jYuik6ktM9FIF3yCEYzpLjO5X/ tqDioGM+R2RyW0QEo+1DG8BrUf4UXHSvCjtQ0yLppygz23z0yPZYfw== -----END PUBLIC KEY-----"

Attributes (return-only):

  • name [string, default ""]: project name. ex: "MyProject"
  • allowed_ips [list of strings]: list containing the strings of the ips allowed to make requests on behalf of this project. ex: ["190.190.0.50"]