1 | <?php |
||
28 | class QRCode extends AbstractAPI |
||
29 | { |
||
30 | const DAY = 86400; |
||
31 | const SCENE_MAX_VALUE = 100000; |
||
32 | const SCENE_QR_CARD = 'QR_CARD'; |
||
33 | const SCENE_QR_TEMPORARY = 'QR_SCENE'; |
||
34 | const SCENE_QR_FOREVER = 'QR_LIMIT_SCENE'; |
||
35 | const SCENE_QR_FOREVER_STR = 'QR_LIMIT_STR_SCENE'; |
||
36 | |||
37 | const API_CREATE = 'https://api.weixin.qq.com/cgi-bin/qrcode/create'; |
||
38 | const API_SHOW = 'https://mp.weixin.qq.com/cgi-bin/showqrcode'; |
||
39 | |||
40 | /** |
||
41 | * Create forever. |
||
42 | * |
||
43 | * @param int $sceneValue |
||
44 | * |
||
45 | * @return \EasyWeChat\Support\Collection |
||
46 | */ |
||
47 | 1 | public function forever($sceneValue) |
|
61 | |||
62 | /** |
||
63 | * Create temporary. |
||
64 | * |
||
65 | * @param string $sceneId |
||
66 | * @param null $expireSeconds |
||
67 | * |
||
68 | * @return \EasyWeChat\Support\Collection |
||
69 | */ |
||
70 | 1 | public function temporary($sceneId, $expireSeconds = null) |
|
76 | |||
77 | /** |
||
78 | * Create QRCode for card. |
||
79 | * |
||
80 | * @param array $card |
||
81 | * |
||
82 | * { |
||
83 | * "card_id": "pFS7Fjg8kV1IdDz01r4SQwMkuCKc", |
||
84 | * "code": "198374613512", |
||
85 | * "openid": "oFS7Fjl0WsZ9AMZqrI80nbIq8xrA", |
||
86 | * "expire_seconds": "1800", |
||
87 | * "is_unique_code": false , "outer_id" : 1 |
||
88 | * } |
||
89 | * |
||
90 | * @return \EasyWeChat\Support\Collection |
||
91 | */ |
||
92 | 1 | public function card($card) |
|
96 | |||
97 | /** |
||
98 | * Return url for ticket. |
||
99 | * |
||
100 | * @param string $ticket |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | 1 | public function url($ticket) |
|
108 | |||
109 | /** |
||
110 | * Create a QRCode. |
||
111 | * |
||
112 | * @param string $actionName |
||
113 | * @param array $actionInfo |
||
114 | * @param bool $temporary |
||
115 | * @param int $expireSeconds |
||
116 | * |
||
117 | * @return \EasyWeChat\Support\Collection |
||
118 | */ |
||
119 | 3 | protected function create($actionName, $actionInfo, $temporary = true, $expireSeconds = null) |
|
134 | } |
||
135 |