使用优惠券
消费已发放的优惠券信息。
调用信息
public void Use (string code, PlayNANOODelegate callback) {}
调用详细信息
| 参数 | 说明 | 类型 |
|---|---|---|
| code | 优惠券代码 | string |
| callback | 通信结果 | PlayNANOODelegate |
源代码
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
plugin.CouponManagerV20240301.Use("COUPON_CODE", (status, error, jsonString, values) =>
{
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
foreach (PlayNANOO.Coupon.v20240301.ItemValueModel item in (PlayNANOO.Coupon.v20240301.ItemValueModel[])values["Items"])
{
Debug.Log(item.item_code);
Debug.Log(item.item_count);
}
}
else
{
Debug.Log("Fail");
}
});
}
}
通信结果
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"Items" : [
{
"item_code": "itemcode",
"item_count": 0
}
]
}
通信结果详细信息
| 数据键 | 说明 | 类型 |
|---|---|---|
| Items.item_code | 物品代码 | string |
| Items.item_count | 物品数量 | integer |