Ejemplo n.º 1
0
def cancel(request, payment_method, payment_code):
        
    from payments.connector import PaymentConnector

    payment = PaymentConnector.get_connector().lookup(payment_code)
    pp = PaymentProcessor.get_processor(payment_method)

    return pp.cancel(request, payment)
Ejemplo n.º 2
0
def success(request, payment_method, payment_code):
    
    from payments.connector import PaymentConnector

    payment = PaymentConnector.get_connector().lookup(payment_code)
    pp = PaymentProcessor.get_processor(payment_method)

    try:
        return pp.success(request, payment)
    except PaymentProcessingError, e:
        return pp.error(request, payment, e)