zengin

package module
v0.0.0-...-011ef7a Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

zengin

Package zengin implements encoding of Zengin File.

Usage

	r := &zengin.Requester{
		Classification: zengin.RequesterClassification_EFT,
		RequesterCode:  1234567890,
	}
	tr := &zengin.Transfer{
		BankCode:      zengin.BankCode(1),
		BranchCode:    zengin.BranchCode(1),
		AccountType:   zengin.AccountType_Ordinary,
		AccountNumber: zengin.AccountNumber(123456),
		AccountName:   zengin.AccountName("ヤマダタロウ"),
		Amount:        100,
	}
	str, err := zengin.Marshal(r, []*zengin.Transfer{tr})
	if err != nil {
		t.Errorf("failed to marshal: err=%s", err)
	}

	fmt.Println(str)
12101234567890                                        00000000               000               00000000                 
20001               001               000010123456?????۳                       00000001000                    0        
8                                                                                                                       
9                                                                                                                       

Documentation

Index

Constants

View Source
const (
	RowLength      = 122
	ZENGIN_TRAILER = "8                                                                                                                       \r\n"
	//スペース1文字消えるので1つ多めに入れる
	ZENGIN_END = "9                                                                                                                       \r\n "
)
View Source
const HEADER_FORMAT = "1%s0%010d                                        00000000               000               00000000                 \r\n"

Variables

This section is empty.

Functions

func LengthSJIS

func LengthSJIS(str string) int

func Marshal

func Marshal(r *Requester, ts []*Transfer) (string, error)

Types

type AccountName

type AccountName string

func (AccountName) ZenginText

func (an AccountName) ZenginText() (string, error)

type AccountNumber

type AccountNumber int

func (AccountNumber) String

func (an AccountNumber) String() string

type AccountType

type AccountType int
const (
	AccountType_Ordinary AccountType = 1 // 普通
	AccountType_Checking AccountType = 2 // 当座
	AccountType_Deposit  AccountType = 4 // 貯蓄
)

func (AccountType) String

func (at AccountType) String() string

type BankCode

type BankCode int

func (BankCode) String

func (bc BankCode) String() string

type BranchCode

type BranchCode int

func (BranchCode) String

func (bc BranchCode) String() string

type Requester

type Requester struct {
	Classification RequesterClassification
	RequesterCode  int
}

func (*Requester) HeaderRecord

func (r *Requester) HeaderRecord() string

type RequesterClassification

type RequesterClassification int
const (
	RequesterClassification_EFT RequesterClassification = 21
)

func (RequesterClassification) String

func (rc RequesterClassification) String() string

type Transfer

type Transfer struct {
	BankCode      BankCode
	BranchCode    BranchCode
	AccountType   AccountType
	AccountNumber AccountNumber
	AccountName   AccountName
	Amount        int
}

Transfer is required data to transfer

func (*Transfer) DataRecord

func (t *Transfer) DataRecord() (string, error)

Jump to

Keyboard shortcuts

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