oppo

package
v1.3.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginUrl         = "https://iopen.game.oppomobile.com/sdkopen/user/fileIdInfo?fileId=%s&token=%s"
	LocationShanghai = "Asia/Shanghai"

	RSA  = "RSA"
	RSA2 = "RSA2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginResType added in v1.2.37

type LoginResType struct {
	ResultCode string `json:"resultCode" dc:"响应码,成功为 200"`
	ResultMsg  string `json:"resultMsg" dc:"响应信息"`
	LoginToken string `json:"loginToken" dc:"透传的token"`
	Ssoid      string `json:"ssoid" dc:"透传的ssoid"`
	//AppKey       string `json:"appKey" dc:"秘钥key,因隐私安全规范,该字段目前已不返回信息"`
	UserName string `json:"userName" dc:"用户ssoid绑定的账户昵称"`
	//Email        string `json:"email" dc:"因隐私安全规范,该字段目前已不返回信息"`
	//MobileNumber string `json:"mobileNumber" dc:"因隐私安全规范,该字段目前已不返回信息"`
	//CreateTime   string `json:"createTime" dc:"因隐私安全规范,该字段目前已不返回信息"`
	UserStatus string `json:"userStatus" dc:"用户状态:NORMAL 表示正常"`
}

登录回复

type LoginType added in v1.2.37

type LoginType struct {
	Token   string `json:"token"`
	Ssoid   string `json:"ssoid"`
	Channel int    `json:"channel"`
	AdId    string `json:"adId"`
}

oppo参数类型

type OppoType

type OppoType struct {
	AppId     string `json:"app_id"`
	AppKey    string `json:"app_key"`
	AppSecret string `json:"app_secret"`
	PublicKey string `json:"public_key"`
}

func New

func New(cfg *OppoType) *OppoType

func (*OppoType) FileIdInfo added in v1.2.37

func (p *OppoType) FileIdInfo(ctx context.Context, oauthToken string, ssoid string) (res *LoginResType, err error)

func (*OppoType) GenLoginBaseStr added in v1.2.40

func (p *OppoType) GenLoginBaseStr(bm map[string]interface{}, appKey, appSecret string) (string, string)

func (*OppoType) GenOauthSignature added in v1.2.37

func (p *OppoType) GenOauthSignature(param string) string

生成签名

func (*OppoType) GenParam added in v1.2.37

func (p *OppoType) GenParam(oauthToken, oauthTimestamp, oauthNonce string) string

func (*OppoType) GetHeader added in v1.2.37

func (p *OppoType) GetHeader(oauthToken string) (headers map[string]string)

func (*OppoType) ParseNotifyByURLValues added in v1.2.40

func (p *OppoType) ParseNotifyByURLValues(value url.Values) (bm map[string]interface{}, err error)

func (*OppoType) ParseNotifyToBodyMap added in v1.2.40

func (p *OppoType) ParseNotifyToBodyMap(req *http.Request) (bm map[string]interface{}, err error)

func (*OppoType) Verify

func (p *OppoType) Verify(ctx context.Context) (err error)

func (*OppoType) VerifySign added in v1.2.40

func (p *OppoType) VerifySign(oppoPayPublicKey string, bm map[string]interface{}) (err error)

type PayCallback

type PayCallback struct {
	NotifyId     string `json:"notifyId" dc:"回调通知单号,以GC开头,必填,示例:GC20230314657000"`
	PartnerOrder string `json:"partnerOrder" dc:"开发者订单号,必填,示例:123456"`
	ProductName  string `json:"productName" dc:"商品名称,必填,示例:10元宝"`
	ProductDesc  string `json:"productDesc" dc:"商品描述,必填,示例:10元宝等于1元"`
	Price        int64  `json:"price" dc:"商品价格,单位为分,需要游戏服务端做验证,必填,示例:100"`
	Count        int    `json:"count" dc:"商品数量(一般为1),必填,示例:1"`
	Attach       string `json:"attach" dc:"请求支付时上传的附加参数,可能为空,选填"`
	Sign         string `json:"sign" dc:"OPPO服务端签名,需要游戏服务端做验证,必填"`
}

OPPO支付回调参数结构体

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL