taply - Version 1.1.0

Version Notes

change api domen

Download this release

Release Info

Developer taply
Extension taply
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.4 to 1.1.0

app/code/local/Taply/Paybutton/Block/Button/Pay.php CHANGED
@@ -22,7 +22,7 @@ class Taply_Paybutton_Block_Button_Pay extends Mage_Core_Block_Template
22
  $cartItems = $quote->getAllVisibleItems();
23
  foreach ($cartItems as $item) {
24
  $product = $item->getProduct();
25
- $arrItems[] = array(
26
  'item_prod_id' => $product->getId(),
27
  'item_name' => $product->getName(),
28
  'item_img' => (string)Mage::helper('catalog/image')->init($product, 'thumbnail'),
@@ -32,8 +32,9 @@ class Taply_Paybutton_Block_Button_Pay extends Mage_Core_Block_Template
32
  );
33
  $objAttr = $product->getCustomOption('attributes');
34
  if($objAttr){
35
- $arrItems['item_prod_attr'] = unserialize($objAttr->getValue());
36
  }
 
37
  }
38
 
39
  return array('merchant' => $this->config['merchant_id'],'description' => $this->config['description'],'currency'=>'USD','items' => $arrItems);
22
  $cartItems = $quote->getAllVisibleItems();
23
  foreach ($cartItems as $item) {
24
  $product = $item->getProduct();
25
+ $arrItem = array(
26
  'item_prod_id' => $product->getId(),
27
  'item_name' => $product->getName(),
28
  'item_img' => (string)Mage::helper('catalog/image')->init($product, 'thumbnail'),
32
  );
33
  $objAttr = $product->getCustomOption('attributes');
34
  if($objAttr){
35
+ $arrItem['item_prod_attr'] = unserialize($objAttr->getValue());
36
  }
37
+ $arrItems[] = $arrItem;
38
  }
39
 
40
  return array('merchant' => $this->config['merchant_id'],'description' => $this->config['description'],'currency'=>'USD','items' => $arrItems);
js/taply/taply.1.1.js CHANGED
@@ -75,7 +75,11 @@
75
 
76
  w.TaplyDlg.initialized = true;
77
  },
78
-
 
 
 
 
79
  send: function(){
80
  w.Taply.send(w.TaplyDlg.current);
81
  },
@@ -150,7 +154,7 @@
150
  break;
151
  case 1:
152
  n='<div><div class="loader">Loading</div><p>' + w.Taply.notifyMessages[c] + '</p></div>';
153
- f='<div><button class="btn pay-later">Pay later</button><button class="btn btn-alt close-modal">Cancel</button></div>'
154
  break;
155
  default :
156
  n= '<div><p>' + (w.Taply.notifyMessages[c] ? w.Taply.notifyMessages[c] : n) + '</p></div>';
@@ -227,7 +231,7 @@
227
  }
228
  };
229
  w.Taply = {
230
- apiurl: "https://njs-api.paybytaply.com/payment",
231
  btnClass: 'taply-block',
232
  modules: [],
233
  mask: '(___) ___-____',
@@ -308,16 +312,18 @@
308
  return false;
309
  },
310
  init: function(){
311
- w.Taply.ls(w.Taply.apiurl + '/start?callback=Taply.initValues');
 
312
  var tbs = d.getElementsByClassName(w.Taply.btnClass);
313
  for(var i=0; i<tbs.length; i++){
314
  w.Taply.modules.push(new w.TaplyModule(tbs[i],w.Taply.modules.length) );
315
  }
316
  },
317
- initValues: function(data){
318
- if(data.result.phone){
319
- w.Taply.savedPhone=w.Taply.format(data.result.phone);
320
- var tbs = d.getElementsByClassName(w.Taply.btnClass), phone=w.Taply.savedPhone;
 
321
  for(var i=0; i<tbs.length; i++){
322
  var ps = tbs[i].getElementsByTagName('input');
323
  for(var p=0;p<ps.length;p++){
@@ -337,8 +343,8 @@
337
  case 'item':
338
  p = "&iuid=" + block.el.attributes['data-iuid'].value;
339
  break;
340
- case 'cart':
341
- p = "&cart=" + block.el.attributes['data-cart'].value;
342
  break;
343
  case 'auto':
344
  // var cart = w.Taply.getCart(block);
@@ -360,20 +366,23 @@
360
  clearInterval(w.Taply.ch);
361
  if(block.save_phone.checked){
362
  w.Taply.savedPhone = block.phone.value;
 
363
  }
364
  if(w.Taply.verify(block)){
365
  w.Taply.ls(w.Taply.apiurl + '/add?callback=Taply.checkResponse' + w.Taply.getParamStr(block));
366
  }
367
  },
368
  cancel: function(block){
 
369
  if(block.pid){
370
- w.Taply.ls(w.Taply.apiurl + "/cancel?payment=" + block.pid);
371
  block.initialized = false;
372
  }
373
  },
374
  payLater: function(block){
 
375
  if(block.pid){
376
- w.Taply.ls(w.Taply.apiurl + "/paylater?payment=" + block.pid);
377
  block.initialized = false;
378
  }
379
  },
@@ -386,6 +395,7 @@
386
  if(el === undefined){
387
  return;
388
  }
 
389
  if (data.result.payment_result == 1){
390
  n = w.Taply.notifies.complete;
391
  w.Taply.ch = setInterval(w.Taply.checkPayment,1000,data.result.payment);
@@ -439,7 +449,7 @@
439
  },
440
  };
441
  var css=document.createElement("style");
442
- css.innerHTML = ".pay-module .taply-apply-pay {background: url( //www.paybytaply.com/static/img/asset/pay-by-taply-btn-dark-wide.png ) no-repeat;display: block;float: right;height: 53px;margin-bottom: 10px;font-size: 0;width: 248px;}@media only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {.pay-module .taply-apply-pay { background-image: url( //www.paybytaply.com/static/img/asset/pay-by-taply-btn-dark-2x.png );background-size: 248px 62px;}}.pay-module a {color: #6a0fa5; text-decoration: none; } .pay-module a:hover {text-decoration: underline; }.pay-module p {color: #959595; font-size: 16px; clear: both;}.pay-module h4 {color: #595959; font-size: 16px; margin-bottom: 10px; }.taply-modal button { box-shadow: none; }";
443
  d.getElementsByTagName("head")[0].appendChild(css);
444
  w.addEventListener('load', w.Taply.init.bind(w), false);
445
- })(window,document);
75
 
