<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_to_payment(order_class, **kwargs):
 """ A function for registering unaware order class to ``getpaid``. This will generate a ``Payment`` model class that will store payments with ForeignKey to original order class This also will build a model class for every enabled backend. """

    global Payment
    global Order

    class Payment(PaymentFactory.construct(order=order_class, **kwargs)):
        objects = PaymentManager()

        class Meta:
            ordering = ('-created_on',)
            verbose_name = _("Payment")
            verbose_name_plural = _("Payments")

    Order = order_class

    # Now build models for backends

    backend_models_modules = import_backend_modules('models')
    for backend_name, models_module in backend_models_modules.items():
        for model in models_module.build_models(Payment):
            apps.register_model(backend_name, model)
    return Payment