rameshmirpuri Posted July 8, 2008 Share Posted July 8, 2008 Hi Guys I have downloaded the Worldpay Junior Module from http://addons.oscommerce.com/info/5665 and followed the instructions in the module to integrate with Worldpay. For some reason I cannot get the callback to work. Is there other settings not included in the documentation that I could have missed out or need to be aware of? I have configured the url as per the instructions in the readme pdf file. I am using both callback password and MD5 and have enabled the callback password on the WorldPay system as well. The callback does not work even when I have disabled the callback password in both OScommerce and Worldpay. I believe the callback code is not executing and hence not generating the customised response which the customer should see after making a payment. I do not have https and have configured the callback url as http://<WPDISPLAY ITEM=MC_callback> on the WorldPay system Thank You Kind Regards Ramesh Quote Link to comment Share on other sites More sharing options...
Kanie Posted July 8, 2008 Share Posted July 8, 2008 Ramesh, you will need to check the "Enable the Shopper Response" option in your WorldPay Installation options. The readme file provided with the contribution refers to it as "Use callback response?" on Page 5 of the PDF. It would seem that the readme is a little out-dated as a number of the settings have seemingly changed their phrasing on the WorldPay site. To confirm, the following settings should be set in your WorldPay Installation configuration: Payment Response URL: http://<WPDISPLAY ITEM=MC_callback> Payment Response enabled?: CHECKED Enable the Shopper Response: CHECKED Payment Response password: YOUR PASSWORD AS SET IN YOUR WORLDPAY MODULE OPTIONS IN OSC ADMIN MD5 secret for transactions: YOUR PASSWORD AS SET IN YOUR WORLDPAY MODULE OPTIONS IN OSC ADMIN I hope that fixes the problem for you. Quote Link to comment Share on other sites More sharing options...
rameshmirpuri Posted July 9, 2008 Author Share Posted July 9, 2008 Dear Kanie Thank you for your reply. I can confirm that we had carried out the setup as per your instructions. Worldpay does make a call to the callback script junior_callback.php We have tested this by modifying the code in the script to output some text and when we try a test payment, the text is shown. The problem seems to be that we are not able to capture the parameters sent by Worldpay in the callback. I have created my own junior_callback.php file which contains only a few lines of code which will read the value of the transStatus parameter from Worldpay and prints the value. I have tried using $_POST["transStatus"] and $transStatus to read the value of the transStatus parameter but it does not seem to be able to do so. Could it be something in my server or php configuration which I have left out? Thanks Ramesh Quote Link to comment Share on other sites More sharing options...
Kanie Posted July 9, 2008 Share Posted July 9, 2008 Ramesh, "Worldpay does make a call to the callback script junior_callback.phpWe have tested this by modifying the code in the script to output some text and when we try a test payment, the text is shown." Where have you inserted this custom text? In order for text to be displayed only if the payment is successful, you must inject the code between the following lines: tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); } ?> YOUR HTML/MESSAGE HERE <?php } } } } } ?> If you have inserted your text after the closing ?> tag, the callback variables won't necessarily have to be read for the text to display. "The problem seems to be that we are not able to capture the parameters sent by Worldpay in the callback." What parameters are you trying to capture? "I have created my own junior_callback.php file which contains only a few lines of code which will read the value of the transStatus parameter from Worldpay and prints the value. I have tried using $_POST["transStatus"] and $transStatus to read the value of the transStatus parameter but it does not seem to be able to do so. Could it be something in my server or php configuration which I have left out?" It could possibly be your server configuration, but at this stage I'm unsure. All callback variables are sent from WorldPay as $_POST, so your code should be able to read it. To test whether your server is reading the callback and $_POST correctly, create a new test junior_callback.php file with just the following code inside: <?php echo "Hello world!<br/><br/>"; print_r($_POST); ?> Once you have completed your payment, you should see "Hello World!" followed by the full contents of the $_POST array. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.