Qualityunit_Pap - Version 1.0.8

Version Notes

- PayPal Standard redirection fixed
- PayPal Standard IPN fixed

Download this release

Release Info

Developer Quality Unit, LLC
Extension Qualityunit_Pap
Version 1.0.8
Comparing to
See all releases


Code changes from version 1.0.7 to 1.0.8

app/code/local/Qualityunit/Pap/Block/Paypal/Redirect.php CHANGED
@@ -11,14 +11,15 @@ class Qualityunit_Pap_Block_Paypal_Redirect extends Mage_Core_Block_Abstract {
11
  ->setUseContainer(true);
12
  foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {
13
  if ($field == 'notify_url') {
14
- $form->addField($field, 'hidden', array('name'=>$field, 'id'=>'pap_ab78y5t4a', 'value'=>$value));
15
  }
16
  else {
17
  $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
18
  }
19
  }
20
  // custom field with order ID
21
- $form->addField('custom', 'hidden', array('name'=>'custom', 'value'=>$this->getCheckout()->getLastRealOrderId()));
 
22
 
23
  $idSuffix = Mage::helper('core')->uniqHash();
24
  $submitButton = new Varien_Data_Form_Element_Submit(array(
@@ -45,6 +46,7 @@ class Qualityunit_Pap_Block_Paypal_Redirect extends Mage_Core_Block_Abstract {
45
  <script type="text/javascript">'.
46
  "PostAffTracker.setAccountId('".$accountID."');
47
  PostAffTracker.writeCookieToCustomField('pap_ab78y5t4a', '', 'pap_custom');
 
48
  </script>
49
  <!-- /Post Affiliate Pro integration snippet -->";
50
  $html.= '</body></html>';
11
  ->setUseContainer(true);
12
  foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {
13
  if ($field == 'notify_url') {
14
+ $form->addField($field, 'hidden', array('name'=>$field, 'id'=>'pap_ab78y5t4a', 'value'=>$value)); // html_id
15
  }
16
  else {
17
  $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
18
  }
19
  }
20
  // custom field with order ID
21
+ $orderIncrementId = $standard->getCheckout()->getLastRealOrderId();
22
+ $form->addField('custom', 'hidden', array('name'=>'custom', 'value'=>$orderIncrementId));
23
 
24
  $idSuffix = Mage::helper('core')->uniqHash();
25
  $submitButton = new Varien_Data_Form_Element_Submit(array(
46
  <script type="text/javascript">'.
47
  "PostAffTracker.setAccountId('".$accountID."');
48
  PostAffTracker.writeCookieToCustomField('pap_ab78y5t4a', '', 'pap_custom');
49
+ PostAffTracker.writeCookieToCustomField('notify_url', '', 'pap_custom');
50
  </script>
51
  <!-- /Post Affiliate Pro integration snippet -->";
52
  $html.= '</body></html>';
app/code/local/Qualityunit/Pap/Model/Paypal.php CHANGED
@@ -7,8 +7,7 @@ class Qualityunit_Pap_Model_Paypal extends Mage_Paypal_Model_Standard {
7
  try {
8
  $pap = Mage::getModel('pap/pap');
9
  $postData = $this->getIpnFormData();
10
- $orderID = $_POST['custom'];
11
- $visitorID = $_GET['pap_custom'];;
12
 
13
  $sReq = '';
14
  foreach($this->getIpnFormData() as $k=>$v) {
@@ -25,7 +24,8 @@ class Qualityunit_Pap_Model_Paypal extends Mage_Paypal_Model_Standard {
25
  $response = trim($response[1]);
26
 
27
  if ($response=='VERIFIED') {
28
- $pap->registerOrder($saleData, isset($visitorID) ? $visitorID : null);
 
29
  }
30
  }
31
  catch (Exception $e) {
7
  try {
8
  $pap = Mage::getModel('pap/pap');
9
  $postData = $this->getIpnFormData();
10
+ $visitorID = $_GET['pap_custom'];
 
11
 
12
  $sReq = '';
13
  foreach($this->getIpnFormData() as $k=>$v) {
24
  $response = trim($response[1]);
25
 
26
  if ($response=='VERIFIED') {
27
+ $order = Mage::getModel('sales/order')->loadByIncrementId($_POST['custom']);
28
+ $pap->registerOrder($order, isset($visitorID) ? $visitorID : null);
29
  }
30
  }
31
  catch (Exception $e) {
app/code/local/Qualityunit/Pap/Model/PaypalIpn.php CHANGED
@@ -16,8 +16,12 @@ class Qualityunit_Pap_Model_PaypalIpn extends Mage_Paypal_Model_Ipn {
16
  $order = Mage::getModel('sales/order')->load($this->_request['custom']);
17
 
18
  Mage::log("Postaffiliatepro: Starting registering sale for cookie '$visitorID'\n");
19
- //$pap->registerOrder($this->_getOrder(), $visitorID);
20
- $pap->registerOrder($order, $visitorID);
 
 
 
 
21
  Mage::log('Postaffiliatepro: Sale registered successfully');
22
  }
23
  catch (Exception $e) {
16
  $order = Mage::getModel('sales/order')->load($this->_request['custom']);
17
 
18
  Mage::log("Postaffiliatepro: Starting registering sale for cookie '$visitorID'\n");
19
+ if ($order == '') {
20
+ $pap->registerOrder($this->_getOrder(), $visitorID);
21
+ }
22
+ else {
23
+ $pap->registerOrder($order, $visitorID);
24
+ }
25
  Mage::log('Postaffiliatepro: Sale registered successfully');
26
  }
27
  catch (Exception $e) {
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Qualityunit_Pap</name>
4
- <version>1.0.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -9,13 +9,12 @@
9
  <summary>The module makes an integration with Post Affiliate Pro or Post Affiliate Network an easy thing. A simple configuration with all the needed options helps you to make it working in seconds.</summary>
10
  <description>The module makes an integration with Post Affiliate Pro or Post Affiliate Network an easy thing. A simple configuration with all the needed options helps you to make it working in seconds.&#xD;
11
  The module integrates sales, supports per product tracking, Coupon tracking and Lifetime Commission tracking. It also automatically approves and declines commissions when transaction status is changed.</description>
12
- <notes>- paypal integration fix&#xD;
13
- - HTTP to HTTPS redirection in case of API communication fixed&#xD;
14
- - API tracking fixed based on new HTTP/HTTPS approach</notes>
15
  <authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
16
- <date>2016-02-23</date>
17
- <time>08:22:23</time>
18
- <contents><target name="magelocal"><dir name="Qualityunit"><dir name="Pap"><dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="a1a70e021c623040796d925afbf52324"/></dir></dir></dir></dir><file name="Clicktracking.php" hash="8ee426151206030457e080ef23ce953b"/><dir name="Paypal"><file name="Redirect.php" hash="6c48219eb2e6f37ef50570e90c904639"/></dir><file name="Saletracking.php" hash="b7e5c50972b856a87c2d24903235e502"/></dir><dir name="Helper"><file name="Data.php" hash="6418f45f1484fd4f676933a8af96cef5"/></dir><dir name="Model"><dir name="Checkout"><file name="Observer.php" hash="eeeb25d90b801c6352568c25e3154942"/></dir><dir name="Config"><dir name="Source"><file name="CustomVariables.php" hash="1419c44e2e174e368f69ac9c12701b63"/><file name="TrackSales.php" hash="1af0c801457e4b31f55fde6ad12e7b67"/></dir></dir><file name="Config.php" hash="75852918132ca6300c3a381574c5404d"/><file name="Observer.php" hash="82e1daf72693410bc4619151d03554e7"/><file name="Pap.php" hash="1010ab29b52c34277397a5b5aeadd7eb"/><file name="Paypal.php" hash="39cbba74d089c1460f2404d8128cfb0b"/><file name="PaypalIpn.php" hash="410b6493a4f3fd451698d56bc0eced94"/><file name="Validateapi.php" hash="2a90e74dc6a137a8960df465f17711ca"/></dir><dir name="etc"><file name="config.xml" hash="fc1d64d6b62a1823e98ee8c327d6bffd"/><file name="system.xml" hash="737444ec24bd0a18af630327f025b03c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pap.xml" hash="600ebb26e9af1c78ac0a5d22717d2cd2"/></dir><dir name="template"><dir name="pap"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="cebb98c5c843a2921debea7cf98fdfe2"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pap.xml" hash="167eddd9fa705fba71f8d3d2992a43cc"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="pap.xml" hash="167eddd9fa705fba71f8d3d2992a43cc"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Qualityunit_Pap.xml" hash="78a58f4a3a637e027e42b74838b56607"/></dir></target><target name="magelib"><dir name="PAP"><file name="PapApi.class.php" hash="f1bae43744873b540b98e448caf7e205"/></dir></target><target name="mage"><dir name="lib"><dir name="PAP"><file name="README.txt" hash="2a279f64825e116dfd29c73fee9dabc8"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pap"><file name="pap.css" hash="ff8a88a99075753b4a0ea9004d579a42"/><file name="pap-tab.png" hash="eef09c5b3777189e05b1702c463a9a33"/><file name="pap-logo.png" hash="e9053c44287a8d84801451ed69ef2f09"/></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>7.5.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Qualityunit_Pap</name>
4
+ <version>1.0.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
9
  <summary>The module makes an integration with Post Affiliate Pro or Post Affiliate Network an easy thing. A simple configuration with all the needed options helps you to make it working in seconds.</summary>
10
  <description>The module makes an integration with Post Affiliate Pro or Post Affiliate Network an easy thing. A simple configuration with all the needed options helps you to make it working in seconds.&#xD;
11
  The module integrates sales, supports per product tracking, Coupon tracking and Lifetime Commission tracking. It also automatically approves and declines commissions when transaction status is changed.</description>
12
+ <notes>- PayPal Standard redirection fixed&#xD;
13
+ - PayPal Standard IPN fixed</notes>
 
14
  <authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
15
+ <date>2016-03-23</date>
16
+ <time>08:16:58</time>
17
+ <contents><target name="magelocal"><dir name="Qualityunit"><dir name="Pap"><dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="a1a70e021c623040796d925afbf52324"/></dir></dir></dir></dir><file name="Clicktracking.php" hash="8ee426151206030457e080ef23ce953b"/><dir name="Paypal"><file name="Redirect.php" hash="163f906979f1fa74c49954f76c32cd48"/></dir><file name="Saletracking.php" hash="b7e5c50972b856a87c2d24903235e502"/></dir><dir name="Helper"><file name="Data.php" hash="6418f45f1484fd4f676933a8af96cef5"/></dir><dir name="Model"><dir name="Checkout"><file name="Observer.php" hash="eeeb25d90b801c6352568c25e3154942"/></dir><dir name="Config"><dir name="Source"><file name="CustomVariables.php" hash="1419c44e2e174e368f69ac9c12701b63"/><file name="TrackSales.php" hash="1af0c801457e4b31f55fde6ad12e7b67"/></dir></dir><file name="Config.php" hash="75852918132ca6300c3a381574c5404d"/><file name="Observer.php" hash="82e1daf72693410bc4619151d03554e7"/><file name="Pap.php" hash="1010ab29b52c34277397a5b5aeadd7eb"/><file name="Paypal.php" hash="253bcb6a212495cfa838ee05cc606f3e"/><file name="PaypalIpn.php" hash="268b92124ac73a3fb35572e3002a6e81"/><file name="Validateapi.php" hash="2a90e74dc6a137a8960df465f17711ca"/></dir><dir name="etc"><file name="config.xml" hash="fc1d64d6b62a1823e98ee8c327d6bffd"/><file name="system.xml" hash="737444ec24bd0a18af630327f025b03c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="pap.xml" hash="600ebb26e9af1c78ac0a5d22717d2cd2"/></dir><dir name="template"><dir name="pap"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="cebb98c5c843a2921debea7cf98fdfe2"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="pap.xml" hash="167eddd9fa705fba71f8d3d2992a43cc"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="pap.xml" hash="167eddd9fa705fba71f8d3d2992a43cc"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Qualityunit_Pap.xml" hash="78a58f4a3a637e027e42b74838b56607"/></dir></target><target name="magelib"><dir name="PAP"><file name="PapApi.class.php" hash="f1bae43744873b540b98e448caf7e205"/></dir></target><target name="mage"><dir name="lib"><dir name="PAP"><file name="README.txt" hash="2a279f64825e116dfd29c73fee9dabc8"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="pap"><file name="pap.css" hash="ff8a88a99075753b4a0ea9004d579a42"/><file name="pap-tab.png" hash="eef09c5b3777189e05b1702c463a9a33"/><file name="pap-logo.png" hash="e9053c44287a8d84801451ed69ef2f09"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>7.5.0</max></php></required></dependencies>
20
  </package>