a543be93a24c75d178b857dbe14bf7605822b1f9
[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   $error = 'Internal error communicating with payment processor.';
5 } elseif ( isset($payment_results['url']) ) {
6   $url = $payment_results['url'];
7 ?>
8 <H3>Redirecting to payment processor...</H3>
9 <DIV STYLE="display:none">
10 <FORM ID="autoform" METHOD="POST" ENCTYPE="multipart/form-data" ACTION="<?
11   echo($url);
12 ?>">
13 <?
14 if (isset($payment_results['post_params'])) {
15   foreach ($payment_results['post_params'] as $key => $value) {
16     echo("<INPUT TYPE=\"hidden\" NAME=\"$key\" VALUE=\"$value\">\n");
17   }
18 } ?>
19   <INPUT TYPE="submit" VALUE="submit">
20 </FORM>
21 </DIV>
22 <SCRIPT TYPE="text/javascript">
23 window.onload = function() {
24   document.getElementById('autoform').submit();
25 }
26 </SCRIPT>
27 <? } else {
28   $error = 'Internal error: no redirect URL.';
29 } ?>