-- HikaShop version -- :2.2.0
-- Joomla version -- : latest
-- PHP version -- : 5.10.1
Hi.
I developed a script for a windows software that requires a challenge code.
This script check if the PayPal Transaction ID is available inside the database.
HikaShop transaction ID's are stored inside the hikashop_history table, but something goes wrong when i query the DB.
I tried to directly check values in rows, and to mysql_fetch aswell.
The script find some values, many not.
This thing is making me fool, since it's possible that the script find the "PayPal transaction id: XXXXXX" only for the ones that i added manually inside the table.
Is hikashop saving something hidden, some errors or formatting?
Using a SELECT * FROM TABLE WHERE history_data = $pay and formartting $pay as "PayPal Transaction id : $transaction_id" always find a value, and others not.
Also i tried to explode only the paypal 17 chars string, but not work!
$pay = "[oaypal id as string]";
// check if Transaction ID is available on the default website.
$query = mysql_query ("SELECT * FROM jh23m_hikashop_history");
$result = mysql_num_rows($query);
while(($row = mysql_fetch_array($query))) {
$paypal_ids[] =$row['history_data'];
}
//print_r ($paypal_ids);
// ora cerca il valore %pay
$paypal_ids_split = implode("", $paypal_ids);
//print_r ($paypal_ids_split);
$paypal_ids_clean = explode ("PayPal transaction id: ", $paypal_ids_split);
print_r ($paypal_ids_clean);
if (array_search($pay, $paypal_ids_clean,TRUE)){
echo "Match";
} else
{ echo "Does not match";
}
echo $pay;
This produce:
Array ( [0] => [1] => 0JW61238FU6854240 [2] => 5EA00979GC149044V [3] => 59P88560S9783170B [4] => 1L697134B06956638 [5] => 1N476458GR470922M [6] => 3N4412142S083993R [7] => 2GN69713EV7294613 [8] => 9WT48148YE725931K [9] => 585690586Y6998523 [10] => 7X9149767T051513K [11] => 5WJ25963L5455313H [12] => 1L717841BA5989748 [13] => 0E750230DV1575308 [14] => 85B43558SH819711N [15] => 78R85507FR2081540 [16] => 96F7363575285431M [17] => 87V99180GV2251342 [18] => 4G459145SE959020V [19] => 86U00726DL9205244 [20] => 70820350T9653825F [21] => 8K002091YN0079914 [22] => 8SD993824R7167708 [23] => 93L886231K973983G [24] => 6E98077468505954G [25] => 770172708D596892K [26] => 22N679682U615734D [27] => 3WR4000656945550Y [28] => 59P88560S9783170B [29] => 8H242117S01162917 [30] => 9WC47475K89394047 [31] => 83L6687699339330K [32] => 1BE09674W4880373N [33] => 3JC01978GH9146509 [34] => 31381161BJ159335S [35] => 17V97629HJ1941344 [36] => 4XG15144CK988864F [37] => 18625833YF123353H [38] => 2GU86013NN2703635 ) Match59P88560S9783170B
But also:
Array ( [0] => [1] => 0JW61238FU6854240 [2] => 5EA00979GC149044V [3] => 59P88560S9783170B [4] => 1L697134B06956638 [5] => 1N476458GR470922M [6] => 3N4412142S083993R [7] => 2GN69713EV7294613 [8] => 9WT48148YE725931K [9] => 585690586Y6998523 [10] => 7X9149767T051513K [11] => 5WJ25963L5455313H [12] => 1L717841BA5989748 [13] => 0E750230DV1575308 [14] => 85B43558SH819711N [15] => 78R85507FR2081540 [16] => 96F7363575285431M [17] => 87V99180GV2251342 [18] => 4G459145SE959020V [19] => 86U00726DL9205244 [20] => 70820350T9653825F [21] => 8K002091YN0079914 [22] => 8SD993824R7167708 [23] => 93L886231K973983G [24] => 6E98077468505954G [25] => 770172708D596892K [26] => 22N679682U615734D [27] => 3WR4000656945550Y [28] => 59P88560S9783170B [29] => 8H242117S01162917 [30] => 9WC47475K89394047 [31] => 83L6687699339330K [32] => 1BE09674W4880373N [33] => 3JC01978GH9146509 [34] => 31381161BJ159335S [35] => 17V97629HJ1941344 [36] => 4XG15144CK988864F [37] => 18625833YF123353H [38] => 2GU86013NN2703635 ) Does not match0JW61238FU6854240
using 0JW61238FU6854240 value.
There is something to know about how the paypal transactions are stored?