nypwidget - Version 2.1.0

Version Notes

Bug Fix:
- Added additional check for generated API Secret, now generating automatically if one isn't set.

Download this release

Release Info

Developer PriceWaiter
Extension nypwidget
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.3 to 2.1.0

app/code/community/PriceWaiter/NYPWidget/Block/Adminhtml/Signup.php CHANGED
@@ -52,4 +52,9 @@ class PriceWaiter_NYPWidget_Block_Adminhtml_Signup extends Mage_Adminhtml_Block_
52
  {
53
  return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_pricewaiter/token');
54
  }
 
 
 
 
 
55
  }
52
  {
53
  return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_pricewaiter/token');
54
  }
55
+
56
+ public function getSecretUrl()
57
+ {
58
+ return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_pricewaiter/secret');
59
+ }
60
  }
app/code/community/PriceWaiter/NYPWidget/controllers/Adminhtml/PricewaiterController.php CHANGED
@@ -95,4 +95,17 @@ class PriceWaiter_NYPWidget_Adminhtml_PriceWaiterController extends Mage_Adminht
95
 
96
  return;
97
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
95
 
96
  return;
97
  }
98
+
99
+ public function secretAction()
100
+ {
101
+ $secret = Mage::helper('nypwidget')->getSecret();
102
+
103
+ $this->getResponse()->clearHeaders()->setHeader(
104
+ 'Content-type', 'application/json', true
105
+ );
106
+
107
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array(
108
+ 'secret' => $secret
109
+ )));
110
+ }
111
  }
app/code/community/PriceWaiter/NYPWidget/etc/config.xml CHANGED
@@ -18,7 +18,7 @@
18
 
19
  <modules>
20
  <PriceWaiter_NYPWidget>
21
- <version>2.0.3</version>
22
  </PriceWaiter_NYPWidget>
23
  </modules>
24
 
18
 
19
  <modules>
20
  <PriceWaiter_NYPWidget>
21
+ <version>2.1.0</version>
22
  </PriceWaiter_NYPWidget>
23
  </modules>
24
 
app/design/adminhtml/default/default/template/pricewaiter/signup.phtml CHANGED
@@ -1,4 +1,5 @@
1
  <?php echo $this->getButtonHtml(); ?>
2
  <script type="text/javascript">
3
  var priceWaiterTokenURL = '<?php echo $this->getTokenUrl(); ?>';
 
4
  </script>
1
  <?php echo $this->getButtonHtml(); ?>
2
  <script type="text/javascript">
3
  var priceWaiterTokenURL = '<?php echo $this->getTokenUrl(); ?>';
4
+ var priceWaiterSecretURL = '<?php echo $this->getSecretUrl(); ?>';
5
  </script>
js/pricewaiter/token.js CHANGED
@@ -18,14 +18,15 @@
18
 
19
  (function() {
20
  document.observe('dom:loaded', function() {
21
- var button, enableButton, fetchToken, pwSignup, scope, tokenInput;
22
  if (typeof priceWaiterTokenURL === 'undefined') {
23
  return;
24
  }
25
  tokenInput = document.getElementById('pricewaiter_configuration_sign_up_token');
26
  button = document.getElementById('nypwidget_signup');
27
  scope = document.getElementById('store_switcher');
28
- if (typeof button === 'undefined') {
 
29
  return;
30
  }
31
  fetchToken = function() {
@@ -40,6 +41,14 @@
40
  }
41
  });
42
  };
 
 
 
 
 
 
 
 
43
  pwSignup = function() {
44
  window.open('https://manage.pricewaiter.com/sign-up?token=' + tokenInput.value);
45
  return false;
@@ -56,6 +65,9 @@
56
  } else {
57
  enableButton();
58
  }
 
 
 
59
  });
60
 
61
  }).call(this);
18
 
19
  (function() {
20
  document.observe('dom:loaded', function() {
21
+ var apiSecret, button, enableButton, fetchSecret, fetchToken, pwSignup, scope, tokenInput;
22
  if (typeof priceWaiterTokenURL === 'undefined') {
23
  return;
24
  }
25
  tokenInput = document.getElementById('pricewaiter_configuration_sign_up_token');
26
  button = document.getElementById('nypwidget_signup');
27
  scope = document.getElementById('store_switcher');
28
+ apiSecret = document.getElementById('pricewaiter_configuration_api_secret');
29
+ if (typeof button === 'undefined' || button === null) {
30
  return;
31
  }
32
  fetchToken = function() {
41
  }
42
  });
43
  };
44
+ fetchSecret = function() {
45
+ new Ajax.Request(priceWaiterSecretURL, {
46
+ method: 'post',
47
+ onSuccess: function(transport) {
48
+ apiSecret.value = transport.responseJSON.secret;
49
+ }
50
+ });
51
+ };
52
  pwSignup = function() {
53
  window.open('https://manage.pricewaiter.com/sign-up?token=' + tokenInput.value);
54
  return false;
65
  } else {
66
  enableButton();
67
  }
68
+ if (apiSecret.value === '') {
69
+ return fetchSecret();
70
+ }
71
  });
