huawei-iap verifies the purchase receipt via Huawei Store
Current API Documents: https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/api-summary-desc-0000001063744095
go get github.com/gokhanm/huawei-iap
import (
hms "github.com/gokhanm/huawei-iap"
)
func main() {
client := hms.New()
req := hms.IAPRequest{
PurchaseToken: token,
SubscriptionID: subscriptionID,
ClientID: clientID,
ClientSecret: clientSecret,
}
purchaseData, err := client.VerifySubscription(context.TODO(), req)
}
import (
"fmt"
hms "github.com/gokhanm/huawei-iap"
)
func main() {
if err := hms.VerifySignature("receipt", "signature", "publicKey"); err != nil {
fmt.Printf("huawei verify signature error. error: %v", err)
}
}