The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
clear sessions and WorldPay - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: clear sessions and WorldPay (/showthread.php?tid=1866)



clear sessions and WorldPay - egeller624 - Jan 23rd, 2012

Hello,
I'm trying to integrate WorldPay into my website and I have hit a bit of a snag. I had previously set up paypal successfully but the issue I'm having with WorldPay is trying to clear the sessions on the result page presented to the customer after they either process a payment or cancel the transaction. With PayPal it was easy to redirect to a specific page on my site and clear sessions with no problem. But WorldPay doesn't allow you to redirect at all. They require you to show certain information to the customer and in order to prevent people bypassing that info they make you stay on their own result page.

Using the payment response feature, I have a php file which pulls the form ID and submission ID from WorldPay (previously submitted to their site via a custom variable on my order form pages) and it successfully finalizes the submission in form tools if the customer completes the purchase. However, I can't seem to find a way to clear the sessions. I'm thinking it's because at that point the customer is on the WorldPay website and not my own so clearing the sessions doesn't really do anything.

Is there a way to send a clear sessions message to my site from the WorldPay site without redirecting? Strange question I know, but WorldPay really makes it difficult to customize anything and the documentation is horrendous.

A code snippet from my php file which WorldPay includes on their result page:

PHP Code:
<?php
require_once("../../form_tools/global/api/api.php");
$fields ft_api_init_form_page(8);
?>

<html><title></title><head>

</head><WPDISPLAY FILE=header.html DEFAULT="<body bgcolor=#ffffff>">

<?php
// successful payment! finalize the submission in the database
if ($_POST['transStatus'] == "Y"
{
  
ft_finalize_submission($_POST['MC_formID'], $_POST['MC_subID']);
  
ft_api_clear_form_sessions();    
}
else
{
    
ft_api_clear_form_sessions();
}
?>    
    
    <p>
    <WPDISPLAY ITEM=banner></p>
<p>
    <a class="one" href="http://sandbox.mtncamps.com"><strong>Click here to return to the Mountain Adventure Camps website</strong></a></p>
 

<WPDISPLAY FILE=footer.html DEFAULT="</body>"></html> 

Thanks.


RE: clear sessions and WorldPay - egeller624 - Jan 24th, 2012

Nevermind. I got a response from WorldPay tech support saying they do allow redirects via meta-refresh as long as there is a delay of 4 or 5 seconds. Wish they had mentioned that in their documentation.

Thanks.