Skip to content

Commit

Permalink
order and subscription divided (reverted)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekrem BOZKURT committed May 18, 2020
1 parent 4e22c94 commit 3c36f6a
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 138 deletions.
65 changes: 0 additions & 65 deletions src/Teknasyon/HuaweiMobileService/OrderPublisher.php

This file was deleted.

106 changes: 106 additions & 0 deletions src/Teknasyon/HuaweiMobileService/Publisher.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?php

namespace Teknasyon\HuaweiMobileService;

use Teknasyon\HuaweiMobileService\InAppPurchase\Resource\CancelledPurchases;
use Teknasyon\HuaweiMobileService\InAppPurchase\Resource\PurchasesOrders;
use Teknasyon\HuaweiMobileService\InAppPurchase\Resource\PurchasesSubscriptions;

class Publisher
{
public $purchases_orders;
public $purchases_subscriptions;
public $cancelled_purchases;

public $rootUrl;
public $version;
public $serviceName;
private $client;

/**
* @param $client
* @param string $rootUrl The root URL used for requests to the service.
*/
public function __construct($client, $rootUrl = null)
{
$this->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;
}

}

6 changes: 3 additions & 3 deletions src/Teknasyon/HuaweiMobileService/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
70 changes: 0 additions & 70 deletions src/Teknasyon/HuaweiMobileService/SubscriptionPublisher.php

This file was deleted.

0 comments on commit 3c36f6a

Please sign in to comment.