76
  w.TaplyDlg.initialized = true;
77
  },
78
+ // mask: function(ti){
79
+ // if(ti.onkeydown){
80
+ // ti.onkeydown = w.Taply.check;
81
+ // }
82
+ // },
83
  send: function(){
84
  w.Taply.send(w.TaplyDlg.current);
85
  },
154
  break;
155
  case 1:
156
  n='<div><div class="loader">Loading</div><p>' + w.Taply.notifyMessages[c] + '</p></div>';
157
+ f='<div>' + (w.Taply.showPayLater? '<button class="btn pay-later">Pay later</button>' : '') + '<button class="btn btn-alt close-modal">Cancel</button></div>'
158
  break;
159
  default :
160
  n= '<div><p>' + (w.Taply.notifyMessages[c] ? w.Taply.notifyMessages[c] : n) + '</p></div>';
231
  }
232
  };
233
  w.Taply = {
234
+ apiurl: "https://api.paybytaply.com/payment",
235
  btnClass: 'taply-block',
236
  modules: [],
237
  mask: '(___) ___-____',
312
  return false;
313
  },
314
  init: function(){
315
+ // w.Taply.ls(w.Taply.apiurl + '/start?callback=Taply.initValues');
316
+ w.Taply.initValues();
317
  var tbs = d.getElementsByClassName(w.Taply.btnClass);
318
  for(var i=0; i<tbs.length; i++){
319
  w.Taply.modules.push(new w.TaplyModule(tbs[i],w.Taply.modules.length) );
320
  }
321
  },
322
+ initValues: function(){
323
+ var phone = w.localStorage.getItem('taply_phone');
324
+ if(phone){
325
+ w.Taply.savedPhone = phone;
326
+ var tbs = d.getElementsByClassName(w.Taply.btnClass);
327
  for(var i=0; i<tbs.length; i++){
328
  var ps = tbs[i].getElementsByTagName('input');
329
  for(var p=0;p<ps.length;p++){
343
  case 'item':
344
  p = "&iuid=" + block.el.attributes['data-iuid'].value;
345
  break;
346
+ case 'cart':
347
+ p = "&cart=" + encodeURIComponent(block.el.attributes['data-cart'].value);
348
  break;
349
  case 'auto':
350
  // var cart = w.Taply.getCart(block);
366
  clearInterval(w.Taply.ch);
367
  if(block.save_phone.checked){
368
  w.Taply.savedPhone = block.phone.value;
369
+ w.localStorage.setItem('taply_phone',w.Taply.savedPhone);
370
  }
371
  if(w.Taply.verify(block)){
372
  w.Taply.ls(w.Taply.apiurl + '/add?callback=Taply.checkResponse' + w.Taply.getParamStr(block));
373
  }
374
  },
375
  cancel: function(block){
376
+ clearInterval(w.Taply.ch);
377
  if(block.pid){
378
+ w.Taply.ls(w.Taply.apiurl + "/cancel?callback=n&payment=" + block.pid);
379
  block.initialized = false;
380
  }
381
  },
382
  payLater: function(block){
383
+ clearInterval(w.Taply.ch);
384
  if(block.pid){
385
+ w.Taply.ls(w.Taply.apiurl + (w.Taply.showPayLater? '/paylater' : '/cancel' ) + "?callback=n&payment=" + block.pid);
386
  block.initialized = false;
387
  }
388
  },
395
  if(el === undefined){
396
  return;
397
  }
398
+ w.Taply.showPayLater = data.result.pay_later_button;
399
  if (data.result.payment_result == 1){
400
  n = w.Taply.notifies.complete;
401
  w.Taply.ch = setInterval(w.Taply.checkPayment,1000,data.result.payment);
449
  },
450
  };
451
  var css=document.createElement("style");
452
+ css.innerHTML = ".pay-module .taply-apply-pay {background: url( //www.paybytaply.com/static/img/asset/pay-by-taply-btn-dark-wide.png ) no-repeat;display: block;float: right;height: 53px;margin-bottom: 10px;font-size: 0;width: 248px;}@media only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min-device-pixel-ratio: 2) {.pay-module .taply-apply-pay {background-image: url( //www.paybytaply.com/static/img/asset/pay-by-taply-btn-dark-wide-2x.png ); background-size: 248px 53px;}}.pay-module a {color: #6a0fa5; text-decoration: none; }.pay-module a:hover {text-decoration: underline; }.pay-module p {color: #959595; font-size: 16px; clear: both;}.pay-module h4 {color: #595959; font-size: 16px; margin-bottom: 10px; }.taply-modal button { box-shadow: none; }";
453
  d.getElementsByTagName("head")[0].appendChild(css);
454
  w.addEventListener('load', w.Taply.init.bind(w), false);
455
+ })(window,document);
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>taply</name>
4
- <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -9,11 +9,11 @@
9
  <summary>Securely checkout using Apple Pay</summary>
