iap - GStones/moke-kit GitHub Wiki
本文档介绍了moke-kit提供的IAP组件的使用方法。
go-iap verifies the purchase receipt via AppStore, GooglePlayStore or Amazon AppStore.
-
在
Main
中初始化 IAPModulefxmain.Main( ..., module.IAPModule, )
-
设置相关环境变量参数
-
在需要的
ParamsObject
中注入ClientsParams ,就可以使用下面的接口。var MyService = fx.Provide( func( ..., iapParams iapfx.ClientsParams, ) (out sfx.GrpcServiceResult, err error) { if iapParams.AppleClient == nil { err = fmt.Errorf("apple client not found") } if iapParams.GoogleClient == nil { err = fmt.Errorf("google client not found") } })