Paypal_InContext - Version 0.1.9

Version Notes

add compatibility with Idev OneStepCheckout

Download this release

Release Info

Developer Tikhonov Alex
Extension Paypal_InContext
Version 0.1.9
Comparing to
See all releases


Code changes from version 0.1.8 to 0.1.9

app/code/community/Paypal/InContext/Block/Js.php CHANGED
@@ -19,7 +19,6 @@ class Paypal_InContext_Block_Js extends Mage_Core_Block_Template{
19
  if (Mage::getStoreConfig('payment/incontext/sandbox')){
20
  $environment = 'sandbox';
21
  }
22
-
23
  if (empty($merchantId)){
24
  $isActive = false;
25
  }
19
  if (Mage::getStoreConfig('payment/incontext/sandbox')){
20
  $environment = 'sandbox';
21
  }
 
22
  if (empty($merchantId)){
23
  $isActive = false;
24
  }
app/code/community/Paypal/InContext/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Paypal_InContext>
5
- <version>0.1.8</version>
6
  </Paypal_InContext>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Paypal_InContext>
5
+ <version>0.1.9</version>
6
  </Paypal_InContext>
7
  </modules>
8
 
app/design/frontend/base/default/layout/incontext.xml CHANGED
@@ -11,7 +11,9 @@
11
  </default>
12
  <checkout_onepage_index>
13
  <reference name="checkout.onepage.payment">
14
- <action method="setTemplate"><template>incontext/onepage/payment.phtml</template></action>
 
 
15
  </reference>
16
  </checkout_onepage_index>
17
  </layout>
11
  </default>
12
  <checkout_onepage_index>
13
  <reference name="checkout.onepage.payment">
14
+ <action method="setTemplate">
15
+ <template>incontext/onepage/payment.phtml</template>
16
+ </action>
17
  </reference>
18
  </checkout_onepage_index>
19
  </layout>
app/design/frontend/base/default/template/incontext/js.phtml CHANGED
@@ -9,6 +9,59 @@ var PayPalLightboxConfig = '<?php echo $this->getJsonConfig();?>';
9
  <?php if (is_array($list) && count($list)>0):?>
10
  var IDS = <?php echo json_encode($list);?>;
11
  <?php endif;?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  </script>
13
  <script type="text/javascript" src="//www.paypalobjects.com/api/checkout.js" async></script>
14
  <?php endif;?>
9
  <?php if (is_array($list) && count($list)>0):?>
10
  var IDS = <?php echo json_encode($list);?>;
11
  <?php endif;?>
12
+ <?php if(Mage::getStoreConfig('onestepcheckout/general/rewrite_checkout_links')){
13
+ ?>
14
+ function idev_incontext_init_dialog(){
15
+ if (typeof(PayPalLightboxConfig) != 'undefined' && PayPalLightboxConfig.isActive==1 && (payment.currentMethod=='paypal_express' || payment.currentMethod=='paypaluk_express')){
16
+ already_placing_order = true;
17
+ if (payment.currentMethod=='paypal_express'){
18
+ var urlConnect = PayPalLightboxConfig.setExpressCheckout
19
+ }
20
+
21
+ if (payment.currentMethod=='paypaluk_express'){
22
+ var urlConnect = PayPalLightboxConfig.setExpressCheckoutUk;
23
+ }
24
+
25
+ paypal.checkout.initXO();
26
+ $ji.support.cors = true;
27
+ $ji.ajax({
28
+ url: urlConnect,
29
+ type: "GET",
30
+ async: true,
31
+ crossDomain: false,
32
+
33
+ success: function (token) {
34
+
35
+ if (token.indexOf('cart') != -1 ){
36
+ paypal.checkout.closeFlow();
37
+ setLocation(token);
38
+
39
+ }else{
40
+ var url = paypal.checkout.urlPrefix + token;
41
+ paypal.checkout.startFlow(url);
42
+ }
43
+
44
+ },
45
+ error: function (responseData, textStatus, errorThrown) {
46
+ alert("Error in ajax post"+responseData.statusText);
47
+ //Gracefully Close the minibrowser in case of AJAX errors
48
+ paypal.checkout.closeFlow();
49
+ }
50
+ });
51
+ }else{
52
+ already_placing_order = false;
53
+ }
54
+ }
55
+ $$('#checkout-payment-method-load dt input').invoke('observe', 'click', function() {
56
+ setTimeout(function(){
57
+ idev_incontext_init_dialog();
58
+ },200);
59
+ });
60
+ $('onestepcheckout-place-order').observe('click', function(e) {
61
+ idev_incontext_init_dialog();
62
+ });
63
+ <?php
64
+ }?>
65
  </script>
66
  <script type="text/javascript" src="//www.paypalobjects.com/api/checkout.js" async></script>
67
  <?php endif;?>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Paypal_InContext</name>
4
- <version>0.1.8</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Displays a PayPal in-context checkout window with the merchant website in the background</summary>
10
  <description>Displays a PayPal in-context checkout window with the merchant website in the background</description>
11
- <notes>add compatibility with new PayFlow(in new magento)</notes>
12
  <authors><author><name>Tikhonov Alex</name><user>nakilon</user><email>tihonov.sania@gmail.com</email></author></authors>
13
- <date>2015-10-23</date>
14
- <time>07:30:29</time>
15
- <contents><target name="magecommunity"><dir name="Paypal"><dir name="InContext"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Merchant.php" hash="c318d24329008a15e0f1d34dec520d54"/></dir></dir></dir></dir></dir><file name="Js.php" hash="566b053dfd3198911d81d5ae26f756a7"/><dir name="Paypal"><file name="Shortcut.php" hash="65b16b243a7af38a1a1e16556b2ddb51"/><file name="Shortcutuk.php" hash="56f3164949451c2b8755ffc1c958962b"/></dir></dir><dir name="Controller"><dir name="Express"><file name="Abstract.php" hash="89f478b50a5d373c4d2118dc434ad7d7"/></dir></dir><dir name="Model"><file name="Observer.php" hash="109d96386ed89a89b45282a8d0d09835"/><dir name="Paypal"><file name="Config.php" hash="42ca14d5c4a86c56fa007a554a0b918f"/></dir><file name="Paypal.php" hash="7856a0aaf391716d8a62f09586892798"/><file name="Paypaluk.php" hash="7826a6ad9b1b6d3119ce746ee6a2f58d"/></dir><dir name="controllers"><file name="ExpressController.php" hash="b5c1ca59f1b9e7bd9c2b6227aa12b8d5"/><file name="ExpressController.php.old" hash="6c7876b7b546e4c5384514b5e331331b"/><file name="ExpressukController.php" hash="5510ed72e457ddb977219bff1d5590c3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="527bc29c7976f429362c69ca2d741e51"/><file name="config.xml" hash="e280168eec14c05cfea78ee5cd4cb3be"/><file name="system.xml" hash="8f6b170346cad1b807109f6e308e5655"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="incontext.xml" hash="f95c43299bac692585bec6528019d6a5"/></dir><dir name="template"><dir name="incontext"><file name="js.phtml" hash="4d1a3d74394e44a4f3b74caa3eb5be50"/><dir name="onepage"><file name="payment.phtml" hash="3d86296835db6ddd6d7639690a0cd9c5"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="checkout"><file name="iwd-jquery-2.1.3.min.js" hash="9772750934a0092349bd664ee16cce53"/><file name="paypal-in-context.js" hash="53f8f9c659f27f69eec7b1e03876531c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Paypal_InContext.xml" hash="516d93ced7f2b513e454a42da1963599"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Paypal_InContext</name>
4
+ <version>0.1.9</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Displays a PayPal in-context checkout window with the merchant website in the background</summary>
10
  <description>Displays a PayPal in-context checkout window with the merchant website in the background</description>
11
+ <notes>add compatibility with Idev OneStepCheckout </notes>
12
  <authors><author><name>Tikhonov Alex</name><user>nakilon</user><email>tihonov.sania@gmail.com</email></author></authors>
13
+ <date>2015-11-23</date>
14
+ <time>14:51:43</time>
15
+ <contents><target name="magecommunity"><dir name="Paypal"><dir name="InContext"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Merchant.php" hash="c318d24329008a15e0f1d34dec520d54"/></dir></dir></dir></dir></dir><file name="Js.php" hash="4f6cf18b97a7202c3d980dc901017638"/><dir name="Paypal"><file name="Shortcut.php" hash="65b16b243a7af38a1a1e16556b2ddb51"/><file name="Shortcutuk.php" hash="56f3164949451c2b8755ffc1c958962b"/></dir></dir><dir name="Controller"><dir name="Express"><file name="Abstract.php" hash="89f478b50a5d373c4d2118dc434ad7d7"/></dir></dir><dir name="Model"><file name="Observer.php" hash="109d96386ed89a89b45282a8d0d09835"/><dir name="Paypal"><file name="Config.php" hash="42ca14d5c4a86c56fa007a554a0b918f"/></dir><file name="Paypal.php" hash="7856a0aaf391716d8a62f09586892798"/><file name="Paypaluk.php" hash="7826a6ad9b1b6d3119ce746ee6a2f58d"/></dir><dir name="controllers"><file name="ExpressController.php" hash="b5c1ca59f1b9e7bd9c2b6227aa12b8d5"/><file name="ExpressController.php.old" hash="6c7876b7b546e4c5384514b5e331331b"/><file name="ExpressukController.php" hash="5510ed72e457ddb977219bff1d5590c3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="527bc29c7976f429362c69ca2d741e51"/><file name="config.xml" hash="96199af3ef17b77edfdecbd7e1765aea"/><file name="system.xml" hash="8f6b170346cad1b807109f6e308e5655"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="incontext.xml" hash="a738201a16edb1d0f65b215743b143d8"/></dir><dir name="template"><dir name="incontext"><file name="js.phtml" hash="e91a0522dec2be5809d7e9ca3bfe1a37"/><dir name="onepage"><file name="payment.phtml" hash="3d86296835db6ddd6d7639690a0cd9c5"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="checkout"><file name="iwd-jquery-2.1.3.min.js" hash="9772750934a0092349bd664ee16cce53"/><file name="paypal-in-context.js" hash="cf993ac5164f6f30debc0177b36e5c65"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Paypal_InContext.xml" hash="516d93ced7f2b513e454a42da1963599"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
skin/frontend/base/default/js/checkout/paypal-in-context.js CHANGED
@@ -70,7 +70,6 @@ window.paypalCheckoutReady = function() {
70
  button: IDS,
71
  click: function (e) {
72
  e.preventDefault();
73
- console.log('express button click');
74
  if ($('paypal-save-button')!=undefined){
75
  if (payment.currentMethod!='paypal_express' && payment.currentMethod!='paypaluk_express'){
76
  return;
70
  button: IDS,
71
  click: function (e) {
72
  e.preventDefault();
 
73
  if ($('paypal-save-button')!=undefined){
74
  if (payment.currentMethod!='paypal_express' && payment.currentMethod!='paypaluk_express'){
75
  return;