aftership - Version 0.2.3

Version Notes

Fixed minor bugs

Download this release

Release Info

Developer aftership
Extension aftership
Version 0.2.3
Comparing to
See all releases


Code changes from version 0.2.2 to 0.2.3

app/code/community/Aftership/.DS_Store DELETED
Binary file
app/code/community/Aftership/.idea/.name ADDED
@@ -0,0 +1 @@
 
1
+ Aftership
app/code/community/Aftership/.idea/Aftership.iml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
9
+
app/code/community/Aftership/.idea/encodings.xml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
+ </project>
5
+
app/code/community/Aftership/.idea/misc.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectResources">
4
+ <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" />
7
+ </project>
8
+
app/code/community/Aftership/.idea/modules.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/Aftership.iml" filepath="$PROJECT_DIR$/.idea/Aftership.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
9
+
app/code/community/Aftership/.idea/scopes/scope_settings.xml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <component name="DependencyValidationManager">
2
+ <state>
3
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
+ </state>
5
+ </component>
app/code/community/Aftership/.idea/vcs.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="" />
5
+ </component>
6
+ </project>
7
+
app/code/community/Aftership/.idea/workspace.xml ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="e3f0b511-56ce-4080-bd76-1051286569e1" name="Default" comment="" />
5
+ <ignored path="Aftership.iws" />
6
+ <ignored path=".idea/workspace.xml" />
7
+ <option name="TRACKING_ENABLED" value="true" />
8
+ <option name="SHOW_DIALOG" value="false" />
9
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+ <option name="LAST_RESOLUTION" value="IGNORE" />
12
+ </component>
13
+ <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
14
+ <component name="CreatePatchCommitExecutor">
15
+ <option name="PATCH_PATH" value="" />
16
+ </component>
17
+ <component name="DaemonCodeAnalyzer">
18
+ <disable_hints />
19
+ </component>
20
+ <component name="FavoritesManager">
21
+ <favorites_list name="Aftership" />
22
+ </component>
23
+ <component name="FileEditorManager">
24
+ <leaf>
25
+ <file leaf-file-name="Observer.php" pinned="false" current="true" current-in-tab="true">
26
+ <entry file="file://$PROJECT_DIR$/Track/Model/Observer.php">
27
+ <provider selected="true" editor-type-id="text-editor">
28
+ <state line="98" column="27" selection-start="3979" selection-end="3979" vertical-scroll-proportion="0.21871203">
29
+ <folding />
30
+ </state>
31
+ </provider>
32
+ </entry>
33
+ </file>
34
+ </leaf>
35
+ </component>
36
+ <component name="IdeDocumentHistory">
37
+ <option name="changedFiles">
38
+ <list>
39
+ <option value="$PROJECT_DIR$/Track/Model/Observer.php" />
40
+ </list>
41
+ </option>
42
+ </component>
43
+ <component name="ProjectFrameBounds">
44
+ <option name="y" value="22" />
45
+ <option name="width" value="1680" />
46
+ <option name="height" value="995" />
47
+ </component>
48
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
49
+ <OptionsSetting value="true" id="Add" />
50
+ <OptionsSetting value="true" id="Remove" />
51
+ <OptionsSetting value="true" id="Checkout" />
52
+ <OptionsSetting value="true" id="Update" />
53
+ <OptionsSetting value="true" id="Status" />
54
+ <OptionsSetting value="true" id="Edit" />
55
+ <ConfirmationsSetting value="0" id="Add" />
56
+ <ConfirmationsSetting value="0" id="Remove" />
57
+ </component>
58
+ <component name="ProjectReloadState">
59
+ <option name="STATE" value="0" />
60
+ </component>
61
+ <component name="ProjectView">
62
+ <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
63
+ <flattenPackages />
64
+ <showMembers />
65
+ <showModules />
66
+ <showLibraryContents ProjectPane="true" />
67
+ <hideEmptyPackages />
68
+ <abbreviatePackageNames />
69
+ <autoscrollToSource />
70
+ <autoscrollFromSource />
71
+ <sortByType />
72
+ </navigator>
73
+ <panes>
74
+ <pane id="ProjectPane">
75
+ <subPane>
76
+ <PATH>
77
+ <PATH_ELEMENT>
78
+ <option name="myItemId" value="Aftership" />
79
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
80
+ </PATH_ELEMENT>
81
+ </PATH>
82
+ <PATH>
83
+ <PATH_ELEMENT>
84
+ <option name="myItemId" value="Aftership" />
85
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
86
+ </PATH_ELEMENT>
87
+ <PATH_ELEMENT>
88
+ <option name="myItemId" value="Aftership" />
89
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
90
+ </PATH_ELEMENT>
91
+ <PATH_ELEMENT>
92
+ <option name="myItemId" value="Track" />
93
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
94
+ </PATH_ELEMENT>
95
+ </PATH>
96
+ <PATH>
97
+ <PATH_ELEMENT>
98
+ <option name="myItemId" value="Aftership" />
99
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
100
+ </PATH_ELEMENT>
101
+ <PATH_ELEMENT>
102
+ <option name="myItemId" value="Aftership" />
103
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
104
+ </PATH_ELEMENT>
105
+ <PATH_ELEMENT>
106
+ <option name="myItemId" value="Track" />
107
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
108
+ </PATH_ELEMENT>
109
+ <PATH_ELEMENT>
110
+ <option name="myItemId" value="Model" />
111
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
112
+ </PATH_ELEMENT>
113
+ </PATH>
114
+ <PATH>
115
+ <PATH_ELEMENT>
116
+ <option name="myItemId" value="Aftership" />
117
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
118
+ </PATH_ELEMENT>
119
+ <PATH_ELEMENT>
120
+ <option name="myItemId" value="Aftership" />
121
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
122
+ </PATH_ELEMENT>
123
+ <PATH_ELEMENT>
124
+ <option name="myItemId" value="Track" />
125
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
126
+ </PATH_ELEMENT>
127
+ <PATH_ELEMENT>
128
+ <option name="myItemId" value="controllers" />
129
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
130
+ </PATH_ELEMENT>
131
+ </PATH>
132
+ </subPane>
133
+ </pane>
134
+ <pane id="Scope" />
135
+ </panes>
136
+ </component>
137
+ <component name="PropertiesComponent">
138
+ <property name="WebServerToolWindowFactoryState" value="false" />
139
+ </component>
140
+ <component name="RunManager">
141
+ <list size="0" />
142
+ </component>
143
+ <component name="ShelveChangesManager" show_recycled="false" />
144
+ <component name="TaskManager">
145
+ <task active="true" id="Default" summary="Default task">
146
+ <created>1344330897186</created>
147
+ <updated>1344330897186</updated>
148
+ </task>
149
+ <servers />
150
+ </component>
151
+ <component name="ToolWindowManager">
152
+ <frame x="0" y="22" width="1680" height="995" extended-state="6" />
153
+ <editor active="true" />
154
+ <layout>
155
+ <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
156
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
157
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
158
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
159
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.249694" sideWeight="0.99885714" order="0" side_tool="false" content_ui="combo" />
160
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
161
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
162
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
163
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
164
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
165
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
166
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
167
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
168
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
169
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
170
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
171
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
172
+ </layout>
173
+ </component>
174
+ <component name="VcsContentAnnotationSettings">
175
+ <option name="myLimit" value="2678400000" />
176
+ </component>
177
+ <component name="VcsManagerConfiguration">
178
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
179
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
180
+ <option name="CHECK_NEW_TODO" value="true" />
181
+ <option name="myTodoPanelSettings">
182
+ <value>
183
+ <are-packages-shown value="false" />
184
+ <are-modules-shown value="false" />
185
+ <flatten-packages value="false" />
186
+ <is-autoscroll-to-source value="false" />
187
+ </value>
188
+ </option>
189
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
190
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
191
+ <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
192
+ <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
193
+ <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
194
+ <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
195
+ <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
196
+ <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
197
+ <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
198
+ <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
199
+ <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
200
+ <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
201
+ <option name="SHORT_DIFF_HORISONTALLY" value="true" />
202
+ <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
203
+ <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
204
+ <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
205
+ <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
206
+ <option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />
207
+ <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
208
+ <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
209
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
210
+ <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
211
+ <option name="LAST_COMMIT_MESSAGE" />
212
+ <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
213
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
214
+ <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
215
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
216
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
217
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
218
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
219
+ <option name="ACTIVE_VCS_NAME" />
220
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
221
+ <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
222
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
223
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
224
+ </component>
225
+ <component name="XDebuggerManager">
226
+ <breakpoint-manager />
227
+ </component>
228
+ <component name="editorHistoryManager">
229
+ <entry file="file://$PROJECT_DIR$/Track/Model/Observer.php">
230
+ <provider selected="true" editor-type-id="text-editor">
231
+ <state line="98" column="27" selection-start="3979" selection-end="3979" vertical-scroll-proportion="0.21871203">
232
+ <folding />
233
+ </state>
234
+ </provider>
235
+ </entry>
236
+ </component>
237
+ </project>
238
+
app/code/community/Aftership/Track/.DS_Store DELETED
Binary file
app/code/community/Aftership/Track/Model/Observer.php CHANGED
@@ -4,25 +4,25 @@ class Aftership_Track_Model_Observer
4
  {
5
  public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
6
  {
7
- ob_start();
8
  $config = Mage::getStoreConfig('aftership_options/messages');
9
 
10
  /*if(array_key_exists("notification",$config)){
11
- $notifications = explode(",",$config["notification"]);
12
- if(array_search("1",$notifications)!==False){ // email
13
- $is_notify_email = true;
14
- }else{
15
- $is_notify_email = false;
16
- }
17
- if(array_search("2",$notifications)!==False){ // sms
18
- $is_notify_sms = true;
19
- }else{
20
- $is_notify_sms = false;
21
- }
22
- }else{
23
- $is_notify_email = false;
24
- $is_notify_sms = false;
25
- }*/
26
 
27
  $track = $observer->getEvent()->getTrack();
28
  $track_data = $track->getData();
@@ -65,13 +65,13 @@ class Aftership_Track_Model_Observer
65
  }
66
 
67
  /*
68
- if($is_notify_email){
69
- $track->setEmail($order_data["customer_email"]);
70
- }
71
 
72
- if($is_notify_sms){
73
- $track->setTelephone($shipping_address_data["telephone"]);
74
- }*/
75
 
76
 
77
  if (array_key_exists("status", $config) && $config["status"]) {
@@ -85,7 +85,7 @@ class Aftership_Track_Model_Observer
85
 
86
 
87
  if (array_key_exists("status", $config) && $config["status"])
88
- {
89
  $api_key = $config["api_key"];
90
 
91
  $post_tracks = Mage::getModel('track/track')
@@ -98,10 +98,10 @@ class Aftership_Track_Model_Observer
98
  foreach ($post_tracks as $track) {
99
  $url = "https://api.aftership.com/v1/trackings";
100
  $url_params["tracking_number"] = $track["tracking_number"];
101
- $url_params["smses"] = array($track["telephone"]);
102
- $url_params["emails"] = array($track["email"]);
103
- $url_params["title"] = $track["title"];
104
- $url_params["order_id"] = $track["order_id"];
105
 
106
  $ch = curl_init();
107
  curl_setopt($ch, CURLOPT_URL, $url);
@@ -112,8 +112,8 @@ class Aftership_Track_Model_Observer
112
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
113
  curl_setopt($ch, CURLOPT_HEADER, 0);
114
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
115
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); //the SSL is not correct
116
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //the SSL is not correct
117
 
118
  $response = curl_exec($ch);
119
  $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
@@ -122,7 +122,7 @@ class Aftership_Track_Model_Observer
122
  $response_obj = json_decode($response, true);
123
 
124
  if ($http_status == "201" || $http_status == "422") //422: repeated
125
- {
126
  $track_obj = Mage::getModel('track/track');
127
  $track_obj->load($track["track_id"]);
128
  $track_obj->setPosted(1);
@@ -133,7 +133,7 @@ class Aftership_Track_Model_Observer
133
  }
134
  }
135
 
136
- ob_end_clean();
137
  }
138
 
139
  public function adminSystemConfigChangedSectionAftership($obj)
@@ -147,7 +147,7 @@ class Aftership_Track_Model_Observer
147
  $url_params = array(
148
  "api_key" => $api_key
149
  );
150
- $url = "http://api.aftership.com/v1/users/authenticate";
151
 
152
  $ch = curl_init();
153
  curl_setopt($ch, CURLOPT_URL, $url);
4
  {
5
  public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
6
  {
7
+ ob_start();
8
  $config = Mage::getStoreConfig('aftership_options/messages');
9
 
10
  /*if(array_key_exists("notification",$config)){
11
+ $notifications = explode(",",$config["notification"]);
12
+ if(array_search("1",$notifications)!==False){ // email
13
+ $is_notify_email = true;
14
+ }else{
15
+ $is_notify_email = false;
16
+ }
17
+ if(array_search("2",$notifications)!==False){ // sms
18
+ $is_notify_sms = true;
19
+ }else{
20
+ $is_notify_sms = false;
21
+ }
22
+ }else{
23
+ $is_notify_email = false;
24
+ $is_notify_sms = false;
25
+ }*/
26
 
27
  $track = $observer->getEvent()->getTrack();
28
  $track_data = $track->getData();
65
  }
66
 
67
  /*
68
+ if($is_notify_email){
69
+ $track->setEmail($order_data["customer_email"]);
70
+ }
71
 
72
+ if($is_notify_sms){
73
+ $track->setTelephone($shipping_address_data["telephone"]);
74
+ }*/
75
 
76
 
77
  if (array_key_exists("status", $config) && $config["status"]) {
85
 
86
 
87
  if (array_key_exists("status", $config) && $config["status"])
88
+ {
89
  $api_key = $config["api_key"];
90
 
91
  $post_tracks = Mage::getModel('track/track')
98
  foreach ($post_tracks as $track) {
99
  $url = "https://api.aftership.com/v1/trackings";
100
  $url_params["tracking_number"] = $track["tracking_number"];
101
+ $url_params["smses"] = array($track["telephone"]);
102
+ $url_params["emails"] = array($track["email"]);
103
+ $url_params["title"] = $track["title"];
104
+ $url_params["order_id"] = $track["order_id"];
105
 
106
  $ch = curl_init();
107
  curl_setopt($ch, CURLOPT_URL, $url);
112
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
113
  curl_setopt($ch, CURLOPT_HEADER, 0);
114
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
115
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); //the SSL is not correct
116
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //the SSL is not correct
117
 
118
  $response = curl_exec($ch);
119
  $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
122
  $response_obj = json_decode($response, true);
123
 
124
  if ($http_status == "201" || $http_status == "422") //422: repeated
125
+ {
126
  $track_obj = Mage::getModel('track/track');
127
  $track_obj->load($track["track_id"]);
128
  $track_obj->setPosted(1);
133
  }
134
  }
135
 
136
+ ob_end_clean();
137
  }
138
 
139
  public function adminSystemConfigChangedSectionAftership($obj)
147
  $url_params = array(
148
  "api_key" => $api_key
149
  );
150
+ $url = "https://api.aftership.com/v1/users/authenticate";
151
 
152
  $ch = curl_init();
153
  curl_setopt($ch, CURLOPT_URL, $url);
app/code/community/Aftership/Track/sql/track_setup/{mysql4-install-0.1.16.php → mysql4-install-0.1.0.php} RENAMED
File without changes
app/etc/modules/Aftership_Track.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Aftership_Track>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Aftership_Track>
8
+ </modules>
9
+ </config>
package.xml CHANGED
@@ -1,19 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>aftership</name>
4
- <version>0.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>AfterShip magento extension interface.&#xD;
10
- Tracking number will be added to the aftership.com &lt;https://www.aftership.com&gt; account at the same time when input in magento shipment. Please go to aftership.com &lt;https://www.aftership.com&gt; to change the notification setting and value.</summary>
11
- <description>Users can simply link their online stores to Aftership and view all packages in one place. Online stores can also automatically inform their customers of the latest delivery status through SMS, email. All the messages are white-labeled and can be customized for any marketing opportunities. Aftership also provides online stores a reporting tool so that they can easily find out any shipping problems like delayed, delivery and solve immediately. Aftership currently supports over 40 shipping companies worldwide.</description>
12
- <notes>Bug fixes</notes>
13
  <authors><author><name>aftership</name><user>aftership</user><email>support@aftership.com</email></author></authors>
14
  <date>2012-10-20</date>
15
- <time>15:01:04</time>
16
- <contents><target name="magecommunity"><dir name="Aftership"><dir name="Track"><dir name="Helper"><file name="Data.php" hash="970d03deb3e5fc478f5d86e5ff3670cb"/></dir><dir name="Model"><file name="Methods.php" hash="d9fa7ef3df0353c01662ff4bdf210f60"/><dir name="Mysql4"><dir name="Track"><file name="Collection.php" hash="336c4b0fba8db78e1222da01aa8c5744"/></dir><file name="Track.php" hash="90ad226fa98576fceb223b85fe88b642"/></dir><file name="Observer.php" hash="9fea70bb15867c43dfb59a1e62a45829"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="b53f65ecc832752c8394f0da74b2f90d"/></dir></dir><file name="Track.php" hash="eb12833d5f084b0b919cbde45f8170eb"/><file name="Words.php" hash="7789e47b991f718fb3097b5e274eb71f"/></dir><dir name="controllers"><file name="IndexController.php" hash="3ee34f42957e816ff336f8f8215a218b"/></dir><dir name="etc"><file name="config.xml" hash="44b407dcd58774176a2a37191daf04a2"/><file name="system.xml" hash="857fa4fae0433c10ba468bff794ca9ef"/></dir><dir name="sql"><dir name="track_setup"><file name="mysql4-install-0.1.16.php" hash="a8f81083585c85a89e8a3097f5f3045c"/></dir></dir><file name=".DS_Store" hash="822777d708619165d544d3256174adc2"/></dir><file name=".DS_Store" hash="187c68966589e21d1b51b9a56354abe6"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.13</min><max>5.4.8</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>aftership</name>
4
+ <version>0.2.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>AfterShip magento extension interface. Tracking number will be added to the aftership.com &lt;https://aftership.com/&gt; account at the same time when input in magento shipment. Please go to aftership.com &lt;https://aftership.com/&gt; to change the notification setting and value.</summary>
10
+ <description>Users can simply link their online stores to Aftership and view all packages in one place. Online stores can also automatically inform their customers of the latest delivery status through SMS, email and Twitter. All the messages are white-labeled and can be customized for any marketing opportunities. Aftership also provides online stores a reporting tool so that they can easily find out any shipping problems like delayed delivery and solve immediately. Aftership currently supports over 40 shipping companies worldwide.</description>
11
+ <notes>Fixed minor bugs</notes>
 
12
  <authors><author><name>aftership</name><user>aftership</user><email>support@aftership.com</email></author></authors>
13
  <date>2012-10-20</date>
14
+ <time>15:33:05</time>
15
+ <contents><target name="magecommunity"><dir name="Aftership"><dir name="Track"><dir name="Helper"><file name="Data.php" hash="970d03deb3e5fc478f5d86e5ff3670cb"/></dir><dir name="Model"><file name="Methods.php" hash="d9fa7ef3df0353c01662ff4bdf210f60"/><dir name="Mysql4"><dir name="Track"><file name="Collection.php" hash="336c4b0fba8db78e1222da01aa8c5744"/></dir><file name="Track.php" hash="90ad226fa98576fceb223b85fe88b642"/></dir><file name="Observer.php" hash="26a6c8cece8550603a74a30c4e7d57d1"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="b53f65ecc832752c8394f0da74b2f90d"/></dir></dir><file name="Track.php" hash="eb12833d5f084b0b919cbde45f8170eb"/><file name="Words.php" hash="7789e47b991f718fb3097b5e274eb71f"/></dir><dir name="controllers"><file name="IndexController.php" hash="3ee34f42957e816ff336f8f8215a218b"/></dir><dir name="etc"><file name="config.xml" hash="44b407dcd58774176a2a37191daf04a2"/><file name="system.xml" hash="857fa4fae0433c10ba468bff794ca9ef"/></dir><dir name="sql"><dir name="track_setup"><file name="mysql4-install-0.1.0.php" hash="a8f81083585c85a89e8a3097f5f3045c"/></dir></dir></dir><dir name=".idea"><file name="Aftership.iml" hash="b65c9187598f152bd608db3b58e0dfa3"/><file name="encodings.xml" hash="f1c5edfa5b1a67aabcb9e41674afa252"/><file name="misc.xml" hash="81f494dfab5f1bcd653cd02a83ad9680"/><file name="modules.xml" hash="36699be41574657c6ba186c138f854ac"/><dir name="scopes"><file name="scope_settings.xml" hash="3d0b1957d39aa5636904788c54e654cf"/></dir><file name="vcs.xml" hash="1b4ab30910ae53c73594cd0e3db9840b"/><file name="workspace.xml" hash="bd1424aa8ed50f761caec75faf90a763"/><file name=".name" hash="c1eff2c08c463519ebd0f4401dbc6e2d"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Aftership_Track.xml" hash="6518f61d8f390f4fc8a517b2b15b01d1"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.13</min><max>5.4.8</max></php></required></dependencies>
18
  </package>