Инструменты пользователя

Инструменты сайта


v6.restore.inapp

Check list of purchase (restore product)

$server/api/rp?id=1&token=12345678901234567890123456789012

Post params

type tBuyInput struct {
	OSint         models.TOs
	Bundle        string
	BundleVer     string
	GAID          string
	GaidType      models.TGAIDType
	ProductType   TProductType
	Data          (json).TInputList
}

type TInputList []TInput

type TInput struct {
	ProductId     string
	PurchaseToken string
}

TProductType enum
const (
	Consumable TProductType = iota
	Non_consumable
	Subscription
)

Response

type TRestoryOutput struct {
	Data        []TPurchase  `json:"Data"`
	Err         string       `json:"E"`
	ProductType TProductType `json:"prt"`
}

type TPurchase struct {
	ProductId        string                    `json:"pid"`
	Quantity         int64                     `json:"q"`
	PurchaseState    models.TYovoPurchaseState `json:"ps"` //-> 1 subscription valid
	Acknowledged     int64                     `json:"a"`
	OrderId          string                    `json:"o"`
	PurchaseToken    string                    `json:"pt"`
	PurchaseTime     string                    `json:"t"`
	ConsumptionState int64                     `json:"cs"`
	PurchaseType     TPurchaseType             `json:"pty"`
	DeveloperPayload string                    `json:"dp"`
	ProductType      TProductType              `json:"prt"`
	ExpiryTimeMillis int64                     `json:"et"`
	Err              string                    `json:"E"`
	kind             string
}


TYovoPurchaseState enum
const (
	PS_UNKNOWN   =  -1
	PS_PURCHASED =   0
	PS_CANCELED  =   1
	PS_PENDING   =   2
	PS_REFUNDED  =   3
)

TPurchaseType enum
const (
	PTTest TPurchaseType = iota
	PTPromo
	PTRewarded
)

Not ok Response

Data

{"Error":"some error"}
v6.restore.inapp.txt · Последние изменения: 2022/06/10 14:07 — serg