adityanatraj / iaplocal

Go library that support Apple Local In-App Purchase (IAP) receipt processing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoDoc Build Status

Description

iaplocal is a Go library that supports Apple Local In-App Purchase (IAP) receipt processing.

  • Verify the receipt signature against App Root CA certificate.
  • Parse the receipt from binary, extract in-app receipts.
  • Validate the receipts hash with host GUID.

Installation

go install github.com/googollee/iaplocal

Usage

The simplest possible usage is:

rootBytes, _ := ioutil.ReadFile("./AppleComputerRootCertificate.cer")
rootCA, _ := x509.ParseCertificate(rootBytes)

receiptB64, _ := ioutil.ReadFile("./receipt_b64")
receiptBytes, _ := base64.StdEncoding.DecodeString(string(receiptB64))
receipt, _ := iaplocal.Parse(rootCA, receiptBytes)

guid, _ := uuid.FromString(hostGUID)
receipt.Verify(guid)

License

See LICENSE.

About

Go library that support Apple Local In-App Purchase (IAP) receipt processing.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%