You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Backward compat: we can have a default for MERCHANT_GATEWAYS that points to the existing classes, so I as far as I can see, this change will be backward compatible. We'll need to display a DeprecationWarning for custom gateways to notify them to update to the new way of adding custom gateways.
Right now, get_gateway and get_integration are a bit magical. If we want
foo
backend, we're looking forapp.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.gMERCHANT_GATEWAYS
with key being the gateway name and value being the dotted path to the gateway class. Thenget_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.
The text was updated successfully, but these errors were encountered: