First of all, this is more of a question than an actual issue. I apologize if this is the wrong place (didn't find any place better in the docs).
I'd like to work on integrating to new providers to django-payments: MercadoPago (works on many latinamerican countries) and TodoPago (works in Argentina).
I've a standalone django app for the former, and a working implementation in a few closed apps for the latter. I'd like to move these into django-payments. Mostly because I'm looking to use saleor, which uses django-payments, but and also open-source the latter.
However, the approach I've taken for these is slightly different to what django-payments does: My approach has generally been to have an Account/ Merchant object, which has the API keys, etc for communicating with the gateway, and relate payments to it. On the other hand, django-payments seems to keep this in the settings file.
The approach I've taken has a couple of advantages:
If the account used with the payment provider changes, any in-process payments can complete their flow normally.
In a single django app, more than one account can be used (though I think that PAYMENT_VARIANTS covers this, right?).
Configuring payment providers doesn't require access to the source code itself (eg: can be done via the admin).
It still works for apps with a single provider, since you just use Account.objects.first().
I assume this approach hasn't been considered before, but, would a PR implementing new gateways that uses this approach be acceptable? Or, to ask for it the opposite way: is the current approach set in stone?
Thanks, and sorry for such a long issue. 🙂 Looking forward to contributing.
First of all, this is more of a question than an actual issue. I apologize if this is the wrong place (didn't find any place better in the docs).
I'd like to work on integrating to new providers to
django-payments
: MercadoPago (works on many latinamerican countries) and TodoPago (works in Argentina).I've a standalone django app for the former, and a working implementation in a few closed apps for the latter. I'd like to move these into django-payments. Mostly because I'm looking to use saleor, which uses django-payments, but and also open-source the latter.
However, the approach I've taken for these is slightly different to what
django-payments
does: My approach has generally been to have anAccount
/Merchant
object, which has the API keys, etc for communicating with the gateway, and relate payments to it. On the other hand,django-payments
seems to keep this in the settings file.The approach I've taken has a couple of advantages:
PAYMENT_VARIANTS
covers this, right?).Account.objects.first()
.I assume this approach hasn't been considered before, but, would a PR implementing new gateways that uses this approach be acceptable? Or, to ask for it the opposite way: is the current approach set in stone?
Thanks, and sorry for such a long issue. 🙂 Looking forward to contributing.