Commit db06b8d9 by TingSong-Syu

declare PayCenter methods.

parent a1e73bae
......@@ -10,7 +10,7 @@
}
],
"require": {
"x2ts/x2ts-rpc": "^2.1"
"x2ts/x2ts-rpc": "^2.1.1"
},
"autoload": {
"psr-4": {
......
......@@ -9,7 +9,55 @@
namespace neoteched\rpc;
use neoteched\rpc\pay_center\Feature;
use neoteched\rpc\pay_center\Order;
use neoteched\rpc\pay_center\Product;
use neoteched\rpc\pay_center\Purpose;
use x2ts\ComponentFactory as X;
use x2ts\rpc\RPCException;
use x2ts\rpc\RPCWrapper;
/**
* Class PayCenter
*
* @package neoteched\rpc
*
* @method Product addProduct(Product $product)
* @method Product editProduct(Product $product)
* @method bool hasProduct(string $name)
* @method bool removeProduct(string $name)
* @method Product fetchProductByName(string $name)
* @method Product[] fetchProductsByNames(string [] $names)
* @method Order buy(Purpose $purpose)
* @method Order revoke(int $orderId)
* @method string fetchWxPayQR(int $orderId, string $clientIp)
* @method string fetchAlipayLink(int $orderId, string $returnUrl)
* @method Order[] fetchOrdersByUser(int $userId, string $condition = '', array $params = [])
* @method Order[] fetchOrdersByProduct(string $productName, string $condition = '', array $params = [])
* @method Order fetchOrderById(int $orderId)
* @method array boughtProductHash(int $userId)
* @method string[] boughtProductNames(int $userId)
* @method Product[] boughtProducts(int $userId)
* @method int includeFeatures(string $productName, array $featureNames)
* @method int excludeFeatures(string $productName, array $featureNames)
* @method Feature addFeature(Feature $feature, string $appendTo = '')
* @method Feature editFeature(Feature $feature)
* @method bool hasFeature(string $name)
* @method bool removeFeature(string $name)
* @method Feature|null fetchFeatureByName(string $name)
* @method Feature[] fetchFeaturesByProductName(string $productName)
* @method Feature[] fetchFeaturesByNames(string [] $names)
* @method array boughtFeatureHash(int $userId)
* @method string[] boughtFeatureNames(int $userId)
* @method Feature[] boughtFeatures(int $userId)
*/
class PayCenter extends RPCWrapper {
public function reloadUserBought() {
X::logger()->trace("Package: {$this->package}");
$rpc = $this->findRpcComponentId();
if ($rpc === false) {
throw new RPCException('The rpc component cannot be found in the component configuration');
}
return X::$rpc($this->package)->callVoid('reloadUserBought');
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment