类 PaymentController
- java.lang.Object
-
- org.elastos.hive.subscription.payment.PaymentController
-
public class PaymentController extends java.lang.ObjectThe payment controller is the wrapper class for accessing the payment module.
-
-
构造器概要
构造器 构造器 说明 PaymentController(NodeRPCConnection connection)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 OrdergetBackupOrder(int orderId)Get the order information of the backup by the order id.java.util.List<Order>getOrders(java.lang.String subscription)Get the orders by the subscription type.ReceiptgetReceipt(int orderId)Get the receipt by the order id.java.util.List<Receipt>getReceipts()Get the receipts belongs to the current user.OrdergetVaultOrder(int orderId)Get the order information of the vault by the order id.java.lang.StringgetVersion()Get the version of the payment module.OrderplaceOrder(java.lang.String subscription, java.lang.String pricingName)This is for creating the payment order which upgrades the pricing plan of the vault or the backup.ReceiptsettleOrder(int orderId)Pay the order by the order id and the transaction id.
-
-
-
构造器详细资料
-
PaymentController
public PaymentController(NodeRPCConnection connection)
-
-
方法详细资料
-
placeOrder
public Order placeOrder(java.lang.String subscription, java.lang.String pricingName) throws HiveException
This is for creating the payment order which upgrades the pricing plan of the vault or the backup.- 参数:
subscription- The value is "vault" or "backup".pricingName- The pricing plan name.- 返回:
- The details of the order.
- 抛出:
HiveException- The error comes from the hive node.
-
settleOrder
public Receipt settleOrder(int orderId) throws HiveException
Pay the order by the order id and the transaction id.- 参数:
orderId- The order id of payment contract- 返回:
- The order which is the proof of the payment of the order for the user.
- 抛出:
HiveException- The error comes from the hive node.
-
getVaultOrder
public Order getVaultOrder(int orderId) throws HiveException
Get the order information of the vault by the order id.- 参数:
orderId- of payment contract- 返回:
- The details of the order.
- 抛出:
HiveException- The error comes from the hive node.
-
getBackupOrder
public Order getBackupOrder(int orderId) throws HiveException
Get the order information of the backup by the order id.- 参数:
orderId- of payment contract- 返回:
- The details of the order.
- 抛出:
HiveException- The error comes from the hive node.
-
getOrders
public java.util.List<Order> getOrders(java.lang.String subscription) throws HiveException
Get the orders by the subscription type.- 参数:
subscription- The value is "vault" or "backup".- 返回:
- The order list, MUST not empty.
- 抛出:
HiveException- The error comes from the hive node.
-
getReceipt
public Receipt getReceipt(int orderId) throws HiveException
Get the receipt by the order id.- 参数:
orderId- The order id.- 返回:
- The details of the receipt.
- 抛出:
HiveException- The error comes from the hive node.
-
getReceipts
public java.util.List<Receipt> getReceipts() throws HiveException
Get the receipts belongs to the current user.- 返回:
- The details of the receipt.
- 抛出:
HiveException- The error comes from the hive node.
-
getVersion
public java.lang.String getVersion() throws HiveExceptionGet the version of the payment module.- 返回:
- The version.
- 抛出:
HiveException- The error comes from the hive node.
-
-