leiting.subscribe
简介
组件接口
类
LtSubscribeNotify
继承自 LtNotify
订阅通知
成员变量
变量名 | 类型 | 初始值 | 须初始化 | 描述 |
---|---|---|---|---|
gameOrderNo | string | nil | 可选 | 游戏订单号,只有首次订阅(0)、取消订阅(1)、恢复订阅(3)会返回 |
thirdNo | string | nil | 可选 | 第三方订单号 |
money | int | 0 | 可选 | 金额(分),游戏需要将此字段与游戏订单中的金额做校验,否则会被盗刷!!! |
currency | string | nil | 可选 | 币种 |
productId | string | nil | 可选 | 游戏拉起充值时传入的商品id,游戏需要将此字段与游戏订单中的商品id做校验,否则会被盗刷!!! |
channelNo | string | nil | 可选 | 渠道编号,游戏需要将此字段与游戏订单中的渠道编号做校验,否则会被盗刷!!! |
userId | string | nil | 可选 | 手游账号ID,游戏需要将此字段与游戏订单中的userId做校验,否则会被盗刷!!! |
notificationType | int | -1 | 可选 | 通知类型,详见通知类型 |
lastGameOrderNo | string | nil | 可选 | 上次续期的游戏订单号,首次订阅(0)、取消订阅(1)、恢复订阅(3)时的lastGameOrderNo与gameOrderNo相同 |
effectiveDate | int | 0 | 可选 | 生效时间(UTC时间戳,以毫秒为单位) |
expirationDate | int | 0 | 可选 | 失效时间(UTC时间戳,以毫秒为单位) |
成员方法
函数原型 | 函数作用 |
---|---|
bool is_user_first_subscribe_notification() | 是不是用户首次订阅通知 |
bool is_user_cancel_notification() | 是不是用户取消订阅通知 |
bool is_user_renew_notification() | 是不是用户过期订阅续订通知 |
bool is_user_restore_notification() | 是不是用户恢复取消的订阅通知 |
bool is_user_resume_notification() | 是不是用户正常续期的订阅通知 |
bool is_user_content_change_notification() | 是不是用户订阅内容变更通知 |
string gen_sign_text(string key) | 生成待签名文本 |
LtResult new_result() | 生成订阅通知处理结果 |
LtSubscribeNotifyResult
继承自 LtResult
订阅通知处理结果
成员变量
变量名 | 类型 | 初始值 | 须初始化 | 描述 |
---|
成员方法
函数原型 | 函数作用 |
---|---|
void succeed() | 设置订阅通知处理结果为成功 无 |
void fail(int status, string message = nil) | 设置订阅通知处理结果为失败 |
void set_game_order_no(string order_no) | 设置游戏订单号 |