go-iap verifies the purchase receipt via AppStore or GooglePlayStore.
Current API Documents:
go get github.com/dogenzaka/go-iap/appstore
go get github.com/dogenzaka/go-iap/playstore
import(
"github.com/dogenzaka/go-iap/appstore"
)
func main() {
client := appstore.New()
req := appstore.IAPRequest{
ReceiptData: "your receipt data encoded by base64",
}
resp, err := client.Verify(&req)
}
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")
}
- Validator for In App Purchase Receipt (AppStore)
- Validator for Subscription token (GooglePlay)
- Validator for Purchase Product token (GooglePlay)
- More Tests
This validator supports the receipt type for iOS7 or above.
This validator uses Version 3 API.
go-iap is licensed under the MIT.