Index: /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 14120)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 14121)
@@ -103,15 +103,30 @@
         xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
-        xmldict['institution_amt'] = 100 * (
-            self.context.amount_auth - provider_amt - GATEWAY_AMT)
         xmldict['institution_item_name'] = self.category
         xmldict['institution_name'] = INSTITUTION_NAME
-        # Interswitch amount is not part of the xml data
-        xmltext = """<payment_item_detail>
+
+        if self.applicant.applicant_id.startswith('pg'):
+            handbook_amount = 2000.0
+            xmldict['handbook_amount'] = 100 * handbook_amount
+            xmldict['institution_amt'] = 100 * (
+                self.context.amount_auth - provider_amt - handbook_amount -GATEWAY_AMT)
+            xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
 <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
+<item_detail item_id="3" item_name="PG Handbook" item_amt="%(handbook_amount)d" bank_id="117" acct_num="1014270207" />
+</item_details>
+</payment_item_detail>""" % xmldict
+
+        else:
+            xmldict['institution_amt'] = 100 * (
+                self.context.amount_auth - provider_amt - GATEWAY_AMT)
+            xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
+<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
+<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
+</item_details>
+</payment_item_detail>""" % xmldict
+
         self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
         self.context.provider_amt = provider_amt
Index: /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py	(revision 14120)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py	(revision 14121)
@@ -82,4 +82,38 @@
         self.assertTrue(
             'item_name="Application Fee" item_amt="775000" bank_id="117" acct_num="1010835352"'
+            in self.browser.contents)
+        self.assertTrue(
+            '<input type="hidden" name="product_id" value="5845" />'
+            in self.browser.contents)
+        delta = timedelta(days=8)
+        self.applicant.values()[0].creation_date -= delta
+        self.browser.open(self.payment_url)
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertTrue(
+            'This payment ticket is too old. Please create a new ticket'
+            in self.browser.contents)
+
+    def test_interswitch_form_pg(self):
+        self.applicant.applicant_id = u'pg_anything'
+        self.browser.getControl("Add online").click()
+        self.assertTrue('ticket created' in self.browser.contents)
+        #self.browser.getLink(value).click()
+        self.assertTrue('Amount Authorized' in self.browser.contents)
+        self.assertTrue('<span>10000.0</span>' in self.browser.contents)
+        self.payment_url = self.browser.url
+        # Manager can access InterswitchForm
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="1000000" />'
+            in self.browser.contents)
+        self.assertTrue(
+            'item_name="BT Education" item_amt="200000"'
+            in self.browser.contents)
+        self.assertTrue(
+            'item_name="Application Fee" item_amt="575000" bank_id="117" acct_num="1010835352"'
+            in self.browser.contents)
+        self.assertTrue(
+            'item_name="PG Handbook" item_amt="200000" bank_id="117" acct_num="1014270207"'
             in self.browser.contents)
         self.assertTrue(
