类
IAPurchaseListener.QueryResponse
public class QueryResponse
{
public string order_id { get; set; }
public string purchase_id { get; set; }
public string status { get; set; }//the value of status is "created" or "processing" or "success" or "failure" or "expired"
public string price { get; set; }
public string currency { get; set; }
public long paid_timestamp { get; set; }
}
| 参数 | 类型 | 描述 |
| order_id | string |
客户端生成的唯一订单 ID。如果为空,则显示
purchase_id
|
| purchase_id | string | 购买 ID |
| status | string |
购买状态。可能的值包括:
created
,
processing
,
success
,
failure
和
expired
。
|
| price | string | 总价 |
| currency | string | 货币代码 |
| paid_timestamp | long | 付款时间(Unix 时间) |
此类在查询单个项目时储存
OnQuerySuccess()
回调和
Query()
函数的购买信息。
IAPurchaseListener.QueryListResponse
public class QueryListResponse
{
public int total { get; set; }
public int from { get; set; }
public int to { get; set; }
public List<QueryResponse2> purchaseList;
}
| 参数 | 类型 | 描述 |
| total | int | 条目总数,从 1 开始。 |
| from | int | [未使用] 查询开始范围,默认为 1 。 |
| to | int |
[未使用] 查询结束范围,默认为
== total
。
|
| purchaseList | List< QueryResponse2 > |
此类在查询最终用户购买的完整列表时储存
OnQuerySuccess()
回调和
Query()
函数的购买数据。购买将以
QueryResponse2
类型的列表形式返回。
IAPurchaseListener.QueryResponse2
public class QueryResponse2
{
public string order_id { get; set; }
public string app_id { get; set; }
public string purchase_id { get; set; }
public string user_data { get; set; }
public string price { get; set; }
public string currency { get; set; }
public long paid_timestamp { get; set; }
}
| 参数 | 类型 | 描述 |
| order_id | string |
客户端生成的唯一订单 ID。如果为空,则显示
purchase_id
|
| purchase_id | string | 购买 ID |
| user_data | string |
Request()
提供的项目名称
|
| price | string | 总价 |
| currency | string | 货币代码 |
| paid_timestamp | long | 付款时间(Unix 时间) |
此类将
QueryList()
类的购买信息储存为大列表的一部分。
IAPurchaseListener.Subscription
public class Subscription
{
public string app_id { get; set; }
public string order_id { get; set; }
public string subscription_id { get; set; }
public string price { get; set; }
public string currency { get; set; }
public long subscribed_timestamp { get; set; }
public TimePeriod free_trial_period { get; set; }
public TimePeriod charge_period { get; set; }
public int number_of_charge_period { get; set; }
public string plan_id { get; set; }
public string plan_name { get; set; }
//the value of status is "created" or "processing" or "failure" or "expired" or "ACTIVE" or "NON_RENEWING" or "CANCELED"
public string status { get; set; }
public StatusDetail status_detail { get; set; }
}
| 参数 | 类型 | 描述 |
| app_id | string | VIVEPORT 开发者控制台中的应用程序 ID |
| order_id | string | 唯一的购买 ID,可用于查询或取消 |
| subscription_id | string | 特定订阅的 ID |
| price | string |
用户货币价格,字符串格式为
"1.50"
|
| currency | string | 请参阅货币列表 |
| subscribed_timestamp | long | 最终用户订阅的时间 |
| free_trial_period | TimePeriod | 免费试用期。试用期长度固定不变,不会随试用过程开始而递减 |
| charge_period | TimePeriod |
订阅的收费单位,例如
“month”
或
“day”
|
| number_of_charge_period | int | 收费期数 |
| plan_id | string | 开发者设置的计划 ID |
| plan_name | string | 开发者设置的计划名称 |
| status | string | 开发者设置的状态字符串 |
| status_detail | StatusDetail | 付款历史记录的信息 |
此类储存与订阅相关的函数数据。
Subscription
通常作为返回订阅列表的函数的数组返回。
请为收费期指定“月”或“日”。收费期数表示在订阅期间该单位的数量。例如:
charge_period.timetype ==
“month”
,
charge_period.value ==
1
,
number_of_charge_period ==
12
的结果为按月计费的订阅期限为一年。
IAPurchaseListener.StatusDetail
public class StatusDetail
{
public long date_next_charge { get; set; }
public StatusDetailTransaction[] transactions { get; set; }
public string cancel_reason { get; set; }
}
| 参数 | 类型 | 描述 |
| date_next_charge | long | 下一账单日 |
| transactions | StatusDetailTransaction [] | |
| cancel_reason | string | 取消的原因,请参见下文 |
此类储存有关
Subscription
类交易的数据。
cancel_reason
的可能值
| 值 | 描述 |
| CANCEL | 最终用户已取消 |
| OUT_OF_PERIOD | 订阅已过期 |
| PAYMENT_FAIL | 付款重试次数过多 |
IAPurchaseListener.StatusDetailTransaction
public class StatusDetailTransaction
{
public long create_time { get; set; }
public string payment_method { get; set; }
public string status { get; set; }
//paymentFailed/pendingWebhook/finish
}
| 参数 | 类型 | 描述 |
| create_time | long | 订购时间(Unix 时间) |
| payment_method | string | 支付方式 |
| status | string |
当前状态,可能的值包括:
paymentFailed
,
pendingWebhook
或
finish
。
|
此类储存与
Subscription
类的支付方式有关的函数数据。
IAPurchaseListener.TimePeriod
public class TimePeriod
{
public string time_type { get; set; }
public int value { get; set; }
}
| 参数 | 类型 | 描述 |
| time_type | string |
"month"
或
"day"
|
| value | int |
TimePeriod
中的
time_type
数量
|
此类储存有关
Subscription
类的付款和订阅时间长度的信息。例如,每六个月收费一次的订阅的
time_type
可能为
“month”
,
value
为
6
。