Skip to content
This repository has been archived by the owner on Sep 16, 2018. It is now read-only.
/ go-iap Public archive

A golang (go) implementation for verifying In App Purchases (IAP) via apple.

License

Notifications You must be signed in to change notification settings

Pallinder/go-iap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-iap

No longer maintained.

If you wish to take this over please contact me.

A go implementation for verifying In App Purchases via apple.

Documentation

http://godoc.org/github.com/Pallinder/go-iap

Usage

package main

import (
	"fmt"
	"github.com/Pallinder/go-iap"
	"log"
)

func main() {
	receipt, err := goiap.VerifyReceipt("receipt",true) // Uses the sandbox environment

	if err != nil {
	  log.Fatal(err)
	}
	
	fmt.Println("Got receipt", receipt)
}

Or even

package main

import (
	"fmt"
	"github.com/Pallinder/go-iap"
	"log"
)

func main() {
	receipt, err := goiap.VerifyReceipt("receipt",false)

	goiapErr, ok := err.(goiap.ErrorWithCode)

	if ok && goiapErr.Code() == goiap.SandboxReceiptOnProd {
		receipt, err = goiap.VerifyReceipt("receipt", true)
	}

	if err != nil {
	  log.Fatal(err)
	}

	fmt.Println("Got receipt", receipt)
}

About

A golang (go) implementation for verifying In App Purchases (IAP) via apple.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages