Ignore:
Timestamp:
22 Oct 2012, 14:37:00 (12 years ago)
Author:
Henrik Bettermann
Message:

Switch to test environment and setup xmp split data (with constant school fee so far).

Location:
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py

    r9347 r9387  
    3333from waeup.kwarapoly.interfaces import MessageFactory as _
    3434
    35 PRODUCT_ID = '83'
     35PRODUCT_ID = '3986'
    3636SITE_NAME = 'kwarapoly-kofa.waeup.org'
    37 PROVIDER_ACCT = '0026781725'
    38 PROVIDER_BANK_ID = '31'
     37PROVIDER_ACCT = '1010764827'
     38PROVIDER_BANK_ID = '117'
    3939PROVIDER_ITEM_NAME = 'BT Education'
    4040INSTITUTION_NAME = 'KwaraPoly'
     
    4242#QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx'
    4343#QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx'
    44 POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx'
    45 #POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx'
    46 
    47 HOST = 'webpay.interswitchng.com'
    48 #HOST = 'testwebpay.interswitchng.com'
    49 URL = '/paydirect/services/TransactionQueryWs.asmx'
    50 #URL = '/test_paydirect/services/TransactionQueryWs.asmx'
     44#POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx'
     45POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx'
     46
     47#HOST = 'webpay.interswitchng.com'
     48HOST = 'testwebpay.interswitchng.com'
     49#URL = '/paydirect/services/TransactionQueryWs.asmx'
     50URL = '/test_paydirect/services/TransactionQueryWs.asmx'
    5151httplib.HTTPConnection.debuglevel = 0
    5252
     
    178178    site_name = SITE_NAME
    179179    currency = CURRENCY
    180     pay_item_id = '8302'
     180    pay_item_id = '101'
    181181    product_id = PRODUCT_ID
    182182
     
    209209        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
    210210        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    211         xmldict['provider_amt'] = 100 * 500
     211        xmldict['provider_amt'] = 100 * 1200
     212        # Dalash data
     213        xmldict['dalash_amt'] = 100 * 1800
    212214        # Institution data
    213         studycourse = student['studycourse']
    214         if student.current_mode in ('ug_sw','prence',):
    215             xmldict['institution_acct'] = "6216801025"
    216             xmldict['institution_bank_id'] = '117'
    217         elif student.current_mode in ('ug_ft',) and \
    218             student['studycourse'].current_verdict == 'O':
    219             xmldict['institution_acct'] = "6216801025"
    220             xmldict['institution_bank_id'] = '117'
    221         elif student.current_mode in ('ug_ft',):
    222             xmldict['institution_acct'] = "6216801033"
    223             xmldict['institution_bank_id'] = '117'
    224         elif student.current_mode in ('pd_ft',):
    225             xmldict['institution_acct'] = "6216801025"
     215        if xmldict['faculty'] in ('CPGS',):
     216            xmldict['institution_acct'] = "1771180233"
     217            xmldict['institution_bank_id'] = '120'
     218        elif xmldict['faculty'] in ('IBAS',):
     219            xmldict['institution_acct'] = "0006772436"
     220            xmldict['institution_bank_id'] = '121'
     221        elif xmldict['faculty'] in ('IETS',):
     222            xmldict['institution_acct'] = "0106259811"
     223            xmldict['institution_bank_id'] = '10'
     224        elif xmldict['faculty'] in ('IFMS',):
     225            xmldict['institution_acct'] = "2013910271"
     226            xmldict['institution_bank_id'] = '8'
     227        elif xmldict['faculty'] in ('ITCH',):
     228            xmldict['institution_acct'] = "1010445144"
    226229            xmldict['institution_bank_id'] = '117'
    227230        else:
    228             xmldict['kwarapoly_acct'] = "0000000000000"
     231            xmldict['institution_acct'] = "0000000000000"
    229232            xmldict['institution_bank_id'] = '0'
    230         xmldict['kwarapoly_split'] = 100 * 1400
    231233        xmldict['institution_amt'] = 100 * (
    232             self.context.amount_auth - 500 - 150 - 1400)
     234            self.context.amount_auth - 1200 - 300 - 1800)
    233235        xmldict['institution_item_name'] = self.context.p_category
    234236        xmldict['institution_name'] = INSTITUTION_NAME
     
    237239<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    238240<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" />
    239 <item_detail item_id="2" item_name="KwaraPoly Split" item_amt="%(kwarapoly_split)s" bank_id="117" acct_num="6216801058" />
     241<item_detail item_id="2" item_name="Dalash" item_amt="%(dalash_amt)s" bank_id="117" acct_num="1013196791" />
    240242<item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
    241243</item_details>
     
    288290        # Institution data
    289291        xmldict['institution_amt'] = 100 * (self.context.amount_auth - 500 - 150)
    290         xmldict['institution_acct'] = '1012445289'
    291         xmldict['institution_bank_id'] = '117'
     292        xmldict['institution_acct'] = '0'
     293        xmldict['institution_bank_id'] = '0'
    292294        xmldict['institution_item_name'] = self.context.p_category
    293295        xmldict['institution_name'] = INSTITUTION_NAME
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py

    r9370 r9387  
    1616## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    1717##
     18import grok
    1819from hurry.workflow.interfaces import IWorkflowState
     20from zope.component import createObject
     21from zope.event import notify
     22from waeup.kofa.university.faculty import Faculty
     23from waeup.kofa.university.department import Department
    1924from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    2025from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
     
    4651    def setUp(self):
    4752        super(InterswitchTestsStudents, self).setUp()
     53
     54        # Create at least one Kwarapoly faculty
     55        self.app['faculties']['CPGS'] = Faculty(code='CPGS')
     56        self.app['faculties']['CPGS']['dep1'] = Department(code='dep1')
     57        self.certificate2 = createObject('waeup.Certificate')
     58        self.certificate2.code = u'CERT2'
     59        self.certificate2.application_category = 'basic'
     60        self.certificate2.study_mode = 'nd_ft'
     61        self.certificate2.start_level = 100
     62        self.certificate2.end_level = 300
     63        self.app['faculties']['CPGS']['dep1'].certificates.addCertificate(
     64            self.certificate2)
     65        # Set study course attributes of test student
     66        self.student['studycourse'].certificate = self.certificate2
     67        self.student['studycourse'].current_session = 2004
     68        self.student['studycourse'].entry_session = 2004
     69        self.student['studycourse'].current_verdict = 'A'
     70        self.student['studycourse'].current_level = 100
     71        # Update the catalog
     72        notify(grok.ObjectModifiedEvent(self.student))
     73
    4874        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    4975        self.browser.open(self.payments_path)
     
    75101                           self.browser.contents)
    76102        self.assertMatches(
    77             '...<span>12495.0</span>...',
     103            '...<span>60980.0</span>...',
    78104            self.browser.contents)
    79105        self.payment_url = self.browser.url
     
    84110                           self.browser.contents)
    85111        self.assertMatches(
    86             '...<input type="hidden" name="amount" value="1249500.0" />...',
    87             self.browser.contents)
    88         self.assertMatches(
    89             '...item_name="schoolfee" item_amt="1044500" bank_id="117" acct_num="6216801033"...',
    90             self.browser.contents)
    91         self.assertMatches(
    92             '...item_name="KwaraPoly Split" item_amt="140000" bank_id="117" acct_num="6216801058"...',
    93             self.browser.contents)
    94         self.assertMatches(
    95             '...item_name="BT Education" item_amt="50000" bank_id="31" acct_num="0026781725"...',
     112            '...<input type="hidden" name="amount" value="6098000.0" />...',
     113            self.browser.contents)
     114        self.assertMatches(
     115            '...item_name="schoolfee" item_amt="5768000" bank_id="120" acct_num="1771180233"...',
     116            self.browser.contents)
     117        self.assertMatches(
     118            '...item_name="Dalash" item_amt="180000" bank_id="117" acct_num="1013196791"...',
     119            self.browser.contents)
     120        self.assertMatches(
     121            '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...',
    96122            self.browser.contents)
    97123
Note: See TracChangeset for help on using the changeset viewer.