Documentation
¶
Index ¶
- Variables
- func Decrypt(dst io.Writer, src io.Reader, srcSize int, key *rsa.PrivateKey) error
- func Encrypt(dst io.Writer, src io.Reader, srcSize int, key *rsa.PublicKey) error
- func GenOrderID() string
- func GenerateKeysPEM(prvKeyDst, pubKeyDst io.Writer, bits int) error
- func MarshalGzipJSON(w io.Writer, data interface{}) error
- func UnmarshalGzipJSON(r io.Reader, data interface{}) error
- type BatchError
- type BlockPEM
- type CheckAccount
- type CheckAccountResponse
- type Config
- type Envelope
- type EnvelopeBase
- type EnvelopeResponse
- type EnvelopeResponseData
- type Error
- type HTTPClient
- type KeyStore
- type Option
- type PartnerAPI
- type Process
- type ProcessResponse
- type QueryByMSISDN
- type QueryByTransaction
- type QueryRequestEnvelope
- type QueryRequests
- type QueryRequestsResponse
- type Request
- type RequestDisbursement
- type RequestDisbursementEnvelope
- type RequestDisbursementResponse
- type SoapClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBatchWaitDisb = &BatchError{Code: "WAIT_DISB"} ErrBatchCancelDisb = &BatchError{Code: "CANCEL_DISB"} ErrBatchDisbursement = &BatchError{Code: "DISBURSEMENT"} ErrBatchDisbTimeout = &BatchError{Code: "DISB_TIMEOUT"} ErrBatchDisbSuccess = &BatchError{Code: "DISB_SUCCESS"} ErrBatchDisbFailed = &BatchError{Code: "DISB_FAILED"} )
View Source
var ErrNoPEM = errors.New("no PEM data is found")
Functions ¶
func GenOrderID ¶
func GenOrderID() string
func MarshalGzipJSON ¶
func UnmarshalGzipJSON ¶
Types ¶
type BatchError ¶
func (BatchError) Error ¶
func (e BatchError) Error() string
func (*BatchError) Is ¶
func (e *BatchError) Is(target error) bool
type BlockPEM ¶
type BlockPEM []byte
BlockPEM is a slice of bytes where the information is PEM in the environment variable.
type CheckAccount ¶
type CheckAccountResponse ¶
type CheckAccountResponse struct {
CheckAccount
Package string `json:"package"`
ErrorCode string `json:"errorCode"`
ErrorDesc string `json:"errorDesc"`
}
func (CheckAccountResponse) Err ¶ added in v0.1.1
func (r CheckAccountResponse) Err() error
type Config ¶
type EnvelopeBase ¶
type EnvelopeBase struct {
Password string `json:"password"`
ServiceCode string `json:"serviceCode"`
Username string `json:"username"`
Data []byte `json:"data,omitempty"`
OrderID string `json:"orderId"`
}
func (*EnvelopeBase) SetData ¶
func (e *EnvelopeBase) SetData(val []byte)
func (*EnvelopeBase) SetPassword ¶
func (e *EnvelopeBase) SetPassword(val string)
func (*EnvelopeBase) SetServiceCode ¶
func (e *EnvelopeBase) SetServiceCode(val string)
func (*EnvelopeBase) SetUsername ¶
func (e *EnvelopeBase) SetUsername(val string)
type EnvelopeResponse ¶
type EnvelopeResponse struct {
Data json.RawMessage `json:"data"`
Signature []byte `json:"signature"`
}
type EnvelopeResponseData ¶
type EnvelopeResponseData struct {
Data []byte `json:"data,omitempty"`
OrderID string `json:"orderId"`
RealServiceCode string `json:"realServiceCode"`
ServiceCode string `json:"serviceCode"`
Username string `json:"username"`
RequestId string `json:"requestId"`
TransDate string `json:"transDate"`
BatchErrorCode string `json:"batchErrorCode"`
BatchErrorDesc string `json:"batchErrorDesc"`
ErrorCode string `json:"errorCode"`
ErrorDesc string `json:"errorDesc"`
}
func (EnvelopeResponseData) CheckError ¶
func (e EnvelopeResponseData) CheckError() error
type HTTPClient ¶
HTTPClient is a client which can make HTTP requests An example implementation is net/http.Client
type KeyStore ¶
type KeyStore interface {
Sign(data []byte) (signature []byte, err error)
Verify(data, signature []byte) (err error)
Decrypt(msg []byte) (string, error)
Encrypt(msg []byte) (string, error)
}
func NewKeyStore ¶
type Option ¶
type Option func(*options)
A Option sets options such as credentials, tls, etc.
func WithHTTPClient ¶
func WithHTTPClient(c HTTPClient) Option
WithHTTPClient is an Option to set the HTTP client to use
func WithKeyStore ¶
WithKeyStore is an Option to set BasicAuth