ganblib

package module
v0.0.0-...-60d39f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 12 Imported by: 0

README

GMO Aozora Net Bank Open Api GO SDK

About

GMOあおぞらネット銀行について

https://gmo-aozora.com/

GMOあおぞらネット銀行 API開発者ポータルについて

https://api.gmo-aozora.com/ganb/developer/

Version

1.0.0

Requirements

Golang 1.8+

Installation

  • get the repository from Github
    $ go get github.com/gmoaozora/gmo-aozora-api-go

  • get a package with the following command
    $ go get github.com/antihax/optional

Getting started

Enviroment

Add the configuration below into your config file
vi conf.json

  • stg

    conf.json

    {
        "AUTH_BASE_URL": "https://stg-api.gmo-aozora.com/ganb/api/auth/v1",
        "JWT_ISSUER": "https://stg-api.gmo-aozora.com/",
        "AUTH_PATH": "/authorization",
        "TOKEN_PATH": "/token",
        "SALT": "PleaseDefineYourself"
    }
    

    configuration.go - Personal

    	BasePath:      "https://stg-api.gmo-aozora.com/ganb/api/personal/v1",
    

    configuration.go - Corporate

    	BasePath:      "https://stg-api.gmo-aozora.com/ganb/api/corporation/v1",
    

    configuration.go - Webhook

    	BasePath:      "https://stg-api.gmo-aozora.com/ganb/api/webhooks/v1",
    
  • prod

    conf.json

    {
        "AUTH_BASE_URL": "https://api.gmo-aozora.com/ganb/api/auth/v1",
        "JWT_ISSUER": "https://api.gmo-aozora.com/",
        "AUTH_PATH": "/authorization",
        "TOKEN_PATH": "/token",
        "SALT": "PleaseDefineYourself"
    }
    

    configuration.go - Personal

    	BasePath:      "https://api.gmo-aozora.com/ganb/api/personal/v1",
    

    configuration.go - Corporate

    	BasePath:      "https://api.gmo-aozora.com/ganb/api/corporation/v1",
    

    configuration.go - Webhook

    	BasePath:      "https://api.gmo-aozora.com/ganb/api/webhooks/v1",
    

Documentation

Autor

GMO Aozora Net Bank, Ltd. (open-api@gmo-aozora.com)

Licence

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ganb

type Ganb struct {
	// contains filtered or unexported fields
}

Ganb is our main struct

func New

func New(clientID string, clientSecret string, nonceSave func(string) error, nonceCheck func(string) error) (Ganb, error)

New setup the lib

func (Ganb) OAuthAuthorization

func (g Ganb) OAuthAuthorization(sessionID string, scope string, redirectURI string) string

OAuthAuthorization methods Authorization used with oAuth

func (Ganb) OAuthGetToken

func (g Ganb) OAuthGetToken(redirectURI string, code string, authMethod string) (Token, error)

OAuthGetToken methods used with oAuth

func (Ganb) OpenIDAuthorization

func (g Ganb) OpenIDAuthorization(sessionID string, scope string, redirectURI string) (string, error)

OpenIDAuthorization methods Authorization used with OpenID

func (Ganb) OpenIDGetToken

func (g Ganb) OpenIDGetToken(redirectURI string, code string, authMethod string) (Token, error)

OpenIDGetToken methods used with OpenID

func (Ganb) RefreshTokens

func (g Ganb) RefreshTokens(refreshToken string) (Token, error)

RefreshToken refresh the session using a refresh token

type Token

type Token struct {
	AccessToken      string `json:"access_token"`
	RefreshToken     string `json:"refresh_token"`
	Scope            string `json:"scope,omitempty"`
	TokenType        string `json:"token_type"`
	ExpiresIn        int    `json:"expires_in"`
	IDToken          string `json:"id_token,omitempty"`
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
	ErrorUri         string `json:"error_uri"`
}

Token data sctucture for both oAuth and openID tokens

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL