Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Decrypt(content string) ([]byte, error)
- func (c *Client) Encrypt(data []byte) (string, error)
- func (c *Client) GenerateInvoiceReqSerialNo() string
- func (c *Client) GenerateSerialNo() string
- func (c *Client) GetEnterpriseInfo(ctx context.Context, req *GetEnterpriseInfoRequest) (*GetEnterpriseInfoResponse, error)
- func (c *Client) OpenBlueInvoice(ctx context.Context, req *OpenBlueInvoiceRequest) (*OpenBlueInvoiceResponse, error)
- func (c *Client) OpenRedInvoice(ctx context.Context, req *OpenRedInvoiceRequest) (*OpenRedInvoiceResponse, error)
- func (c *Client) PlatformCode() string
- func (c *Client) PlatformName() string
- func (c *Client) QueryInvoice(ctx context.Context, req *QueryInvoiceRequest) (*QueryInvoiceResponse, error)
- func (c *Client) Register(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error)
- func (c *Client) SignRequest(req *Request) error
- func (c *Client) SignResponse(res *Response) error
- func (c *Client) VerifyRequest(req *Request) error
- func (c *Client) VerifyResponse(res *Response) error
- type Config
- type Error
- type GetEnterpriseInfoRequest
- type GetEnterpriseInfoResponse
- type GoodsItem
- type OpenBlueInvoiceRequest
- type OpenBlueInvoiceResponse
- type OpenRedInvoiceRequest
- type OpenRedInvoiceResponse
- type QueryInvoiceRequest
- type QueryInvoiceResponse
- type RegisterRequest
- type RegisterResponse
- type Request
- type Response
- type TerminalItem
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSignature = errors.New("invalid signature")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GenerateInvoiceReqSerialNo ¶
func (*Client) GenerateSerialNo ¶
GenerateSerialNo returns a serialNo specified in the API doc.
func (*Client) GetEnterpriseInfo ¶
func (c *Client) GetEnterpriseInfo( ctx context.Context, req *GetEnterpriseInfoRequest, ) (*GetEnterpriseInfoResponse, error)
func (*Client) OpenBlueInvoice ¶
func (c *Client) OpenBlueInvoice( ctx context.Context, req *OpenBlueInvoiceRequest, ) (*OpenBlueInvoiceResponse, error)
func (*Client) OpenRedInvoice ¶
func (c *Client) OpenRedInvoice( ctx context.Context, req *OpenRedInvoiceRequest, ) (*OpenRedInvoiceResponse, error)
func (*Client) PlatformCode ¶
func (*Client) PlatformName ¶
func (*Client) QueryInvoice ¶
func (c *Client) QueryInvoice( ctx context.Context, req *QueryInvoiceRequest, ) (*QueryInvoiceResponse, error)
func (*Client) Register ¶
func (c *Client) Register( ctx context.Context, req *RegisterRequest, ) (*RegisterResponse, error)
func (*Client) SignRequest ¶
SignRequest 对向票通发起的请求进行签名
func (*Client) SignResponse ¶
SignResponse 对返回给票通的响应进行签名
func (*Client) VerifyRequest ¶
VerifyRequest 验证票通请求签名
func (*Client) VerifyResponse ¶
VerifyResponse 验证票通响应签名
type GetEnterpriseInfoResponse ¶
type GetEnterpriseInfoResponse struct {
TaxpayerNum string `json:"taxpayerNum"`
EnterpriseName string `json:"enterpriseName"`
LegalPersonName string `json:"legalPersonName"`
ContactsName string `json:"contactsName"`
ContactsEmail string `json:"contactsEmail"`
ContactsPhone string `json:"contactsPhone"`
RegionCode string `json:"regionCode"`
CityName string `json:"cityName"`
EnterpriseAddress string `json:"enterpriseAddress"`
InvitationCode string `json:"invitationCode"`
ReviewStatus string `json:"reviewStatus"`
ReviewOpinion string `json:"reviewOpinion"`
TerminalType string `json:"terminalType"`
InvoiceKind string `json:"invoiceKind"`
InvoiceLayoutFileType string `json:"invoiceLayoutFileType"`
BlockchainInvSingleQuota string `json:"blockchainInvSingleQuota"`
BlockchainInvDailyQuota string `json:"blockchainInvDailyQuota"`
BlockchainInvMonthlyQuota string `json:"blockchainInvMonthlyQuota"`
ServiceStatus string `json:"serviceStatus"`
TerminalList []*TerminalItem `json:"terminalList"`
}
type GoodsItem ¶
type GoodsItem struct {
GoodsName string `json:"goodsName"`
TaxClassificationCode string `json:"taxClassificationCode"`
SpecificationModel string `json:"specificationModel,omitempty"`
MeteringUnit string `json:"meteringUnit,omitempty"`
Quantity string `json:"quantity,omitempty"`
IncludeTaxFlag string `json:"includeTaxFlag,omitempty"`
UnitPrice string `json:"unitPrice,omitempty"`
InvoiceAmount string `json:"invoiceAmount"`
TaxRateValue string `json:"taxRateValue"`
TaxRateAmount string `json:"taxRateAmount,omitempty"`
DiscountAmount string `json:"discountAmount,omitempty"`
DiscountTaxRateAmount string `json:"discountTaxRateAmount,omitempty"`
DeductionAmount string `json:"deductionAmount,omitempty"`
PreferentialPolicyFlag string `json:"preferentialPolicyFlag,omitempty"`
ZeroTaxFlag string `json:"zeroTaxFlag,omitempty"`
VatSpecialManage string `json:"vatSpecialManage,omitempty"`
}
type OpenBlueInvoiceRequest ¶
type OpenBlueInvoiceRequest struct {
TaxpayerNum string `json:"taxpayerNum"`
InvoiceReqSerialNo string `json:"invoiceReqSerialNo"`
BuyerName string `json:"buyerName"`
BuyerTaxpayerNum string `json:"buyerTaxpayerNum,omitempty"`
BuyerAddress string `json:"buyerAddress,omitempty"`
BuyerTel string `json:"buyerTel,omitempty"`
BuyerBankName string `json:"buyerBankName,omitempty"`
BuyerBankAccount string `json:"buyerBankAccount,omitempty"`
SellerAddress string `json:"sellerAddress,omitempty"`
SellerTel string `json:"sellerTel,omitempty"`
SellerBankName string `json:"sellerBankName,omitempty"`
SellerBankAccount string `json:"sellerBankAccount,omitempty"`
ItemName string `json:"itemName,omitempty"`
CasherName string `json:"casherName,omitempty"`
ReviewerName string `json:"reviewerName,omitempty"`
DrawerName string `json:"drawerName,omitempty"`
TakerName string `json:"takerName,omitempty"`
TakerTel string `json:"takerTel,omitempty"`
TakerEmail string `json:"takerEmail,omitempty"`
SpecialInvoiceKind string `json:"specialInvoiceKind,omitempty"`
Remark string `json:"remark,omitempty"`
DefinedData string `json:"definedData,omitempty"`
TradeNo string `json:"tradeNo,omitempty"`
ExtensionNum string `json:"extensionNum,omitempty"`
MachineCode string `json:"machineCode,omitempty"`
AgentInvoiceFlag string `json:"agentInvoiceFlag,omitempty"`
ShopNum string `json:"shopNum,omitempty"`
ItemList []*GoodsItem `json:"itemList"`
}
type OpenBlueInvoiceResponse ¶
type OpenRedInvoiceRequest ¶
type OpenRedInvoiceRequest struct {
TaxpayerNum string `json:"taxpayerNum"`
InvoiceReqSerialNo string `json:"invoiceReqSerialNo"`
InvoiceCode string `json:"invoiceCode"`
InvoiceNo string `json:"invoiceNo"`
RedReason string `json:"redReason"`
Amount string `json:"amount"`
DefinedData string `json:"definedData,omitempty"`
}
type OpenRedInvoiceResponse ¶
type QueryInvoiceRequest ¶
type QueryInvoiceResponse ¶
type QueryInvoiceResponse struct {
TaxpayerNum string `json:"taxpayerNum"`
InvoiceReqSerialNo string `json:"invoiceReqSerialNo"`
InvoiceType string `json:"invoiceType"`
Code string `json:"code"`
Msg string `json:"msg"`
TradeNo string `json:"tradeNo,omitempty"`
SecurityCode string `json:"securityCode,omitempty"`
QRCode string `json:"qrCode,omitempty"`
InvoiceCode string `json:"invoiceCode,omitempty"`
InvoiceNo string `json:"invoiceNo,omitempty"`
InvoiceDate string `json:"invoiceDate,omitempty"`
NoTaxAmount string `json:"noTaxAmount,omitempty"`
TaxAmount string `json:"taxAmount,omitempty"`
InvoiceLayoutFileType string `json:"invoiceLayoutFileType,omitempty"`
InvoicePdf string `json:"invoicePdf,omitempty"`
DownloadURL string `json:"downloadUrl,omitempty"` // base64 decoded
VatPlatformInvPreviewURL string `json:"vatPlatformInvPreviewUrl,omitempty"` // base64 decoded
ExtensionNum string `json:"extensionNum,omitempty"`
DiskNo string `json:"diskNo,omitempty"`
InvPreviewQrcodePath string `json:"invPreviewQrcodePath,omitempty"` // base64 decoded
InvPreviewQrcode string `json:"invPreviewQrcode,omitempty"` // base64 encoded
}
type RegisterRequest ¶
type RegisterRequest struct {
TaxpayerNum string `json:"taxpayerNum"`
EnterpriseName string `json:"enterpriseName"`
LegalPersonName string `json:"legalPersonName"`
ContactsName string `json:"contactsName"`
ContactsEmail string `json:"contactsEmail"`
ContactsPhone string `json:"contactsPhone"`
RegionCode string `json:"regionCode"`
CityName string `json:"cityName"`
EnterpriseAddress string `json:"enterpriseAddress"`
TaxRegistrationCertificate string `json:"taxRegistrationCertificate"`
TaxControlDeviceType string `json:"taxControlDeviceType"`
}
type RegisterResponse ¶
type Request ¶
type Request struct {
PlatformCode string `json:"platformCode"`
SignType string `json:"signType"`
Sign string `json:"sign"`
Format string `json:"format"`
Timestamp string `json:"timestamp"`
Version string `json:"version"`
SerialNo string `json:"serialNo"`
Content string `json:"content,omitempty"`
}
func (*Request) SignatureContent ¶
Click to show internal directories.
Click to hide internal directories.