Skip to content
/ go-iap Public
forked from awa/go-iap

go-iap verifies the purchase receipt via AppStore or GooglePlayStore

License

Notifications You must be signed in to change notification settings

suzujun/go-iap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-iap

Build Status codecov.io

go-iap verifies the purchase receipt via AppStore or GooglePlayStore.

Current API Documents:

  • AppStore: GoDoc
  • GooglePlay: GoDoc

Installation

go get github.com/dogenzaka/go-iap/appstore
go get github.com/dogenzaka/go-iap/playstore

Quick Start

In App Purchase (via App Store)

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)
}

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

  • Validator for In App Purchase Receipt (AppStore)
  • Validator for Subscription token (GooglePlay)
  • Validator for Purchase Product token (GooglePlay)
  • More Tests

Support

In App Purchase

This validator supports the receipt type for iOS7 or above.

In App Billing

This validator uses Version 3 API.

License

go-iap is licensed under the MIT.

About

go-iap verifies the purchase receipt via AppStore or GooglePlayStore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.5%
  • Makefile 2.5%