payment

Payment模块管理支付功能,用于提供网页安全支付能力,支持通过Web接口进行支付操作。通过plus.payment可获取支付管理对象。

方法:

对象:

回调方法:

权限:

permissions

{
// ...
"permissions":{
	// ...
	"Payment": {
		"description": "支付"
	}
}
}
			

PaymentChannel

支付通道对象

interface plus.payment.PaymentChannel{
	attribute String id;
	attribute String description;
	attribute Boolean serviceReady;
	function void installService();
	
	// iOS iAP
	function void requestOrder(ids, successCB, errorCB);
	function void restoreComplateRequest(options, successCB);
}
				

说明:

PaymentChannel对象表示特定的支付通道,用于向系统请求支付操作。

属性:

方法:

OrderStatementIAP

IAP订单数据对象

interface plus.payment.OrderStatementIAP {
	attribute String productid;
	attribute String username;
	attribute String quantity;
}
				

说明:

描述IAP商品订单信息,如标识、数量等。

属性:

PaymentResult

支付操作结果对象

interface plus.payment.PaymentResult {
	attribute PaymentChannel channel;
	attribute String tradeno;
	attribute String description;
	attribute String url;
	attribute String signature;
	attribute String rawdata;
}
				

说明:

PaymentResult对象表示支付操作返回结果,用于确认支付操作成功。

属性:

IAPProduct

IAP商品对象

interface plus.payment.IAPProduct {
	attribute String productid;
	attribute String price;
	attribute String title;
	attribute String description;
}
				

说明:

描述IAP商品详细信息,如标识、价格、标题、描述信息等。

属性:

IAPProductInfo

购买IAP商品对象

interface plus.payment.IAPProductInfo {
	attribute String productIdentifier;
	attribute String quantity;
}
				

说明:

描述购买的IAP商品详细信息,如标识、数量等。

属性:

IAPTransaction

购买IAP商品交易信息对象

interface plus.payment.IAPTransaction {
    attribute IAPProductInfo payment;
    attribute String transactionDate;
    attribute String transactionIdentifier;
    attribute String transactionReceipt;
    attribute String transactionState;
}
				

说明:

描述购买的IAP商品交易详细信息,如购买商品信息、交易日期、订单标识等。

属性:

ChannelsSuccessCallback

获取支付通道成功回调

void ChannelsSuccessCallback( channels ) {
	// Get payment channels success code
}
				

说明:

当获取支付通道列表成功时的回调函数,用于返回终端支持的支付通道列表。

参数:

返回值:

void : 无

IapRequestOrderSuccessCallback

请求支付商品列表回调方法

void onsuccess( results ) {
	// Payment success code
}
				

说明:

获取IAP商品列表信息成功时的回调函数,返回商品详细信息。

参数:

返回值:

void : 无

IapRestoreComplateRequestCallback

请求已经购买的非消耗性商品和订阅商品回调方法

void onsuccess( results ) {
	// Payment success code
}
				

说明:

获取IAP商品列表信息成功时的回调函数,返回商品详细信息。

参数:

返回值:

void : 无

PaymentSuccessCallback

支付操作成功回调

void PaymentSuccessCallback ( result ) {
	// Payment success code
}
				

说明:

当支付操作成功时的回调函数,用于返回支付操作的成功信息。

参数:

返回值:

void : 无

PaymentErrorCallback

支付操作失败回调

void PaymentErrorCallback(error){
	// Payment error code
}
				

说明:

当支付操作失败时的回调函数,用于返回支付操作失败的错误信息。

参数:

返回值:

void : 无