-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improved base template message compatibility. * Add json data type. * 稍微完善下 * fix styles * fix unused parameter
- Loading branch information
Showing
13 changed files
with
470 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/wechat. | ||
* | ||
* (c) overtrue <i@overtrue.me> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* AbstractMiniProgram.php. | ||
* | ||
* Part of Overtrue\WeChat. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author mingyoung <mingyoungcheung@gmail.com> | ||
* @copyright 2016 | ||
* | ||
* @see https://github.com/overtrue | ||
* @see http://overtrue.me | ||
*/ | ||
|
||
namespace EasyWeChat\MiniProgram\Core; | ||
|
||
use EasyWeChat\Core\AbstractAPI; | ||
|
||
class AbstractMiniProgram extends AbstractAPI | ||
{ | ||
/** | ||
* Mini program config. | ||
* | ||
* @var array | ||
*/ | ||
protected $config; | ||
|
||
/** | ||
* AbstractMiniProgram constructor. | ||
* | ||
* @param \EasyWeChat\MiniProgram\AccessToken $accessToken | ||
* @param array $config | ||
*/ | ||
public function __construct($accessToken, $config) | ||
{ | ||
parent::__construct($accessToken); | ||
|
||
$this->config = $config; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/wechat. | ||
* | ||
* (c) overtrue <i@overtrue.me> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Temporary.php. | ||
* | ||
* @author mingyoung <mingyoungcheung@gmail.com> | ||
* | ||
* @see https://github.com/overtrue | ||
* @see http://overtrue.me | ||
*/ | ||
|
||
namespace EasyWeChat\MiniProgram\Material; | ||
|
||
use EasyWeChat\Material\Temporary as BaseTemporary; | ||
|
||
/** | ||
* Class Temporary. | ||
*/ | ||
class Temporary extends BaseTemporary | ||
{ | ||
public function __construct() | ||
{ | ||
$accessToken = func_get_args()[0]; | ||
|
||
parent::__construct($accessToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/wechat. | ||
* | ||
* (c) overtrue <i@overtrue.me> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Notice.php. | ||
* | ||
* Part of Overtrue\WeChat. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author mingyoung <mingyoungcheung@gmail.com> | ||
* @copyright 2016 | ||
* | ||
* @see https://github.com/overtrue | ||
* @see http://overtrue.me | ||
*/ | ||
|
||
namespace EasyWeChat\MiniProgram\Notice; | ||
|
||
use EasyWeChat\Notice\Notice as BaseNotice; | ||
|
||
class Notice extends BaseNotice | ||
{ | ||
/** | ||
* {@inheritdoc}. | ||
*/ | ||
protected $message = [ | ||
'touser' => '', | ||
'template_id' => '', | ||
'page' => '', | ||
'form_id' => '', | ||
'data' => [], | ||
'emphasis_keyword' => '', | ||
]; | ||
|
||
/** | ||
* {@inheritdoc}. | ||
*/ | ||
protected $defaults = [ | ||
'touser' => '', | ||
'template_id' => '', | ||
'form_id' => '', | ||
'data' => [], | ||
]; | ||
|
||
/** | ||
* {@inheritdoc}. | ||
*/ | ||
protected $required = ['touser', 'template_id', 'form_id']; | ||
|
||
public function __construct() | ||
{ | ||
$accessToken = func_get_args()[0]; | ||
|
||
parent::__construct($accessToken); | ||
} | ||
|
||
/** | ||
* Send notice message. | ||
*/ | ||
const API_SEND_NOTICE = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the overtrue/wechat. | ||
* | ||
* (c) overtrue <i@overtrue.me> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* QRCode.php. | ||
* | ||
* Part of Overtrue\WeChat. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author mingyoung <mingyoungcheung@gmail.com> | ||
* @copyright 2016 | ||
* | ||
* @see https://github.com/overtrue | ||
* @see http://overtrue.me | ||
*/ | ||
|
||
namespace EasyWeChat\MiniProgram\QRCode; | ||
|
||
use EasyWeChat\MiniProgram\Core\AbstractMiniProgram; | ||
|
||
class QRCode extends AbstractMiniProgram | ||
{ | ||
/** | ||
* API. | ||
*/ | ||
const API_CREATE_QRCODE = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode'; | ||
|
||
/** | ||
* Create mini program qrcode. | ||
* | ||
* @param $path | ||
* @param int $width | ||
* | ||
* @return \EasyWeChat\Support\Collection | ||
*/ | ||
public function create($path, $width = 430) | ||
{ | ||
return $this->parseJSON('POST', [self::API_CREATE_QRCODE, compact('path', 'width')]); | ||
} | ||
} |
Oops, something went wrong.