-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issue-878/eur-bank-transfer-iso-11649-refere…
…nces Conflicts: apps/common/epc.py [logical, non-merge conflict] apps/payments/invoice.py tests/test_epc.py
- Loading branch information
Showing
49 changed files
with
726 additions
and
945 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from io import BytesIO | ||
|
||
from markupsafe import Markup | ||
from segno import QRCode, helpers | ||
|
||
from models.payment import BankPayment | ||
|
||
|
||
def make_epc_qrfile(payment: BankPayment, **kwargs) -> BytesIO: | ||
qrfile = BytesIO() | ||
# TODO: this isn't currently used. Need to fetch IBAN from payment.recommended_destination | ||
# and name from somewhere - maybe config rather than hard-coding. | ||
qr: QRCode = helpers.make_epc_qr( | ||
name="EMF Festivals Ltd", | ||
iban=payment.recommended_destination.iban, | ||
amount=payment.amount, | ||
reference=payment.customer_reference, | ||
encoding=1, | ||
) | ||
qr.save(qrfile, **kwargs) | ||
qrfile.seek(0) | ||
return qrfile | ||
|
||
|
||
def qrfile_to_svg(qrfile: BytesIO) -> str: | ||
return Markup(qrfile.getvalue().decode("utf-8")) | ||
|
||
|
||
def format_inline_epc_qr(payment: BankPayment) -> str: | ||
qrfile = make_epc_qrfile( | ||
payment, | ||
kind="svg", | ||
svgclass=None, | ||
omitsize=True, | ||
xmldecl=False, | ||
svgns=False, | ||
nl=False, | ||
) | ||
return qrfile_to_svg(qrfile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -415,3 +415,6 @@ input[type=range]::range-thumb { | |
} | ||
|
||
|
||
#mailing-list-form #name-field { | ||
display: none; | ||
} |
Oops, something went wrong.