Ignore:
Timestamp:
23 Apr 2012, 14:06:39 (13 years ago)
Author:
Henrik Bettermann
Message:

Implement acceptance fee payments via Interswitch (part 2)

Location:
main/waeup.uniben/trunk/src/waeup/uniben/interswitch
Files:
3 edited

Legend:

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

    r8256 r8259  
    2828from waeup.kofa.students.viewlets import RequestCallbackActionButton as RCABStudent
    2929from waeup.kofa.applicants.viewlets import RequestCallbackActionButton as RCABApplicant
     30from waeup.kofa.payments.interfaces import payment_categories
    3031from waeup.uniben.students.utils import actions_after_student_payment
    3132from waeup.uniben.applicants.utils import actions_after_applicant_payment
     
    3435#    Interswitch test account data:
    3536#
    36 #    Card Number: 6274807700000007
    37 #    Expiry Date: July 2012
    38 #    PIN: 0000
    39 
    40 #    Card Number: 6278050000000007
    41 #    Expiry Date: July 2012
    42 #    PIN: 0000
     37#   Card Number: 6274807700000007
     38#   Expiry Date: July 2012
     39#   PIN: 0000
     40
     41#   Card Number: 6278050000000007
     42#   Expiry Date: July 2012
     43#   PIN: 0000
     44#
     45#   PAN,EXPIRY,PIN,CVV2
     46#   5060990330000003386,1304,0000,543
     47#   5060990330000003394,1304,0000,865
     48#   5060990330000003402,1304,0000,012
     49#   5060990330000003410,1304,0000,737
     50#   5060990330000003428,1304,0000,310
     51#   5060990330000003436,1304,0000,173
    4352
    4453PRODUCT_ID = '57'
     
    160169
    161170class InterswitchActionButtonStudent(RCABStudent):
    162     grok.order(2)
     171    grok.order(1)
    163172    grok.context(ICustomStudentOnlinePayment)
    164173    icon = 'actionicon_pay.png'
     
    173182
    174183class InterswitchActionButtonApplicant(RCABApplicant):
    175     grok.order(2)
     184    grok.order(1)
    176185    grok.context(ICustomApplicantOnlinePayment)
    177186    icon = 'actionicon_pay.png'
     
    186195
    187196# Deprecated
    188 class InterswitchRequestCallbackActionButtonStudent(RCABStudent):
    189     grok.order(3)
     197#class InterswitchRequestCallbackActionButtonStudent(RCABStudent):
     198#    grok.order(3)
     199#    grok.context(ICustomStudentOnlinePayment)
     200#    icon = 'actionicon_call.png'
     201#    text = _('Request CollegePAY callback')
     202
     203#    def target_url(self):
     204#        if self.context.p_state == 'paid':
     205#            return ''
     206#        site_redirect_url = self.view.url(self.view.context, 'isw_callback')
     207#        args = {
     208#            'transRef':self.context.p_id,
     209#            'prodID':PRODUCT_ID,
     210#            'redirectURL':site_redirect_url}
     211#        return QUERY_URL + '?%s' % urllib.urlencode(args)
     212
     213# Alternative preferred solution
     214class InterswitchRequestWebserviceActionButtonStudent(RCABStudent):
     215    grok.order(2)
    190216    grok.context(ICustomStudentOnlinePayment)
    191217    icon = 'actionicon_call.png'
    192     text = _('Request CollegePAY callback')
    193 
    194     def target_url(self):
    195         if self.context.p_state == 'paid':
    196             return ''
    197         site_redirect_url = self.view.url(self.view.context, 'isw_callback')
    198         args = {
    199             'transRef':self.context.p_id,
    200             'prodID':PRODUCT_ID,
    201             'redirectURL':site_redirect_url}
    202         return QUERY_URL + '?%s' % urllib.urlencode(args)
    203 
    204 # Alternative preferred solution
    205 class InterswitchRequestWebserviceActionButtonStudent(RCABStudent):
    206     grok.order(4)
    207     grok.context(ICustomStudentOnlinePayment)
    208     icon = 'actionicon_call.png'
    209     text = _('Request CollegePAY webservice')
     218    text = _('Request CollegePAY Webservice')
    210219    target = 'request_webservice'
    211220
    212221class InterswitchRequestWebserviceActionButtonApplicant(RCABApplicant):
    213     grok.order(4)
     222    grok.order(2)
    214223    grok.context(ICustomApplicantOnlinePayment)
    215224    icon = 'actionicon_call.png'
    216     text = _('Request CollegePAY webservice')
     225    text = _('Request CollegePAY Webservice')
    217226    target = 'request_webservice'
    218227
     
    252261        self.amount = (self.context.amount_auth + self.context.surcharge_1 +
    253262            self.context.surcharge_2 + self.context.surcharge_3)
     263        self.category = payment_categories.getTermByToken(
     264            self.context.p_category).title
    254265        self.amount_100 = 100 * self.amount
    255266        self.local_date_time = str(self.context.creation_date)
     
    267278
    268279    def update(self):
    269         if self.context.p_state != 'unpaid':
    270             self.flash(_("Payment ticket can't be re-send to CollegePAY."))
    271             self.redirect(self.url(self.context, '@@index'))
    272             return
     280        #if self.context.p_state != 'unpaid':
     281        #    self.flash(_("Payment ticket can't be re-send to CollegePAY."))
     282        #    self.redirect(self.url(self.context, '@@index'))
     283        #    return
    273284        self.applicant = self.context.__parent__
    274285        xmldict = {}
    275286        xmldict['department'] = None
    276287        xmldict['faculty'] = None
     288        self.category = payment_categories.getTermByToken(
     289            self.context.p_category).title
    277290        self.amount = (self.context.amount_auth + self.context.surcharge_1 +
    278291            self.context.surcharge_2 + self.context.surcharge_3)
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/applicant_goto_interswitch.pt

    r8256 r8259  
    5050          Payment Category:</td>
    5151        <td>
    52           <span tal:replace="view/context/p_category">PAYMENTCATEGORY</span>
     52          <span tal:replace="view/category">PAYMENTCATEGORY</span>
    5353        </td>
    5454      </tr>
     
    6363  <input type="hidden" name="local_date_time" tal:attributes="value view/local_date_time" />
    6464  <input type="hidden" name="amount" tal:attributes="value view/amount_100" />
    65 
    6665  <input type="hidden" name="txn_ref" tal:attributes="value view/context/p_id" />
    67   <input type="hidden" name="cust_id_desc" tal:attributes="value view/context/p_item" />
    68   <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_category" />
    69 
     66  <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_item" />
     67  <input type="hidden" name="cust_id_desc" tal:attributes="value view/category" />
    7068  <input type="hidden" name="cust_id" tal:attributes="value view/applicant/applicant_id" />
    7169  <input type="hidden" name="cust_name" tal:attributes="value view/applicant/display_fullname" />
    72 
    7370
    7471  <input type="hidden" name="payment_params" value="college_split" />
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/student_goto_interswitch.pt

    r8256 r8259  
    5050          Payment Category:</td>
    5151        <td>
    52           <span tal:replace="view/context/p_category">PAYMENTCATEGORY</span>
     52          <span tal:replace="view/category">PAYMENTCATEGORY</span>
    5353        </td>
    5454      </tr>
     
    6363  <input type="hidden" name="local_date_time" tal:attributes="value view/local_date_time" />
    6464  <input type="hidden" name="amount" tal:attributes="value view/amount_100" />
    65 
    6665  <input type="hidden" name="txn_ref" tal:attributes="value view/context/p_id" />
    67   <input type="hidden" name="cust_id_desc" tal:attributes="value view/context/p_item" />
    68   <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_category" />
    69 
     66  <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_item" />
     67  <input type="hidden" name="cust_id_desc" tal:attributes="value view/category" />
    7068  <input type="hidden" name="cust_id" tal:attributes="value view/student/student_id" />
    7169  <input type="hidden" name="cust_name" tal:attributes="value view/student/display_fullname" />
    72 
    7370
    7471  <input type="hidden" name="payment_params" value="college_split" />
Note: See TracChangeset for help on using the changeset viewer.