Jump to content


  • Content count

  • Joined

  • Last visited

Posts posted by Ian-San

  1. Ok I have answered my own question. PayPal sends two responses for a Refund:


    The first:

    payment_status = Completed

    txn_type = reversal


    The second:

    payment_status = Refunded

    txn_type = web_accept


    See here: http://www.paypaldev.org/topic.asp?TOPIC_ID=4394


    so to stop the re-processing of the order, you need to add:


    && ($txn_type != 'reversal')


    to the if in paypal_notify.php. I have combined it all together like this:


    if ( ($notify_customer_id > '0') && ($response_verified == '1') && ($payment_status == 'Completed') && ($txn_type != 'reversal') ) {


    However, you will not see txn_type = reversal in the database as this is instantly replaced by the second PayPal response which will show txn_type = web_accept.

  2. I installed this on MS1 - it works fine. It is a great mod and to be recommended.


    One minor error was the (int) in:


    tep_db_query("delete from " . TABLE_PAYPALIPN_TXN . " where txn_id = '" . (int)$paypalipn_txn_id . "'");



    in admin/paypalipn_txt.php. $paypalipn_txn_id is alphanumeric so the (int) should be deleted.


    Plus I also added 'Refunded' to the list of response options.


    I also set the mailto in paypal_notify.php back to the original and just made the default sendto address as option 1 to retain the address formating. ie.


    $email_order .= "\n" . EMAIL_TEXT_PAYPAL_ADDRESS . "\n" .

    EMAIL_SEPARATOR . "\n" .

    tep_address_label($notify_customer_id, '1', 0, '', "\n") . "\n\n";


    EMAIL_TEXT_PAYPAL_ADDRESS just says ' Customer Address'. It is not a problem to me that customers may have different billing and delivery addresses as this is just the email confirmation. They can always check these details in their Account Order History.


    So, everything works fine in test and on real transations except for a refund.


    For a Refund, the PayPal response processes the order again - even though in tests this seems impossible - and the status of the order is actually updated to Refunded.


    My conclusion is that the PayPal response is using a cached version of paypal_notify.php or actioning the order on the first pass using variables stored with the Cid before it updates the order status in MySQL.


    Has anyone come across this problem?

  3. As you say, localhost is the problem. Your page does not exist on the WP server (which is what using localhost implies) so you need to make sure that the callback is to a real, full, URL.


    WP probably do not allow callbacks to IP addresses either for security reasons (but not sure about this).

  4. The have moved the currency download to https:// from http:// and not bothered to tell anyone.


    You will need to mod you scripts accordingly (something which I have not got round to yet)

    Correct - but I don't think you can make the change as https should not allow automatic access in the way the currency update script currently works.


    The answer (for me at least) was to ask WP to add all my display currencies to my installation (which they did free of charge) and so the WP currency conversion is no longer required (as the displayed currency price is now used in WP without conversion).

  5. After browsing through these threads I noticed that someone was on about trying to get the Worldpay TransID into the customer order within OSC. This is something I have been wanting to do for a while as its a pain trying to match up the cost values in the worldpay email and the order to work out which order goes with which payment.


    I would be gratefull if anyone knows of how to do this?






    Shouldnt be too difficult as the transId is already passed back to OSC in the WP success string. So in wpcallback.php, you would just need to find it and store it:


    if(isset($transId) ) {






    You would need to create a new field in the database to store it and have some way to check what it is in Admin.


  6. So - de-engineer looks like the best way... if only I knew how to do that! Any ideas anyone? :shock:


    It shouldnt be too difficult as all the WP part will work as will the callback pages. The only problem would be that a few variables would show up as null or you will get errors reported from the main worldpay.php file.


    If you can, I would just load it and see what errors you get.

  7. I dont think that these changes by Worldpay should affect the way release 3c works but release 3c was never 'legal' due to the auto-redirect technology that it uses. It really just worked as WorldPay did not, at that time, have any way to uphold their own rules.


    So it is possible that WP have now made the changes to their system to stop auto-redirects working. Lets see the error messages when they are posted.


    I agree with scottymcloo, there is not much point trying to make changes to old versions - it is much better that you either upgrade to MS1 or try to de-engineer the MS1 release to make it work with earlier versions.

  8. WorldPay tell me there is going to be an upgrade

    Any more details? What sort of upgrade?


    I have been trying to test my payment process via thier test server, but when it comes to the end of the process it is failing.

    What actually happens? What do you see on screen?


    Therefore, it might be best to go ask the developer of that module to see if he will change it.

    :shock: I wonder, more chance to win the lottery I think!! :twisted:

  9. Ian,


    Sorry a bit off topic, well.... to put on topic thanks for this contribution, it has worked a treat and will be going live in a few days.


    What I was going to say was that I thought your shadows on the info boxes neat on your site. really effective.


    Yep - defintely off topic!


    No doubt someone is now going to ask how its done - so to avoid cluttering up this thread anymore with this subject, here is the answer:


    Copy the shadow images under the boxes from my site - left and right.

    Add to the each info box like this (noting left and right images):


    new infoBox($info_box_contents);

    echo tep_image(DIR_WS_IMAGES . 'shadow_l.gif'); // shadow_r.gif for right side.




    <!-- information_eof //-->

  10. Does anyone know if the worldpay module will/can allow two separate worldpay account numbers to be stored or used by OSCommerce?


    I have two distinct organizations each with their own Worldpay account using the same OSCommerce cart.  I would like to send the payment transaction to one of the worldpay accounts based on the contents of the purchase.


    Any thoughts?


    In a word no.


    Not sure how you would be able to tell which site was calling the WP module so as to associate the right account number anyway?

  11. The Second line has an INVALID SID - there are two question marks in it.


    This code snippet is fundamentally flawed as it will always select the option to put the ? in as it will never find the osCsid in the string. Not that this will concern most users as nearly everyone seems to be working with cookies enabled. A better test would be to check if cookies are on or off.


    Forget about whether cookies are enabled or not - WorldPay will not worry what is on the callback URL.
    True but OSC does care and the idea developed in an earlier thread was to pass the CID back through the callback. Again, most people do not care as most are using cookies. Whether it is STILL necessary to pass the CID back in this was is a mute point.


    If you look at the code you presented, it does not interrogate a dynamic URL, it is using references from within the setup parameters, so there never will be a SID present in it.
    Not sure about this, example 2 above with the 2 ? shows that there is. Or have I misunderstood?


    Here again is the code that will always work, hang the language prameter on the end if you need it.
    On return to the store, only default parameters are used (as you are really running a copy of the store within the WP window) so it will display the default language. By passing the language parameter back like this you can force the language of choice for the user.


    I see that the address is still incorretly formatted too - I posted alternative code for that here.
    It seems okay to me??

  12. I downloaded version 1.4 of the worldpay payment module. It looks great but in the installation instructions it states that you need to modify the file catalog/includes/filename.php. Unfortunately that file does not exist. I am using the 2.2 snap shot and am running os commerce on windows


    Any suggestions?





    Modify catalog/includes/application_top.php instead - after a certain date, filename defines were moved to filenames.php.

  13. thanks but i dont know where i have to put it? im new to the coding side of things and have got by so far by the good advice within this forum...


    so if you know where i place this within which file i would be greatful



    Well, assuming that you are using a clean copy of OSC, then my suggestion would be to start by putting the images into the conditions file like this:


    Find catalog/includes/languages/english/conditions.php


    Look for: define('TEXT_INFORMATION', 'Put here your Conditions of Use information.');


    And paste the above code in say like this:


    define('TEXT_INFORMATION', '

    We accept the following credit cards:<br><center>

    <script language="JavaScript" src="http://www.worldpay.com/cgenerator/cgenerator.php?instId=' . MODULE_PAYMENT_WORLDPAY_ID . '"></script></center>


  14. Great.  I tested it on CVC.  


    and now I have a division by 1 error on these lines.


    Warning: Division by zero in /home/discount/public_html/catalog/includes/classes/split_page_results.php on line 59


    Warning: Division by zero in /home/discount/public_html/catalog/includes/classes/split_page_results.php on line 86

    Warning: Division by zero in /home/discount/public_html/catalog/includes/classes/split_page_results.php on line 89



    If I go to the includes/classes/split_page_results.php.  What would a safe division be:  by one etc.?


    Ooops! I think I meant to say:


    $affiliate_sales_split = new splitPageResults($affiliate_sales_raw, MAX_DISPLAY_SEARCH_RESULTS);


    but dont count on it working - hard to do this without actually having MS2 installed!

  15. I tried to comment out the split page results on line 36.  That showed the results.  But I am now getting an error on line 123 for function not defining a non-existing object.  


    On the face of it, you just need to change line 36 to:


    $affiliate_sales_split = new splitPageResults($affiliate_sales_raw, $HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS);


    but as I said, I am not using MS2 and cannot test this.

  16. heh, same problem for all of us :(


    I am not using this but looking at your problem, I would say it is caused by the recent changes to the splitPageResults class. Just out of interest, try commenting out line 36 of affiliate_sales.php.


    Maybe nothing to do with this but you never know!

  17. if I press MAKE PAYMENT it can not go back to shopping site, and I can see what I just ordered in shopping site in admin page.


    Where does it go? Do you see the WP banner or do you see the wpcallback file included in the contribution?

  18. Just make sure that you enter your Worldpay Installation ID in Admin, enable the module plus enter the callback info in WP Configuration manager - http://<wpdisplay item="MC_callback"> - see installation instructions in MS1 version - and you should have no problem. (If not using the MS1 version of the WP mod dont do this).


    Good luck :)

  19. does anyone have an answer to this one please... as need to install worldpay


    Providing you have put the right files in catalog/includes/modules/payment and catalog/includes/languages/english/modules/payment and are using MS1 or before, you should see 'Secure Credit Card Payment' in Admin.


    If you do not, then it might be because you have changed something such as the class name - so check that everything important says 'worldpay' in lower case. e.g.


    class worldpay


    $this->code = 'worldpay';



  20. $affiliate_conversions = tep_round(($affiliate_transactions / $affiliate_clickthroughs)*100, 2) . "%";




    $affiliate_conversions = tep_round(($affiliate_sales['count'] * 100) / $affiliate_clickthroughs, 2);



  21. I still see a lot of people are using redirects in the final page after WorldPay is complete - this is still a contravention of their Ts & Cs - NO automatic redirects at all.


    That may be true but if you ask WP, they still recommend that you use version 3c of this mod which works entirely on auto-redirects. They explained it to me that they have the condition to a) prevent redirects to sites OTHER than the origin and B) to allow the user to read their banner. The MS1 version of the WP mod meets both those conditions.