fix certain problems with third-party payment, #23579
[freeside.git] / ng_selfservice / elements / post_thirdparty.php
1 <?
2 if ( $payment_results['error'] ) {
3   // an error at this stage isn't meaningful to the user
4   // but make sure it's logged
5   error_log("[start_thirdparty] $error");
6   $error = 'Internal error communicating with payment processor.';
7   include('error.php');
8 } elseif ( isset($payment_results['url']) ) {
9   $url = $payment_results['url'];
10 ?>
11 <H3>Redirecting to payment processor...</H3>
12 <DIV STYLE="display:none">
13 <FORM ID="autoform" METHOD="POST" ENCTYPE="multipart/form-data" ACTION="<?
14   echo($url);
15 ?>">
16 <?
17 if (isset($payment_results['post_params'])) {
18   foreach ($payment_results['post_params'] as $key => $value) {
19     echo("<INPUT TYPE=\"hidden\" NAME=\"$key\" VALUE=\"$value\">\n");
20   }
21 } ?>
22   <INPUT TYPE="submit" VALUE="submit">
23 </FORM>
24 </DIV>
25 <SCRIPT TYPE="text/javascript">
26 window.onload = function() {
27   document.getElementById('autoform').submit();
28 }
29 </SCRIPT>
30 <? } else {
31   $error = 'Internal error: no redirect URL.';
32 } ?>