haritsfahreza / go-bca

Bank BCA API's Go SDK

Home Page:https://developer.bca.co.id/documentation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🏦 BCA (Bank Central Asia) API's Go Library

Library Status Go Report Card MIT license Build Status

Go(lang) library to speed up your BCA (Bank Central Asia) API integration process. See this official documentation of BCA API

Usage

import (
	"context"

	"github.com/haritsfahreza/go-bca"
	"github.com/haritsfahreza/go-bca/business"
)

func main() {
    cfg := bca.Config{
		URL:          "https://sandbox.bca.co.id",
		ClientID:     "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
		ClientSecret: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
		APIKey:       "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
		APISecret:    "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
		CorporateID:  "BCAAPI2016", //Based on API document
		OriginHost:   "localhost",
	}
	businessClient := business.NewClient(cfg)
	authClient := auth.NewClient(cfg)

	ctx := context.Background()
	authToken, err := authClient.GetToken(ctx)
	if err != nil {
		panic(err)
	}

    businessClient.AccessToken = authToken.AccessToken

    ctx := context.Background()
    response, err := client.GetBalanceInfo(ctx, []string{"0201245680", "0063001004"})
}

Example

We have attached usage examples in this repository in folder example. Please proceed there for more detail on how to run the example.

License

See LICENSE.

About

Bank BCA API's Go SDK

https://developer.bca.co.id/documentation/

License:MIT License


Languages

Language:Go 100.0%