def process_postpay_callback(params):
 try:
  valid_params = verify_signatures(params)
  result = _payment_accepted(valid_params['req_reference_number'], valid_params['auth_amount'], valid_params['req_currency'], valid_params['decision'])
  if result['accepted']:
   _record_purchase(params, result['order'])
   return {'success': True, 'order': result['order'], 'error_html': ''}
  else:
   _record_payment_info(params, result['order'])
   return {'success': False, 'order': result['order'], 'error_html': _get_processor_decline_html(params)}
 except CCProcessorException as error:
  log.exception('error processing CyberSource postpay callback')
  if hasattr(error, 'order'):
   _record_payment_info(params, error.order)
  else:
   log.info(json.dumps(params))
  return {'success': False, 'order': None, 'error_html': _get_processor_exception_html(error)}

def process_postpay_callback ( params ) : try : valid_params = verify_signatures ( params ) result = _payment_accepted ( valid_params [ 'req_reference_number' ] , valid_params [ 'auth_amount' ] , valid_params [ 'req_currency' ] , valid_params [ 'decision' ] ) if result [ 'accepted' ] : _record_purchase ( params , result [ 'order' ] ) return { 'success' : True , 'order' : result [ 'order' ] , 'error_html' : '' } else : _record_payment_info ( params , result [ 'order' ] ) return { 'success' : False , 'order' : result [ 'order' ] , 'error_html' : _get_processor_decline_html ( params ) } except CCProcessorException as error : log . exception ( 'error processing CyberSource postpay callback' ) if hasattr ( error , 'order' ) : _record_payment_info ( params , error . order ) else : log . info ( json . dumps ( params ) ) return { 'success' : False , 'order' : None , 'error_html' : _get_processor_exception_html ( error ) }
the top level call to this module .