Skip to content

Refactor get_gateway, get_integration logic #111

@tuxcanfly

Description

@tuxcanfly

Right now, get_gateway and get_integration are a bit magical. If we want foo backend, we're looking for app.gateways.foo.FooGateway in all installed apps. In addition to being inefficient, it has a chance of causing unintended consequences due to layout of other installed apps. The only benefit is that we allow users to define custom backends by following the above convention.

Instead, I propose we should have a setting similar to CACHES e.g MERCHANT_GATEWAYS with key being the gateway name and value being the dotted path to the gateway class. Then get_gateway could simply load the class pointed at by the path. This will allow more flexibility in creating and laying out custom backends.

Same goes for integrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions