def sagepayment(payment, config_request): factory = SagePaymentMain(None, config_request) factory.set_payment(payment) return factory