Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by christh

  1. christh

    HSBC secure-epayment module

    Neil: I can't really help, but regarding the: putenv("LD_LIBRARY_PATH=$path"); my host is on safe mode too, so I asked my host to install the HSBC .so library for me (at quite a cost) and removed the putenv line. As far as I know, you NEED a secure (https) connection between yourself and the CPI. The two things above (library installation and secure server requirement) have forced me to pay top dollar for my hosting, and I'm not particularly happy about it seeing as E-Payments won't even work anyway! If anyone's reading this considering E-Payments as a card processor, all I can say is, 'FORGET IT! GO FOR WORLDPAY! If I could go back in time 3 months that's exactly what I would have done.'
  2. No worries Ian, glad to be of help! Nice to finally be able to contribute something. Can't really help with the actual attributes thing though -- I'm using "Product Attributes/Item Editor/Price v. 1.1". Not sure if it's the best, but it does the job! As far as PHP books go, I don't even have any myself, using http://www.php.net whenever I need to look something up, although a reference book is definitely a must for any serious coding. You might want to get a book for a general introduction, and I would generally recommend the O'Reilly "In a Nutshell" series, of which I own a good few. They are concise and to the point, and I have not been disappointed by one yet. Have a look in your local library, I've been doing that of late, and have been surprised at some of the recent books they have (Macromedia Flash, 3D studio). Or just see what's popular on Amazon, the reviews section really helps avoid buying duff books (I wish they had it when I was at university!) Cheers, Chris
  3. Aha! Found it (after sifting through over 2000 lines of code). On around line 2047 of admin/easypopulate.php, the following code exists: if (tep_db_num_rows($attribute_prices_values) <= 0) { $attribute_prices_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int)$v_products_id . "', '" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "', '" . (int)$$v_attribute_values_price_var . "', '" . $attribute_values_price_prefix . "')"; The culprit is this part: (int)$$v_attribute_values_price_var Turns out the attribute prices were being converted to ints. What I did to fix it was a simple cast from integer to floating point like so: (float)$$v_attribute_values_price_var So the whole line likes like: if (tep_db_num_rows($attribute_prices_values) <= 0) { $attribute_prices_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int)$v_products_id . "', '" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "', '" . (float)$$v_attribute_values_price_var . "', '" . $attribute_values_price_prefix . "')"; I'm no PHP coder (rather a C++/Java coder), and would recommend those in the know take a look at my change before you all go and update your easypopulate code. This has solved the problem for me however! Cheers, Chris
  4. I have the exact same problem as Ian -- which I only just noticed after doing a large attribute update in Excel and then uploading the file. Fortunately I'd taken a backup prior to performing the update. I'm not convinced that the problem is that of rounding though -- all my figures are rounded down, i.e. ?349.99 becomes ?349.00. It may be that the information after the decimal point is simply being ignored. I'm not sure enough of PHP's rounding rules, although rounding down in all cases sounds like an unlikely way of dealing with float -> integer conversions. I'll have a look at the code this evening and see if I can figure anything out. Cheers, Chris
  5. christh

    HSBC secure-epayment module

    First of all, fantastic news on the new HSBC mod! I too greatly appreciate this mod being released to the public. I've just been playing about with the mod for a few hours and as you might have guessed, I'm having a few problems. I'm getting back the dreaded CpiResultsCode = 10 -- "The transaction failed because of invalid input data." -- when I attempt to submit my order to HSBC's CPI. I know my server is properly configured to talk to the CPI, as I have the TestHash working using the HSBC supplied CcResults.cgi and sample html files. To aid me (and anyone else reading!) with my debugging, I plugged the CcResults.e into the mod to see what data I'm getting back from the CPI. A sample result: StorefrontId = <mystorefrontID> (fine) OrderId = 0437-070041326 PurchaseAmount = 45496 PurchaseCurrency = 826 PurchaseDate = 1076180453955 ShopperEmail = chris@***.co.uk MerchantData = 066f856a69f55d7f2c568fac166d7127 (appears to be my session ID) CpiResultsCode = 10 :( OrderHash = viVT6vpOLVxbmhM9fJ34slFMjIM= Hash Fields: <mystorefrontID>,0437-070041326,45496,826,1076180453955,chris@***.co.uk,066f856a69f55d7f2c568fac166d71 27,10 Received OrderHash = viVT6vpOLVxbmhM9fJ34slFMjIM= Generated OrderHash = viVT6vpOLVxbmhM9fJ34slFMjIM= Hash validates = true Everything looks fine to me, but HSBC just doesn't like it! Any ideas on what might be causing the CpiResultsCode = 10 ? I also tried stripping down the information sent to the CPI to be the bare minimum required by the CPI, but still no dice. I noticed from sniffing the parameters sent to the CPI that there were some extra fields being sent to the CPI. Parameters named 'x' and 'y'. I've heard that the CPI is EXTREMELY fussy about the fields it receives in a POST. I am also using the STS simple template contrib, which doesn't seem to like the HSBC mod too :huh: -- and hsbc_return.php doesn't seem to work with safe mode enabled ($hash=$hsbc->getHash($post_2) == "") the but I can live with that for now, just want to get this mod working! Could this be the problem, that I need to disable safe mode? I can't easily test this, as I won't be able to disable it on my shared SSL server (I don't think). Help!