Added badges and modifies usage

This commit is contained in:
tsuji_jumpei
2014-12-05 02:39:48 +09:00
parent 5bfb97f88e
commit 130d668729

View File

@@ -1,12 +1,21 @@
go-iap go-iap
====== ======
go-iap verifies the purchase receipt via AppStore or GooglePlayStore [![Build Status](https://travis-ci.org/dogenzaka/go-iap.svg?branch=master)](https://travis-ci.org/dogenzaka/go-iap)
[![codecov.io](https://codecov.io/github/dogenzaka/go-iap/coverage.svg?branch=master)](https://codecov.io/github/dogenzaka/go-iap?branch=master)
go-iap verifies the purchase receipt via AppStore or GooglePlayStore.
Current API Documents:
* AppStore: [![GoDoc](https://godoc.org/github.com/dogenzaka/go-iap/appstore?status.svg)](https://godoc.org/github.com/dogenzaka/go-iap/appstore)
* GooglePlay: [![GoDoc](https://godoc.org/github.com/dogenzaka/go-iap/playstore?status.svg)](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.