Documentation ¶
Index ¶
- Constants
- func Base64RawStdDecode(s string) string
- func Base64RawStdEncode(s string) string
- func LoadCertificate(key string) (*x509.Certificate, error)
- type Client
- func (c *Client) Check(purchaseToken, purchaseOrderID string) (err error)
- func (c *Client) GetToken(body any) (s string, err error)
- func (c *Client) Hash(body any) (s string, err error)
- func (c *Client) QueryOrder(purchaseToken, purchaseOrderID string) (r *Response, err error)
- func (c *Client) Verify(token string) (err error)
- type Header
- type Payload
- type Response
Constants ¶
View Source
const ( Server = "https://iap.cloud.huawei.com" QueryOrder = Server + "/order/harmony/v1/application/order/status/query" )
Variables ¶
This section is empty.
Functions ¶
func Base64RawStdDecode ¶ added in v1.1.3
func Base64RawStdEncode ¶ added in v1.1.3
func LoadCertificate ¶ added in v1.1.3
func LoadCertificate(key string) (*x509.Certificate, error)
Types ¶
type Client ¶
type Client struct { PrivateKey string `json:"private_key"` KeyID string `json:"key_id"` IssuerID string `json:"issuer_id"` AppID string `json:"app_id"` Header *Header Payload *Payload // contains filtered or unexported fields }
func (*Client) QueryOrder ¶
type Payload ¶ added in v1.1.3
type Payload struct { PurchaseOrderId string `json:"purchaseOrderId"` PurchaseToken string `json:"purchaseToken"` ApplicationId string `json:"applicationId"` ProductId string `json:"productId"` PurchaseTime int64 `json:"purchaseTime"` ProductType string `json:"productType"` DeveloperPayload string `json:"developerPayload"` SignedTime int64 `json:"signedTime"` Environment string `json:"environment"` CountryCode string `json:"countryCode"` Price int `json:"price"` Currency string `json:"currency"` FinishStatus string `json:"finishStatus"` NeedFinish bool `json:"needFinish"` }
func GetPayload ¶ added in v1.1.3
Click to show internal directories.
Click to hide internal directories.