forked from Mirrors/go-iap
Added badges and modifies usage
This commit is contained in:
52
README.md
52
README.md
@@ -1,12 +1,21 @@
|
|||||||
go-iap
|
go-iap
|
||||||
======
|
======
|
||||||
|
|
||||||
go-iap verifies the purchase receipt via AppStore or GooglePlayStore
|
[](https://travis-ci.org/dogenzaka/go-iap)
|
||||||
|
[](https://codecov.io/github/dogenzaka/go-iap?branch=master)
|
||||||
|
|
||||||
|
go-iap verifies the purchase receipt via AppStore or GooglePlayStore.
|
||||||
|
|
||||||
|
Current API Documents:
|
||||||
|
|
||||||
|
* AppStore: [](https://godoc.org/github.com/dogenzaka/go-iap/appstore)
|
||||||
|
* GooglePlay: [](https://godoc.org/github.com/dogenzaka/go-iap/playstore)
|
||||||
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
```
|
```
|
||||||
go get github.com/dogenzaka/go-iap
|
go get github.com/dogenzaka/go-iap/appstore
|
||||||
|
go get github.com/dogenzaka/go-iap/playstore
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +25,7 @@ go get github.com/dogenzaka/go-iap
|
|||||||
|
|
||||||
```
|
```
|
||||||
import(
|
import(
|
||||||
"github.com/dogenzaka/go-iap/appstore"
|
"github.com/dogenzaka/go-iap/appstore"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -28,14 +37,43 @@ func main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### In App Billing (via GooglePlay)
|
||||||
|
|
||||||
|
```
|
||||||
|
import(
|
||||||
|
"code.google.com/p/goauth2/oauth"
|
||||||
|
|
||||||
|
"github.com/dogenzaka/go-iap/playstore"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// You need to prepare an authorization code or a refresh token
|
||||||
|
// If you have a refresh token, you can generate an oauth token like this
|
||||||
|
oauth := &oauth.Token{
|
||||||
|
RefreshToken: "your refresh token",
|
||||||
|
}
|
||||||
|
|
||||||
|
client := playstore.New(oauth)
|
||||||
|
resp, err := client.VerifySubscription("package", "subscriptionID", "purchaseToken")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
# ToDo
|
# ToDo
|
||||||
- [x] App Store Client
|
- [x] Validator for In App Purchase Receipt (AppStore)
|
||||||
- [ ] Google Play Store Client
|
- [x] Validator for Subscription token (GooglePlay)
|
||||||
|
- [ ] Validator for Purchase Product token (GooglePlay)
|
||||||
|
- [ ] More Tests
|
||||||
|
|
||||||
|
|
||||||
# Support
|
# Support
|
||||||
iOS7 or above
|
|
||||||
|
### In App Purchase
|
||||||
|
This validator supports the receipt type for iOS7 or above.
|
||||||
|
|
||||||
|
### In App Billing
|
||||||
|
This validator uses [Version 3 API](http://developer.android.com/google/play/billing/api.html).
|
||||||
|
|
||||||
|
|
||||||
# License
|
# License
|
||||||
Gorv is licensed under the MIT.
|
go-iap is licensed under the MIT.
|
||||||
|
|||||||
Reference in New Issue
Block a user