forked from Mirrors/go-iap
Add support for HMS
This commit is contained in:
22
README.md
22
README.md
@@ -12,6 +12,7 @@ Current API Documents:
|
||||
* AppStore: [](https://godoc.org/github.com/awa/go-iap/appstore)
|
||||
* GooglePlay: [](https://godoc.org/github.com/awa/go-iap/playstore)
|
||||
* Amazon AppStore: [](https://godoc.org/github.com/awa/go-iap/amazon)
|
||||
* Huawei HMS: [](https://godoc.org/github.com/awa/go-iap/hms)
|
||||
|
||||
|
||||
# Installation
|
||||
@@ -19,6 +20,7 @@ Current API Documents:
|
||||
go get github.com/awa/go-iap/appstore
|
||||
go get github.com/awa/go-iap/playstore
|
||||
go get github.com/awa/go-iap/amazon
|
||||
go get github.com/awa/go-iap/hms
|
||||
```
|
||||
|
||||
|
||||
@@ -78,6 +80,23 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
### In App Purchase (via Huawei Mobile Services)
|
||||
|
||||
```
|
||||
import(
|
||||
"github.com/awa/go-iap/hms"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// If "orderSiteURL" and/or "subscriptionSiteURL" are empty,
|
||||
// they will be default to AppTouch German.
|
||||
// Please refer to https://developer.huawei.com/consumer/en/doc/HMSCore-References-V5/api-common-statement-0000001050986127-V5 for details.
|
||||
client := hms.New("clientID", "clientSecret", "orderSiteURL", "subscriptionSiteURL")
|
||||
ctx := context.Background()
|
||||
resp, err := client.VerifySubscription(ctx, "purchaseToken", "subscriptionID", 1)
|
||||
}
|
||||
```
|
||||
|
||||
# ToDo
|
||||
- [x] Validator for In App Purchase Receipt (AppStore)
|
||||
- [x] Validator for Subscription token (GooglePlay)
|
||||
@@ -96,6 +115,9 @@ This validator uses [Version 3 API](http://developer.android.com/google/play/bil
|
||||
### In App Purchase (Amazon)
|
||||
This validator uses [RVS for IAP v2.0](https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/verifying-receipts-in-iap-2.0).
|
||||
|
||||
### In App Purchase (HMS)
|
||||
This validator uses [Version 2 API](https://developer.huawei.com/consumer/en/doc/HMSCore-References-V5/api-common-statement-0000001050986127-V5).
|
||||
|
||||
|
||||
# License
|
||||
go-iap is licensed under the MIT.
|
||||
|
||||
Reference in New Issue
Block a user