Skip to content

Commit

Permalink
Merge pull request #631 from Hexor/hex_fix_bug_and_add_feature
Browse files Browse the repository at this point in the history
修复一个创建卡券时的 bug, 添加获取微信门店类目表的api
  • Loading branch information
mingyoung committed Mar 31, 2017
2 parents cef1361 + f44ad89 commit 1ae43c0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Card/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function create($cardType = 'member_card', array $baseInfo = [], array $e
$params = [
'card' => [
'card_type' => strtoupper($cardType),
strtolower($cardType) => array_merge(['base_info' => $baseInfo], $especial, $advancedInfo),
strtolower($cardType) => array_merge(['base_info' => $baseInfo], $especial, ['advanced_info' => $advancedInfo]),
],
];

Expand Down
11 changes: 11 additions & 0 deletions src/POI/POI.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ class POI extends AbstractAPI
const API_LIST = 'http://api.weixin.qq.com/cgi-bin/poi/getpoilist';
const API_UPDATE = 'http://api.weixin.qq.com/cgi-bin/poi/updatepoi';
const API_DELETE = 'http://api.weixin.qq.com/cgi-bin/poi/delpoi';
const API_GET_CATEGORIES = 'http://api.weixin.qq.com/cgi-bin/poi/getwxcategory';

/**
* Get POI supported categories.
*
* @return \EasyWeChat\Support\Collection
*/
public function getCategories()
{
return $this->parseJSON('get', [self::API_GET_CATEGORIES]);
}

/**
* Get POI by ID.
Expand Down
11 changes: 11 additions & 0 deletions tests/POI/POIPOITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ public function getPOI()
return $POI;
}

/**
* Test getCategories().
*/
public function testGetCategories()
{
$POI = $this->getPOI();

$response = $POI->getCategories();
$this->assertStringStartsWith(POI::API_GET_CATEGORIES, $response['api']);
}

/**
* Test get().
*/
Expand Down

0 comments on commit 1ae43c0

Please sign in to comment.