def _payment_accepted(order_id, auth_amount, currency, decision):
 try:
  order = Order.objects.get(id=order_id)
 except Order.DoesNotExist:
  raise CCProcessorDataException(_('The payment processor accepted an order whose number is not in our system.'))
 if (decision == 'ACCEPT'):
  if ((auth_amount == order.total_cost) and (currency.lower() == order.currency.lower())):
   return {'accepted': True, 'amt_charged': auth_amount, 'currency': currency, 'order': order}
  else:
   ex = CCProcessorWrongAmountException(_(u'The amount charged by the processor {charged_amount} {charged_amount_currency} is different than the total cost of the order {total_cost} {total_cost_currency}.').format(charged_amount=auth_amount, charged_amount_currency=currency, total_cost=order.total_cost, total_cost_currency=order.currency))
   ex.order = order
   raise ex
 else:
  return {'accepted': False, 'amt_charged': 0, 'currency': 'usd', 'order': order}

def _payment_accepted ( order_id , auth_amount , currency , decision ) : try : order = Order . objects . get ( id = order_id ) except Order . DoesNotExist : raise CCProcessorDataException ( _ ( 'The payment processor accepted an order whose number is not in our system.' ) ) if ( decision == 'ACCEPT' ) : if ( ( auth_amount == order . total_cost ) and ( currency . lower ( ) == order . currency . lower ( ) ) ) : return { 'accepted' : True , 'amt_charged' : auth_amount , 'currency' : currency , 'order' : order } else : ex = CCProcessorWrongAmountException ( _ ( u'The amount charged by the processor {charged_amount} {charged_amount_currency} is different than the total cost of the order {total_cost} {total_cost_currency}.' ) . format ( charged_amount = auth_amount , charged_amount_currency = currency , total_cost = order . total_cost , total_cost_currency = order . currency ) ) ex . order = order raise ex else : return { 'accepted' : False , 'amt_charged' : 0 , 'currency' : 'usd' , 'order' : order }
check that cybersource has accepted the payment .