10
  <description>Securely checkout using Apple Pay with only a tap of your finger and never enter your billing or shipping information again.&#xD;
11
  taply allows you to use Apple Pay for an incredibly fast, secure, and seamless online checkout. Go anywhere online that has the taply button, enter your mobile number, then use the taply app to complete the purchase using Touch ID.</description>
12
- <notes>fix taply button</notes>
13
  <authors><author><name>taply</name><user>taply</user><email>admin@paybytaply.com</email></author></authors>
14
- <date>2015-09-23</date>
15
- <time>08:30:43</time>
16
- <contents><target name="magelocal"><dir><dir name="Taply"><dir name="Paybutton"><dir name="Block"><dir name="Button"><file name="Pay.php" hash="667bb6ad961f4b4a4b861815f7399224"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c8404ec959ddf4bf9fbee31fc2314d34"/></dir><dir name="Model"><file name="Payment.php" hash="4af32846253babe72e11551003a2662c"/><file name="Viewtype.php" hash="c39cf7f525e11ab1de3f10a939caf494"/></dir><dir name="controllers"><file name="GetshippingController.php" hash="eddc9190345dffefbfcfcd59035af51d"/><file name="SuccessController.php" hash="403d9213201003191a2bf2a98aa055d6"/></dir><dir name="etc"><file name="config.xml" hash="609a44c8d30d748b8840400e37666dba"/><file name="system.xml" hash="520313dbaf29da8a44325f1a2880d30a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Taply_Paybutton.xml" hash="2c4c33fa727a3fe1d863353583e1dfa0"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="taply.xml" hash="bc7a785448a0e2b2754e46fa786a5b3d"/></dir><dir name="template"><dir name="taply"><file name="button.phtml" hash="b6541c278d428eea006a782e11abe2e3"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="taply"><file name="taply.1.1.js" hash="167a2e41fd6a28d4e723cf94dd99be12"/></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.4.0</min><max>5.6.999</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>taply</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
9
  <summary>Securely checkout using Apple Pay</summary>
10
  <description>Securely checkout using Apple Pay with only a tap of your finger and never enter your billing or shipping information again.&#xD;
11
  taply allows you to use Apple Pay for an incredibly fast, secure, and seamless online checkout. Go anywhere online that has the taply button, enter your mobile number, then use the taply app to complete the purchase using Touch ID.</description>
12
+ <notes>change api domen</notes>
13
  <authors><author><name>taply</name><user>taply</user><email>admin@paybytaply.com</email></author></authors>
14
+ <date>2015-11-13</date>
15
+ <time>15:21:53</time>
16
+ <contents><target name="magelocal"><dir><dir name="Taply"><dir name="Paybutton"><dir name="Block"><dir name="Button"><file name="Pay.php" hash="7c751e6a0aa7e1e015e5dd58e4c8f7da"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c8404ec959ddf4bf9fbee31fc2314d34"/></dir><dir name="Model"><file name="Payment.php" hash="4af32846253babe72e11551003a2662c"/><file name="Viewtype.php" hash="c39cf7f525e11ab1de3f10a939caf494"/></dir><dir name="controllers"><file name="GetshippingController.php" hash="eddc9190345dffefbfcfcd59035af51d"/><file name="SuccessController.php" hash="403d9213201003191a2bf2a98aa055d6"/></dir><dir name="etc"><file name="config.xml" hash="609a44c8d30d748b8840400e37666dba"/><file name="system.xml" hash="520313dbaf29da8a44325f1a2880d30a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Taply_Paybutton.xml" hash="2c4c33fa727a3fe1d863353583e1dfa0"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="taply.xml" hash="bc7a785448a0e2b2754e46fa786a5b3d"/></dir><dir name="template"><dir name="taply"><file name="button.phtml" hash="b6541c278d428eea006a782e11abe2e3"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="taply"><file name="taply.1.1.js" hash="2a1757f3faa76ac06ccaa3b6a52c2f2c"/></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.4.0</min><max>5.6.999</max></php></required></dependencies>
19
  </package>