diff --git a/src/Teknasyon/HuaweiMobileService/OrderPublisher.php b/src/Teknasyon/HuaweiMobileService/OrderPublisher.php deleted file mode 100644 index fd68c98..0000000 --- a/src/Teknasyon/HuaweiMobileService/OrderPublisher.php +++ /dev/null @@ -1,65 +0,0 @@ -client = $client; - $this->rootUrl = $rootUrl ?: 'https://subscr-dre.iap.hicloud.com/'; - $this->version = 'v2'; - $this->serviceName = 'hmsPublisher'; - - $this->purchases_orders = new PurchasesOrders( - $this, - 'orders', - array( - 'methods' => array( - 'get' => array( - 'path' => '/applications/purchases/tokens/verify', - 'httpMethod' => 'POST', - 'parameters' => array(), - ), - ) - ) - ); - - $this->cancelled_purchases = new CancelledPurchases( - $this, - 'cancelled', - array( - 'methods' => array( - 'cancelledList' => array( - 'path' => '/applications/' . $this->version . '/purchases/cancelledList', - 'httpMethod' => 'POST', - 'parameters' => array(), - ), - ) - ) - ); - } - - public function getClient() - { - return $this->client; - } - -} - diff --git a/src/Teknasyon/HuaweiMobileService/Publisher.php b/src/Teknasyon/HuaweiMobileService/Publisher.php new file mode 100644 index 0000000..8cff3ac --- /dev/null +++ b/src/Teknasyon/HuaweiMobileService/Publisher.php @@ -0,0 +1,106 @@ +client = $client; + $this->rootUrl = $rootUrl ?: null; + $this->version = 'v2'; + $this->serviceName = 'hmsPublisher'; + + $this->purchases_subscriptions = new PurchasesSubscriptions( + $this, + 'subscriptions', + array( + 'methods' => array( + 'stop' => array( + 'path' => 'https://subscr-dre.iap.hicloud.com/sub/applications/' . $this->version + . '/purchases/stop', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + 'delay' => array( + 'path' => 'https://subscr-dre.iap.hicloud.com/sub/applications/' . $this->version + . '/purchases/delay', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + 'get' => array( + 'path' => 'https://subscr-dre.iap.hicloud.com/sub/applications/' . $this->version + . '/purchases/get', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + 'returnFee' => array( + 'path' => 'https://subscr-dre.iap.hicloud.com/sub/applications/' . $this->version + . '/purchases/returnFee', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + 'withdrawal' => array( + 'path' => 'https://subscr-dre.iap.hicloud.com/sub/applications/' . $this->version + . '/purchases/withdrawal', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + ) + ) + ); + + $this->purchases_orders = new PurchasesOrders( + $this, + 'orders', + array( + 'methods' => array( + 'get' => array( + 'path' => 'https://orders-dre.iap.hicloud.com/applications/purchases/tokens/verify', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + ) + ) + ); + + $this->cancelled_purchases = new CancelledPurchases( + $this, + 'cancelled', + array( + 'methods' => array( + 'cancelledList' => array( + 'path' => 'https://orders-dre.iap.hicloud.com/applications/' . $this->version + . '/purchases/cancelledList', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + ) + ) + ); + } + + public function getClient() + { + return $this->client; + } + +} + diff --git a/src/Teknasyon/HuaweiMobileService/Resource.php b/src/Teknasyon/HuaweiMobileService/Resource.php index 02e1f71..a77bc33 100644 --- a/src/Teknasyon/HuaweiMobileService/Resource.php +++ b/src/Teknasyon/HuaweiMobileService/Resource.php @@ -30,9 +30,9 @@ class Resource /** * Resource constructor. * - * @param SubscriptionPublisher|OrderPublisher $service - * @param string $resourceName - * @param array $resource + * @param Publisher $service + * @param string $resourceName + * @param array $resource */ public function __construct($service, $resourceName, $resource) { diff --git a/src/Teknasyon/HuaweiMobileService/SubscriptionPublisher.php b/src/Teknasyon/HuaweiMobileService/SubscriptionPublisher.php deleted file mode 100644 index 14dc1ba..0000000 --- a/src/Teknasyon/HuaweiMobileService/SubscriptionPublisher.php +++ /dev/null @@ -1,70 +0,0 @@ -client = $client; - $this->rootUrl = $rootUrl ?: 'https://subscr-dre.iap.hicloud.com/'; - $this->version = 'v2'; - $this->serviceName = 'hmsPublisher'; - - $this->purchases_subscriptions = new PurchasesSubscriptions( - $this, - 'subscriptions', - array( - 'methods' => array( - 'stop' => array( - 'path' => '/sub/applications/' . $this->version . '/purchases/stop', - 'httpMethod' => 'POST', - 'parameters' => array(), - ), - 'delay' => array( - 'path' => '/sub/applications/' . $this->version . '/purchases/delay', - 'httpMethod' => 'POST', - 'parameters' => array(), - ), - 'get' => array( - 'path' => 'sub/applications/' . $this->version . '/purchases/get', - 'httpMethod' => 'POST', - 'parameters' => array(), - ), - 'returnFee' => array( - 'path' => '/sub/applications/' . $this->version . '/purchases/returnFee', - 'httpMethod' => 'POST', - 'parameters' => array(), - ), - 'withdrawal' => array( - 'path' => '/sub/applications/' . $this->version . '/purchases/withdrawal', - 'httpMethod' => 'POST', - 'parameters' => array(), - ), - ) - ) - ); - } - - public function getClient() - { - return $this->client; - } - -} -