Skip to content

booscaaa/juno-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Juno API - Golang SDK

Juno API (Open Banking) (2.0.0)

Reference Release Software License Test status Coverage


Why?

This project is part of my personal portfolio, so, I'll be happy if you could provide me any feedback about the project, code, structure or anything that you can report that could make me a better developer!

Email-me: boscardinvinicius@gmail.com

Connect with me at LinkedIn.


Functionalities

  • Get authentication token
  • Create tokenized card
  • Get plans for signatures
  • Get plan by ID
  • Create plan
  • Disable plan by ID
  • Enable plan by ID

Getting Started

Prerequisites

To run this project in the development mode, you'll need to have a basic environment to run:

  • A Golang SDK, that can be found here.

Installing

$ go get github.com/booscaaa/juno-go-sdk

Create a config.json file inside your project like this

The access client_id, client_secret and resource_token can be found into Juno account

{
  "juno": {
    "client_id": "cliend id",
    "client_secret": "client secret",
    "resource_token": "resource token"
  }
}


Create main.go file

package main

import (
    "fmt"

    "github.com/booscaaa/juno-go-sdk/juno"
    "github.com/spf13/viper"
)

func init() {
    viper.SetConfigFile(`config.json`)
    err := viper.ReadInConfig()
    if err != nil {
        panic(err)
    }
}

func main() {
    // Get configuration variavables
    clientID := viper.GetString("juno.client_id")
    clientSecret := viper.GetString("juno.client_secret")
    resourceToken := viper.GetString("juno.resource_token")

    // Configure Sandbox access into Juno api
    junoAccess := juno.JunoConfig().
        ClientID(clientID).
        ClientSecret(clientSecret).
        ResourceToken(resourceToken).
        Sandbox()

    junoSdk := juno.Instance(junoAccess)

    // Get authentication token from juno api
    accessToken, err := junoSdk.GetAuthToken()

    if err != nil {
        fmt.Println(err)
    }

    //Get list plans from juno api
    plans, err := junoSdk.GetPlans(*accessToken)

    if err != nil {
        fmt.Println(err)
    }

    //see more examples into examples folder
}

Running local

go run main.go



Api application built With




Contributing

You can send how many PR's do you want, I'll be glad to analyze and accept them! And if you have any question about the project...

Email-me: boscardinvinicius@gmail.com

Connect with me at LinkedIn

Thank you!

License

This project is licensed under the MIT License - see the LICENSE.md file for details