72
 
73
  }).call(this);
package.xml CHANGED
@@ -1,14 +1,14 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>nypwidget</name>
4
- <version>2.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>PriceWaiter&#xAE; let's buyers make offers on your products that you can easily accept, counter offer or reject.</summary>
10
  <description>Sell more, immediately, with the PriceWaiter&#xAE; widget. Convert comparison shoppers you might have lost, increase sales and conversions, and stop "minimum advertised price" from preventing sales before they even start.&#xD;&#xD; PriceWaiter&#xAE; lets customers make offers on products you sell-- offers you can accept, reject or counter. The widget embeds a simple Name Your Price button on any product page or category that you choose. Simply install the extension and you'll have full control over PriceWaiter&#xAE; in your Magento admin control panel.</description>
11
- <notes>Bug Fix:&#xD;- Fixes a bug in configurable product price calculation.</notes>
12
  <authors>
13
  <author>
14
  <name>PriceWaiter</name>
@@ -16,137 +16,9 @@
16
  <email>bobby.b@pricewaiter.com</email>
17
  </author>
18
  </authors>
19
- <date>2014-02-17</date>
20
- <time>21:05:35</time>
21
- <contents>
22
- <target name="magecommunity">
23
- <dir name="PriceWaiter">
24
- <dir name="NYPWidget">
25
- <dir name="Block">
26
- <dir name="Adminhtml">
27
- <file name="Widget.php" hash="b781daf1de34d7856de7faba65afe414"/>
28
- <file name="Link.php" hash="848a4e3813a3d238cacdd812334bb780"/>
29
- <file name="Signup.php" hash="dab8d9a3da78ce206c70877e1e8f71b9"/>
30
- </dir>
31
- <file name="Category.php" hash="de6397a45d7deabc803bef83a83d6b9a"/>
32
- <file name="Widget.php" hash="193d694c4acc2133d8402f1e59d4dc25"/>
33
- </dir>
34
- <dir name="Helper">
35
- <file name="Data.php" hash="3b85120aaa222082063f464f1d11debb"/>
36
- </dir>
37
- <dir name="Model">
38
- <file name="Callback.php" hash="65f978209a660f847954795c6a8525e8"/>
39
- <dir name="Carrier">
40
- <file name="ShippingMethod.php" hash="43a6ec1ad462797a5359238dcf9a749d"/>
41
- </dir>
42
- <file name="Category.php" hash="884685769be745cb273833ab7d691593"/>
43
- <dir name="Display">
44
- <file name="Phrase.php" hash="5b595a42b487930154c505a8e9a1301c"/>
45
- <file name="Size.php" hash="8a596164268f48c3c034274550b13b96"/>
46
- </dir>
47
- <dir name="Mysql4">
48
- <dir name="Category">
49
- <file name="Collection.php" hash="45eaa532cd5935b69102b8969da848fa"/>
50
- </dir>
51
- <file name="Category.php" hash="f4e761813ec4bb81d919f30895ce3578"/>
52
- <dir name="Order">
53
- <file name="Collection.php" hash="4dc5b344274c0e5a391a24864fd1c003"/>
54
- </dir>
55
- <file name="Order.php" hash="c08b340cec16bf774a7c178726dee0ac"/>
56
- </dir>
57
- <file name="Observer.php" hash="2399e210dd82633091570483f144bf12"/>
58
- <file name="Order.php" hash="080844dcc4cf55d516abe27175a3a62a"/>
59
- <file name="PaymentMethod.php" hash="386134e1ac803580222263523f0ced31"/>
60
- <dir name="Resource">
61
- <dir name="Eav">
62
- <dir name="Mysql4">
63
- <file name="Setup.php" hash="d63678e9cc718ee87e8db3ca5163a8fd"/>
64
- </dir>
65
- </dir>
66
- </dir>
67
- </dir>
68
- <dir name="controllers">
69
- <dir name="Adminhtml">
70
- <file name="PricewaiterController.php" hash="2dbf6509bca54d915c6f83de40e572bb"/>
71
- </dir>
72
- <file name="CallbackController.php" hash="d16b43353b74924298ff4cf7cf989f33"/>
73
- <file name="ProductinfoController.php" hash="116869b03b42e93c66fde077aeec22ce"/>
74
- </dir>
75
- <dir name="etc">
76
- <file name="adminhtml.xml" hash="dff2f6de0dacaf5a933048fa4a347f2f"/>
77
- <file name="config.xml" hash="5f3051ad2ee38e9642dd6cac5a52926a"/>
78
- <file name="system.xml" hash="82bb83cf7eb6a1d0ebf6bb774cd24414"/>
79
- </dir>
80
- <dir name="sql">
81
- <dir name="nypwidget_setup">
82
- <file name="mysql4-install-1.0.0.php" hash="cd1b7892e75e4452ee94afbbefb4de6e"/>
83
- <file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="d1ae05f5cbe4a8f833e92b9f49d395db"/>
84
- <file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="bd342c802f6c91de6f9f51b0a4a25414"/>
85
- <file name="mysql4-upgrade-1.2.4-1.2.5.php" hash="b1ced0226bef6e950e026402b933872f"/>
86
- <file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="106b36065c125be31fc67424d80acdd4"/>
87
- </dir>
88
- </dir>
89
- </dir>
90
- </dir>
91
- </target>
92
- <target name="magedesign">
93
- <dir name="adminhtml">
94
- <dir name="default">
95
- <dir name="default">
96
- <dir name="layout">
97
- <file name="pricewaiter.xml" hash="9e06026a8a820224336de4c9a7dde3fd"/>
98
- </dir>
99
- <dir name="template">
100
- <dir name="pricewaiter">
101
- <file name="categorytab.phtml" hash="d1d2c333cc9b18c909a44d333d8ab077"/>
102
- <file name="signup.phtml" hash="1a1f3c3cd82b8e3360951c1012dc1131"/>
103
- </dir>
104
- </dir>
105
- </dir>
106
- </dir>
107
- </dir>
108
- <dir name="frontend">
109
- <dir name="base">
110
- <dir name="default">
111
- <dir name="layout">
112
- <file name="pricewaiter.xml" hash="cbaa61566545d46740d2e9b6078d1874"/>
113
- </dir>
114
- <dir name="template">
115
- <dir name="pricewaiter">
116
- <file name="widget.phtml" hash="9b2734821e5ed45d51b6926f51f834a0"/>
117
- </dir>
118
- </dir>
119
- </dir>
120
- </dir>
121
- </dir>
122
- </target>
123
- <target name="mageetc">
124
- <dir name="modules">
125
- <file name="PriceWaiter_NYPWidget.xml" hash="72be18d9a8a741abc8926866449619cd"/>
126
- </dir>
127
- </target>
128
- <target name="mage">
129
- <dir name="js">
130
- <dir name="pricewaiter">
131
- <file name="product-pages.js" hash="db4c96a2186bda2754d80fab21139503"/>
132
- <file name="token.js" hash="d125ae6b7d01b3c0320691c29fd6cce2"/>
133
- </dir>
134
- </dir>
135
- </target>
136
- <target name="mageskin">
137
- <dir name="adminhtml">
138
- <dir name="default">
139
- <dir name="default">
140
- <dir name="images">
141
- <file name="pricewaiter_logo.png" hash="becb9713a561131ff69eabb7503d3e74"/>
142
- <file name="pricewaiter_tab.png" hash="1bab71be6b1a93aee2ae7aeae3807484"/>
143
- </dir>
144
- <file name="pricewaiter.css" hash="c4061169f3e505c28bd09924108ca0ad"/>
145
- </dir>
146
- </dir>
147
- </dir>
148
- </target>
149
- </contents>
150
  <compatible/>
