Jump to content


  • Content count

  • Joined

  • Last visited

1 Follower

About ambience

  • Birthday 01/08/1979

Profile Information

  • Real Name
    Graeme Simms
  • Location
    South Africa
  • Interests
    Computing, e-commerce, electronic music, keyboards, synths.
  • Website
  1. ambience

    Worldpay support III

    Glad it worked! Don't thank me dude; just help someone else out via forums if you can.. I've been helped countless times, just trying to give some back. Just had a thought for the cartid field by the way! I think the order number in oscomerce is auto-incremented when new orders are placed. So if your last order number was 45, you could safely assume your next order number would be 46.. With that thinking, you could retrieve the last known order number in the database, add 1 to it, and send that as your cartid field to worldpay with the assumption that if the order is successful the order number should match up.. The only case where this would not theoretically work, was if two orders are placed at the same time and one customer is faster than another one during payment. A places order, redirects to WP. B places order, redirects to WP. B completes order, success A completes order, success. In this case the order numbers would be swopped around.. Not sure how to go about doing this yet; will investigate much later today. If you're bored, try it out :)
  2. ambience

    Worldpay support III

    You're thinking about it the right way.. the key to understanding what is happening is to look in the order.php file in classes. That's going to show you how it gets and puts information into that order variable / class.. which is how you can say order->customer etc.. Where you're wrong with the code is that the customer_id field isn't part of the order class - you will see it's missing from the order.php file. The customer_id field is stored in a global variable on it's own so it's a simple case of calling it directly: tep_draw_hidden_field('cartId', STORE_NAME.' : '.$customer_id.' - '.$order->customer['firstname'].' '.$order->customer['lastname']) Sure you can work out how that will turn out... StoreName : CustNum - First Last I'm a beginner myself so I stand to be corrected on my thinking, but that solves the problem :)
  3. ambience

    Worldpay support III

    That's it yes - replace that line with the one documented above, but make sure to keep a dot (full stop) at the end.
  4. ambience

    Worldpay support III

    In catalog/includes/modules/payment/worldpay.php Look for the line similar to this with cartid in it and change it to this tep_draw_hidden_field('cartId', STORE_NAME.' : '.$order->customer['firstname'].' '.$order->customer['lastname'])
  5. ambience

    Worldpay support III

    I recall looking at the CartID field a while back - I think that oscommerce only generates the order number after payment is successful, so it seems impossible. I orginally included the customer's name in the cartid field because I thought the oscsid was useless info. I want to actually try do something with the product info in the cartid using the product codes, to generate something like this: "1xAB;2xGGHHS" so you can easily see via worldpay what the order was if you don't get it in osc.. but haven't found a way to do it yet. Might be a nice idea for the clever people :)
  6. ambience

    [Contribution] Ship 2 Pay v1.0 (MS1)

    Thanks for a great module! I would like to confirm that this module works for MS2 without modifications.
  7. ambience

    [Contribution] Worldpay V4 Beta

    That's what I thought! But even creating a simple test.php script (see thread above) with only the worldpay banner string in it gets completely ignored as well. I think the next step in the process is not to get it to work with oscommerce, and rather try get it working on a standard piece of arb php code.. that way we can easily rule out anything osc is doing, and at the same time get an idea of worldpay are trying to do. Using the same piece of test code I wrote above, this has been tested as well and I still get no result. What I'm thinking of is the following: - Get the worldpay server callback setup to a test script directly, eg, in worldpay admin, make it directly http://my.server/test.php - Create a standard test.php page with a few settings to display some of the strings worldpay send - Create another standard php page with a test form that passes direct variables to worldpay I'm hoping this rules out any variable passing errors and hopefully it should assist to debug.. I'm going to attempt this a little later and see what happens..
  8. ambience

    [Contribution] Worldpay V4 Beta

    Well, I'm afraid the whole script is pretty useless :( I can't seem to get it working in a live environment - I think my problem has mainly to do with my lack of php knowledge. At this point I think the worldpay callback seems to require that your callback script contains <WPDISPLAY ITEM=banner> within the script... but even creating a test page as follows does not help <html> <head> <title>Test</title> </head> <body bgcolor=#ffffff> <? echo "<WPDISPLAY ITEM=banner>"; ?> <? echo "Hello World"; ?> <? echo $HTTP_GET_VARS[MC_banner]; ?> <b><WPDISPLAY ITEM=banner></b> </body> </html> The confirm/cancel screen still uses the worldpay default which means they had a problem with the above script, even when worldpay.php is modified to redirect to that script and filename. The problem is finding out where the problem is!!! ARGH *pulls out hair* Can anyone more experienced confirm if I am on the right track!? Does anyone have a working php callback script for worldpay, even perhaps not with OSC just so that I can see how it should work?
  9. ambience

    [Contribution] Worldpay V4 Beta

    Hey mattpary, You're right - I've been working with Scotty who has assisted me and I'm narrowing the problem down all the time. I've got another modification worth trying, but it needs testing before being released again.. I'll PM you.
  10. ambience

    [Contribution] Worldpay V4 Beta

    Here is why I'm pretty convinced that it should work... Setup : I've setup osc on a local linux server running redhat 6.2, mysql, php, and apache. All operations of osc work perfectly via my Windows based PC where I make code changes and FTP to the local webserver. According to the worldpay docs, when they send a callback to you, they use a post command. I replicated the action of this by creating a file called test.php I modified my worldpay module to direct to test.php instead of the usual worldpay https address, effectively making everyone think test.php is worldpay. Here is the code for test.php <html> <head><title>My First PHP Page</title> </head> <body bgcolor=#ffffff> <FORM ACTION="" METHOD="POST"> <INPUT TYPE=HIDDEN NAME="transStatus" VALUE="C"> <INPUT TYPE=SUBMIT VALUE="FAIL"> </FORM> <br> <FORM ACTION="" METHOD="POST"> <INPUT TYPE=HIDDEN NAME="transStatus" VALUE="Y"> <INPUT TYPE=SUBMIT VALUE="PASS"> </FORM> </body> </html> There are two criteria. Pass or fail. One posts the transtatus Y and the other C - the only useful info osc can use in determining what happened. I created the form action links manually by looking at the code produced by osc on the final confirmation screen just before the last click would take you through to worldpay - that's how I got the session id that was created for me that I am using to link back. Effectively the same thing should be happening transparently at worldpay. Using this mock setup which I believe my logic is correct on, pressing PASS returns to the page saying transaction successful and processes the order as normal, while pressing FAIL returns you to the payment page with the error message. Due to the design, you will always get the error message unless it picked up the Y variable of transtatus. However in the code it looks like it should be doing the opposite. However, the test works so I know it will work in the real model... or have I completely lost the plot? Logically, if you have the RESULTC/Y files from the previous module version in worldpays configuration, that page will redirect you back without the transtatus variable, which will generate the error because the script is currently designed that way (at least I think.) This whole PHP thing is new to me but I'm passionate about this and it's my mission in life to get this thing working since I need to use it for my upcoming store ;-)
  11. ambience

    [Contribution] Worldpay V4 Beta

    Hi, Are you definitely sure that you have enabled callback on Worldpay hence NOT using the Result files as supplied in the previous module?
  12. I hope this solves the problem here - I've updated the worldpay module to work with the newer class system. Need some help with testing please! http://www.oscommerce.com/community/contri...utions,5/page,3
  13. ambience

    Worldpay Payment Module

    I hope this update will assist you all :) Please test and advise. http://www.oscommerce.com/community/contri...utions,5/page,3[/url]
  14. Hi All, I hope I've been able to resolve some of the problems experienced in the current WorldPay modules by now utilising the callback feature from Worldpay directly. I can't test this live though, so I hope this contrib will spark off someone who is prepared to test it and make further refinements. http://www.oscommerce.com/community/contri...utions,5/page,3