All Projects → stone-co → go-stone-openbank

stone-co / go-stone-openbank

Licence: GPL-3.0 License
A Go library to connect with Stone Open Banking API

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-stone-openbank

awesome-hacktoberfest-plant-a-tree
Will you choose the ✨ Hacktoberfest t-shirt ✨ but don't want to stop contributing to the environment and a sustainable future? Find an organization here so you can plant a tree! 🌱
Stars: ✭ 30 (-3.23%)
Mutual labels:  hacktoberfest2021
github-readme-quotes
Dynamic quote generator for your GitHub readmes | Give a poetic touch to readmes
Stars: ✭ 128 (+312.9%)
Mutual labels:  hacktoberfest2021
Everything-CPP
Contribute all levels of C++ related codes for Hacktoberfest 2021!
Stars: ✭ 17 (-45.16%)
Mutual labels:  hacktoberfest2021
designtodevelopment
This repository is all about converting design inspirations into code.
Stars: ✭ 135 (+335.48%)
Mutual labels:  hacktoberfest2021
Embellish
This repository contains different styled components in html,css,js,jquery which can be used in any website.
Stars: ✭ 32 (+3.23%)
Mutual labels:  hacktoberfest2021
Hacktoberfest-2021
This repository aims to help code beginners with their first successful pull request and open source contribution. 🥳🎯🚀
Stars: ✭ 24 (-22.58%)
Mutual labels:  hacktoberfest2021
Stress-master
Website to promote mental and physical health among all ages through proper meditation and diet.
Stars: ✭ 23 (-25.81%)
Mutual labels:  hacktoberfest2021
WhatsApp-Scraping
Python script to get WhatsApp iformation frrom WhatsApp Web
Stars: ✭ 76 (+145.16%)
Mutual labels:  hacktoberfest2021
Data-Structures-and-Algorithm-C-
Hi folks🖐🏻 , I'm maintaining this repository, feel free to open a pull request and contribute! :)
Stars: ✭ 39 (+25.81%)
Mutual labels:  hacktoberfest2021
Coffeegram
Android app using Jetpack Compose together with StateFlow and MVI
Stars: ✭ 155 (+400%)
Mutual labels:  hacktoberfest2021
gqlalchemy
GQLAlchemy is a library developed with the purpose of assisting in writing and running queries on Memgraph. GQLAlchemy supports high-level connection to Memgraph as well as modular query builder.
Stars: ✭ 39 (+25.81%)
Mutual labels:  hacktoberfest2021
gateway-mt
Storj edge services (including multi-tenant, S3 compatible server to interact with the Storj network)
Stars: ✭ 18 (-41.94%)
Mutual labels:  hacktoberfest2021
HacktoberFest-2021
No description or website provided.
Stars: ✭ 278 (+796.77%)
Mutual labels:  hacktoberfest2021
theportfolio
Portfolio for Everyone!
Stars: ✭ 16 (-48.39%)
Mutual labels:  hacktoberfest2021
DSA
Implementation of various data structures and algorithms.
Stars: ✭ 15 (-51.61%)
Mutual labels:  hacktoberfest2021
Automatic-attendance-management-system
ROLLCALL an automatic and smart attendance marking and management system which uses Microsoft Azure’s Cognitive service at its core to create a system that could make sure that no human intervention is required and provides government the ability to monitor the attendance of the schools and helps the government officials in mark fake schools.
Stars: ✭ 44 (+41.94%)
Mutual labels:  hacktoberfest2021
All Program helper
add PR and i ll merge it with hacktoberfest-accepted tag
Stars: ✭ 34 (+9.68%)
Mutual labels:  hacktoberfest2021
Basic-Components-of-a-Web-Layout
No description or website provided.
Stars: ✭ 16 (-48.39%)
Mutual labels:  hacktoberfest2021
geeks-for-geeks-solutions
Solutions of questions on Geeks-for-Geeks.Solution Available in C++.
Stars: ✭ 28 (-9.68%)
Mutual labels:  hacktoberfest2021
dsalgo
Contains Algorithms useful for interview preparation, various practice problems of Arrays, Stacks, queue etc. Contributors are Welcome but, DO NOT MAKE THIS REPO ACT LIKE A SOURCE OF +1.
Stars: ✭ 45 (+45.16%)
Mutual labels:  hacktoberfest2021

go-stone-openbank

A Go library to connect with Stone Open Banking API

How to install

go get github.com/stone-co/go-stone-openbank

Example Usage

package main

import (
	openbank "github.com/stone-co/go-stone-openbank"
	"github.com/stone-co/go-stone-openbank/types"
)

func main() {
	clientID := os.Getenv("STONE_CLIENT_ID")
	privKeyPath := os.Getenv("STONE_PRIVATE_KEY")
	consentURL := os.Getenv("STONE_CONSENT_REDIRECT_URL")

	pemPrivKey := readFileContent(privKeyPath)

	client, err := openbank.NewClient(
		openbank.WithClientID(clientID),
		openbank.SetConsentURL(consentURL),
		openbank.WithPEMPrivateKey(pemPrivKey),
		openbank.UseSandbox(),
	//	openbank.EnableDebug(),
	)
	if err != nil {
		log.Fatal(err)
	}

	err := client.Authenticate()
	if err != nil {
		log.Fatal(err)
	}

	consentLink, err := client.ConsentLink("")
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("consent_link: %s\n", consentLink)

	// returns institutions
	allinstitutions, _, err := client.Institution.List(openbank.AllInstitutions)
	if err != nil {
		log.Fatal(err)
	}
	log.Print(len(allinstitutions), allinstitutions[0])

	// returns institutions participating in the SPI. Useful for PIX operations
	SPIinstitutions, _, err := client.Institution.List(openbank.SPIParticipants)
	if err != nil {
		log.Fatal(err)
	}
	log.Print(len(SPIinstitutions), SPIinstitutions[0])

	// returns institutions participating in the STR. Useful for TED operations
	STRinstitutions, _, err := client.Institution.List(openbank.STRParticipants)
	if err != nil {
		log.Fatal(err)
	}
	log.Print(len(STRinstitutions), STRinstitutions[0])

	// return institution by code or ISPB code
	institution, _, err := client.Institution.Get(SPIinstitutions[0].ISPBCode)
	if err != nil {
		log.Fatal(err)
	}
	log.Print(institution)

	accounts, _, err := client.Account.List()
	if err != nil {
		log.Fatal(err)
	}
	for i := range accounts {
		balance, _, err := client.Account.GetBalance(accounts[i].ID)
		if err != nil {
			log.Fatal(err)
		}
		fmt.Printf("Balance: %+v", balance)
 	}
}

func readFileContent(path string) []byte {
	content, _ := ioutil.ReadFile(path)
	return content
}

see full example

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].