stinovlas / django-pain Goto Github PK
View Code? Open in Web Editor NEWDjango application for managing bank payments and invoices.
License: GNU General Public License v3.0
Django application for managing bank payments and invoices.
License: GNU General Public License v3.0
Processing payments now takes one payment at a time and feeds it to the processor. However, in some cases (such as communication through REST API) sending payments in bulk is much more efficient. We should extend the interface to allow bulk processing.
process_payments(self, payments: Iterable[BankPayment]) -> Iterable[bool]
to processors.common.AbstractPaymentProcessor
.process_payment(self, payment: BankPayment) -> bool
from processors.common.AbstractPaymentProcessor
.management.commands.process_payments
appropriately.This change breaks backwards compatibility and minor version should be bumped up.
PaymentListView
urls.py
Add CHANGELOG.rst
with changelog informations for all existing versions.
Add field uuid
of type UUIDField
to BankPayment
model in order to generate nice unique identifier for each payment. Values will be generated by uuid.uuid4()
function.
This identifier will be used by payment processors in communication with various systems to prevent data mismatch in case of broken connection or other unexpected events.
Use mypy
for checking static types. Write annotations to the appropriate functions.
Embed payment symbols in BankPayment
model and simplify commands and parses. Parser will output only the processed BankPayment
, no other objects.
Transproc parser should only process payments which has state = 1
(realized) and code = 1
(normal transaction).
django-admin process_payments [--from isodatetime --to isodatetime]
Command process_payments
will take all payments in state IMPORTED
(with optional date limitation). For each payment, it calls one or more payment processors, until one of them succeeds or all processors return negative answer. If any payment processor returns True
, payment will be marked as PROCESSED
. Otherwise, payment will be marked as DEFERRED
(new payment state).
Every processor is a Python class, that MUST implement following methods:
process_payment(BankPayment) -> bool
True
if payment is recognized and processed by the processor. Otherwise, this method returns False
.Add new web interface for choosing purpose of payment. Any payment in state imported
or deferred
can be manually assigned its purpose. Each payment processor has to advertise the required items for manual assignment.
processor
to BankPayment
model. Fill this field when payment is processed.objective
to BankPayment
model. This field will be filled with value returned by payment processor for each individual payment.(True, 'Registrar payment')
django.admin
interface to handle payments and allow manual assigning the purpose.
client_id
to edit form. This field will be used to manually assign the payment, but it won't be saved into database.assign_payment(self, payment: BankPayment, client_id: str) -> Tuple[bool, str]
. This method will be used to manually assign payment using client_id.PaymentListView
.default_objective
to each payment processor to advertize human readable payment processor description.Use Enum for payments states instead of three different constants.
Remove unnecessary column id
from PaymentSymbols
model. payment
can be used as primary key.
Add new payment processor (see #12) for FRED backend. Communication with FRED backend will be done through CORBA
interface. Method process_payment
will be implemented as follows:
False
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.