Franz Holzinger

Verse of the day

Wer sich aber rühmt, der rühme sich des HERRN. Denn darum ist einer nicht tüchtig, daß er sich selbst lobt, sondern daß ihn der HERR lobt.
2 Korinther 10:17-18

© Bible Gateway's Verse of the Day


Specific Gateway Extensions
 
 
Patch
 
autor: Franz Holzinger Datum: 26-01-10 13:30:07
 
Ich hatte noch folgenden Patch vorgeschlagen, den der Extension Autor offensichtlich nicht übernommen hat:

--- paymentlib_payone/lib/fe/conf.php.inc 2010-01-26 13:10:48.000000000 +0100
+++ paymentlib_payone_korrigiert/lib/fe/conf.php.inc 2009-09-25 17:03:26.000000000 +0200
@@ -1,11 +1,5 @@
<?php
-/**
- * Important!
- * Set here an user which has access rights to the backend of typo3. The user has to be a real existing user in
- * the backend.
- * Prefix the username with "_CLI_".
- */
-$MCONF['name']='_CLI_payoneuser';
+// DO NOT REMOVE OR CHANGE THESE LINES:

define('TYPO3_cliMode', TRUE);
define('TYPO3_MOD_PATH', '../typo3conf/ext/paymentlib_payone/lib/fe/');
@@ -15,8 +9,11 @@
$MCONF['access'] = 'user,group';
$MCONF['script'] = 'index.php';

-require($BACK_PATH.'init.php');
-require($BACK_PATH.'template.php');
+//$MLANG['default']['tabs_images']['tab'] = 'moduleicon.gif';
+//$MLANG['default']['ll_ref']='LLL:EXT:profile_pages_system/mod1/locallang_mod.xml';
+
+require(dirname(PATH_thisScript).'/'.$BACK_PATH.'init.php');
+require(dirname(PATH_thisScript).'/'.$BACK_PATH.'template.php');

2.) Das ist nur ein Hack. Der Pfad muss angepasst werden:

--- paymentlib_payone/lib/fe/transactionStatus.php 2010-01-26 13:10:48.000000000 +0100
+++ paymentlib_payone_korrigiert/lib/fe/transactionStatus.php 2009-09-25 17:03:26.000000000 +0200
@@ -1,10 +1,27 @@
<?php
/**
- * Please do not touch anything any of the code below
- * Changes in the code below could harm your payone installation or result
+ * Important!
+ * Change this to the location wherever this script will reside in your
+ * own installation. The fullpath to this script is needed here.
+ */
+define('PATH_thisScript', '/home/ ... www .... /typo3conf/ext/paymentlib_payone/lib/fe/transactionStatus.php');
+
+/**
+ * Important!
+ * Set here an user which has access rights to the backend of typo3. The user has to be a real existing user in
+ * the backend.
+ * Prefix the username with "_CLI_".
+ */
+$MCONF['name']='_CLI_payoneuser';
+
+
+/**
+ * Below these line you must not touch anything!!! So please stop here!
+ *
+ * The real script starts here and changes in the code below could harm your payone installation or result
* in false or insufficient transaction/payment data.
*/
-require_once('./conf.php.inc');
+require_once(dirname(PATH_thisScript).'/'.'conf.php.inc');

