Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to operate without storing anything in database #2

Open
pszpetkowski opened this issue Feb 28, 2017 · 1 comment
Open

Allow to operate without storing anything in database #2

pszpetkowski opened this issue Feb 28, 2017 · 1 comment

Comments

@pszpetkowski
Copy link
Contributor

Some people might wish to be able to disable storing payment related data in database and to have everything processed "on the fly". Some of the other people might wish to disable just the indicated parts. Use of case of such feature might be for example a website which accepts anonymous donations (charity?).

Such feature might be controlled through few various scopes:

# settings.py

REST_PAYMENTS = {
    # ...
    'USE_DB': False,
}
# some_integration.py

class Charge:
    def create(self, amount=None, currency=None, **kwargs):
        use_db = kwargs.get('use_db'):
        if use_db is not None:
            self.use_db = use_db
// optional param to REST request

{
    "amount": 1000,
    "currency": "usd",
    "use_db": false,
}

Just like in Python local scope would override the global (settings scope).

@pawelswiecki
Copy link

No db-payments -- I like this idea! I'd treat no-db cases not as configuration thing, though. I'd treat them as whole different business case than payments that leave something in the db (may it be only payment Stripe ID). This way we'd avoid if self.use_db ... else ... all over the place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants