Ignore:
Timestamp:
10 Jan 2007, 09:02:02 (18 years ago)
Author:
joachim
Message:

create payment object before submitting to the bank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py

    r1243 r1257  
    1313"""
    1414import logging
     15from urllib import urlencode
    1516logger = logging.getLogger('EPayment.')
    1617import DateTime
     
    3435##    sfc = res[0].getPath().split('/')[-4]
    3536info = {}
     37info['site_id'] = '8000'
     38info['currency_id'] = '566'
    3639info['amount'] = amount
    3740info['type_code'] = sbrain.faculty
     
    5558else:
    5659    payments = getattr(student,'payments')
     60if request.has_key('epayment'):
     61    return context.wema_form(info=info)
     62
    5763p_id = "p%s" % order_id
    5864payments.invokeFactory('Payment', p_id)
     
    6975    info['action'] = "%s/payments/%s/simulate_callback" % (student.absolute_url(),p_id)
    7076logger.info('"%(student_id)s","%(type_description)s", "%(amount)s N"' % info)
    71 return context.wema_form(info=info)
     77payment_fields = (('x_SiteID','site_id'),
     78                  ('x_Redirect_url','callback_url'),
     79                  ('x_CurrencyID','currency_id'),
     80                  ('x_PaymentCode','type_code'),
     81                  ('x_PayDesc','type_description'),
     82                  ('x_Billto','pay_bill_to'),
     83                  ('x_Shipto','pay_ship_to'),
     84                  ('x_PayerID','student_id'),
     85                  ('x_PayerNames','student_name'),
     86                  ('x_PayerEmail','student_email'),
     87                  ('x_OrderID','order_id'),
     88                  ('x_amt','amount'),
     89                  )
     90args = {}
     91for arg,field in payment_fields:
     92    args[arg] = info[field]
     93url = info['action'] + "?" + urlencode(args)
     94request.RESPONSE.redirect(url)
     95
Note: See TracChangeset for help on using the changeset viewer.