151
  <dependencies>
152
  <required>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>nypwidget</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>PriceWaiter&#xAE; let's buyers make offers on your products that you can easily accept, counter offer or reject.</summary>
10
  <description>Sell more, immediately, with the PriceWaiter&#xAE; widget. Convert comparison shoppers you might have lost, increase sales and conversions, and stop "minimum advertised price" from preventing sales before they even start.&#xD;&#xD; PriceWaiter&#xAE; lets customers make offers on products you sell-- offers you can accept, reject or counter. The widget embeds a simple Name Your Price button on any product page or category that you choose. Simply install the extension and you'll have full control over PriceWaiter&#xAE; in your Magento admin control panel.</description>
11
+ <notes>Bug Fix:&#xD;- Added additional check for generated API Secret, now generating automatically if one isn't set.</notes>
12
  <authors>
13
  <author>
14
  <name>PriceWaiter</name>
16
  <email>bobby.b@pricewaiter.com</email>
17
  </author>
18
  </authors>
19
+ <date>2015-05-07</date>
20
+ <time>13:44:40</time>
21
+ <contents><target name="mageweb"><dir name="app"><dir name="etc"><dir name="modules"><file name="PriceWaiter_NYPWidget.xml" hash="72be18d9a8a741abc8926866449619cd"/></dir></dir><dir name="code"><dir name="community"><dir name="PriceWaiter"><dir name="NYPWidget"><dir name="Block"><dir name="Adminhtml"><file name="Link.php" hash="848a4e3813a3d238cacdd812334bb780"/><file name="Signup.php" hash="35a2739246307b5c7a3b69780a7f31fd"/><file name="Widget.php" hash="b781daf1de34d7856de7faba65afe414"/></dir><file name="Category.php" hash="de6397a45d7deabc803bef83a83d6b9a"/><file name="Widget.php" hash="193d694c4acc2133d8402f1e59d4dc25"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PricewaiterController.php" hash="27e17f05c8e2b2edcc28230185334f35"/></dir><file name="CallbackController.php" hash="d16b43353b74924298ff4cf7cf989f33"/><file name="ProductinfoController.php" hash="116869b03b42e93c66fde077aeec22ce"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dff2f6de0dacaf5a933048fa4a347f2f"/><file name="config.xml" hash="6e7c11b1df196d5c4e74bf0bae93d5fd"/><file name="system.xml" hash="82bb83cf7eb6a1d0ebf6bb774cd24414"/></dir><dir name="Helper"><file name="Data.php" hash="49a7fdd4928b3c0d358ad7e1d240d874"/></dir><dir name="Model"><file name="Callback.php" hash="65f978209a660f847954795c6a8525e8"/><file name="Category.php" hash="884685769be745cb273833ab7d691593"/><file name="Observer.php" hash="2399e210dd82633091570483f144bf12"/><file name="Order.php" hash="080844dcc4cf55d516abe27175a3a62a"/><file name="PaymentMethod.php" hash="386134e1ac803580222263523f0ced31"/><dir name="Carrier"><file name="ShippingMethod.php" hash="43a6ec1ad462797a5359238dcf9a749d"/></dir><dir name="Display"><file name="Phrase.php" hash="5b595a42b487930154c505a8e9a1301c"/><file name="Size.php" hash="8a596164268f48c3c034274550b13b96"/></dir><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="45eaa532cd5935b69102b8969da848fa"/></dir><file name="Category.php" hash="f4e761813ec4bb81d919f30895ce3578"/><file name="Order.php" hash="c08b340cec16bf774a7c178726dee0ac"/><dir name="Order"><file name="Collection.php" hash="4dc5b344274c0e5a391a24864fd1c003"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="d63678e9cc718ee87e8db3ca5163a8fd"/></dir></dir></dir></dir><dir name="sql"><dir name="nypwidget_setup"><file name="mysql4-install-1.0.0.php" hash="cd1b7892e75e4452ee94afbbefb4de6e"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="d1ae05f5cbe4a8f833e92b9f49d395db"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="bd342c802f6c91de6f9f51b0a4a25414"/><file name="mysql4-upgrade-1.2.4-1.2.5.php" hash="b1ced0226bef6e950e026402b933872f"/><file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="106b36065c125be31fc67424d80acdd4"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="9e06026a8a820224336de4c9a7dde3fd"/></dir><dir name="template"><dir name="pricewaiter"><file name="categorytab.phtml" hash="d1d2c333cc9b18c909a44d333d8ab077"/><file name="signup.phtml" hash="fc18c669c18c55cccdf2c66c96199dec"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pricewaiter.xml" hash="cbaa61566545d46740d2e9b6078d1874"/></dir><dir name="template"><dir name="pricewaiter"><file name="widget.phtml" hash="3b85120aaa222082063f464f1d11debb"/></dir></dir></dir></dir></dir></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="pricewaiter_logo.png" hash="becb9713a561131ff69eabb7503d3e74"/><file name="pricewaiter_tab.png" hash="1bab71be6b1a93aee2ae7aeae3807484"/><file name="pricewaiter_logo.png" hash="becb9713a561131ff69eabb7503d3e74"/><file name="pricewaiter_tab.png" hash="1bab71be6b1a93aee2ae7aeae3807484"/></dir><file name="pricewaiter.css" hash="c4061169f3e505c28bd09924108ca0ad"/></dir></dir></dir></dir><dir name="js"><dir name="pricewaiter"><file name="product-pages.js" hash="db4c96a2186bda2754d80fab21139503"/><file name="token.js" hash="dbaedb04a60982743949e16096ed7f58"/></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  <compatible/>
23
  <dependencies>
24
  <required>