Comments (11)
Hi Theju,
+1 on the approach you're taking, I think it's in the right direction.
- What do you think about structuring the framework-specific stuff as
merchant/contrib/django
andmerchant/contrib/flask
? I'm looking at raven-python which has a similar layout /bikeshedding - What do you think about having a base class which transmits the signals since it's common to all the gateways? https://github.com/theju/merchant/blob/framework-agnostic/django-merchant/billing/gateways/stripe_gateway.py
- Just a point to note - if we have
m
gateways andn
frameworks, we'll need to supportmxn
cases. Sounds unavoidable.
I'll be taking a closer look later this week.
Thanks.
from merchant.
What do you think about structuring the framework-specific stuff as merchant/contrib/django and merchant/contrib/flask? I'm looking at raven-python which has a similar layout /bikeshedding
So when merchant is installed, the contrib backends also get installed?
What do you think about having a base class which transmits the signals since it's common to all the gateways? https://github.com/theju/merchant/blob/framework-agnostic/django-merchant/billing/gateways/stripe_gateway.py
Good idea.
Just a point to note - if we have m gateways and n frameworks, we'll need to support mxn cases. Sounds unavoidable.
Can't really help it.
from merchant.
Building on @theju 's work, restructured the project, fixed stripe gateway.
https://github.com/tuxcanfly/merchant/tree/framework-agnostic
from merchant.
https://travis-ci.org/tuxcanfly/merchant/builds/7428915
We had ~100 tests earlier, 38 passing in the above branch - so we're 38% there... ✋
from merchant.
Hit a roadblock with paypal pro gateway because we're currently using django-paypal for it.
paypal-python looks more more equally well maintained and is pure python so maybe we should use this.
https://github.com/duointeractive/paypal-python
from merchant.
Done migrating all gateways except paypal:
https://travis-ci.org/tuxcanfly/merchant/builds/7495359
Need to think how we're going to handle integrations, since they are more dependant on django.
from merchant.
You may want to check the links below:
https://github.com/theju/merchant/blob/framework-agnostic/django-merchant/billing/integrations/stripe_integration.py
https://github.com/theju/merchant/blob/framework-agnostic/flask-merchant/flask_merchant/integrations/stripe_integration.py
from merchant.
OK, seen that, but still not convinced if we need a base class like this:
https://github.com/theju/merchant/blob/framework-agnostic/merchant/merchant/integration.py#L13
from merchant.
I think we need better abstraction around the integration classes. We're trying to fit too much (urls, views) in the integration class, and this is leading to choices like logic in the urls, or monkey-patching urlpatterns. We should probably move the urls out of the integration class and make it easier to construct a class based view / route handler.
https://github.com/agiliq/merchant/blob/master/example/app/urls.py#L6
https://github.com/tuxcanfly/merchant-django-demo/blob/master/example/app/views.py#L75
A better abstraction is also required to keep payment logic in the base class and framework logic (urls, views, templates) in the contrib implementations.
from merchant.
I'm curious, is there an ETA on this? I have a major project which will be launching within the next couple of months using merchant and django-paypal. But if things are going to shift toward paypal-python soon, I would rather try to test and launch with that if possible.
from merchant.
We're almost there, there's a few design decisions pending on how to handle integrations in a cross-framework way. No ETA at the moment, but I'll try to work on it over the next weekend.
from merchant.
Related Issues (20)
- Better document in Integration module. HOT 1
- Refactor get_gateway, get_integration logic HOT 1
- Don't run travis builds on PRs
- Django 1.7 support HOT 2
- Updating raw_post_data to body HOT 2
- Python 3 imports in __init__.py HOT 3
- can i use coinbase with the bitcoin payment method? HOT 2
- Stripe credit card charges are missing the name on the card HOT 2
- USAePay Support HOT 1
- Invalid format string in example code HOT 4
- Is the example code functional? HOT 1
- Braintree support broken
- support of Django 1.9 HOT 1
- django 1.9 compatibility HOT 2
- Will this project be updated? HOT 1
- Latest Django versions imcompatibility
- Fix simple typo: transation -> transaction
- ACH
- debit card
- L
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from merchant.