add the start at PHP self-service as a quick early renew example
[freeside.git] / fs_selfservice / php / process_payment_order_renew.php
1 <?php
2
3 require('freeside.class.php');
4 $freeside = new FreesideSelfService();
5
6 $response = $freeside->process_payment_order_renew( array( 
7     'session_id' => $_POST['session_id'],
8     'payby'      => 'CARD',
9     'amount'     => $_POST['amount'],
10     'payinfo'    => $_POST['payinfo'],
11     'paycvv'     => $_POST['paycvv'],
12     'month'      => $_POST['month'],
13     'year'       => $_POST['year'],
14     'payname'    => $_POST['payname'],
15     'address1'   => $_POST['address1'],
16     'address2'   => $_POST['address2'],
17     'city'       => $_POST['city'],
18     'state'      => $_POST['state'],
19     'zip'        => $_POST['zip'],
20     'save'       => $_POST['save'],
21     'auto'       => $_POST['auto'],
22     'paybatch'   => $_POST['paybatch'],
23 ) );
24
25 #error_log("[process_payment_order_renew] received response from freeside: $response");
26
27 $error = $response['error'];
28
29 if ( $error ) {
30
31   header('Location:order_renew.php'.
32            '?session_id='. urlencode($_POST['session_id']).
33            '&payby=CARD'.
34            '&amount='.     urlencode($_POST['amount'])
35            '&payinfo='.    urlencode($_POST['payinfo'])
36            '&paycvv='.     urlencode($_POST['paycvv'])
37            '&month='.      urlencode($_POST['month'])
38            '&year='.       urlencode($_POST['year'])
39            '&payname='.    urlencode($_POST['payname'])
40            '&address1='.   urlencode($_POST['address1'])
41            '&address2='.   urlencode($_POST['address2'])
42            '&city='.       urlencode($_POST['city'])
43            '&state='.      urlencode($_POST['state'])
44            '&zip='.        urlencode($_POST['zip'])
45            '&save='.       urlencode($_POST['save'])
46            '&auto='.       urlencode($_POST['auto'])
47            '&paybatch='.   urlencode($_POST['paybatch'])
48         );
49   die();
50
51 }
52
53 // sucessful renewal.
54
55 $session_id = $response['session_id']'
56
57 // now what?
58
59 ?>
60 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
61 <HTML>
62   <HEAD>
63     <TITLE>Renew Early</TITLE>
64   </HEAD>
65   <BODY>
66     <H1>Renew Early</H1>
67
68     Renewal processed sucessfully.
69
70   </BODY>
71 </HTML>