Commit 09dde6dd by yeran

v1.1.0

1 parent 0d85da47
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="46e013cf-f1f1-43ea-b23a-b777a3ce6230" name="Default" comment="" />
<list default="true" id="46e013cf-f1f1-43ea-b23a-b777a3ce6230" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Card/ApiConfig.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Card/CardUtil.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Card/Color.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Card/WxCard.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Core/Common.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/ApiConfig.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/Code.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/Domain.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/Login.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/Member.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/MsgTemplate.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/Templet.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Mini/UnionAccount.php" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/Card/Card.php" afterPath="$PROJECT_DIR$/src/Card/Cards.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/AccessToken/AccessToken.php" afterPath="$PROJECT_DIR$/src/AccessToken/AccessToken.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Config/Config.php" afterPath="$PROJECT_DIR$/src/Config/Config.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Open/Open.php" afterPath="$PROJECT_DIR$/src/Open/Open.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Run/Run.php" afterPath="$PROJECT_DIR$/src/Run/Run.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -12,21 +33,46 @@
<component name="ComposerSettings">
<executablePath>composer</executablePath>
</component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_TABLE_DETAILS" value="true" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
<expand />
<select />
</component>
<component name="FileEditorManager">
<leaf />
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300" />
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>namespace wechat\</find>
<find>\wechat</find>
<find>wechat\</find>
<find>Config</find>
<find>readCertificates</find>
<find>$oAuthAccessToken</find>
<find>$CARDJSTICKET</find>
<find>oAuthAccessToken</find>
<find>CARDJSTICKET</find>
<find>error</find>
<find>error(</find>
<find>nonceStr</find>
<find>$accessToken</find>
</findStrings>
<replaceStrings>
<replace>namespace wechatkit\</replace>
<replace>\wechatkit</replace>
<replace>wechatkit\</replace>
<replace>// error(</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
......@@ -36,10 +82,27 @@
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/HttpFul/HttpFul.php" />
<option value="$PROJECT_DIR$/src/Run/Run.php" />
<option value="$PROJECT_DIR$/Docment.md" />
<option value="$PROJECT_DIR$/src/AccessToken/AccessToken.php" />
<option value="$PROJECT_DIR$/composer.json" />
<option value="$PROJECT_DIR$/src/Mini/APiConfig.php" />
<option value="$PROJECT_DIR$/src/Mini/Domain.php" />
<option value="$PROJECT_DIR$/src/Mini/Member.php" />
<option value="$PROJECT_DIR$/src/Mini/ApiConfig.php" />
<option value="$PROJECT_DIR$/src/Mini/Templet.php" />
<option value="$PROJECT_DIR$/src/Mini/Login.php" />
<option value="$PROJECT_DIR$/src/Mini/MsgTemplate.php" />
<option value="$PROJECT_DIR$/src/Mini/UnionAccount.php" />
<option value="$PROJECT_DIR$/src/Open/Open.php" />
<option value="$PROJECT_DIR$/src/Run/Run.php" />
<option value="$PROJECT_DIR$/src/Config/Config.php" />
<option value="$PROJECT_DIR$/src/Card/ApiConfig.php" />
<option value="$PROJECT_DIR$/src/Card/Color.php" />
<option value="$PROJECT_DIR$/src/Card/WxCard.php" />
<option value="$PROJECT_DIR$/src/Card/Cards.php" />
<option value="$PROJECT_DIR$/src/Core/common.php" />
<option value="$PROJECT_DIR$/src/Card/CardUtil.php" />
<option value="$PROJECT_DIR$/src/AccessToken/AccessToken.php" />
<option value="$PROJECT_DIR$/src/Mini/Code.php" />
</list>
</option>
</component>
......@@ -50,11 +113,10 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="1440" />
<component name="ProjectFrameBounds" fullScreen="true">
<option name="y" value="23" />
<option name="width" value="2560" />
<option name="height" value="1345" />
<option name="width" value="1440" />
<option name="height" value="807" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
......@@ -174,6 +236,7 @@
</profile-state>
</entry>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
......@@ -189,7 +252,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="AndroidView" />
<pane id="ProjectPane">
<subPane>
......@@ -198,12 +261,17 @@
<item name="wechatkit" type="b2602c69:ProjectViewProjectNode" />
<item name="wechatkit" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="wechatkit" type="b2602c69:ProjectViewProjectNode" />
<item name="wechatkit" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
......@@ -215,6 +283,11 @@
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/Card" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
......@@ -368,15 +441,18 @@
<option name="presentableId" value="Default" />
<updated>1511445860070</updated>
<workItem from="1511445861493" duration="416000" />
<workItem from="1511446636718" duration="1747000" />
<workItem from="1511446636718" duration="2555000" />
<workItem from="1513672216850" duration="2403000" />
<workItem from="1515426655262" duration="19805000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="2163000" />
<option name="totallyTimeSpent" value="25179000" />
</component>
<component name="ToolWindowManager">
<frame x="1440" y="23" width="2560" height="1345" extended-state="0" />
<frame x="0" y="0" width="1440" height="900" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
......@@ -386,12 +462,12 @@
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3296" sideWeight="0.5015886" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3296" sideWeight="0.49841145" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24980143" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.21316166" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3297568" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980332" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
......@@ -418,25 +494,57 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/CryptMsg/CryptMsg.php">
<entry file="file://$PROJECT_DIR$/composer.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<state relative-caret-position="120">
<caret line="8" column="5" lean-forward="false" selection-start-line="8" selection-start-column="5" selection-end-line="8" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Device/Device.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="12" column="57" lean-forward="false" selection-start-line="12" selection-start-column="57" selection-end-line="12" selection-end-column="57" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Run/Run.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="17" column="66" lean-forward="true" selection-start-line="17" selection-start-column="66" selection-end-line="17" selection-end-column="66" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Card/Card.php">
<entry file="file://$PROJECT_DIR$/src/Config/Config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="8" lean-forward="true" selection-start-line="4" selection-start-column="8" selection-end-line="4" selection-end-column="8" />
<caret line="4" column="13" lean-forward="true" selection-start-line="4" selection-start-column="13" selection-end-line="4" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/AccessToken/AccessToken.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1110">
<caret line="76" column="9" lean-forward="true" selection-start-line="76" selection-start-column="9" selection-end-line="76" selection-end-column="9" />
<folding>
<element signature="e#36#64#0#PHP" expanded="false" />
<element signature="e#5385#6559#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Core/ErrorCode.php">
<entry file="file://$PROJECT_DIR$/src/Card/Cards.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="12" column="37" lean-forward="true" selection-start-line="12" selection-start-column="37" selection-end-line="12" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/composer.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
......@@ -444,55 +552,255 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/CryptMsg/CryptMsg.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Docment.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="30">
<caret line="2" column="0" lean-forward="true" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Config/Config.php">
<entry file="file://$PROJECT_DIR$/src/JsSdk/JsSdk.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="16" lean-forward="false" selection-start-line="2" selection-start-column="16" selection-end-line="2" selection-end-column="16" />
<state relative-caret-position="-461">
<caret line="11" column="29" lean-forward="true" selection-start-line="11" selection-start-column="29" selection-end-line="11" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Message/Message.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Pay/Pay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="8" column="87" lean-forward="true" selection-start-line="8" selection-start-column="87" selection-end-line="8" selection-end-column="87" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Service/Service.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-183">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Shake/Shake.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="8" column="39" lean-forward="true" selection-start-line="8" selection-start-column="39" selection-end-line="8" selection-end-column="39" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/composer.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="5" lean-forward="false" selection-start-line="8" selection-start-column="5" selection-end-line="8" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Run/Run.php">
<entry file="file://$PROJECT_DIR$/src/Device/Device.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="14" lean-forward="false" selection-start-line="4" selection-start-column="14" selection-end-line="4" selection-end-column="14" />
<caret line="4" column="27" lean-forward="false" selection-start-line="4" selection-start-column="27" selection-end-line="4" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/AccessToken/AccessToken.php">
<entry file="file://$PROJECT_DIR$/src/Mini/Domain.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1035">
<caret line="74" column="7" lean-forward="true" selection-start-line="74" selection-start-column="7" selection-end-line="74" selection-end-column="7" />
<folding>
<element signature="e#120#148#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Mini/Templet.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="12" column="8" lean-forward="false" selection-start-line="12" selection-start-column="8" selection-end-line="12" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Mini/MsgTemplate.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="14" column="3" lean-forward="false" selection-start-line="14" selection-start-column="3" selection-end-line="14" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Mini/UnionAccount.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="13" column="3" lean-forward="false" selection-start-line="13" selection-start-column="3" selection-end-line="13" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Mini/Login.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="12" column="9" lean-forward="false" selection-start-line="12" selection-start-column="9" selection-end-line="12" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Mini/ApiConfig.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1318">
<caret line="157" column="29" lean-forward="false" selection-start-line="157" selection-start-column="29" selection-end-line="157" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Open/Open.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="259">
<caret line="19" column="98" lean-forward="false" selection-start-line="19" selection-start-column="98" selection-end-line="19" selection-end-column="98" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Card/Color.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<caret line="8" column="24" lean-forward="false" selection-start-line="8" selection-start-column="24" selection-end-line="8" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Card/ApiConfig.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-446">
<caret line="10" column="0" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<state relative-caret-position="-258">
<caret line="9" column="0" lean-forward="true" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Card/WxCard.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6225">
<caret line="420" column="7" lean-forward="true" selection-start-line="420" selection-start-column="7" selection-end-line="420" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Card/Cards.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="10" lean-forward="false" selection-start-line="8" selection-start-column="10" selection-end-line="8" selection-end-column="10" />
<folding>
<element signature="e#93#121#0#PHP" expanded="true" />
<element signature="e#36#64#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Core/Run.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Core/ErrorCode.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="7" column="29" lean-forward="true" selection-start-line="7" selection-start-column="4" selection-end-line="7" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Core/Common.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="16" column="22" lean-forward="true" selection-start-line="16" selection-start-column="22" selection-end-line="16" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/HttpFul/HttpFul.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1395">
<caret line="93" column="29" lean-forward="true" selection-start-line="93" selection-start-column="29" selection-end-line="93" selection-end-column="29" />
<state relative-caret-position="266">
<caret line="62" column="24" lean-forward="false" selection-start-line="62" selection-start-column="24" selection-end-line="62" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/composer.json">
<entry file="file://$PROJECT_DIR$/src/AccessToken/AccessToken.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="237">
<caret line="36" column="30" lean-forward="true" selection-start-line="36" selection-start-column="30" selection-end-line="36" selection-end-column="30" />
<folding>
<element signature="e#1208#2911#0#PHP" expanded="false" />
<element signature="e#2983#3194#0#PHP" expanded="false" />
<element signature="e#3198#5381#0#PHP" expanded="false" />
<element signature="e#5385#6559#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Mini/Member.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="447">
<caret line="44" column="52" lean-forward="false" selection-start-line="44" selection-start-column="52" selection-end-line="44" selection-end-column="52" />
<folding>
<element signature="e#120#148#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Mini/Code.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="627">
<caret line="160" column="8" lean-forward="false" selection-start-line="160" selection-start-column="8" selection-end-line="160" selection-end-column="8" />
<folding>
<element signature="e#120#148#0#PHP" expanded="false" />
<element signature="e#601#1230#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Card/CardUtil.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="370">
<caret line="335" column="0" lean-forward="true" selection-start-line="335" selection-start-column="0" selection-end-line="335" selection-end-column="0" />
<folding>
<element signature="e#122#152#0#PHP" expanded="true" />
<element signature="e#8536#8924#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Config/Config.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="22" lean-forward="true" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Run/Run.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225">
<caret line="15" column="27" lean-forward="true" selection-start-line="15" selection-start-column="27" selection-end-line="15" selection-end-column="27" />
<state relative-caret-position="150">
<caret line="10" column="11" lean-forward="false" selection-start-line="10" selection-start-column="11" selection-end-line="10" selection-end-column="11" />
<folding />
</state>
</provider>
......
......@@ -9,18 +9,53 @@
use wechatkit\Core\ErrorCode;
use wechatkit\HttpFul\HttpFul;
class AccessToken
{
class AccessToken{
static $Certificates = [
'AccessToken',
'JsTicket',
];
/**
*
* 初始化微信令牌参数等
*
* @param bool $authSelf
* true : 自身维护微信令牌
* false: 第三方服务来维护
*
*/
static function certificate($authSelf = false){
if($authSelf){
self::readCertificates();
}else{
$appid = Config::$options['appid'];
$data = array(
'appid' => $appid,
'secret' => 'yeran'
);
$tokens = HttpFul::init()->handler(Config::$authThirdUrls['accessTokenUrl'],[],$data,'JSON','POST');
Config::$componentAccessToken = $tokens['componentAccessToken'];
Config::$accessToken = $tokens['accessToken'];
Config::$jsApiTicket = null;
Config::$CARDJSTICKET = null;
}
}
/**
* @throws \Exception
*/
static function readCertificates()
{
static function readCertificates(){
debug('进入初始化微信信息' . PHP_EOL);
if (Config::$type == 'O') {
......@@ -62,7 +97,7 @@
}
}
/**
/**
*
* 根据公众号的appid获取第三方平台对应的accesstoken
*
......
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2017/12/21
* Time: 下午3:08
*/
namespace wechatkit\Card;
class ApiConfig{
public static $cardDetail = 'https://api.weixin.qq.com/card/get?access_token=%1%';
public static $cardModifyStock = 'https://api.weixin.qq.com/card/modifystock?access_token=%1%';
public static $cardDelete = 'https://api.weixin.qq.com/card/delete?access_token=%1%';
public static $cardUnAvailable = 'https://api.weixin.qq.com/card/code/unavailable?access_token=%1%';//使卡券失效,code
public static $cardCodeUpdate = 'https://api.weixin.qq.com/card/code/update?access_token=%1%';//更改code,在卡券分享时候,用于更换被分享卡券的code值
public static $selfconsumecell = 'https://api.weixin.qq.com/card/selfconsumecell/set?access_token=%1%';//设置自主核销
public static $wxCardApiTicket = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%1%&type=wx_card'; //卡券api_ticket
/**
* 查询code接口可以查询当前code是否可以被核销并检查code状态。当前可以被定位的状态为正常、已核销、转赠中、已删除、已失效和无效code
* @var string
*/
public static $cardCodeDetail = 'https://api.weixin.qq.com/card/code/get?access_token=%1%';
/**
*
* 用于获取用户卡包里的,属于该appid下所有可用卡券,包括正常状态和异常状态
*
* @var string
*/
public static $userCardList = 'https://api.weixin.qq.com/card/user/getcardlist?access_token=%1%';
/**
* 拉取本商户的总体数据情况,包括时间区间内的各指标总量。
* @var string
*/
public static $cardStatistics = 'https://api.weixin.qq.com/datacube/getcardbizuininfo?access_token=%1%';
/**
* 拉取免费券(优惠券、团购券、折扣券、礼品券)在固定时间区间内的相关数据。
* @var string
*/
public static $certainCardStatistics = 'https://api.weixin.qq.com/datacube/getcardcardinfo?access_token=%1%';
/**
*
* 卡券消息解密接口
* @var string
*/
public static $decrypt = 'https://api.weixin.qq.com/card/code/decrypt?access_token=%1%';
/**
*
* 更新卡券基础信息
*
* @var string
*/
public static $update = 'https://api.weixin.qq.com/card/update?access_token=%1%';
public static $consumeCard = 'https://api.weixin.qq.com/card/code/consume?access_token=%1%';
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2017/12/19
* Time: 下午7:32
*/
namespace wechatkit\Card;
use wechatkit\HttpFul\HttpFul;
use wechatkiy\Card\Card;
use wechatkit\Core\Common;
class CardUtil{
/**
*
* 返回随机的核销码
*
* @return mixed
*
*/
static function verifyCode(){
$verifyCodes = array(
123,188,
222,234,
456,
555,508,518,520,
618,666,688,678,
777,
888,818,808,
999,918,998,988
);
return $verifyCodes[array_rand($verifyCodes,1)];
}
/**
* 卡券code解密接口
*
* 卡券内跳转外链的签名中会对code进行加密处理,通过调用解码接口获取真实code
* @param $encryptCode
* @param $accessToken
* @return null
*/
static function decrypt($encryptCode,$accessToken){
$data = array(
'encrypt_code' =>$encryptCode
);
$response = HttpFul::init()->handler(ApiConfig::$decrypt,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
return $response['code'];
}
return null;
}
/**
*
* 卡券的LOGO上传到微信图片服务器
*
* 先从图片服务器(七牛云)拉取文件到本地,然后再上传至微信服务器,成功后,本地文件会被删除
*
* @param $picUrl //图片在图片服务器的地址
* @param $file //文件在本地的临时存储路径
*
* @return null
*/
static function logo2WxService($picUrl,$accessToken,$file=null){
if(!$picUrl){
return null;
}
if(!$file)
$file = APP_ROOT. DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'media'.DIRECTORY_SEPARATOR .mt_rand(0,1000).'.png';
$location = strpos($picUrl,"qpic.cn");
if(!$location){
//拉取文件
$filePath = Common::httpcopy($picUrl,$file);
if($filePath){
//上传文件至微信服务器
$response = HttpFul::init()->handler('uploadimg', [$accessToken], ['buffer' => $filePath], 'JSON', 'FILE');
if ($response) {
unlink($filePath);
$pic_url_wx = $response['url'];
return $pic_url_wx;
} else {
echo ('商户logo图标上传微信服务器失败');
return null;
}
}
}
return $picUrl;
}
static function createCard($data,$accessToken){
$response = HttpFul::init()->handler('card', [$accessToken], $data, 'JSON', 'POST');
echo('---------'.json_encode($response));
if($response && ($response['errcode'] == 0)){
$card_id = $response['card_id'];
return $card_id;
}
return null;
}
static function createWxCard($card,$accessToken){
if(!$card instanceof Card){
// error('卡券类型不匹配');
return false;
}
$cardDetail = $card->get_card();
$baseInfo = $cardDetail->base_info;
$picUrl = self::logo2WxService($baseInfo->logo_url,$accessToken);
if(!$picUrl)
return null;
$baseInfo->logo_url = $picUrl;
return self::createCard(['card'=>$card],$accessToken);
}
/**
*
* 更新卡券基础信息
*
* @param $data
* @param $accessToken
* @return null
*/
static function updateWxCard($data,$accessToken){
$response = HttpFul::init()->handler(ApiConfig::$update, [$accessToken], $data, 'JSON', 'POST');
echo('---------'.json_encode($response));
if($response && ($response['errcode'] == 0)){
$send_check = $response['send_check'];
return true;
}
return false;
}
/**
*
* 自主核销
*
* @param $cardId
* @param bool $is_open
* @param bool $need_verify_code //用户核销时是否需要输入验证码, 填true/false, 默认为false
* @param bool $need_remark_amount //用户核销时是否需要备注核销金额, 填true/false, 默认为false
* @param $accessToken
* @return bool
*/
static function selfConsumeCell($cardId,$is_open = true,$need_verify_code = true,$need_remark_amount = true,$accessToken){
$data = array(
'card_id' =>$cardId,
'is_open' =>$is_open,
'need_verify_code' =>$need_verify_code,
'need_remark_amount' =>$need_remark_amount
);
$response = HttpFul::init()->handler(ApiConfig::$selfconsumecell,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
return true;
}
return false;
}
/**
*
* 修改卡券库存
*
* @param $cardId
* @param $accessToken
* @param int $increase_stock_value
* @param int $reduce_stock_value
* @return bool
*/
static function modifyStock($cardId,$accessToken,$increase_stock_value=0,$reduce_stock_value=0){
$data = array(
'card_id' =>$cardId
);
if($increase_stock_value>0){
$data['increase_stock_value'] = $increase_stock_value;
}
if($reduce_stock_value>0){
$data['reduce_stock_value'] = $reduce_stock_value;
}
$response = HttpFul::init()->handler(ApiConfig::$cardModifyStock,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
return true;
}
return false;
}
/**
*
* 删除卡券(种类)
*
* @param $cardId
* @param $accessToken
* @return bool
*/
static function delete($cardId,$accessToken){
$data = array(
'card_id' =>$cardId
);
$response = HttpFul::init()->handler(ApiConfig::$cardDelete,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
return true;
}
return false;
}
/**
* 使卡券失效
*
* @param $cardId
* @param $code //平台卡券唯一标示
* @param $accessToken
* @param string $reason
* @return bool
*/
static function unavailable($cardId,$code,$accessToken,$reason=''){
$data = array(
'card_id' =>$cardId,
'code' =>$code,
'reason' => $reason
);
$response = HttpFul::init()->handler(ApiConfig::$cardUnAvailable,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
return true;
}
return false;
}
/*-----辅助查询能力接口-----*/
/**
*
* 某张卡券当前的信息
*
* @param $cardId
* @param $code
* @param bool $check_consume
* @param $accessToken
* @return bool
*/
static function codeSelect($cardId,$code,$check_consume=true,$accessToken){
$data = array(
'card_id' =>$cardId,
'code' =>$code,
'check_consume' => $check_consume
);
$response = HttpFul::init()->handler(ApiConfig::$cardCodeDetail,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
return $response;
}
return false;
}
/**
*
* 卡券API核销
*
* @param $code
* @param $accessToken
* @param null $cardId
* @return bool|mixed
*/
static function consumeCard($code,$accessToken,$cardId= null){
$data = array(
'code' => $code
);
if($cardId){
$data['card_id'] = $cardId;
}
$response = HttpFul::init()->handler(ApiConfig::$consumeCard,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
return $response;
}
return false;
}
/**
*
* 用于获取用户卡包里的,属于该appid下所有可用卡券,包括正常状态和异常状态
*
* @param $openid //需要查询的用户openid
* @param null $cardId //卡券ID。不填写时默认查询当前appid下的卡券
* @param $accessToken
* @return null
*/
static function getCardList($openid,$cardId=null,$accessToken){
$data = array(
'openid' =>$openid
);
if(!empty($cardId)){
$data['card_id'] = $cardId;
}
$response = HttpFul::init()->handler(ApiConfig::$userCardList,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
$cardList = $response['card_list'];
$has_share_card = $response['has_share_card'];
return $cardList;
}
return null;
}
/**
*
* 查询卡券详情
*
* @param $cardId
* @param $accessToken
* @return null
*/
static function cardDetail($cardId,$accessToken){
$data = array(
'card_id' =>$cardId
);
$response = HttpFul::init()->handler(ApiConfig::$cardDetail,[$accessToken],$data,'JSON','POST');
if($response && ($response['errcode'] == 0)){
$cardInfo = $response['card'];
return $cardInfo;
}
return null;
}
/**
*
* 拉取免费券(优惠券、团购券、折扣券、礼品券)在固定时间区间内的相关数据
*
* @param $begin_date //2015-06-15
* @param $end_date //2015-07-15
* @param int $cond_source //卡券来源,0为公众平台创建的卡券数据 、1是API创建的卡券数据
* @param $accessToken
* @param null $cardId // 如果为null,则拉去总的统计数据
*
*
* 1. 查询时间区间需<=62天,否则报错{errcode: 61501,errmsg: "date range error"};
*
* 2. 传入时间格式需严格参照示例填写”2015-06-15”,否则报错{errcode":61500,"errmsg":"date format error"}
*
* 3. 该接口只能拉取非当天的数据,不能拉取当天的卡券数据,否则报错
*
* @return null
*/
static function cardStatistics($begin_date,$end_date,$cond_source=1,$accessToken,$cardId=null){
$data = array(
"begin_date" => $begin_date,
"end_date" => $end_date,
"cond_source"=> $cond_source
);
if($cardId){
$url = ApiConfig::$certainCardStatistics;
$data['card_id'] = $cardId;
}else{
$url = ApiConfig::$cardStatistics;
}
$response = HttpFul::init()->handler($url,[$accessToken],$data,'JSON','POST');
if($response){
$dataList = $response['list'];
return $dataList;
}
return null;
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
use wechatkit\Core\Func;
use wechatkit\HttpFul\HttpFul;
class Card
class Cards
{
public function logo($body)
{
......
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2017/12/19
* Time: 下午5:49
*/
namespace wechatkit\Card;
class Color{
const GREEN_LIGHT = 'Color010'; //浅绿色:#63b359
const GREEN = 'Color020'; //绿色:#2c9f67
const BLUE_LIGHT = 'Color030'; //浅蓝色:#509fc9
const BLUE = 'Color040'; //蓝色:#5885cf
const PURPLE = 'Color050'; //紫色:#9062c0
const YELLOW_DARK = 'Color060'; //深黄色:#d09a45
const YELLOW_LIGHT = 'Color070'; //浅黄色:#e4b138
const YELLOW = 'Color080'; //黄色:#ee903c
const RED_LIGHT = 'Color090'; //浅红色:#dd6549
const RED = 'Color100'; //红色:#cc463d
public static function wxColor($name){
switch ($name){
case 'green': {
return self::GREEN;
}
case 'yellow':{
return self::YELLOW;
}
case 'red':{
return self::RED;
}
case 'blue':{
return self::BLUE;
}
default :
return self::GREEN;
}
}
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2017/12/19
* Time: 下午5:01
*/
namespace wechatkiy\Card;
class Sku{
function __construct($quantity){
$this->quantity = $quantity; //数量
}
}
/*
微信卡包api SDK V1.0
!!README!!:
base_info的构造函数的参数是必填字段,有set接口的可选字段。
针对某一种卡的必填字段(参照文档)仍然需要手动set(比如团购券Groupon的deal_detail),通过card->get_card()拿到card的实体对象来set。
ToJson就能直接转换为符合规则的json。
Signature是方便生成签名的类,具体用法见示例。
注意填写的参数是int还是string或者bool或者自定义class。
更具体用法见最后示例test,各种细节以最新文档为准。
*/
class DateInfo{
function __construct($type, $arg0, $arg1 = null)
{
if (!is_string($type) )
// error("DateInfo.type must be integer");
$this->type = $type;
if ( $type == 'DATE_TYPE_FIX_TIME_RANGE' ) //固定日期区间
{
if (!is_int($arg0) || !is_int($arg1))
// error("begin_timestamp and end_timestamp must be integer");
$this->begin_timestamp = $arg0;
$this->end_timestamp = $arg1;
}
else if ( $type == 'DATE_TYPE_FIX_TERM' ) //固定时长(自领取后多少天内有效)
{
if (!is_int($arg0))
echo("fixed_term must be integer");
$this->fixed_term = $arg0;
}else
echo("DateInfo.tpye Error");
}
};
class BaseInfo{
function __construct($logo_url, $brand_name, $code_type, $title, $color, $notice, $service_phone,
$description, $date_info, $sku){
if(!empty($logo_url))
$this->logo_url = $logo_url;
if(!empty($brand_name))
$this->brand_name = $brand_name;
if(!empty($code_type))
$this->code_type = $code_type;
if(!empty($title))
$this->title = $title;
if(!empty($color))
$this->color = $color;
if(!empty($notice))
$this->notice = $notice;
if(!empty($service_phone))
$this->service_phone = $service_phone;
if(!empty($description))
$this->description = $description;
if(!empty($date_info))
$this->date_info = $date_info;
if(!empty($sku))
$this->sku = $sku;
}
function set_logo_url($logo_url){
$this->logo_url = $logo_url;
}
function set_service_phone($service_phone){
$this->service_phone = $service_phone;
}
function set_use_limit($use_limit){
if (! is_int($use_limit) )
// error("use_limit must be integer");
$this->use_limit = $use_limit;
}
function set_get_limit($get_limit){
if (! is_int($get_limit) )
// error("get_limit must be integer");
$this->get_limit = $get_limit;
}
function set_can_share($can_share){
$this->can_share = $can_share;
}
/**
* 卡券是否可转赠。
* @param $can_give_friend
*/
function set_can_give_friend($can_give_friend){
$this->can_give_friend = $can_give_friend;
}
/**
*
* 是否自定义Code码 。填写true或false,默认为false。 通常自有优惠码系统的开发者选择 自定义Code码,并在卡券投放时带入 Code码,详情见 是否自定义Code码
*
* @param $use_custom_code
*/
function set_use_custom_code($use_custom_code){
$this->use_custom_code = $use_custom_code;
}
/**
*
* 是否指定用户领取,填写true或false 。默认为false。通常指定特殊用户群体 投放卡券或防止刷券时选择指定用户领取
*
* @param $bind_openid
*/
function set_bind_openid($bind_openid){
$this->bind_openid = $bind_openid;
}
/**
* 门店位置poiid。 调用 POI门店管理接 口 获取门店位置poiid。具备线下门店 的商户为必填。
*
* @param $location_id_list
*/
function set_location_id_list($location_id_list){
$this->location_id_list = $location_id_list;
}
/**
*
* 设置本卡券支持全部门店,与location_id_list互斥
* @param $bool
*/
function set_use_all_locations($bool){
$this->use_all_locations = $bool;
}
/*--------------新版升级,最新字段更新-----------------*/
/**
*
* 卡券顶部居中的按钮,仅在卡券状 态正常(可以核销)时显示
*
* @param $center_title
*/
function set_center_title($center_title){
$this->center_title = $center_title;
}
/**
*
* 显示在入口下方的提示语 ,仅在卡券状态正常(可以核销)时显示
*
* @param $center_sub_title
*/
function set_center_sub_title($center_sub_title){
$this->center_sub_title = $center_sub_title;
}
function set_sub_title($sub_title){
$this->sub_title = $sub_title;
}
/**
* 顶部居中的url ,仅在卡券状态正常(可以核销)时显示
* @param $center_url
*/
function set_center_url($center_url){
$this->center_url = $center_url;
}
/**
*
* 卡券跳转的小程序的user_name,仅可跳转该 公众号绑定的小程序
*
* @param $center_app_brand_user_name
*/
function set_center_app_brand_user_name($center_app_brand_user_name){
$this->center_app_brand_user_name = $center_app_brand_user_name;
}
/**
* 卡券跳转的小程序的path
* @param $center_app_brand_pass
*/
function set_center_app_brand_pass($center_app_brand_pass){
$this->center_app_brand_pass = $center_app_brand_pass;
}
/**
* 自定义跳转外链的入口名字。
* @param $custom_url_name
*/
function set_custom_url_name($custom_url_name){
$this->custom_url_name = $custom_url_name;
}
/**
*
* 自定义跳转的URL
* @param $custom_url
*/
function set_custom_url($custom_url){
$this->custom_url = $custom_url;
}
/**
*
* 显示在入口右侧的提示语。
*
* @param $custom_url_sub_title
*/
function set_custom_url_sub_title($custom_url_sub_title){
$this->custom_url_sub_title = $custom_url_sub_title;
}
/**
*
* 卡券跳转的小程序的user_name,仅可跳转该 公众号绑定的小程序
* @param $custom_app_brand_user_name
*/
function set_custom_app_brand_user_name($custom_app_brand_user_name){
$this->custom_app_brand_user_name = $custom_app_brand_user_name;
}
/**
* 卡券跳转的小程序的path
* @param $custom_app_brand_pass
*/
function set_custom_app_brand_pass($custom_app_brand_pass){
$this->custom_app_brand_pass = $custom_app_brand_pass;
}
/**
* 营销场景的自定义入口名称。
* @param $promotion_url_name
*/
function set_promotion_url_name($promotion_url_name){
$this->promotion_url_name = $promotion_url_name;
}
/**
* 入口跳转外链的地址链接。
* @param $promotion_url
*/
function set_promotion_url($promotion_url){
$this->promotion_url = $promotion_url;
}
/**
* 显示在营销入口右侧的提示语
* @param $promotion_url_sub_title
*/
function set_promotion_url_sub_title($promotion_url_sub_title){
$this->promotion_url_sub_title = $promotion_url_sub_title;
}
/**
* 卡券跳转的小程序的user_name,仅可跳转该 公众号绑定的小程序
* @param $promotion_app_brand_user_name
*/
function set_promotion_app_brand_user_name($promotion_app_brand_user_name){
$this->promotion_app_brand_user_name = $promotion_app_brand_user_name;
}
/**
*
* 卡券跳转的小程序的path
*
* @param $promotion_app_brand_pass
*/
function set_promotion_app_brand_pass($promotion_app_brand_pass){
$this->promotion_app_brand_pass = $promotion_app_brand_pass;
}
};
class AdvancedInfo{
function set_use_condition($use_condition){
$this->use_condition = $use_condition;
}
function set_abstract($abstract){
$this->abstract = $abstract;
}
function set_text_image_list($text_image_list){
$this->text_image_list = $text_image_list;
}
}
/**
* 高级信息里面的外部的封面摘要结构体名称
*
* Class AbstractInfo
* @package service\func\card
*/
class AbstractInfo{
function __construct($abstract,$icon_url_list){
$this->abstract = $abstract;
$this->icon_url_list = $icon_url_list; //必须是微信侧服的图片地址
}
}
class TextImage{
function __construct($image_url,$text){
$this->image_url = $image_url;
$this->text = $text;
}
}
class CardBase{
public function __construct($base_info,$advanced_info=null){
$this->base_info = $base_info;
if($advanced_info){
$this->advanced_info = $advanced_info;
}
}
};
class GeneralCoupon extends CardBase{
function set_default_detail($default_detail){
$this->default_detail = $default_detail;
}
};
class Groupon extends CardBase{
function set_deal_detail($deal_detail){
$this->deal_detail = $deal_detail;
}
};
class Discount extends CardBase{
function set_discount($discount){
$this->discount = $discount;
}
};
class Gift extends CardBase{
function set_gift($gift){
$this->gift = $gift;
}
};
class Cash extends CardBase{
function set_least_cost($least_cost){
$this->least_cost = $least_cost;
}
function set_reduce_cost($reduce_cost){
$this->reduce_cost = $reduce_cost;
}
};
class MemberCard extends CardBase{
function set_supply_bonus($supply_bonus){
$this->supply_bonus = $supply_bonus;
}
function set_supply_balance($supply_balance){
$this->supply_balance = $supply_balance;
}
function set_bonus_cleared($bonus_cleared){
$this->bonus_cleared = $bonus_cleared;
}
function set_bonus_rules($bonus_rules){
$this->bonus_rules = $bonus_rules;
}
function set_balance_rules($balance_rules){
$this->balance_rules = $balance_rules;
}
function set_prerogative($prerogative){
$this->prerogative = $prerogative;
}
function set_bind_old_card_url($bind_old_card_url){
$this->bind_old_card_url = $bind_old_card_url;
}
function set_activate_url($activate_url){
$this->activate_url = $activate_url;
}
};
class ScenicTicket extends CardBase{
function set_ticket_class($ticket_class){
$this->ticket_class = $ticket_class;
}
function set_guide_url($guide_url){
$this->guide_url = $guide_url;
}
};
class MovieTicket extends CardBase{
function set_detail($detail){
$this->detail = $detail;
}
};
class Card{ //工厂
private $CARD_TYPE = Array("GENERAL_COUPON",
"GROUPON", "DISCOUNT",
"GIFT", "CASH", "MEMBER_CARD",
"SCENIC_TICKET", "MOVIE_TICKET" );
const GENERAL_COUPON = 'GENERAL_COUPON';
const GROUPON = 'GROUPON';
const DISCOUNT = 'DISCOUNT';
const GIFT = 'GIFT';
const CASH = 'CASH';
const MEMBER_CARD = 'MEMBER_CARD';
const SCENIC_TICKET = 'SCENIC_TICKET';
const MOVIE_TICKET = 'MOVIE_TICKET';
function __construct($card_type, $base_info,$advanced_info=null,$showCardType=true)
{
if (!in_array($card_type, $this->CARD_TYPE))
// error("CardType Error");
if (! $base_info instanceof BaseInfo )
// error("base_info Error");
if($showCardType)
$this->card_type = $card_type;
switch ($card_type)
{
case $this->CARD_TYPE[0]:
$this->general_coupon = new GeneralCoupon($base_info,$advanced_info);
break;
case $this->CARD_TYPE[1]:
$this->groupon = new Groupon($base_info,$advanced_info);
break;
case $this->CARD_TYPE[2]:
$this->discount = new Discount($base_info,$advanced_info);
break;
case $this->CARD_TYPE[3]:
$this->gift = new Gift($base_info,$advanced_info);
break;
case $this->CARD_TYPE[4]:
$this->cash = new Cash($base_info,$advanced_info);
break;
case $this->CARD_TYPE[5]:
$this->member_card = new MemberCard($base_info,$advanced_info);
break;
case $this->CARD_TYPE[6]:
$this->scenic_ticket = new ScenicTicket($base_info,$advanced_info);
break;
case $this->CARD_TYPE[8]:
$this->movie_ticket = new MovieTicket($base_info,$advanced_info);
break;
default:
// error("CardType Error");
}
return true;
}
function get_card()
{
switch ($this->card_type)
{
case $this->CARD_TYPE[0]:
return $this->general_coupon;
case $this->CARD_TYPE[1]:
return $this->groupon;
case $this->CARD_TYPE[2]:
return $this->discount;
case $this->CARD_TYPE[3]:
return $this->gift;
case $this->CARD_TYPE[4]:
return $this->cash;
case $this->CARD_TYPE[5]:
return $this->member_card;
case $this->CARD_TYPE[6]:
return $this->scenic_ticket;
case $this->CARD_TYPE[8]:
return $this->movie_ticket;
default:
// error("GetCard Error");
}
}
function toJson()
{
return "{ \"card\":" . urldecode(json_encode($this)) . "}";
}
};
class Signature{
function __construct(){
$this->data = array();
}
function add_data($str){
array_push($this->data, (string)$str);
}
function get_signature(){
sort( $this->data, SORT_STRING );
return sha1( implode( $this->data ) );
}
};
......@@ -3,6 +3,7 @@
namespace wechatkit\Config;
class Config{
static public $options = [
'appid'=>null,
'secret'=>null,
......@@ -24,6 +25,20 @@ class Config{
]
];
/**
*
* 第三方授权维护服务的链接
*
* @var array
*/
static public $authThirdUrls = array(
'accessTokenUrl' => null,
'jsApiTicketUrl' => null,
'cardJsTicketUrl' => null
);
static public $authSelf = false; //是否本平台维护授权,默认为false
static public $typeList = [
'openHandler'=>'O', //开放平台接入
'mpHandler'=>'A' //普通接入
......
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午5:59
*/
namespace wechatkit\Core;
class Common{
/**
*
* 文件下载
*
*/
static function httpcopy($url, $file = "", $timeout = 60){
$file = empty($file) ? pathinfo($url, PATHINFO_BASENAME) : $file;
$dir = pathinfo($file, PATHINFO_DIRNAME);
!is_dir($dir) && @mkdir($dir, 0777, true);
$url = str_replace(" ", "%20", $url);
if (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$temp = curl_exec($ch);
if (@file_put_contents($file, $temp) && !curl_error($ch)) {
return $file;
} else {
return false;
}
} else {
$opts = array(
"http" => array(
"method" => "GET",
"header" => "",
"timeout" => $timeout)
);
$context = stream_context_create($opts);
if (@copy($url, $file, $context)) {
//$http_response_header
return $file;
} else {
return false;
}
}
}
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午1:37
*/
namespace wechatkit\Mini;
class ApiConfig{
/**
*
* 需要先将域名登记到第三方平台的小程序服务器域名中,才可以调用接口进行配置。
*
* @var string
*/
public static $modifyDomain = 'https://api.weixin.qq.com/wxa/modify_domain?access_token=%1%';
/**
*
* 授权给第三方的小程序,其业务域名只可以为第三方的服务器,当小程序通过第三方发布代码上线后,小程序原先自己配置的业务域名将被删除,只保留第三方平台的域名,所以第三方平台在代替小程序发布代码之前,需要调用接口为小程序添加业务域名。
* 提示:需要先将域名登记到第三方平台的小程序业务域名中,才可以调用接口进行配置
*
* @var string
*
*/
public static $setwebviewDomain = 'https://api.weixin.qq.com/wxa/setwebviewdomain?access_token=%1%';
/*---成员管理---*/
public static $bindTester = 'https://api.weixin.qq.com/wxa/bind_tester?access_token=%1%';
public static $unbindTester = 'https://api.weixin.qq.com/wxa/unbind_tester?access_token=%1%';
/*---代码管理----*/
/**
* 为授权的小程序帐号上传小程序代码
* @var string
*/
public static $commit = 'https://api.weixin.qq.com/wxa/commit?access_token=%1%';
/**
* 获取体验小程序的体验二维码
* @var string
*/
public static $get_qrcode = 'https://api.weixin.qq.com/wxa/get_qrcode?access_token=%1%';
/**
*
* 获取授权小程序帐号的可选类目
*
* @var string
*/
public static $get_category = 'https://api.weixin.qq.com/wxa/get_category?access_token=%1%';
/**
* 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用)
* @var string
*/
public static $get_page = 'https://api.weixin.qq.com/wxa/get_page?access_token=%1%';
/**
* 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用)
*
* @var string
*/
public static $submit_audit = 'https://api.weixin.qq.com/wxa/submit_audit?access_token=%1%';
/**
* 查询某个指定版本的审核状态(仅供第三方代小程序调用)
* @var string
*/
public static $get_auditstatus = 'https://api.weixin.qq.com/wxa/get_auditstatus?access_token=%1%';
/**
* 查询最新一次提交的审核状态(仅供第三方代小程序调用)
* @var string
*/
public static $get_latest_auditstatus = 'https://api.weixin.qq.com/wxa/get_latest_auditstatus?access_token=%1%';
/**
*
* 发布已通过审核的小程序(仅供第三方代小程序调用)
*
* @var string
*/
public static $release = 'https://api.weixin.qq.com/wxa/release?access_token=%1%';
/**
*
* 修改小程序线上代码的可见状态(仅供第三方代小程序调用)
*
* @var string
*/
public static $change_visitstatus ='https://api.weixin.qq.com/wxa/change_visitstatus?access_token=%1%';
/**
* 小程序版本回退(仅供第三方代小程序调用)
* @var string
*/
public static $revertcoderelease = 'https://api.weixin.qq.com/wxa/revertcoderelease?access_token=%1%';
/**
* 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用)
* @var string
*/
public static $getweappsupportversion = 'https://api.weixin.qq.com/cgi-bin/wxopen/getweappsupportversion?access_token=%1%';
/**
* 设置最低基础库版本(仅供第三方代小程序调用)
* @var string
*/
public static $setweappsupportversion = 'https://api.weixin.qq.com/cgi-bin/wxopen/setweappsupportversion?access_token=%1%';
/**
* 设置小程序“扫普通链接二维码打开小程序”能力
* 【增加或修改二维码规则】
*
* @var string
*/
public static $qrcodejumpadd = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpadd?access_token=%1%';
/**
* 设置小程序“扫普通链接二维码打开小程序”能力
* 【获取已设置的二维码规则】
* @var string
*/
public static $qrcodejumpget = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpget?access_token=%1%';
/**
* 设置小程序“扫普通链接二维码打开小程序”能力
* 获取校验文件名称及内容
* @var string
*/
public static $qrcodejumpdownload = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpdownload?access_token=%1%';
/**
* 设置小程序“扫普通链接二维码打开小程序”能力
* 删除已设置的二维码规则
* @var string
*/
public static $qrcodejumpdelete = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpdelete?access_token=%1%';
/**
* 设置小程序“扫普通链接二维码打开小程序”能力
* 发布已设置的二维码规则
* @var string
*/
public static $qrcodejumppublish = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumppublish?access_token=%1%';
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午2:21
*/
namespace wechatkit\Mini;
use wechatkit\Config\Config;
use wechatkit\HttpFul\HttpFul;
/**
*
* 代码管理
*
* Class Code
* @package wechatkit\Mini
*
*/
class Code {
/**
*
* 为授权的小程序帐号上传小程序代码
*
* @param $template_id //代码库中的代码模版ID
* @param $ext_json //第三方自定义的配置,如果代码中已经有配置,则配置的合并规则为:除了pages和tabBar.list直接覆盖原配置,其他都为插入或同级覆盖
* @param $user_version //代码版本号,开发者可自定义
* @param $user_desc //代码描述,开发者可自定义
* @param null $accessToken
*
* @return bool
*/
public function commitCode($template_id,$ext_json,$user_version='v1.0.0',$user_desc='第一次发布版本',$accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array(
'template_id' => $template_id,
'ext_json' =>$ext_json,
'user_version' =>$user_version,
'user_desc' => $user_desc
);
$response = HttpFul::init()->handler(ApiConfig::$commit, [$accessToken], $data, 'JSON', 'POST');
if($response && ($response['errcode'] == 0)){
return true;
}
return false;
}
/**
*
* 获取体验小程序的体验二维码
*
* @param $accessToken
* @return bool|mixed
*/
public function getQrcode($accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$response = HttpFul::init()->handler(ApiConfig::$commit, [$accessToken], [], null, 'GET');
if(is_array($response) && $response['errcode'] == -1){
return false;
}else{
return $response;
}
}
/**
* 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用)
*
* @param $item_list
* @param null $accessToken
* @return bool|mixed
*/
public function submitAudit($item_list,$accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array(
'item_list' => $item_list
);
$response = HttpFul::init()->handler(ApiConfig::$submit_audit, [$accessToken], $data, 'JSON', 'POST');
return $response;
}
/**
*
* 发布已通过审核的小程序(仅供第三方代小程序调用)
*
* @param null $accessToken
* @return bool|mixed
*/
public function release($accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array();
$response = HttpFul::init()->handler(ApiConfig::$release, [$accessToken], $data, 'JSON', 'POST');
return $response;
}
/**
* 设置小程序是否用户可见,刚发布之后的小程序是默认为可见的,因此这里的默认值是不可见
* @param string $action
* @param null $accessToken
* @return bool|mixed
*/
public function changeVisitstatus($action='close',$accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array(
'action' =>$action
);
$response = HttpFul::init()->handler(ApiConfig::$change_visitstatus, [$accessToken], $data, 'JSON', 'POST');
return $response;
}
/**
* 小程序版本回退(仅供第三方代小程序调用)
*
* @param null $accessToken
* @return bool|mixed
*/
public function revertCodeRelease($accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$response = HttpFul::init()->handler(ApiConfig::$revertcoderelease, [$accessToken], null, null, 'GET');
return $response;
}
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午1:15
*/
namespace wechatkit\Mini;
use wechatkit\Config\Config;
use wechatkit\HttpFul\HttpFul;
/**
*
* 小程序域名设置
*
* Class Domain
* @package wechatkit\Mini
*
*/
class Domain{
/**
*
* 设置小程序服务器域名
*
* @param $action
* // add添加, delete删除, set覆盖, get获取。当参数是get时不需要填四个域名字段。
* @param $accessToken
* @param null $domains
* @return array|bool|null
*/
function modifyDomain($action,$domains=null,$accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array(
'action' => $action
);
if($action != 'get' && !empty($domains)){
$data['requestdomain'] = $domains['requestdomain'];
$data['wsrequestdomain'] = $domains['wsrequestdomain'];
$data['uploaddomain'] = $domains['uploaddomain'];
$data['downloaddomain'] = $domains['downloaddomain'];
}
$response = HttpFul::init()->handler(ApiConfig::$modifyDomain, [$accessToken], $data, 'JSON', 'POST');
if($response && ($response['errcode'] == 0)){
if('get' == $action){
$domains = array(
'requestdomain' => $response['requestdomain'],
'wsrequestdomain' => $response['wsrequestdomain'],
'uploaddomain' => $response['uploaddomain'],
'downloaddomain' => $response['downloaddomain']
);
return $domains;
}
return true;
}
return false;
}
/**
*
* 授权给第三方的小程序,其业务域名只可以为第三方的服务器,当小程序通过第三方发布代码上线后,小程序原先自己配置的业务域名将被删除,只保留第三方平台的域名
*
* 提示:需要先将域名登记到第三方平台的小程序业务域名中,才可以调用接口进行配置
*
* @param $action
* @param $accessToken
* @param null $webviewdomain
* @return array|bool
*/
function setWebviewDomain($action,$webviewdomain=null,$accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array(
'action' => $action
);
if($action != 'get' && !empty($domains)){
$data['webviewdomain'] = $webviewdomain;
}
$response = HttpFul::init()->handler(ApiConfig::$setwebviewDomain, [$accessToken], $data, 'JSON', 'POST');
if($response && ($response['errcode'] == 0)){
if('get' == $action){
$domains = array(
'webviewdomain' => $response['webviewdomain']
);
return $domains;
}
return true;
}
return false;
}
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午2:53
*/
namespace wechatkit\Mini;
/**
*
* 微信授权登陆
*
* Class Login
* @package wechatkit\Mini
*/
class Login{
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午2:06
*/
namespace wechatkit\Mini;
use wechatkit\Config\Config;
use wechatkit\HttpFul\HttpFul;
/**
*
* 小程序成员管理
*
* Class Member
* @package wechatkit\Mini
*/
class Member {
public function bindTester($wechatid,$accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array(
'wechatid' => $wechatid
);
$response = HttpFul::init()->handler(ApiConfig::$bindTester, [$accessToken], $data, 'JSON', 'POST');
if($response && ($response['errcode'] == 0)){
return true;
}
return false;
}
public function unbindTester($wechatid,$accessToken=null){
if(!$accessToken){
$accessToken = Config::$accessToken;
}
$data = array(
'wechatid' => $wechatid
);
$response = HttpFul::init()->handler(ApiConfig::$unbindTester, [$accessToken], $data, 'JSON', 'POST');
if($response && ($response['errcode'] == 0)){
return true;
}
return false;
}
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午2:55
*/
namespace wechatkit\Mini;
/**
*
* 模板消息管理
*
*
* Class MsgTemplate
* @package wechatkit\Mini
*/
class MsgTemplate{
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午2:51
*/
namespace wechatkit\Mini;
/**
*
* 代码模板库管理
*
* Class Templet
* @package wechatkit\Mini
*/
class Templet{
}
\ No newline at end of file
<?php
/**
* Created by IntelliJ IDEA.
* User: yeran
* Date: 2018/1/9
* Time: 下午3:47
*/
namespace wechatkit\Mini;
/**
*
* 微信开放平台帐号管理
*
* 适用与统一主体小程序之间的用户互通
*
* Class UnionAccount
* @package wechatkit\Mini
*/
class UnionAccount{
}
\ No newline at end of file
......@@ -17,8 +17,10 @@
public function webOAuth2($url = NULL, $type = 'URL', $state = NULL, $wxLoginConfig = ['style' => 'black',
'href' => NULL])
{
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
if(null == $url){
$url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$url = $http_type.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
if ('URL' == $type) {
......@@ -67,7 +69,10 @@
$preAuthCode = HttpFul::init()->handler('preAuthCode',[Config::$componentAccessToken],['component_appid'=>Config::$options['open']['appid']],'JSON','POST');
if($preAuthCode){
if(null == $url){
$url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
$url = $http_type.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
header(sprintf('Location:https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s',Config::$options['open']['appid'],$preAuthCode['pre_auth_code'],urlencode($url)));
exit(255);
......
......@@ -4,8 +4,7 @@
use wechatkit\Config, wechatkit\AccessToken;
class Run implements \wechatkit\Core\Run
{
class Run implements \wechatkit\Core\Run{
static $self = NULL;
......@@ -27,7 +26,7 @@
Config\Config::$config = array_merge(Config\Config::$config, $config);
$this->AccessToken()->readCertificates();
$this->AccessToken()->certificate(false);
return $this;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!