Version Notes
- account ID issue fixed
Download this release
Release Info
| Developer | Quality Unit, LLC |
| Extension | Qualityunit_Pap |
| Version | 1.0.5 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.3 to 1.0.5
app/code/local/Qualityunit/Pap/Model/Pap.php
CHANGED
|
@@ -217,7 +217,7 @@ class Qualityunit_Pap_Model_Pap extends Mage_Core_Model_Abstract {
|
|
| 217 |
$config->includePapAPI();
|
| 218 |
|
| 219 |
$saleTracker = new Pap_Api_SaleTracker($config->getInstallationPath().'/scripts/sale.php');
|
| 220 |
-
$saleTracker->setAccountId($config->
|
| 221 |
if (!empty($visitorID)) {
|
| 222 |
$saleTracker->setVisitorId($visitorID);
|
| 223 |
}
|
| 217 |
$config->includePapAPI();
|
| 218 |
|
| 219 |
$saleTracker = new Pap_Api_SaleTracker($config->getInstallationPath().'/scripts/sale.php');
|
| 220 |
+
$saleTracker->setAccountId($config->getAPICredential('account'));
|
| 221 |
if (!empty($visitorID)) {
|
| 222 |
$saleTracker->setVisitorId($visitorID);
|
| 223 |
}
|
app/code/local/Qualityunit/Pap/Model/Validateapi.php
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Qualityunit_Pap_Model_Validateapi extends Mage_Core_Model_Config_Data {
|
| 3 |
+
|
| 4 |
+
public function save() {
|
| 5 |
+
// validation here... try to connect to PAP and throw error if problem occurred
|
| 6 |
+
try {
|
| 7 |
+
Mage::getSingleton('pap/config')->includePapAPI();
|
| 8 |
+
$config = Mage::getSingleton('pap/config');
|
| 9 |
+
} catch (Exception $e) {
|
| 10 |
+
Mage::getSingleton('adminhtml/session')->addError('An error occurred: '.$e);
|
| 11 |
+
return;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
$server = str_replace('https', 'http', $this->getValue());
|
| 15 |
+
$server = str_replace('http://', '', $server);
|
| 16 |
+
if (substr($server,-1) == '/') {
|
| 17 |
+
$server = substr($server,0,-1);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
$url = 'http://'.$server.'/scripts/server.php';
|
| 21 |
+
$username = $_POST['groups']['api']['fields']['username']['value'];
|
| 22 |
+
$password = $_POST['groups']['api']['fields']['password']['value'];
|
| 23 |
+
|
| 24 |
+
$session = new Gpf_Api_Session($url);
|
| 25 |
+
if (!@$session->login($username, $password)) {
|
| 26 |
+
Mage::getSingleton('adminhtml/session')->addError('Credential are probably not correct: '.$session->getMessage());
|
| 27 |
+
return null;
|
| 28 |
+
} else {
|
| 29 |
+
Mage::getSingleton('core/session')->addSuccess('API Connection tested successfully!');
|
| 30 |
+
}
|
| 31 |
+
return parent::save(); // let's save it anyway
|
| 32 |
+
}
|
| 33 |
+
}
|
app/code/local/Qualityunit/Pap/etc/system.xml
CHANGED
|
@@ -29,6 +29,7 @@
|
|
| 29 |
<url translate="label">
|
| 30 |
<label>Application URL</label>
|
| 31 |
<frontend_type>text</frontend_type>
|
|
|
|
| 32 |
<sort_order>10</sort_order>
|
| 33 |
<show_in_default>1</show_in_default>
|
| 34 |
<show_in_website>1</show_in_website>
|
| 29 |
<url translate="label">
|
| 30 |
<label>Application URL</label>
|
| 31 |
<frontend_type>text</frontend_type>
|
| 32 |
+
<backend_model>pap/validateapi</backend_model>
|
| 33 |
<sort_order>10</sort_order>
|
| 34 |
<show_in_default>1</show_in_default>
|
| 35 |
<show_in_website>1</show_in_website>
|
lib/PAP/PapApi.class.php
CHANGED
|
@@ -9,8 +9,8 @@
|
|
| 9 |
* Version 1.0 (the "License"); you may not use this file except in compliance
|
| 10 |
* with the License. You may obtain a copy of the License at
|
| 11 |
* http://www.qualityunit.com/licenses/gpf
|
| 12 |
-
* Generated on: 2015-
|
| 13 |
-
* PAP version: 5.4.
|
| 14 |
*
|
| 15 |
*/
|
| 16 |
|
|
@@ -951,6 +951,13 @@ if (!class_exists('Gpf_Data_RecordHeader', false)) {
|
|
| 951 |
return;
|
| 952 |
}
|
| 953 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 954 |
foreach ($headerArray as $id) {
|
| 955 |
$this->add($id);
|
| 956 |
}
|
|
@@ -998,6 +1005,10 @@ if (!class_exists('Gpf_Data_RecordHeader', false)) {
|
|
| 998 |
}
|
| 999 |
return $result;
|
| 1000 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1001 |
}
|
| 1002 |
|
| 1003 |
|
|
@@ -1331,6 +1342,10 @@ if (!class_exists('Gpf_Data_RecordSet', false)) {
|
|
| 1331 |
$this->_array[] = $record;
|
| 1332 |
}
|
| 1333 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1334 |
/**
|
| 1335 |
* Adds new row to RecordSet
|
| 1336 |
*
|
|
@@ -2091,7 +2106,13 @@ if (!class_exists('Gpf_Net_Http_Response', false)) {
|
|
| 2091 |
|
| 2092 |
public function getResponseCode() {
|
| 2093 |
$headers = $this->getHeaders();
|
|
|
|
|
|
|
|
|
|
| 2094 |
preg_match('/.*?\s([0-9]*?)\s.*/', $headers['status'], $match);
|
|
|
|
|
|
|
|
|
|
| 2095 |
return $match[1];
|
| 2096 |
}
|
| 2097 |
|
|
@@ -2950,17 +2971,21 @@ if (!class_exists('Gpf_Rpc_Action', false)) {
|
|
| 2950 |
public function getErrorMessage() {
|
| 2951 |
return $this->errorMessage;
|
| 2952 |
}
|
| 2953 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2954 |
public function setInfoMessage($message) {
|
| 2955 |
$this->infoMessage = $message;
|
| 2956 |
}
|
| 2957 |
|
| 2958 |
-
public function addOk() {
|
| 2959 |
-
$this->successCount
|
| 2960 |
}
|
| 2961 |
|
| 2962 |
-
public function addError() {
|
| 2963 |
-
$this->errorCount
|
| 2964 |
}
|
| 2965 |
|
| 2966 |
}
|
|
@@ -5271,25 +5296,26 @@ if (!class_exists('Pap_Api_Transaction', false)) {
|
|
| 5271 |
|
| 5272 |
if (!class_exists('Pap_Tracking_Action_RequestActionObject', false)) {
|
| 5273 |
class Pap_Tracking_Action_RequestActionObject extends Gpf_Rpc_JsonObject {
|
| 5274 |
-
public $ac
|
| 5275 |
-
public $t
|
| 5276 |
-
public $f
|
| 5277 |
-
public $o
|
| 5278 |
-
public $p
|
| 5279 |
-
public $d1
|
| 5280 |
-
public $d2
|
| 5281 |
-
public $d3
|
| 5282 |
-
public $d4
|
| 5283 |
-
public $d5
|
| 5284 |
-
public $a
|
| 5285 |
-
public $c
|
| 5286 |
-
public $b
|
| 5287 |
-
public $ch
|
| 5288 |
-
public $cc
|
| 5289 |
-
public $
|
| 5290 |
-
public $
|
| 5291 |
-
public $
|
| 5292 |
-
public $
|
|
|
|
| 5293 |
|
| 5294 |
public function __construct($object = null) {
|
| 5295 |
parent::__construct($object);
|
|
@@ -5365,6 +5391,10 @@ if (!class_exists('Pap_Tracking_Action_RequestActionObject', false)) {
|
|
| 5365 |
return $this->cc;
|
| 5366 |
}
|
| 5367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5368 |
public function getStatus() {
|
| 5369 |
return $this->s;
|
| 5370 |
}
|
|
@@ -5441,6 +5471,10 @@ if (!class_exists('Pap_Tracking_Action_RequestActionObject', false)) {
|
|
| 5441 |
$this->cc = $value;
|
| 5442 |
}
|
| 5443 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5444 |
public function setStatus($value) {
|
| 5445 |
$this->s = $value;
|
| 5446 |
}
|
|
@@ -6455,6 +6489,6 @@ if (!class_exists('Gpf_Net_Http_Client', false)) {
|
|
| 6455 |
}
|
| 6456 |
/*
|
| 6457 |
VERSION
|
| 6458 |
-
|
| 6459 |
*/
|
| 6460 |
?>
|
| 9 |
* Version 1.0 (the "License"); you may not use this file except in compliance
|
| 10 |
* with the License. You may obtain a copy of the License at
|
| 11 |
* http://www.qualityunit.com/licenses/gpf
|
| 12 |
+
* Generated on: 2015-12-16 07:55:32
|
| 13 |
+
* PAP version: 5.4.27.1, GPF version: 1.3.32.0
|
| 14 |
*
|
| 15 |
*/
|
| 16 |
|
| 951 |
return;
|
| 952 |
}
|
| 953 |
|
| 954 |
+
if (!$this->isIterable($headerArray)) {
|
| 955 |
+
$e = new Gpf_Exception('');
|
| 956 |
+
Gpf_Log::error('Not correct header for RecordHeader, trace: '.$e->getTraceAsString());
|
| 957 |
+
|
| 958 |
+
return;
|
| 959 |
+
}
|
| 960 |
+
|
| 961 |
foreach ($headerArray as $id) {
|
| 962 |
$this->add($id);
|
| 963 |
}
|
| 1005 |
}
|
| 1006 |
return $result;
|
| 1007 |
}
|
| 1008 |
+
|
| 1009 |
+
private function isIterable($var) {
|
| 1010 |
+
return (is_array($var) || $var instanceof Traversable || $var instanceof stdClass);
|
| 1011 |
+
}
|
| 1012 |
}
|
| 1013 |
|
| 1014 |
|
| 1342 |
$this->_array[] = $record;
|
| 1343 |
}
|
| 1344 |
|
| 1345 |
+
public function removeRecord($i) {
|
| 1346 |
+
unset($this->_array[$i]);
|
| 1347 |
+
}
|
| 1348 |
+
|
| 1349 |
/**
|
| 1350 |
* Adds new row to RecordSet
|
| 1351 |
*
|
| 2106 |
|
| 2107 |
public function getResponseCode() {
|
| 2108 |
$headers = $this->getHeaders();
|
| 2109 |
+
if ($headers == false || !isset($headers['status'])) {
|
| 2110 |
+
return false;
|
| 2111 |
+
}
|
| 2112 |
preg_match('/.*?\s([0-9]*?)\s.*/', $headers['status'], $match);
|
| 2113 |
+
if (!isset($match[1])) {
|
| 2114 |
+
return false;
|
| 2115 |
+
}
|
| 2116 |
return $match[1];
|
| 2117 |
}
|
| 2118 |
|
| 2971 |
public function getErrorMessage() {
|
| 2972 |
return $this->errorMessage;
|
| 2973 |
}
|
| 2974 |
+
|
| 2975 |
+
public function getInfoMessage() {
|
| 2976 |
+
return $this->infoMessage;
|
| 2977 |
+
}
|
| 2978 |
+
|
| 2979 |
public function setInfoMessage($message) {
|
| 2980 |
$this->infoMessage = $message;
|
| 2981 |
}
|
| 2982 |
|
| 2983 |
+
public function addOk($count = 1) {
|
| 2984 |
+
$this->successCount += $count;
|
| 2985 |
}
|
| 2986 |
|
| 2987 |
+
public function addError($count = 1) {
|
| 2988 |
+
$this->errorCount += $count;
|
| 2989 |
}
|
| 2990 |
|
| 2991 |
}
|
| 5296 |
|
| 5297 |
if (!class_exists('Pap_Tracking_Action_RequestActionObject', false)) {
|
| 5298 |
class Pap_Tracking_Action_RequestActionObject extends Gpf_Rpc_JsonObject {
|
| 5299 |
+
public $ac = ''; // actionCode
|
| 5300 |
+
public $t = ''; // totalCost
|
| 5301 |
+
public $f = ''; // fixedCost
|
| 5302 |
+
public $o = ''; // order ID
|
| 5303 |
+
public $p = ''; // product ID
|
| 5304 |
+
public $d1 = ''; // data1
|
| 5305 |
+
public $d2 = ''; // data2
|
| 5306 |
+
public $d3 = ''; // data3
|
| 5307 |
+
public $d4 = ''; // data4
|
| 5308 |
+
public $d5 = ''; // data5
|
| 5309 |
+
public $a = ''; // affiliate ID
|
| 5310 |
+
public $c = ''; // campaign ID
|
| 5311 |
+
public $b = ''; // banner ID
|
| 5312 |
+
public $ch = ''; // channel ID
|
| 5313 |
+
public $cc = ''; // custom commission
|
| 5314 |
+
public $ccfc = ''; // load next tiers from campaign
|
| 5315 |
+
public $s = ''; // status
|
| 5316 |
+
public $cr = ''; // currency
|
| 5317 |
+
public $cp = ''; // coupon code
|
| 5318 |
+
public $ts = ''; // time stamp
|
| 5319 |
|
| 5320 |
public function __construct($object = null) {
|
| 5321 |
parent::__construct($object);
|
| 5391 |
return $this->cc;
|
| 5392 |
}
|
| 5393 |
|
| 5394 |
+
public function getCustomCommissionNextTiersFromCampaign() {
|
| 5395 |
+
return $this->ccfc;
|
| 5396 |
+
}
|
| 5397 |
+
|
| 5398 |
public function getStatus() {
|
| 5399 |
return $this->s;
|
| 5400 |
}
|
| 5471 |
$this->cc = $value;
|
| 5472 |
}
|
| 5473 |
|
| 5474 |
+
public function setCustomCommissionNextTiersFromCampaign($value) {
|
| 5475 |
+
$this->ccfc = $value;
|
| 5476 |
+
}
|
| 5477 |
+
|
| 5478 |
public function setStatus($value) {
|
| 5479 |
$this->s = $value;
|
| 5480 |
}
|
| 6489 |
}
|
| 6490 |
/*
|
| 6491 |
VERSION
|
| 6492 |
+
8b602caa3f7e5f3b21972a0566b24f95
|
| 6493 |
*/
|
| 6494 |
?>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Qualityunit_Pap</name>
|
| 4 |
-
<version>1.0.
|
| 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,11 +9,11 @@
|
|
| 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.
|
| 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
|
| 13 |
<authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
|
| 14 |
-
<date>
|
| 15 |
-
<time>
|
| 16 |
-
<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="c6c83477cfe5da045be89eff12b8e54d"/></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="0a6d8bf59b6b89bb23305bdbb0a593c6"/><file name="Ipn.php" hash="410b6493a4f3fd451698d56bc0eced94"/><file name="Observer.php" hash="82e1daf72693410bc4619151d03554e7"/><file name="Pap.php" hash="
|
| 17 |
<compatible/>
|
| 18 |
-
<dependencies><required><php><min>5.2.0</min><max>
|
| 19 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Qualityunit_Pap</name>
|
| 4 |
+
<version>1.0.5</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.
|
| 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>- account ID issue fixed</notes>
|
| 13 |
<authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
|
| 14 |
+
<date>2016-01-28</date>
|
| 15 |
+
<time>13:56:08</time>
|
| 16 |
+
<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="c6c83477cfe5da045be89eff12b8e54d"/></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="0a6d8bf59b6b89bb23305bdbb0a593c6"/><file name="Ipn.php" hash="410b6493a4f3fd451698d56bc0eced94"/><file name="Observer.php" hash="82e1daf72693410bc4619151d03554e7"/><file name="Pap.php" hash="239ed108cdef69b7ae0800279b29fd26"/><file name="Paypal.php" hash="39cbba74d089c1460f2404d8128cfb0b"/><file name="Validateapi.php" hash="8f4e945fcbcf29e72c1b914ede455cb3"/></dir><dir name="etc"><file name="config.xml" hash="ecc1d4532536056788349c075af166b2"/><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>
|
| 17 |
<compatible/>
|
| 18 |
+
<dependencies><required><php><min>5.2.0</min><max>7.5.0</max></php></required></dependencies>
|
| 19 |
</package>
|