class tx_paymentlibpayone_transactionsStatus {

@@ -26,11 +43,6 @@

$payment = $dbProcessor->findPaymentByInternalTransactionId($internalTransactionId);

- // Set transaction to "processed" with the initial TransactionStatus call
- if (t3lib_div::_POST("txaction")=="appointed") {
- $payment->setProcessed(true);
- }
-
$paymentKey = md5($payment->getPayoneKey());
$transMissionKey = t3lib_div::_POST('key');


--- paymentlib_payone/lib/helper/class.payone_basket_mapper.php 2010-01-26 13:10:48.000000000 +0100
+++ paymentlib_payone_korrigiert/lib/helper/class.payone_basket_mapper.php 2009-09-25 17:03:25.000000000 +0200
@@ -182,16 +182,20 @@

$productVat = $this->getValueFromArrayWithMappingString($productVatMappingString, $callerExtensionProduct);

- // JG: VAT can be empty (0)
- //$ok = $ok && !empty($productVat) && is_numeric($productVat);
- $ok = $ok && is_numeric($productVat);
+ $ok = $ok && !empty($productVat) && is_numeric($productVat);


Da ist einiges von meinen Vorschlägen nicht übernommen worden!

--- paymentlib_payone/pi1/class.tx_paymentlibpayone_provider.php 2010-01-26 13:10:48.000000000 +0100
+++ paymentlib_payone_korrigiert/pi1/class.tx_paymentlibpayone_provider.php 2009-10-03 21:14:04.000000000 +0200
@@ -454,38 +451,58 @@

}

$transactionArr = &$detailsArr["transaction"];
// Special handling of tt_products
if ($this->callingExtension==="tt_products") {
+ //$amount = $transactionArr['amount']; Korr. FHO
$amount = $detailsArr['total']['amounttax'];
+ //$amount = $detailsArr['total']['amounttax'];
$shipping = $detailsArr['total']['shippingtax'];
$handling = $detailsArr['total']['handlingtax'];
+
} else {
$amount = $transactionArr['amount'];
$shipping = $detailsArr['shipping'];
$handling = $detailsArr['handling'];
- }

+ }
+// FHO start
$shipping = payone_basket_mapper::transformPriceStringToPayonePrice($shipping);
$handling = payone_basket_mapper::transformPriceStringToPayonePrice($handling);
- $ok = $ok && is_numeric($amount)
+// FHO end
+
+ $ok = is_numeric($amount)
&& strlen($transactionArr["orderuid"])
&& strlen($transactionArr["currency"]);


@@ -513,34 +531,23 @@
}

$this->selectedPaymentMethod->setPayoneCurrency($currency);
+debug ($amount, '$amount Pos 4', __LINE__, __FILE__);
$this->selectedPaymentMethod->setPayoneAmount($amount);
$this->selectedPaymentMethod->setPayoneReference($orderuid);

//
// Basket handling below theses lines
//
+
+debug ($this->sendBasket, '$this->sendBasket', __LINE__, __FILE__);
// Processing articles
if ($this->sendBasket) {

$payoneBasket = $this->basketMapper->getPayoneBasket();

} else {
-
- if ($this->callingExtension == "tt_products") {
-
- // Fix to get the real amount from tt_products because
- // of tt_products delivers the total amount (shipping included)
- // and the shipping code in transaction which results
- // in one artile with the total amount as article and
- // the shipping as second article.
$prodAmount = $amount - $shipping - $handling; // FHO

- } else {
-
- $prodAmount = $amount;
-
- }
-
$dummyArticle[payone_basket_mapper::FIELD_PRODUCT_ID] = $this->basketDummyArticleId;
$dummyArticle[payone_basket_mapper::FIELD_PRODUCT_NUMBER] = "1";
$dummyArticle[payone_basket_mapper::FIELD_PRODUCT_DESCRIPTION] = $this->basketDummyArticleTitle;
@@ -565,10 +572,6 @@
}

// Handling
-
- // TODO: Ask Franz if the handling is also included in the total amount and will
- // be delivered separatly also
-
if (is_numeric($handling) && $handling > 0) {
// FHO
$handlingArticle[payone_basket_mapper::FIELD_PRODUCT_ID] = $this->basketHandlingArticleId;
@@ -652,9 +655,9 @@
parse_str($parsedRedirect['query'], $preSavedParams);

$savedTransactionId = $preSavedParams[tx_paymentlibpayone_provider::PAYONE_TX_URL_PARAM]; // should return the current transaction
-/* JG: DO NOT DELETE ANTHING, DAMMIT!
+
$dbProcessor->deletePaymentFromDatabase($savedTransactionId);
-*/ }
+ }

// Generate an unique transaction id

@@ -839,11 +843,11 @@
*/
public function transaction_setOkPage ($uri) {